function popUpNewWindow(URL) {

var hobo = window.open(URL, "Popup", "location=no,scrollbars=yes,menubars=yes,toolbar=yes,resizable=yes");
hobo.focus();
}

function popUpMedium(URL) {

var hobo = window.open(URL, "Popup", "height=210,width=205,location=no,scrollbars=no,menubars=no,toolbar=no,resizable=no");
hobo.focus();
}

function popUpSmall(URL) {

var hobo = window.open(URL, "Popup", "height=140,width=205,location=no,scrollbars=no,menubars=no,toolbar=no,resizable=no");
hobo.focus();
}

function popUpMediumLarge(URL) {

var hobo = window.open(URL, "Popup", "height=310,width=405,location=no,scrollbars=no,menubars=no,toolbar=no,resizable=no");
hobo.focus();
}

function popUpMediumLargeScroll(URL) {
escape(URL);
var hobo = window.open(URL, "Popup", "height=310,width=425,location=no,scrollbars=yes,menubars=no,toolbar=no,resizable=no");
hobo.focus();
}

function popUpFull(URL) {

var hobo = window.open(URL, "Popup", "height=600,width=700,location=no,scrollbars=yes,menubars=no,toolbar=no,resizable=yes");
hobo.focus();
}

function popUpLarge(URL) {

var hobo = window.open(URL, "Popup", "height=600,width=620,location=no,scrollbars=yes,menubars=no,toolbar=no,resizable=yes");
hobo.focus();
}

function popUpSiteTour(URL) {

var hobo = window.open(URL, "Popup", "height=400,width=520,location=no,scrollbars=yes,menubars=no,toolbar=no,resizable=yes");
hobo.focus();
}

function popUpMM(URL) {

var hobo = window.open("/pp/us/hcp/framemm.jspzQzpgzEz"+URL, "Popup", "height=600,width=700,location=no,scrollbars=yes,menubars=no,toolbar=yes,resizable=yes");
hobo.focus();
}

function popUpFullBrowser(URL) {

var hobo = window.open(URL, "Popup");
hobo.focus();
}

function openAddWindow(urlcontrolname, titlecontrolname) {

	var url = window.location;
	var title = window.document.title;

//	title = title.replace(/\s/gi, "+");

	newWindow = window.open("/pp/us/cns/myfolders/bookmarksaddurl.jspzQz" + urlcontrolname + "zEz" + escape(url) + "zAz" +  titlecontrolname + "=" + escape(title) + "", "Popup", "dependent=true,height=500,width=600,location=true,menubar=false,resizable=yes,status=false,toolbar=false,scrollbars=yes");
	//return false;
}
function openNewsLetterArchive(URL) {

	var url = window.location;
	//var title = "Merck Source - The Source Report";
	//title = window.document.title;
	//alert(title);

	var hobo = window.open(URL, "Popup", "height=600,width=690,location=no,scrollbars=yes,escape(title),menubar=false,toolbar=no,resizable=no");
	hobo.focus();
	
}

function openCNSAddWindow(urlcontrolname, titlecontrolname) {
	var url;
	var title = "";

	// If the bookmarked page exist in frames, get the parent's
	// frameset location and pass the content frame's PG parameter.
	if (parent.frames[0]){
		var strPg = "pg=";
		var strPgEnc = "pgzEz";
		var strParentURL = parent.document.location.toString();
		var strContentURL = window.location.toString();
		var intIndex;

		if(strContentURL.indexOf(strPgEnc, 0) < 0)
			intIndex = strContentURL.indexOf(strPg, 0);
		else
			intIndex = strContentURL.indexOf(strPgEnc, 0);

		strContentURL = strContentURL.substring(intIndex, strContentURL.length);	// Get content frame's PG parameter.

		if(strParentURL.indexOf(strPgEnc, 0) < 0){
			intIndex = strParentURL.indexOf(strPg, 0);
			intIndex = strParentURL.indexOf(strPg, intIndex + 1);
		}
		else{
			intIndex = strParentURL.indexOf(strPgEnc, 0);
			intIndex = strParentURL.indexOf(strPgEnc, intIndex + 1);
		}

		strParentURL = strParentURL.substring(0, intIndex);		// Remove the default PG parameter from the parent URL.

		url = strParentURL + strContentURL;		// Append the content frame's PG parameter to the parent URL.

		// If parent frame is PDR Health Maps add JS code to pop-up window.
		if(strParentURL.indexOf("cns_pdr_frameset.jsp") > -1)
			url = 'javascript:popUpFullBrowser(&#034;' + url + '&#034;)';
	}
	// Else, get the current window's location and title
	else
		url = window.location;

	var ind = title.indexOf("and how those diseases can affect you");
	if (ind != -1)
		title = title.substring(0, title.length-38);

	var ind = title.indexOf("and how they can affect you");
	if (ind != -1)
		title = title.substring(0, title.length-28);

	var ind = title.indexOf("and how it can affect you");
	if (ind != -1)
		title = title.substring(0, title.length-26);

	var ind = title.indexOf("MerckSource provides important information about");
	if (ind != -1)
		title = title.substring(0, ind) + title.substring(ind + 49, title.length);

	title = window.document.title;

	newWindow = window.open("/pp/us/cns/myfolders/bookmarksaddurl.jspzQz" + urlcontrolname + "zEz" + escape(url) + "zAz" +  titlecontrolname + "zEz" + escape(title) + "", "Popup", "dependent=true,height=500,width=600,location=true,menubar=false,resizable=yes,status=false,toolbar=false,scrollbars=yes");
}

