<!--


// show study layer
function ShowContent(d, e) {
if(d.length < 1) { return; }
if(document.getElementById(d).style.display != "block"){

	if (document.all) {
		tempX = event.clientX + document.body.scrollLeft;
		tempY = event.clientY + document.body.scrollTop;
	} else {
		tempX = e.pageX;
		tempY = e.pageY;
	}
	
	if(tempY < 320) {
		tempY = 282;
	} else {
		tempY -= 45;
	}
	  
	document.getElementById(d).style.display = "block";
	document.getElementById(d).style.top = tempY;
	document.getElementById(d).style.left = tempX;
	}
}
// wait .5 seconds and turn off study layer
function HideContent(d) {
if(d.length < 1) { return; }
setTimeout('document.getElementById("' + d + '").style.display = "none"',500);
}






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_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_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 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];}
   //MM_swapImage('imageName','','image/address',1);
}

function centerLayout(){
	var layoutWidth = 760;
	
	if (document.getElementById && navigator.appName == 'Netscape'){
		var bodyWidth = self.innerWidth;
		if(bodyWidth >= layoutWidth){
			document.getElementById('centerlayer').style.left = "50%";
			document.getElementById('centerlayer').style.marginLeft = "-380px";
		}else{
			document.getElementById('centerlayer').style.left = "0px";
			document.getElementById('centerlayer').style.marginLeft = "0px";
		}
		
	}else if (document.getElementById){
		var bodyWidth = document.body.offsetWidth; 
		
		if(bodyWidth >= layoutWidth - 10){
			document.getElementById('centerlayer').style.left = "50%";
			document.getElementById('centerlayer').style.marginLeft = "-380px";
		}else{
			document.getElementById('centerlayer').style.left = "0px";
			document.getElementById('centerlayer').style.marginLeft = "0px";
		}
		
	}else if (document.layers){
			document.layers['centerlayer'].left = 0;
			document.layers['centerlayer'].marginLeft = 0;
			
    }else if (document.all){
		var bodyWidth = self.innerWidth;
		if (bodyWidth >= layoutWidth){
			document.all.tags('div')['centerlayer'].style.left = "50%";
			document.all.tags('div')['centerlayer'].style.marginLeft = "-380px";
		}else{
			document.all.tags('div')['centerlayer'].style.left = "0px";
			document.all.tags('div')['centerlayer'].style.marginLeft = "0px";
		}
	}
}
   
function MM_showHideLayers() { //v3.0

  var i,p,v,obj,args=MM_showHideLayers.arguments;

  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];

    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }

    obj.visibility=v; }

}

function showHideContent(id)
  {
    var elem = document.getElementById(id);
    var img = document.images['img' + id];
   	
   	var rExp = "";
   	var replace = "";
   	
    if (elem) 
    {
      if (elem.style.visibility == 'hidden') 
      {
        elem.style.display = 'block';
        elem.style.visibility = 'visible';
		rExp = /up/gi;
        replace = "down";
      } 
      else
      {
        elem.style.display = 'none';
        elem.style.visibility = 'hidden';
        rExp = /down/gi;
        replace = "up";
      }
    }
    
     if (img)
	{
		imgSrc = new String(img.src);
		var newPath = imgSrc.replace(rExp,replace);
		img.src = newPath;
	}
  }
  
function showTips(id1,id2)
{
	var elem1 = document.getElementById(id1);
	var elem2 = document.getElementById(id2);
	
	 if (elem1 && elem2) 
    {
        elem1.style.display = 'none';
        elem1.style.visibility = 'hidden';
        elem2.style.display = '';
        elem2.style.visibility = 'visible';
    } 
} 

function MM_reloadPage()
{
}

function GetLink(list) {

	if (list.selectedIndex > 0) {
		var win = window.open("http://www.sbshopnow.com/templates/sbexit.asp?mr=" + (list.selectedIndex) + "&ct=LIST&sbid=" + list.options[list.selectedIndex].value,"win");
		win.focus();
	}
}

function JumpLink(link) {

	var win = window.open(link,"win");
    win.focus();
}

function popUp(strUrl,strName,strFeatures) {
	if(strUrl == ""){strUrl = "";}
	if(strName == ""){strName = "default";}
	if(strFeatures == ""){strFeatures = "";}
	
	newwindow = window.open(strUrl,strName,strFeatures);
	newwindow.focus();
}

