popupWins = new Array();

// *****************************************************************
// *
// * Name: windowOpener
// *
// * Purpose: the popupWins array stores an object reference for
// * each separate window that is called, based upon
// * the name attribute that is supplied as an argument
// *
// * Inputs: url - the usrl of the website you are going to
// * 		 name - the name of the window to be used in the array
// * 		 args - attributes of the window
// *		 (scrollbars=1,toolbar=0, status=0, location=0, menubar=0, resizable=1,width=200,height=200)
// * 		 type - 1 (if you want a confirmation to appear that you
// *		 are leaving our web site) Leave blank if you don't want the
// *		 prompt.   		
// * 
// * Outputs: Focus to the window
// *
// *****************************************************************
function windowOpener(url, name, args, type) {

	if ( typeof( popupWins[name] ) != "object" ){
		if (type==1) {
			if (confirm("You are exiting www.healthnowny.com.\n\nLinks to other web sites are provided for your convenience only.\n HealthNow New York Inc. disclaims any responsibility\nfor the content and accuracy of any and all information\nwhich may be listed and contained within these other web sites.\n\nIf you understand and agree with the above statement, click OK to proceed.\nOtherwise click Cancel and you will be returned to www.healthnowny.com.")) {
				popupWins[name] = window.open(url,name,args);
				popupWins[name].focus();
			}
		} else {
			popupWins[name] = window.open(url,name,args);
			popupWins[name].focus();
		}
	} else {
		if (!popupWins[name].closed){
			popupWins[name].location.href = url;
			popupWins[name].focus();
		} else {
			if (type==1) {
				if (confirm("You are exiting www.healthnowny.com.\n\nLinks to other web sites are provided for your convenience only.\n HealthNow New York Inc. disclaims any responsibility\nfor the content and accuracy of any and all information\nwhich may be listed and contained within these other web sites.\n\nIf you understand and agree with the above statement, click OK to proceed.\nOtherwise click Cancel and you will be returned to www.healthnowny.com.")) {
					popupWins[name] = window.open(url, name,args);
					popupWins[name].focus();
				}
			} else {
				popupWins[name] = window.open(url, name,args);
				popupWins[name].focus();
			}
		}
	}
} // End Function



// *****************************************************************
// *
// * Name: menu_hide_show
// *
// * Purpose: Hides elements within a DIV or Layer (Used due to a
// *	      DHTML error with our menu and SELECT BOXES
// *
// * Inputs: arrDiv - array of divs or layers to hide 		
// * 
// * Outputs: Nothing
// *
// *****************************************************************
function menu_hide_show(arrDiv) {
	var i = 0;

	 if(document.layers){
		
		for(i=0; i<arrDiv.length; i++){
			dqm__showmenu_code1 = "document." + arrDiv[i] + ".visibility = 'hide'"
			dqm__hidemenu_code1 = "document." + arrDiv[i] + ".visibility = 'show'"
			dqm__showmenu_code2 = "document." + arrDiv[i] + ".visibility = 'hide'"
			dqm__hidemenu_code2 = "document." + arrDiv[i] + ".visibility = 'show'"
			dqm__showmenu_code3 = "document." + arrDiv[i] + ".visibility = 'hide'"
			dqm__hidemenu_code3 = "document." + arrDiv[i] + ".visibility = 'show'"
			dqm__showmenu_code4 = "document." + arrDiv[i] + ".visibility = 'hide'"
			dqm__hidemenu_code4 = "document." + arrDiv[i] + ".visibility = 'show'"
			dqm__showmenu_code5 = "document." + arrDiv[i] + ".visibility = 'hide'"
			dqm__hidemenu_code5 = "document." + arrDiv[i] + ".visibility = 'show'"
			dqm__showmenu_code6 = "document." + arrDiv[i] + ".visibility = 'hide'"
			dqm__hidemenu_code6 = "document." + arrDiv[i] + ".visibility = 'show'"
		}

	 } else if(document.all){

		for(i=0; i<arrDiv.length; i++){
			dqm__showmenu_code1 = arrDiv[i] + ".style.visibility = 'hidden'"
			dqm__hidemenu_code1 = arrDiv[i] + ".style.visibility = 'visible'"
			dqm__showmenu_code2 = arrDiv[i] + ".style.visibility = 'hidden'"
			dqm__hidemenu_code2 = arrDiv[i] + ".style.visibility = 'visible'"
			dqm__showmenu_code3 = arrDiv[i] + ".style.visibility = 'hidden'"
			dqm__hidemenu_code3 = arrDiv[i] + ".style.visibility = 'visible'"
			dqm__showmenu_code4 = arrDiv[i] + ".style.visibility = 'hidden'"
			dqm__hidemenu_code4 = arrDiv[i] + ".style.visibility = 'visible'"
			dqm__showmenu_code5 = arrDiv[i] + ".style.visibility = 'hidden'"
			dqm__hidemenu_code5 = arrDiv[i] + ".style.visibility = 'visible'"
			dqm__showmenu_code6 = arrDiv[i] + ".style.visibility = 'hidden'"
			dqm__hidemenu_code6 = arrDiv[i] + ".style.visibility = 'visible'"
		}

 
	} else if(!document.all && document.getElementById) {
		 
		 dqm__showmenu_code1 = "document.getElementById('" + arrDiv[i] + "').style.visibility='hidden'"
		 dqm__hidemenu_code1 = "document.getElementById('" + arrDiv[i] + "').style.visibility='visible'"
		 dqm__showmenu_code2 = "document.getElementById('" + arrDiv[i] + "').style.visibility='hidden'"
		 dqm__hidemenu_code2 = "document.getElementById('" + arrDiv[i] + "').style.visibility='visible'"
		 dqm__showmenu_code3 = "document.getElementById('" + arrDiv[i] + "').style.visibility='hidden'"
		 dqm__hidemenu_code3 = "document.getElementById('" + arrDiv[i] + "').style.visibility='visible'"
		 dqm__showmenu_code4 = "document.getElementById('" + arrDiv[i] + "').style.visibility='hidden'"
		 dqm__hidemenu_code4 = "document.getElementById('" + arrDiv[i] + "').style.visibility='visible'"
		 dqm__showmenu_code5 = "document.getElementById('" + arrDiv[i] + "').style.visibility='hidden'"
		 dqm__hidemenu_code5 = "document.getElementById('" + arrDiv[i] + "').style.visibility='visible'"
		 dqm__showmenu_code6 = "document.getElementById('" + arrDiv[i] + "').style.visibility='hidden'"
		 dqm__hidemenu_code6 = "document.getElementById('" + arrDiv[i] + "').style.visibility='visible'"
	}

	return;
}