function openCNSAddHLWindow(urlcontrolname, url, titlecontrolname, title) {
	newWindow = window.open("/pp/us/cns/myfolders/bookmarksaddurl.jspzQz" + urlcontrolname + "zEz" + escape(url) + "zAz" +  titlecontrolname + "zEz" + escape(title) + "", "Popup", "dependent=true,height=500,width=600,location=true,menubar=false,resizable=yes,status=false,toolbar=false,scrollbars=yes");
	//return false;
}
function navHandler(list) {
        window.location.href = list.options[list.selectedIndex].value;
}

function openInfoWindow (infoPage) {

// openInfoWindow opens the passed html page parameter in a remote window.
// You can create more remote windows by naming the new window object a
// different name.

var browser=navigator.appName + " " + navigator.appVersion;

   if (browser.substring(0, 8) == "Netscape" ){
      var newWind=window.open(infoPage,'info','toolbar=no,location=no,status=no,menubar=no,scrollbars=1,top=20,width=450,height=450,resizable=yes');
      if (newWind.closed){
        if (newWind.opener == null){
          newWind.opener = window;
        }
        else {
          if (browser.substring(0, 12) == "Netscape 3.0" )
            newWind.focus();
          if (browser.substring(0, 12) == "Netscape 2.0" )
            newWind.document.forms[0].display.focus();
        }
      }
      else {
        newWind.focus()
      }
   }
   else {
     var newWind=window.open(infoPage,'info','toolbar=no,location=no,status=no,menubar=no,scrollbars=1,top=20,width=450,height=450,resizable=yes');
   }
}

function popUpEXTERNAL(URL, NAME)
{
	var newWin = window.open('/pp/us/cns/cns_exit.jspzQzurlzEz'+URL+'zAznamezEz'+NAME);
	newWind.focus()
}
function virtbodysys(){
	var newpage = window.open("/ppdocs/us/cns/content/adam/animationplayer_merck/detector_qt.htm", "Popup", "height=620,width=640,location=no,scrollbars=no,menubars=no,toolbar=no,resizable=no");
	newpage.focus();
}
function popUpInteractiveBody(){
	var newWin = window.open("/ppdocs/us/cns/content/adam/visualbody/index.html", "Popup", "width=760,height=599,toolbar=no,location=no,directories=no,menubar=no,scrollbars=no");
	newWin.focus();
}

// This script is used only for Blausen Interactive Human Atlas
siteURL = "/ppdocs/us/cns/content/blausen/flash_content/";
//modify for clients
basefolder = "human";
//BASEurl = siteURL + "BMCfile/" + basefolder + "/atlasvar.js";
popupURL = siteURL + "flash_content/BMCfile/popupNF.js";
//document.write(' <script language=\"JavaScript\" src=\"'+BASEurl+'"><\/script>');
document.write(' <script language=\"JavaScript\" src=\"'+popupURL+'"><\/script>');
document.write(' <link rel=\"stylesheet\" type=\"text/css\" href=\"'+ siteURL +'flash_content/BMCfile/propertiesfordivs.css">');
// This script is used only for Blausen Interactive Human Atlas



