// JavaScript Document related to accordion

function ExpandMenu(eltId) {
accordion.expand(document.getElementById(eltId));
}

function SetDefaultFont() {
	ft('middle');
}



// JavaScript Font Resize

function ft(p) {

var subHeadBig = document.getElementById('subHeadBig');
if(p=="sm") {
document.getElementById('MainContent').style.fontSize='10px';
document.getElementById('MainContent').style.lineHeight='13px';
document.getElementById('font10').style.color = '#797979';
document.getElementById('font10').style.textDecoration = 'underline';
document.getElementById('font12').style.color = '#03a0e7';
document.getElementById('font12').style.textDecoration = '';
document.getElementById('font14').style.color = '#03a0e7';
document.getElementById('font14').style.textDecoration = '';


if(subHeadBig != null)
{
	subHeadBig.style.fontSize = '16px';
}

}
else if(p=="middle") {
document.getElementById('MainContent').style.fontSize='12px';
document.getElementById('MainContent').style.lineHeight='14px';
document.getElementById('font10').style.color = '#03a0e7';
document.getElementById('font10').style.textDecoration = '';
document.getElementById('font12').style.color = '#797979';
document.getElementById('font12').style.textDecoration = 'none';
document.getElementById('font14').style.color = '#03a0e7';
document.getElementById('font14').style.textDecoration = '';

if(subHeadBig != null)
{
	subHeadBig.style.fontSize = '18px';
}
}
else {
document.getElementById('MainContent').style.fontSize='14px';
document.getElementById('MainContent').style.lineHeight='16px';
document.getElementById('font10').style.color = '#03a0e7';
document.getElementById('font10').style.textDecoration = '';
document.getElementById('font12').style.color = '#03a0e7';
document.getElementById('font12').style.textDecoration = '';
document.getElementById('font14').style.color = '#797979';
document.getElementById('font14').style.textDecoration = 'underline';

if(subHeadBig != null)
{
	subHeadBig.style.fontSize = '20px';
}
}
}

/*
document.observe("dom:loaded", function() {
    var url = window.location.href;
    var pageName = url.substring(url.lastIndexOf('/') + 1).toLowerCase();

    if (pageName.startsWith("dosing.html") || pageName.startsWith("how-supplied-materials-needed.html") || pageName.startsWith("handling-guidelines.html") || pageName.startsWith("constitution.html") || pageName.startsWith("dilution.html") || pageName.startsWith("iv-adminstration.html") || pageName.startsWith("faqs.html") || pageName.startsWith("additional-resources.html")) {
        ExpandMenu("twoToggle");
    }
    else if (pageName.startsWith("combination_therapy.html")) {
        ExpandMenu("1");
    }
})*/
<!--Pop Up Window
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
function leaving_Popup(website) {
    //this line was modified to pass the website data to the popup window
    window.open('leaving_site_popup.html?' + website, '_blank', 'status=no,width=414,height=165');
}

/*********Interstitial popup - start ***********/

var isIE = (/MSIE (\d+\.\d+);/.test(navigator.userAgent));
function closelb()
{
	document.getElementById('light').style.display='none';
	document.getElementById('fade').style.display='none';
	if(isIE){fixdropdowns(false);}
}

function fixdropdowns(bshow,elementlist,classname)
{
	var arSelect; 
	var ospan;
	var oselect;
	var oSel=null;
	var selValue="";

	if(typeof(elementlist)=="undefined"){arSelect = document.getElementsByTagName("select");}
	else{arSelect = elementlist.split("|");}

	for(var i=0;i<arSelect.length;i++)
	{	
		oSel = (typeof(arSelect[i])=="string"?document.getElementById(arSelect[i]):arSelect[i]);
		
		selValue=oSel.options[oSel.selectedIndex].text;

		ospan=document.getElementById(oSel.id+"-layer");
		if(ospan!=null)
		{			
			ospan.parentNode.removeChild(ospan);
		}

		ospan=document.createElement("span");
		ospan.id=oSel.id+"-layer";
		ospan.appendChild(document.createTextNode(selValue));
		ospan.className=(typeof(classname)=="undefined"?"layerspan_small":classname);
		oSel.parentNode.insertBefore(ospan,oSel);
		
		oSel.style.display=(bshow?"none":"inline");
		ospan.style.display=(bshow?"inline":"none");
		
	}
}

