


//Off Ramp Alert
//Off Ramp Alert
function offRamp(theSite){
	
     return offRampStandard_local(2,'humate',null,theSite,null,false);
	}

/* CURRENT FUNCTIONS */
	function offRampStandard_local(langIncluded,siteName,windowName,URL,otherOptions,returnEnabled) 
	{	
				
		var aLanguage = new Array(2);

		langIncluded = langIncluded - 1	
		aLanguage[0] = "The site you are accessing is maintained by a third party over whom CSL Behring has no control. CSL Behring does not review, approve or necessarily endorse viewpoints, inferences, or conclusions stated in or implied by the content of this site. CSL Behring is not responsible for third-party content or the consequences of your use thereof. \n\n Do you wish to continue?";
		aLanguage[1] = "The site you are accessing is maintained by a third party over whom CSL Behring has no control. CSL Behring does not review, approve or necessarily endorse viewpoints, inferences, or conclusions stated in or implied by the content of this site. CSL Behring is not responsible for third-party content or the consequences of your use thereof. \n\n Do you wish to continue?";	  

		if (windowName == null) windowName = '';
		if (otherOptions == null) otherOptions = '';
		
  		if (confirm(aLanguage[langIncluded]))
  		{
			if (URL != null) window.open(URL,windowName ,otherOptions);
			if (returnEnabled) return true;
		}
		else	
			if (returnEnabled) return false;
	}
		
		/* function that prompts the user to let them know that they are leaving the site.
		This function should be used....blah blah add pra stuff for why.
	*/

function IsEmail (objEmailString)
{
    // Email address must be of form a@b.c
    // * there must be at least one character before the @
    // * there must be at least one character before and after the .
    // * the characters @ and . are both required

    // there must be >= 1 character before @, so we
    // start looking at character position 1 
    // (i.e. second character)

	var s = objEmailString.value;
	var i = 1;
    var sLength = s.length;

    // look for @
    while ((i < sLength) && (s.charAt(i) != "@"))
    {
		i++
    }

    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;

    // look for .
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }

    // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
}


function isEmpty(s)
{
	return ((s == null) || (s.length == 0))
}

function IsNothing (s)
{
	if (s == null)
			return false
	
	var i;
     // whitespace characters
     var whitespace = " \t\n\r";
  	 var str = s.value;
     // Is s empty?
     if (isEmpty(str))
	 {	
	 	return false;
	 }

     for (i = 0; i < str.length; i++)
     {
          // Check that current character isn't whitespace.
          var c = str.charAt(i);

          if (whitespace.indexOf(c) == -1) return true;
     }

     // All characters are whitespace.
     return false;
}

