var browser = "";
var browsername = navigator.appName;
var browserversion = parseInt(navigator.appVersion);
if (browsername == "Netscape") 
{
	browser = "ns" + browserversion;
}
else
{
	if (browsername == "Microsoft Internet Explorer") 
	{
		if (browserversion >= 4) 
		{
			browser = "ie" + browserversion;
		}
		else 
		{
			browser = "ie3";
		}
	}
}
bName = navigator.appName;
bVer = parseInt(navigator.appVersion);



// this is for opening pop-up windows
function openWindow (earl,name,widgets) 
{
	host = location.hostname;
	if (host.indexOf('stjude') != -1) 
	{
		var url = 'http://www.stjudetv.org/popups' + earl;
	}
	else
	{
		var url = earl;
	}
	popupWin = window.open (url,name,widgets);
	
	var agt=navigator.userAgent.toLowerCase();
	var is_major = parseInt(navigator.appVersion);
     var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
     var is_ie3    = (is_ie && (is_major < 4));
     var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
     var is_aol   = (agt.indexOf("aol") != -1);
     var is_aol3  = (is_aol && is_ie3);
     var is_aol4  = (is_aol && is_ie4);
     var is_aol5  = (agt.indexOf("aol 5") != -1);
     var is_aol6  = (agt.indexOf("aol 6") != -1);
     var is_comp   = (agt.indexOf("compuserve") != -1);
     var is_compie = (is_comp && is_ie);

     if(!is_aol6 && !is_aol3 && !is_aol4 && !is_aol5 && !is_compie) { popupWin.opener.top.name = "opener"; }
     
	popupWin.focus();
}


function closeWindow () 
{
	parent.close ();
}



// hopeline eletter
var submitcount=0;
function checkHopelineFields() {                       // field validation
if ((document.hopeline.Email_Address.value=="") || 
   (document.hopeline.Email_Address.value.indexOf('@') == -1) || 
   (document.hopeline.Email_Address.value.indexOf('.') == -1))     // checks if email field is blank
   {
   alert("Please enter your Email Address then re-submit this form.\n\nExample: first.lastname@stjude.org");
   document.hopeline.Email_Address.focus();
   document.hopeline.Email_Address.select();
   return false;
   }  
 else 
   {
   if (submitcount == 0)
      {
      submitcount++;
      return true;
      }
   else 
      {
      alert("This form has already been submitted.  Thanks!");
      return false;
      }
   }
}

// virtual tour popup
function MM_openBrWindow() { 
	window.open("http://www2.stjude.org/virtual_tour/index.htm","virtual_tour","toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes");
}


// virtual tour popup
function openCatalogWindow (url,name,widgets) 
{
	popupWin = window.open (url,name,widgets);
	
	var agt=navigator.userAgent.toLowerCase();
	var is_major = parseInt(navigator.appVersion);
     var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
     var is_ie3    = (is_ie && (is_major < 4));
     var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
     var is_aol   = (agt.indexOf("aol") != -1);
     var is_aol3  = (is_aol && is_ie3);
     var is_aol4  = (is_aol && is_ie4);
     var is_aol5  = (agt.indexOf("aol 5") != -1);
     var is_aol6  = (agt.indexOf("aol 6") != -1);
     var is_comp   = (agt.indexOf("compuserve") != -1);
     var is_compie = (is_comp && is_ie);

     if(!is_aol6 && !is_aol3 && !is_aol4 && !is_aol5 && !is_compie) { popupWin.opener.top.name = "opener"; }
     
	popupWin.focus();
}

// no right-click
//function click(e){if (document.all) if (event.button == 2) return false;if
//(document.layers) if (e.which == 3) return false;}

//function click2(){event.returnValue=false;return false;}if (document.layers)
//document.captureEvents(Event.MOUSEDOWN);document.onmousedown=click;document.oncontextmenu=click2;