// *****************************************************************
// *
// * Name: display_logon_box
// *
// * Purpose: Displays the OnlineServices Logon Box
// *
// * Inputs: strType - Type of constituent
// * 
// * Outputs: Nothing
// *
// *
// *****************************************************************
function display_logon_box(strType, strHostSecure, strSite) {

var strPathLogin
var strPathRegister
var strPathMessage

switch (strType) {
	case "memb":
		if (strSite == "bcbs") {
			strPathLogin = strHostSecure + "/online_services/wnymember/wnymembLogin.asp?catg=memb";
			strPathRegister = strHostSecure + "/online_services/wnymember/wnymembRegister.asp?catg=memb";
			strPathMessage = "/content/bcbs_home_0000_whatsinitforme.html";
		} else if (strSite == "neny") {
			strPathLogin = strHostSecure + "/online_services/nenymember/nenymembLogin.asp?catg=memb";
			strPathRegister = strHostSecure + "/online_services/nenymember/nenymembRegister.asp?catg=memb";
			strPathMessage = "/content/neny_home_0000_whatsinitforme.html";
		} else if (strSite == "hnny") {
			strPathLogin = strHostSecure + "/online_services/hnnymember/hnnymembLogin.asp?catg=memb";
			strPathRegister = strHostSecure + "/online_services/hnnymember/hnnymembRegister.asp?catg=memb";
			strPathMessage = "/content/hnny_home_0000_whatsinitforme.html";
		}
		break;
	case "empl":
		if (strSite == "bcbs") {
			strPathLogin = strHostSecure + "/online_services/wnygroup/wnygrpLogin.asp?catg=empl";
			strPathRegister = strHostSecure + "/online_services/wnygroup/wnygrpregister.asp?catg=empl";
			strPathMessage = "/content/bcbs_home_0000_whatsinitforme.html";
		} else if (strSite == "neny") {
			strPathLogin = strHostSecure + "/online_services/nenygroup/nenygrpLogin.asp?catg=empl";
			strPathRegister = strHostSecure + "/online_services/nenygroup/nenygrpregister.asp?catg=empl";
			strPathMessage = "/content/neny_home_0000_whatsinitforme.html";
		} else if (strSite == "hnny") {
			strPathLogin = strHostSecure + "/online_services/hnnygroup/hnnygrpLogin.asp?catg=empl";
			strPathRegister = strHostSecure + "/online_services/hnnygroup/hnnygrpregister.asp?catg=empl";
			strPathMessage = "/content/hnny_home_0000_whatsinitforme.html";
		}
		break;
	case "brok":
		if (strSite == "bcbs") {
			strPathLogin = strHostSecure + "/online_services/wnybroker/wnybrkLogin.asp?catg=brok";
			strPathRegister = strHostSecure + "/online_services/wnybroker/wnybrkregister.asp?catg=brok";
			strPathMessage = "/content/bcbs_home_0000_whatsinitforme.html";
		} else if (strSite == "neny") {
			strPathLogin = strHostSecure + "/online_services/nenybroker/nenybrkLogin.asp?catg=brok";
			strPathRegister = strHostSecure + "/online_services/nenybroker/nenybrkregister.asp?catg=brok";
			strPathMessage = "/content/neny_home_0000_whatsinitforme.html";
		} else if (strSite == "hnny") {
			strPathLogin = strHostSecure + "/online_services/hnnybroker/hnnybrkLogin.asp?catg=brok";
			strPathRegister = strHostSecure + "/online_services/hnnybroker/hnnybrkregister.asp?catg=brok";
			strPathMessage = "/content/hnny_home_0000_whatsinitforme.html";
		}
		break;
	case "prov":
		if (strSite == "bcbs") {
			strPathLogin = strHostSecure + "/online_services/wnyprovider/wnyprovLogin.asp?catg=prov";
			strPathRegister = strHostSecure + "/online_services/wnyprovider/wnyprovServiceAgreement.asp?catg=prov";
			strPathMessage = "/content/bcbs_home_0000_whatsinitformeproviders.html";
		} else if (strSite == "neny") {
			strPathLogin = strHostSecure + "/online_services/nenyprovider/nenyprovLogin.asp?catg=prov";
			strPathRegister = strHostSecure + "/online_services/nenyprovider/nenyprovServiceAgreement.asp?catg=prov";
			strPathMessage = "/content/neny_home_0000_whatsinitformeproviders.html";
		} else if (strSite == "hnny") {
			strPathLogin = strHostSecure + "/online_services/hnnyprovider/hnnyprovLogin.asp?catg=prov";
			strPathRegister = strHostSecure + "/online_services/hnnyprovider/hnnyprovServiceAgreement.asp?catg=prov";
			strPathMessage = "/content/hnny_home_0000_whatsinitformeproviders.html";
		}
		break;
}
  document.write('<table width="100%" border="0" cellpadding="0" cellspacing="0">');
  document.write('<tr>');
  document.write('<td align="right">');
  document.write('<table width="546" border="0" cellspacing="0" cellpadding="0">');
  document.write('<tr>');
  document.write('<td colspan="3"><img src="../images/login_top2.gif" alt="Login or register for secure online  services" width="546" height="13" border="0"></td>');
  document.write('</tr>');
  document.write('<tr>');
  document.write('<td><img src="../images/left2.gif"></td>');
  document.write('<td align="right">');
  document.write('<table border="0" cellspacing="0" cellpadding="0" align="right">');
  document.write('<tr>');
  document.write('<TD cellpadding="0" cellspacing="0" valign="top" align="right">');		
  document.write('<b class="online"">Online Services</b>&nbsp;');
  document.write("<INPUT TYPE=\"BUTTON\" CLASS=\"homebutton\" VALUE=\"Log In\" OnClick=\"(document.location.href='" + strPathLogin + "' );\" title=\"Click here to logon to or register for Online Services!\">")
  document.write('&nbsp;&nbsp;');
  document.write("<INPUT TYPE=\"BUTTON\" CLASS=\"homebutton\" VALUE=\"Register\" OnClick=\"(document.location.href='" + strPathRegister + "' );\"  title=\"Click here to logon to or register for Online Services!\">")
  document.write('&nbsp;&nbsp;');
  document.write("<INPUT TYPE=\"BUTTON\" CLASS=\"homebutton\" VALUE=\"What's in it for me?\" onclick=\"JavaScript:void windowOpener('" + strPathMessage + "', 'searches', 'height=150,width=500,resizable=1,toolbar=0,menubar=0,scrollbars=1,status=0');\"  title=\"Click here to learn about the advantages of Online Services!\">")
  document.write('</TD>');				
  document.write('</tr>');
  document.write('</table>');
  document.write('</td>');
  document.write('<td align="right"><img src="../images/right2.gif"></td>');
  document.write('</tr>');
  document.write('<TR>');
  document.write('<TD colspan="3" valign="top"><img src="../images/bottomLogin.gif"></TD>');
  document.write('</TR>');
  document.write('</table>');
  document.write('</td>');
  document.write('</tr>');
  document.write('</table>');
	
  return;
}

	function subMenuState(subMenu)
	{
		var objMenu = document.getElementById(subMenu);
		if (objMenu != null)
		{
			if (objMenu.style.display == "none")
			{
				objMenu.style.display = "";
			}
			else
			{
				objMenu.style.display = "none";
			}
		}
	}
	
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];}
}