//==============


function PanelToggle(pnl,pnllink,CSSname,isOff){
	if (isOff == "true"){
		document.getElementById(pnl).style.display = "none";
	}
	if (document.getElementById(pnl).style.display == "none"){
		document.getElementById(pnl).style.display = "block";
		document.getElementById(pnllink).className = CSSname + "-on";
	} else {
		document.getElementById(pnl).style.display = "none";
		document.getElementById(pnllink).className = CSSname;
	}
}

//===========

function checkQS(){
	if (location.search == "?x=open"){
		if (document.getElementById("new1")){
			document.getElementById("new1").style.display = "block";
		}
	if (document.getElementById("lnk1")){
		document.getElementById("lnk1").className = "YWMwhatnew-on";
		}
	}
}

//=============

MDMG_menusection = new Array();
MDMG_MovabilityOfSubMenuPositions = "static";

MDMG_menusection[1] = "div_abreva";
MDMG_menusection[2] = "div_triggers";
MDMG_menusection[3] = "div_tips";

MDMG_menusection[0] = "unused";
MDMG_menusectionprinted = new Array();
for(i = 0; i < MDMG_menusection.length; i++) { MDMG_menusectionprinted[i] = false; }
bNS4 = bNS6 = bIE = bOPERA = false;
if     (navigator.userAgent.indexOf("Opera") != -1) { bOPERA = true; }
else if(navigator.userAgent.indexOf("Gecko") != -1) { bNS6 = true;   }
else if(document.layers)                            { bNS4 = true;   }
else if(document.all)                               { bIE = true;    }

MDMGx = MDMGxx = MDMGy = MDMGyy = 0;
var MDMG_mousex;
var MDMG_mousey;
STO = null;
if(bNS4 || bNS6 || bOPERA) { document.captureEvents(Event.MOUSEMOVE); }
document.onmousemove = MDMG_getmouseposition;


// Functions used by all browsers

function MDMG_getmouseposition(e){
if(bIE || bOPERA) { 
	MDMG_mousex = event.clientX;
	MDMG_mousey = event.clientY;
	}
else if(bNS6 || bNS4) {
	MDMG_mousex = e.pageX;
	MDMG_mousey = e.pageY;
	}
} // MDMG_getmouseposition()

function MDMG_HideIfOutsideRectangle()
{
	if(MDMG_mouseinrectangle()) { STO = setTimeout('MDMG_HideIfOutsideRectangle()',500); }
	else { clearTimeout(STO); MDMG_hideallmenusections(); }
} // MDMG_HideIfOutsideRectangle()

function MDMG_mouseinrectangle() {
if(MDMG_mousex >= MDMGx && MDMG_mousex <= MDMGxx && MDMG_mousey >= MDMGy && MDMG_mousey <= MDMGyy) { return true; }
else { return false; }
} // MDMG_mouseinrectangle()



// Functions to relay browser type to custom functions

function MDMG_showsection(m_section) {
clearTimeout(STO);
if(bIE) {
	MDMG_bIE_hideallmenusections();
	MDMG_bIE_showit(m_section);
	}
else if(bNS6) {
	MDMG_bNS6_hideallmenusections();
	MDMG_bNS6_showit(m_section);
	}
else if(bOPERA) {
	MDMG_bOPERA_hideallmenusections();
	MDMG_bOPERA_showit(m_section);
	}
else if(bNS4) {
	MDMG_bNS4_hideallmenusections();
	MDMG_bNS4_showit(m_section);
	}
} // MDMG_showsection()

function MDMG_hideallmenusections() {
clearTimeout(STO);
if(bIE) { MDMG_bIE_hideallmenusections(); }
else if(bNS6) { MDMG_bNS6_hideallmenusections(); }
else if(bOPERA) { MDMG_bOPERA_hideallmenusections(); }
else if(bNS4) { MDMG_bNS4_hideallmenusections(); }
} // MDMG_hideallmenusections()




// IE functions

function MDMG_bIE_hidesection(m_section) {
if(MDMG_mouseinrectangle()) { return; }
eval(MDMG_menusection[m_section] + '.style.visibility="hidden"');
MDMG_menusectionprinted[m_section] = false;
} // MDMG_bIE_hidesection()

