var memberEligURL = "https://"+sUrl+"/membereligibility/servlet/Controller";
var claimsURL = "https://"+sUrl+"/claimsStatus/MbrLogin.do";
var mbsURL = "https://"+sUrl+"/mbs/login.do";
var memberClaimsURL = "https://"+sUrl+"/ccs/userLogin.do";
var sClientName ="";
document.writeln(" <form name=\"navigationForm\" method=\"POST\" action=\"/smfh/navigation.do\" >");
            document.writeln(" <input type=\"hidden\" name=\"groupCode\"  value='' >");
            document.writeln(" <input type=\"hidden\" name=\"portalId\"     value='' >");
            document.writeln(" <input type=\"hidden\" name=\"menuId\"     value='' > ");
            document.writeln(" </form>");
            document.writeln("<form name=goContactUs action='/afhmd/contactUs.jsp'>");
            document.writeln("<input type=hidden name=groupcode value=''>");
            document.writeln("<input type=hidden name=portalId value=''>");
            document.writeln("<input type=hidden name=pageID value=''>");
            document.writeln("</form>");
            document.writeln("<form name=goLogout action='/smfh/userLogout.do'>");
            document.writeln("<input type=hidden name=groupcode value=''>");
            document.writeln("<input type=hidden name=userLogout value='true'>");
            document.writeln("</form>");
 document.writeln("<form name=\"LinkApps\" action=\"\" method=POST>");
 document.writeln("<input type=hidden name=\"groupCode\" value=\"\" >");
 document.writeln("<input type=hidden name=\"portalId\" value=\"\" >");
 document.writeln("<input type=hidden name=\"pageId\" value=\"\" >");
 document.writeln("<input type=hidden name=\"myAcctURL\" value=\"\">");
 document.writeln("<input type=hidden name=\"companyName\" value=\"\" >");
 document.writeln("<input type=hidden name=\"displayPendedClaims\" value=\"\" >");
 document.writeln("</form> ");
 document.writeln("<form name=\"goGHPServlet\" method=\"POST\">");
 document.writeln("<input type=\"hidden\" name=\"CLIENT_CODE\" value=\"\">");
 document.writeln("<input type=\"hidden\" name=\"pageUrl\" value=\"\">");
 document.writeln("</form>");


function navigate(appURL)
    {
        document.LinkApps.groupCode.value = sGroupCode;
        document.LinkApps.portalId.value = sPortalId;
        document.LinkApps.pageId.value = sPageId ;
        document.LinkApps.companyName.value = sClientName ;
        document.LinkApps.myAcctURL.value = "javascript:fromNavigation('"+sAccountMenuId+"');";

      if (  isEmpty(sGroupCode)   ||   isEmpty(sPortalId)   ||   isEmpty(sMenuId)    ||   isEmpty(sPageId)   )
      {
         alert(" Missing User Information , Request cannot be completed");
         return;
      }

      document.LinkApps.action=appURL;
      document.LinkApps.submit();

  }


function secureNavigate(appURL, jPageId, jMenuId, jPortalId, displayPendedClaims)
{
	document.LinkApps.groupCode.value = sGroupCode;
    document.LinkApps.portalId.value = jPortalId;
    document.LinkApps.pageId.value = jPageId ;
    document.LinkApps.myAcctURL.value = "javascript:fromNavigation('"+jMenuId+"');";

    if (  isEmpty(sGroupCode)   ||   isEmpty(jPortalId)   ||   isEmpty(jMenuId)    ||   isEmpty(jPageId)   )
    {
        alert(" Missing User Information , Request cannot be completed");
        return;
    }
    document.LinkApps.displayPendedClaims.value = displayPendedClaims;
    document.LinkApps.action=appURL;
    document.LinkApps.submit();

}

function ImgOn(index,location)
{
	img=document.images[index];
	img.src=location;
}
function ImgOff(index,location)
{
	img=document.images[index];
	img.src=location;
	}
            // Added for the navigation form.
function fromNavigation(menuid)
{
	document.navigationForm.groupCode.value = sGroupCode;
	document.navigationForm.portalId.value = sPortalId;
	document.navigationForm.menuId.value = menuid ;
	document.navigationForm.submit();
}

function goContactUs()
{
	document.goContactUs.pageID.value = sPageId;
	document.goContactUs.portalId.value = sPortalId;
	document.goContactUs.groupcode.value = sGroupCode;
	document.goContactUs.submit();
	//this.open('/contactUs/member_contactUs.html?fSubject=memberservices@firsthealth.com','_blank');
}


function goLogout()
{
	document.goLogout.groupcode.value = sGroupCode;
	document.goLogout.submit();
}

          	// end of navigation script.


function popup(url, width, height) {

	//if(!popup.arguments[1]) { var width = 720; }
	//if(!popup.arguments[2]) { var height = 540; }
	var winWidth = 720;
    var winHeight =	540;
	var xOffset = (800-720-40)*(1/2);
    var yOffset = (600-540)*(1/2);
    myWindow=window.open(url,'myWindow','location=yes,menubar=yes,personalbar=yes,resizable=yes,height='
        			+ winHeight+',width='+winWidth
        			+',scrollbars=yes,status=yes,titlebar=yes,toolbar=yes,'
        			+ 'innerheight='+winWidth +
        			',innerWidth = '+winHeight+
        			',left=' + xOffset +
                    ',screenX=' + xOffset +
                    ',top=' + yOffset +
                    ',screenY=' + yOffset);
    myWindow.focus();
}

function openWindow1(record){

	  var winWidth = 720;
        var winHeight =	540;
        var xOffset = (800-720-40)*(1/2);
    	var yOffset = (600-540)*(1/2);

        myWindow=window.open('','myWindow','location=yes,menubar=yes,personalbar=yes,resizable=yes,height=\"'
        			+ winHeight+'\",width=\"'+winWidth
        			+'\",scrollbars=yes,status=yes,titlebar=yes,toolbar=yes,'
        			+ 'innerheight='+winHeight+
        			',innerWidth = '+winWidth+
        			',left=' + xOffset +
                    ',screenX=' + xOffset +
                    ',top=' + yOffset +
                    ',screenY=' + yOffset);
        myWindow.focus();
 }

 function goGHPServlet(page,groupCode)
		{
			document.goGHPServlet.pageUrl.value = page;
			document.goGHPServlet.CLIENT_CODE.value = groupCode;
			document.goGHPServlet.action = "http://"+sUrl+"/ghp/servlet/GHPServlet" ;
			document.goGHPServlet.submit();
		}