function popUpBlausen2(URL,id,topicSelection,subtopicSelection)
	{
	topicMyDoc=topicSelection;
	subtopicMyDoc=subtopicSelection;

	if (id == "videoWindow")
		{
/*
		w	= "770";
		h	= (basefolder == "SLH")?465:535;
		if	(	basefolder == "human"
			&&	typeof(cobrandingActive) == "boolean"
			&&	cobrandingActive == true
			)
			{
			h += 24;
			URL += "?cb=1";
			}
		scrol	= "0";
		L	= "185";
		T	= "10";
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars='+scrol+',location=0,status=1,menubar=0,resizable=0,width='+w+',height='+h+',screenX='+L+',screenY='+T+',left = '+L+',top = '+T+' ');pagevideoWindow.focus();");
*/
		selectedVideo = subtopicSelection;
		var tag = document.getElementById("blausenLaunchLink");
		fireEvent(tag,'click');
		}
	else if (id == "clientWindow")
		{
		w	= "340";
		h	= "450";
		scrol	= "1";
		L	= "10";
		T	= "10";
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars='+scrol+',location=0,status=1,menubar=0,resizable=0,width='+w+',height='+h+',screenX='+L+',screenY='+T+',left = '+L+',top = '+T+' ');pageclientWindow.focus();");
		}
	else
		{
		w	= "330";
		h	= (basefolder == "SLH")?465:440;
		scrol	= "0";
		L	= "360";
		T	= "10";
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars='+scrol+',location=0,status=1,menubar=0,resizable=0,width='+w+',height='+h+',screenX='+L+',screenY='+T+',left = '+L+',top = '+T+' ');pageBMCWindow.focus();");
		}
	}

// Popup used for Care Guides
function popUpHealthTool(targetTool,desc)
		{
				window.open("/pp/us/cns/cns_healthtools_frame.jsp?targetTool="+targetTool + "&desc="+desc ,"winHealthtool"," width=800, height=550, status=yes, resizeable=yes");
				window.focus;
		}

// Popup used for RESTRICTED Health Tools
function popUpRestricted(targetTool,vendor,desc,lockState){
	if (!(targetTool==null || vendor == null || desc == null || lockState == null)){
		if(lockState == "listRestricted"){

			var referer				=   top.location.href;
			// check whether the URL contains question mark or not
			referer					=  (referer.indexOf("zQz") != -1 || referer.indexOf("?") != -1) ? referer + "&" : referer + "?";
			document.cookie			= "RedirectURL" + "=" + escape(referer + "targetTool=" + targetTool + "&vendor=" + vendor + "&desc=" + desc  + "~~" + parent.document.title) + "; path=/";
			window.location="https://"+location.hostname+"/pp/us/cns/cns_sign_in.jsp";
		}
		else{
			var healthToolsWin = window.open("/pp/us/cns/cns_healthtools_redirector.jsp?targetTool="+targetTool + "&vendor="+vendor + "&desc="+desc ,"winHealthtool","width=700,height=550,location=no,scrollbars=yes,menubar=yes,toolbar=yes,status=yes,resizable=yes");
			healthToolsWin.focus();
		}
	}
}

function MozKeyCap(e){
	if (navigator.appName == 'Netscape') {
		if (e.which == 13)
			viewCondGuide ();
	}
}

function IEKeyCap(){
	if (navigator.appName != 'Netscape') {
		if (window.event.keyCode == 13)
			viewCondGuide ();
	}
}

// View specific Condition Guide from drop-down list

function viewCondGuide(){
  //var doc = document.forms['conditionForm'];

  //for(var i=0; i<doc.condition.options.length; i++) {
	//if(doc.condition.options[i].selected)
		//doc.action=doc.condition.options[i].value ;
  //}
    //doc.submit();
  var curl = document.forms['conditionForm'].condition.value;
    if (curl != "") {
      window.location = curl;
    } else
      alert("Please select a condition");
    return false;
}
/* HTML Homepage Condition Guides nav list */
var selectedURL = "";
function toggleDropDownState(currentAnchor){
	var menuDiv = document.getElementById('cond-guide-home-menu');
	selectedURL = currentAnchor;
	currentAnchor.className = "on";
	for(i=0;i<menuDiv.getElementsByTagName('a').length;i++){
		if(menuDiv.getElementsByTagName('a')[i]!=currentAnchor){
			menuDiv.getElementsByTagName('a')[i].className="off";
		}
		else{
			menuDiv.getElementsByTagName('a')[i].className="on";
		}
	}
	return false;
}
function goToCondGuideNoMsg(){
	if(selectedURL != ""){
		window.location.href=selectedURL;
	}
}
function goToCondGuideBtn(){
	if(selectedURL!=""){
		window.location.href=selectedURL;
	}
	else{
		alert("Please select a condition");
	}
}
function checkCondGuide(e){
	if (e.which) {
		if (e.which == 13 ){
			goToCondGuideNoMsg();
		}
	}
	else if (window.event) {
		if (window.event.keyCode == 13){
			goToCondGuideNoMsg();
		}
	}
}
function popUp(URL) {

var hobo = window.open(URL, "Popup", "height=540,width=556,location=no,scrollbars=yes,menubars=no,toolbar=no,resizable=yes");
hobo.focus();
}
/* END HTML Homepage Condition Guides nav list */