//HCP Popup
function createCookie(name,value,days) {
    if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
    }
    else expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) 
    {
        var c = ca[i];
        while (c.charAt(0)==' ') {c = c.substring(1,c.length);}
        if (c.indexOf(nameEQ) == 0) {return c.substring(nameEQ.length,c.length);}
    }
    return null;
}

function checkCookie() {
    return (readCookie('ONGHCP')); 
}

function setCookie(txtAnswer) {
    if (txtAnswer=="yes") {
        createCookie('ONGHCP','YES',0);
    } else {
        createCookie('ONGHCP','NO',0);
    }
}

function popup_show(gotoHcp,e,url)
	{
		popup_hide();
		if(gotoHcp)
		{
			var cookie_val=checkCookie();
			if(cookie_val==null || cookie_val!="YES")
			{
				document.getElementById('popup_light').style.left=(document.body.clientWidth/2 - 200)+"px";
				document.getElementById('popup_light').style.display='block';
				document.getElementById('fadepopup').style.display='block';
				var h=document.body.clientHeight;
				document.getElementById('fadepopup').style.height=h+"px"; 
				if(isIE){fixdropdowns(true);}
			}
			else
			{
				window.location = "/hcp/index.aspx";
			}
		}
		
		/*else
		{
			dvexitpopup=document.getElementById('popup_exit');
			moveObject(dvexitpopup, e)
			var lnk_exit=document.getElementById('lnk_exit');
			var fda_link="http://www.fda.gov/medwatch";
			
			if(typeof(url)!="undefined" && (lnk_exit)!=null) {lnk_exit.href=url;}
			else{lnk_exit.href=fda_link;}
			
			document.getElementById('popup_exit').style.display='block';
			if(isIE){fixdropdowns(true);}
		}*/
	}
	function popup_hide()
	{
		/*document.getElementById('popup_exit').style.display = 'none';*/
	   var popLight = document.getElementById('popup_light');
	   var popFade = document.getElementById('fadepopup');
	   popLight.style.display = 'none';
		popFade.style.display = 'none';
		/*
		var pi_flash=document.getElementById('pi_flash');
		if(pi_flash != null) {pi_flash.style.display = 'none'}
	*/
		if(isIE){fixdropdowns(false);}
	}
	
    function moveObject( obj, e ) 
    {
		// step 1
  		var offset = -25;
  		var objHolder = obj;
		var windowHeight =  windowSize();
		var scrollY = getScrollXY();
		
		var tempX = (document.body.clientWidth * .23);	  
		var tempY = 1 * scrollY + (windowHeight * .20);
	  	

	  // step 4
	  if (tempX < 0){tempX = 0}
	  if (tempY < 0){tempY = 0}

	  // step 5
	  obj.style.top  = (tempY + offset) + 'px';
	  obj.style.left = (tempX + offset) + 'px';
  }

  //get window height + width
  function windowSize() 
  {
	  var myWidth = 0, myHeight = 0;
	  if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	  }
  		return  myHeight;
  }

  //gets scroll
  function getScrollXY() {
	  var scrOfX = 0, scrOfY = 0;
	  if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		//DOM compliant
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	  }
	 // return [ scrOfX, scrOfY ];
	  return [ scrOfY ];

}	
/*********Interstitial popup - end ***********/
/***** ISI message *****/
function createISICookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime() + (days*24*60*60*1000));
		var expires = "; expires = "+ date.toGMTString();
	}
	else var expires = "";
	document.cookie = name + "="+ value + expires + "; path=/";      // available throughout the directory
}

function setISIcookie()
{
createISICookie("myname", "myvalue","1");
}


//Function to print ISI information.