function MDMG_bIE_hideallmenusections() {
for(i = 1; i < MDMG_menusection.length; i++) { 
	eval(MDMG_menusection[i] + '.style.visibility="hidden"');
	MDMG_menusectionprinted[i] = false;
	}
} // MDMG_bIE_hideallmenusections()

function MDMG_bIE_showit(m_section) {
	if(MDMG_menusectionprinted[m_section] == true) { return; }
	clearTimeout(STO);
	MDMG_bIE_hideallmenusections();
	MDMG_menusectionprinted[m_section] = true;
	var x = MDMG_mousex - 1;
	if(x < 0) { x = 0; }
	var y = MDMG_mousey - 1;
	if(y < 0) { y = 0; }
	if(MDMG_MovabilityOfSubMenuPositions != "static") {
		eval(MDMG_menusection[m_section] + '.style.left="' + x + '"');
		eval(MDMG_menusection[m_section] + '.style.top="' + y + '"');
		}
	eval(MDMG_menusection[m_section] + '.style.visibility="visible"');
	MDMGx = eval(MDMG_menusection[m_section] + '.style.pixelLeft');
	MDMGxx = eval(MDMG_menusection[m_section] + '.scrollWidth') + MDMGx;
	MDMGy = eval(MDMG_menusection[m_section] + '.style.pixelTop');
	MDMGyy = eval(MDMG_menusection[m_section] + '.scrollHeight') + MDMGy;
	STO = setTimeout('MDMG_HideIfOutsideRectangle()',2000);
} // MDMG_bIE_showit()



// Netscape 6 functions

function MDMG_bNS6_hidesection(m_section) {
if(MDMG_mouseinrectangle()) { return; }
document.getElementById(MDMG_menusection[m_section]).style.visibility="hidden";
MDMG_menusectionprinted[m_section] = false;
} // MDMG_bNS6_hidesection()

function MDMG_bNS6_hideallmenusections() {
for(i = 1; i < MDMG_menusection.length; i++) { 
	document.getElementById(MDMG_menusection[i]).style.visibility="hidden";
	MDMG_menusectionprinted[i] = false;
	}
} // MDMG_bNS6_hideallmenusections()

function MDMG_bNS6_showit(m_section) {
	if(MDMG_menusectionprinted[m_section] == true) { return; }
	clearTimeout(STO);
	MDMG_bNS6_hideallmenusections();
	MDMG_menusectionprinted[m_section] = true;
	var x = MDMG_mousex - 1;
	if(x < 0) { x = 0; }
	var y = MDMG_mousey - 1;
	if(y < 0) { y = 0; }
	if(MDMG_MovabilityOfSubMenuPositions != "static") {
		document.getElementById(MDMG_menusection[m_section]).style.left = x + 'px';
		document.getElementById(MDMG_menusection[m_section]).style.top = y + 'px';
		}
	document.getElementById(MDMG_menusection[m_section]).style.visibility="visible";
	var padding = 0;
	if(parseInt(document.getElementById(MDMG_menusection[m_section]).style.padding) > 0) { padding = parseInt(document.getElementById(MDMG_menusection[m_section]).style.padding) * 2; }
	MDMGx = parseInt(document.getElementById(MDMG_menusection[m_section]).style.left);
	MDMGxx = parseInt(document.getElementById(MDMG_menusection[m_section]).style.width) + MDMGx + padding;
	MDMGy = parseInt(document.getElementById(MDMG_menusection[m_section]).style.top);
	MDMGyy = parseInt(document.getElementById(MDMG_menusection[m_section]).style.height) + MDMGy + padding;
	STO = setTimeout('MDMG_HideIfOutsideRectangle()',2000);
} // MDMG_bNS6_showit()



// Opera 5 and Opera 6 functions
function MDMG_bOPERA_hidesection(m_section) {
if(MDMG_mouseinrectangle()) { return; }
document.getElementById(MDMG_menusection[m_section]).style.visibility="hidden";
MDMG_menusectionprinted[m_section] = false;
} // MDMG_bOPERA_hidesection()

function MDMG_bOPERA_hideallmenusections() {
for(i = 1; i < MDMG_menusection.length; i++) { 
	document.getElementById(MDMG_menusection[i]).style.visibility="hidden";
	MDMG_menusectionprinted[i] = false;
	}
} // MDMG_bOPERA_hideallmenusections()