/* code for search */
//So therefore you need the fields
//q -- this is the text value you want to search on.
//site -- This is the collection in the search engine (I named it HAE-erkennen, which is case sensitive)
//output -- The value should be xml_no_dtd
//oe -- The value should always be UTF-8
//ie -- The value should be UTF-8
//client -- This is the results page that is used (I named it hae-erkennen)
//proxystylesheet -- This is the style sheet that should be used (I named it hae-erkennen)
//filter -- this value tells google weather to ommit results or show all (0 means show all, 1 means 			filter)




	function subSearch()
	{
	
	//The following lines of code are to make sure the a proper search term was put in the search box. If any special characters are in the search term they will be striped out by the regular expression below.
	var Valid = true;
	var f = document.webform;

	if(f.site == null) {
		
		newElement = document.createElement("input");
		newElement.setAttribute("name", "site");
		newElement.setAttribute("type", "hidden");
		newElement.setAttribute("value", "Rhophylac");


		newElement2 = document.createElement("input");
		newElement2.setAttribute("name", "output");
		newElement2.setAttribute("type", "hidden");
		newElement2.setAttribute("value", "xml_no_dtd");

		newElement3 = document.createElement("input");
		newElement3.setAttribute("name", "x");
		newElement3.setAttribute("type", "hidden");
		newElement3.setAttribute("value", "26");

		newElement4 = document.createElement("input");
		newElement4.setAttribute("name", "y");
		newElement4.setAttribute("type", "hidden");
		newElement4.setAttribute("value", "10");

		newElement5 = document.createElement("input");
		newElement5.setAttribute("name", "oe");
		newElement5.setAttribute("type", "hidden");
		newElement5.setAttribute("value", "UTF-8");

		newElement6 = document.createElement("input");
		newElement6.setAttribute("name", "ie");
		newElement6.setAttribute("type", "hidden");
		newElement6.setAttribute("value", "UTF-8");

		newElement7 = document.createElement("input");
		newElement7.setAttribute("name", "client");
		newElement7.setAttribute("type", "hidden");
		newElement7.setAttribute("value", "cslbehring");

		newElement8 = document.createElement("input");
		newElement8.setAttribute("name", "proxystylesheet");
		newElement8.setAttribute("type", "hidden");
		newElement8.setAttribute("value", "cslbehring");

		f.appendChild(newElement);	
	//	f.appendChild(newElement3);
	//	f.appendChild(newElement4);
		f.appendChild(newElement2);
		f.appendChild(newElement5);
		f.appendChild(newElement6);
		f.appendChild(newElement7);
		f.appendChild(newElement8);
	}

	    if(f.q.value == '')
	    {
		f.q.focus();
		Valid = false;
	    }
	    else
	    {
		var strSearchFor = f.q.value ;
		var retValue = strSearchFor;
		var cTest = retValue.substring(0, 1);
		while (cTest == " ") { // Check for spaces at the beginning of the string
			retValue = retValue.substring(1, retValue.length);
			cTest = retValue.substring(0, 1);
			} //end while

		if(retValue.length == 0)
		{
			retValue = retValue.replace(/[%|$|\<|\>|\||\~|\:|\{|\}|\[|\]]/g,"");
			//Make sure we still have a value.
			if(retValue.length == 0)
			{
			    f.q.focus();
			    Valid   = false;
			}

			f.q.value = retValue;
		}
	    }

	    if (Valid)
	    {
		//document.webform.site.value = document.webform.ssite.value;
		document.webform.action ="http://search.cslbehring.com/search?site=Rhophylac";
//&x=26&y=10&output=xml_no_dtd&oe=UTF-8&iUTF-8&client=cslbehring&proxystylesheet=cslbehring
		document.webform.submit();
	    }
	}
	
	
	function confirmation() 
    {
        return confirm("You are accessing a Web site maintained by a third party over whom CSL Behring has no control.\nCSL Behring is not responsible for, and accepts no liability for, information contained in any third-party Web site.\n\nDo you wish to continue?")       
    }
    
    function externalLinks()
    { 
     if (!document.getElementsByTagName) return; 
     var anchors = document.getElementsByTagName("a"); 
     for (var i=0; i<anchors.length; i++) { 
       var anchor = anchors[i]; 
       if (anchor.getAttribute("href") && 
           anchor.getAttribute("rel") == "external") 
         anchor.target = "_blank"; 
     } 
    } 
    
    window.onload = externalLinks;
        
        function OffRamp()  //  JWB
                //  Syntax: <a href="yoururl" onclick="return OffRamp();">Your Link</a>
                {
                    return (confirm('You are about to leave Hizentra.com \n\nThe site you are accessing is maintained by a third party over whom CSL Behring has no control. CSL Behring does not review, approve, or necessarily endorse viewpoints, inferences, or conclusions stated in or implied by the content of this site. CSL Behring is not responsible for third-party content or the consequences of your use thereof.'));
                }
        function OffRampInternal()  //  JWB
                //  Syntax: <a href="yoururl" onclick="return OffRampInternal();">Your Link</a>
                {
                    return (confirm('You are about to leave Hizentra.com \n\nYou are about to enter CSLBehring.com, a site owned by the maker of Hizentra, to help you learn more about Hizentra, a treatment option for patients with primary immunodeficiency disease (PIDD).'));
                }