//function printContent(objCtl) {
//        var elmntCtl = document.getElementById(objCtl);
//        while(elmntCtl.hasChildNodes()){
//            elmntCtl.removeChild(elmntCtl.lastChild);
//        }
//        var img = document.createElement('img');
//        img.src = "/images/hcp/ISI_Print.jpg";
//        var img1 = document.createElement('img');
//        img1.src = "/images/hcp/pi_print.jpg";
//        img1.width="698";        
//        elmntCtl.appendChild(img);
//        elmntCtl.appendChild(img1);
//        elmntCtl.style.display = 'block';
//        window.print();
//        setTimeout('hideContent()', '1000');
//    }
//    
//    function hideContent(){
//        var elmntCtl = document.getElementById('printPIinformation');
//        elmntCtl.style.display = 'none';
//    }

//Function to implement onMouseover and onMouseout for Clinical and Dose & Administration Landing Pages
        if (document.images) {
        button1 = new Image
        button2 = new Image
        button3 = new Image
        button4 = new Image        
        button5 = new Image
        button6 = new Image
        button7 = new Image
        button8 = new Image
        button9 = new Image
        button10 = new Image
        button11 = new Image
        button12 = new Image
        button13 = new Image
        button14 = new Image        
        button15 = new Image
        button16 = new Image
        button17 = new Image
        button18 = new Image
        button19 = new Image
        button20 = new Image
        button21 = new Image
        button22 = new Image        
        button23 = new Image
        button24 = new Image 
        button25 = new Image
        button26 = new Image
        button27 = new Image
        button28 = new Image                           
        button29 = new Image
        button30 = new Image 
        button31 = new Image
        button32 = new Image                           
        button33 = new Image
        button34 = new Image                    
                          


        button1.src = '/images/hcp/banner_img_monotherapy.gif'
        button2.src = '/images/hcp/banner_img_monotherapy_on.gif'
        button3.src = '/images/hcp/banner_img_combination-therapy.gif'
        button4.src = '/images/hcp/banner_img_combination-therapy.gif_on.gif'
        button5.src = '/images/hcp/banner_dosing_administration_img_dose-modi.png'                                   
        button6.src = '/images/hcp/banner_dosing_administration_img_dose-modi_on.png'
        button7.src = '/images/hcp/banner_dosing_administration_img_how-supplied.png'
        button8.src = '/images/hcp/banner_dosing_administration_img_how-supplied_on.png'
        button9.src = '/images/hcp/banner_dosing_administration_img_guidelines.png'
        button10.src = '/images/hcp/banner_dosing_administration_img_guidelines_on.png'
        button11.src = '/images/hcp/banner_dosing_administration_img_how-constitution.png'
        button12.src = '/images/hcp/banner_dosing_administration_img_how-constitution_on.png'
        button13.src = '/images/hcp/banner_dosing_administration_img_how-dilution.png'
        button14.src = '/images/hcp/banner_dosing_administration_img_how-dilution_on.png'
        button15.src = '/images/hcp/banner_dosing_administration_img_iv.png'                                   
        button16.src = '/images/hcp/banner_dosing_administration_img_iv_on.png'
        button17.src = '/images/hcp/banner_dosing_administration_img_faq.png'
        button18.src = '/images/hcp/banner_dosing_administration_img_faq_on.png'
        button19.src = '/images/hcp/banner_dosing_administration_img_resources.png'
        button20.src = '/images/hcp/banner_dosing_administration_img_resources_on.png'
        button21.src = '/images/hcp/blue_tab_study-design_normal.png'
        button22.src = '/images/hcp/blue_tab_study-design_RO.png'
        button23.src = '/images/hcp/blue_tab_efficacy_normal.png'
        button24.src = '/images/hcp/blue_tab_efficacy_RO.png'  
        button25.src = '/images/hcp/blue_tab_safety_normal.png'
        button26.src = '/images/hcp/blue_tab_safety_RO.png' 
        button27.src = '/images/hcp/maroon_button_previous.png'
        button28.src = '/images/hcp/maroon_button_previous_RO.png'                         
        button29.src = '/images/hcp/maroon_button_next.png'
        button30.src = '/images/hcp/maroon_button_next_RO.png' 
        button31.src = '/images/hcp/blue_button_previous.png'
        button32.src = '/images/hcp/blue_button_previous_RO.png'                         
        button33.src = '/images/hcp/blue_button_next.png'
        button34.src = '/images/hcp/blue_button_next_RO.png'                   
                                                                   
                                         
    }