function MDMG_bOPERA_showit(m_section) {
	if(MDMG_menusectionprinted[m_section] == true) { return; }
	clearTimeout(STO);
	MDMG_bOPERA_hideallmenusections();
	MDMG_menusectionprinted[m_section] = true;
	var x = MDMG_mousex - 1;
	if(x < 0) { x = 0; }
	var y = MDMG_mousey - 1;
	if(y < 0) { y = 0; }
	if(MDMG_MovabilityOfSubMenuPositions != "static") {
		document.getElementById(MDMG_menusection[m_section]).style.left = x + 'px';
		document.getElementById(MDMG_menusection[m_section]).style.top = y + 'px';
		}
	document.getElementById(MDMG_menusection[m_section]).style.visibility="visible";
	var padding = 0;
	if(parseInt(document.getElementById(MDMG_menusection[m_section]).style.padding) > 0) { padding = parseInt(document.getElementById(MDMG_menusection[m_section]).style.padding) * 2; }
	MDMGx = parseInt(document.getElementById(MDMG_menusection[m_section]).style.left);
	MDMGxx = parseInt(document.getElementById(MDMG_menusection[m_section]).style.width) + MDMGx + padding;
	MDMGy = parseInt(document.getElementById(MDMG_menusection[m_section]).style.top);
	MDMGyy = parseInt(document.getElementById(MDMG_menusection[m_section]).style.height) + MDMGy + padding;
	STO = setTimeout('MDMG_HideIfOutsideRectangle()',2000);
} // MDMG_bOPERA_showit()



// Netscape 4 functions

function MDMG_bNS4_hidesection(m_section) {
if(MDMG_mouseinrectangle()) { return; }
eval('document.' + MDMG_menusection[m_section] + '.visibility="hide"');
MDMG_menusectionprinted[m_section] = false;
} // MDMG_bNS4_hidesection()

function MDMG_bNS4_hideallmenusections() {
for(i = 1; i < MDMG_menusection.length; i++) { 
	eval('document.' + MDMG_menusection[i] + '.visibility="hide"');
	MDMG_menusectionprinted[i] = false;
	}
} // MDMG_bNS4_hideallmenusections()

function MDMG_bNS4_showit(m_section) {
	if(MDMG_menusectionprinted[m_section] == true) { return; }
	clearTimeout(STO);
	MDMG_bNS4_hideallmenusections();
	MDMG_menusectionprinted[m_section] = true;
	var x = MDMG_mousex - 1;
	if(x < 0) { x = 0; }
	var y = MDMG_mousey - 1;
	if(y < 0) { y = 0; }
	if(MDMG_MovabilityOfSubMenuPositions != "static") {
		eval('document.' + MDMG_menusection[m_section] + '.left="' + x + '"');
		eval('document.' + MDMG_menusection[m_section] + '.top="' + y + '"');
		}
	eval('document.' + MDMG_menusection[m_section] + '.visibility="show"');
	MDMGx = eval('parseInt(document.' + MDMG_menusection[m_section] + '.left)');
	MDMGxx = eval('parseInt(document.' + MDMG_menusection[m_section] + '.clip.width)') + MDMGx;
	MDMGy = eval('parseInt(document.' + MDMG_menusection[m_section] + '.top)');
	MDMGyy = eval('parseInt(document.' + MDMG_menusection[m_section] + '.clip.height)') + MDMGy;
	STO = setTimeout('MDMG_HideIfOutsideRectangle()',2000);
} // MDMG_bNS4_showit()


//================

function postBackHiddenField(hiddenFieldID) {
var hiddenField = $get(hiddenFieldID);
if (hiddenField) {
    hiddenField.value = (new Date()).getTime();
    __doPostBack(hiddenFieldID,'');
}
}

function checkCookie()
{
    try
    {
        var x = readCookie('storyID')
    }
    catch(err)
    {
        document.cookie = 'storyID=00000000-0000-0000-0000-000000000000';
    }
}


function getPharmacistsRole(){
	window.location = "PharmRole_help.aspx"
};

function getYouCanHelp(){
	window.location = "PharmRole_help.aspx"
};

function getAboutColdSores(){
	window.location = "AboutCS_etiology.aspx"
};

function getEtiology(){
	window.location = "AboutCS_etiology.aspx"
};

function getAvoidingTheTriggers(){
	window.location = "AboutCS_avoid.aspx"
};

function getHsvTransmission(){
	window.location = "AboutCS_HSV1.aspx"
};

