$(document).ready(function () {
	$('.rmv-dft-val').click(
		function() {
			if (this.value == this.defaultValue) {
				this.value = '';
			}
		}
	);

	$('.rmv-dft-val').blur(
		function() {

			if (this.value == "") {
				this.value = this.defaultValue;
			}
		}
	);
});

function StJohnInitPage2009()
{
	init();
}


function sjOpenerNamed(WindowName, PageName, Width,Height)
{
	x=window.open(PageName, WindowName, 'width='+Width+',height='+Height+',resizable=0,scrollbars=no,menubar=no,status=no,left=200,top=100');
}

function sjOpener(PageName, Width,Height)
{
	x=window.open(PageName, 'messageWindow', 'width='+Width+',height='+Height+',resizable=0,scrollbars=no,menubar=no,status=no,left=200,top=100');
}

function sjOpener_Scroll(PageName, Width,Height)
{
	x=window.open(PageName, 'messageWindow', 'width='+Width+',height='+Height+',resizable=0,scrollbars=1,menubar=no,status=no,left=200,top=100');
}

var agt = navigator.userAgent.toLowerCase();


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function clearText(thefield) {
	if (thefield.defaultValue==thefield.value)
	thefield.value = ""
} 

// toggle visibility
function toggle( targetId ){
  if (document.getElementById){
  		target = document.getElementById( targetId );
  			if (target.style.display == "none"){
  				target.style.display = "";
  			} else {
  				target.style.display = "none";
  			}
  	}
}


var JS_LINK="javascript";
function openwin(url)
	{
	if(url.indexOf("donateonline.asp")>0)
		{
		 //myString = new String(url)
		//rExp = 'http:';
		//url = myString.replace(rExp, "https:")

		 //window.open(url,'_blank','height=480,width=650,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,resizable=yes')
		 window.open('https://www.stjohn.org/Foundation/donateonline.asp','_blank','height=480,width=650,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,resizable=yes')
		}
	else 
	{
	
	if(url.indexOf("make_appointment.asp")>0||url=="make_appointment.asp")
		{
		 window.open('https://www.stjohn.org/MakeAppt/make_appointment.asp','_blank','height=480,width=650,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,resizable=yes')
		}
	else 
		{
		window.open('https://vanelslandercancercenter.org/'+url,'_blank','height=480,width=650,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,resizable=yes')
		}
	}	
	}
	
function openwin2(url)
	{
	window.open(url,'_blank','height=650,width=600,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,resizable=yes');
	}


function InfoForLinksSubmit(InfoForSelectList)
{
	var index=InfoForSelectList.selectedIndex;
	if (InfoForSelectList.options[index].value != "0") 
	{
		if (InfoForSelectList.options[index].value=="http://healthweb.stjohn.org/")
		{
			window.open(InfoForSelectList.options[index].value,'_blank','height=700,width=750,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,resizable=yes');
		}
		else
		{
			top.location=InfoForSelectList.options[index].value;
		}
	}
	return false;
}





		function MoreInformationToggleCurrent(curLinkType)
		{
		var moreInfoLink_Phys		= document.getElementById("MoreInformationLink_PHYS");
		var moreInfoLink_Press		= document.getElementById("MoreInformationLink_PRESS");
		var moreInfoLink_Classes	= document.getElementById("MoreInformationLink_CLASSES");
		var moreInfoLink_News		= document.getElementById("MoreInformationLink_NEWS");
		var moreInfoLink_Rel		= document.getElementById("MoreInformationLink_REL");

 		var moreInfoDet_Phys		= document.getElementById("MoreInformationDet_PHYS");
		var moreInfoDet_Press		= document.getElementById("MoreInformationDet_PRESS");
		var moreInfoDet_Classes		= document.getElementById("MoreInformationDet_CLASS");
		var moreInfoDet_News		= document.getElementById("MoreInformationDet_NEWS");
		var moreInfoDet_Rel			= document.getElementById("MoreInformationDet_REL");
 

			if (moreInfoLink_Phys!=null)				moreInfoLink_Phys.style.fontWeight="normal";
			if (moreInfoLink_Press!=null)				moreInfoLink_Press.style.fontWeight="normal";		
			if (moreInfoLink_Classes!=null)				moreInfoLink_Classes.style.fontWeight="normal";
			if (moreInfoLink_News!=null)				moreInfoLink_News.style.fontWeight="normal";
			if (moreInfoLink_Rel!=null)					moreInfoLink_Rel.style.fontWeight="normal";

			if (moreInfoDet_Phys!=null)					moreInfoDet_Phys.style.display="none";		
			if (moreInfoDet_Press!=null)				moreInfoDet_Press.style.display="none";
			if (moreInfoDet_Classes!=null)				moreInfoDet_Classes.style.display="none";
			if (moreInfoLink_News!=null)				moreInfoDet_News.style.display="none";
			if (moreInfoLink_Rel!=null)					moreInfoDet_Rel.style.display="none";


			if (curLinkType=="Phys")
			{
				moreInfoLink_Phys.style.fontWeight="bold";
				moreInfoDet_Phys.style.display="block";
			}
			else if (curLinkType=="Press")
			{
				moreInfoLink_Press.style.fontWeight="bold";
				moreInfoDet_Press.style.display="block";
			}
			else if (curLinkType=="Classes")
			{
				moreInfoLink_Classes.style.fontWeight="bold";
				moreInfoDet_Classes.style.display="block";
			}
			else if (curLinkType=="News")
			{
				moreInfoLink_News.style.fontWeight="bold";
				moreInfoDet_News.style.display="block";
			}
			else if (curLinkType=="Rel")
			{
				moreInfoLink_Rel.style.fontWeight="bold";
				moreInfoDet_Rel.style.display="block";
			}
		}


	function ShowFullServiceListing()
	{
		var fullSvcList = document.getElementById("FullServicesListing");	var smallSvcList= document.getElementById("SmallServicesListing");
		if (fullSvcList!=null && smallSvcList!=null)	{
			smallSvcList.style.display	="none";	
			fullSvcList.style.display="inline";	
			}
	}

	function ShowSmallServiceListing()
	{
		var fullSvcList = document.getElementById("FullServicesListing");	var smallSvcList= document.getElementById("SmallServicesListing");
		if (fullSvcList!=null && smallSvcList!=null)	{
			fullSvcList.style.display	="none";	
			smallSvcList.style.display="block";			
			}
	}