function getPrevalence(){
	window.location = "AboutCS_prev.aspx"
};

function getPathophysiology(){
	window.location = "AboutCS_path.aspx"
};

function getFarReachingImpact(){
	window.location = "AboutCS_impact.aspx"
};

function getColdSoreTreatment(){
	window.location = "CSTreat_stop.aspx"
};

function getStoppingTheVirus(){
	window.location = "CSTreat_stop.aspx"
};

function getTreamentGoals(){
	window.location = "CSTreat_goals.aspx"
};

function getWhenToRefer(){
	window.location = "CSTreat_refer.aspx"
};

function getTreatmentOptions(){
	window.location = "TreatOption_manage.aspx"
};

function getEffectiveManagement(){
	window.location = "TreatOption_manage.aspx"
};

function getDoProductsWork(){
	window.location = "TreatOption_work.aspx"
};

function getPrescriptionAntivirals(){
	window.location = "TreatOption_antiviral.aspx"
};

function getCellEntryVirusBlocker(){
	window.location = "TreatOption_blocker.aspx"
};

function getPalliativeCareOptions(){
	window.location = "TreatOption_pallative.aspx"
};

function getAlternativeRemedies(){
	window.location = "TreatOption_alt.aspx"
};

function getAboutAbreva(){
	window.location = "AboutAbreva_only.aspx"
};

function getTheOnlyCellEntryBlocker(){
	window.location = "AboutAbreva_only.aspx"
};

function getAUniqueModeOfAction(){
	window.location = "AboutAbreva_mode.aspx"
};

function getHowToUseAbreva(){
	window.location = "AboutAbreva_use.aspx"
};

function getPatientCounselling(){
	window.location = "PatientCounsel_material.aspx"
};

function getCounsellingMaterial(){
	window.location = "PatientCounsel_material.aspx"
};

function getCounsellingTips(){
	window.location = "PatientCounsel_tips.aspx"
};

function getTreamentOptionCounselling(){
	window.location = "PatientCounsel_option.aspx"
};

function getTheSuffersDoAndDontList(){
	window.location = "PatientCounsel_dos.aspx"
};

function getFAQs(){
	window.location = "PatientCounsel_faq.aspx"
};

function getContinuingEducation(){
	window.open('http://www.powerpak.com/index.asp?page=courses/105313/disclaimer.htm&lsn_id=105313')
};


// ========================

 function openFlashPanel(swfName) 
	{
	    var o = thisMovie("swf_Home");
        //alert(o);   
        if (o != null)
        {
            o.openContentPanel(swfName);
        }
        else
        {
            window.location="kiss.promo";
        }
    }
    
    function thisMovie(movieName) 
    {
	    var isIE = navigator.appName.indexOf("Microsoft") != -1;
	    return (isIE) ? window[movieName] : document[movieName];
    }
    
    function playFlashVideo(fileName) 
    {
        var o = thisMovie("swf_Home");
      //  alert(o);   
        if (o != null)
        {
              o.openVideo(fileName);
        }
        else
        {
            window.location="Default.aspx?x=pharm";
        }
    }
    
    function doAddVariable() 
    {
        var o = thisMovie("swf_tracker");
        if (o != null)
        {
        //    o.addVariable('urlPath', 'http://abreva2008.pub.ciberpgh.com/'); // once this SWF is on ciber's stage, this shouldn't be needed
		//    o.addVariable('firstTree', 'EEB03939-A5A2-4D6C-B72E-E5652F0FC2A4'); // this loads the first tree
		}
    }

// home page rollovers

    function swpImg(imgname, imgnameSrc, imgsrcPart){
        var str=imgnameSrc.substr(imgnameSrc.length - 7);
        if (str == '_on.gif'){
         }else if (str == 'ver.gif'){
            MM_swapImgRestore();
         }
         else{
            MM_swapImage(imgname,'',imgsrcPart + '_over.gif',1);
         }
     }
     
    function swapAll(imgname){
        var Names = new Array(2);
        Names[0] = "home_Ask";
        Names[1] = "home_Kiss";
        Names[2] = "home_Reminder";
        var i=0;
        for (i=0;i<=Names.length-1;i++){
            if (Names[i] != imgname){
                MM_swapImage(Names[i],'','images/nav/' + Names[i] + '.gif',1);
            }
         }
    }

//-->

