
<!--BEGIN SET COOKIE FUNCTION-->
function setCookie(cookieName, cookieValue, cookiePath, cookieExpires)
    {
    cookieValue = escape(cookieValue);
    if (cookieExpires == "")
        {
        var nowDate = new Date();
        nowDate.setMonth(nowDate.getMonth() + 6);
        cookieExpires = nowDate.toGMTString();
        }
    if (cookiePath != "")
        {
        cookiePath = ";path=" + cookiePath;
        }
    document.cookie = cookieName + "=" + cookieValue + ";expires=" + cookieExpires + cookiePath;
    }
<!--END SET COOKIE FUNCTION-->

<!--BEGIN GET COOKIE VALUE FUNCTION-->
function getCookieValue(cookieName)
    {
    var cookieValue = document.cookie;
    var cookieStartsAt = cookieValue.indexOf(" " + cookieName + "=");
    if (cookieStartsAt == -1)
        {
        cookieStartsAt = cookieValue.indexOf(cookieName + "=");
        }
    if (cookieStartsAt == -1)
        {
        cookieValue = null;
        }
    else
        {
        cookieStartsAt = cookieValue.indexOf("=", cookieStartsAt) + 1;
        var cookieEndsAt = cookieValue.indexOf(";", cookieStartsAt);
        if (cookieEndsAt == -1)
            {
            cookieEndsAt = cookieValue.length;
            }
        cookieValue = unescape(cookieValue.substring(cookieStartsAt,cookieEndsAt));
        }
    return cookieValue;
    }
<!--END GET COOKIE VALUE FUNCTION-->


<!--BEGIN MEMBERS OPEN PAGE FUNCTIONS-->

function openPageMembersLink()
    {
    if (cookieXplan == null || cookieXproduct == null)
        {
        var pageName = "/en/members/choose_state.jsp?xlang=en&xrole=members&xpick=plan_overview";
        }
    if (cookieXplan != null && cookieXproduct != null)
        {
        var pageName = "/en/members/plan_overview.jsp?xlang=en&xrole=members&xstate=" + cookieXstate + "&xplan=" + cookieXplan + "&xproduct=" + cookieXproduct;
        }
    window.location.href=pageName;
    }

function openPageFindDoctor()
    {
    if (cookieXplan == null || cookieXproduct == null)
        {
        var pageName = "/en/members/choose_state.jsp?xlang=en&xrole=members&xpick=find_doctor";
        }
    if (cookieXplan != null && cookieXproduct != null)
        {
        var pageName = "/en/members/find_doctor.jsp?xlang=en&xrole=members&xstate=" + cookieXstate + "&xplan=" + cookieXplan + "&xproduct=" + cookieXproduct;
        }
    window.location.href=pageName;
    }

function openPageFindDrug()
    {
    if (cookieXplan == null || cookieXproduct == null)
        {
        var pageName = "/en/members/choose_state.jsp?xlang=en&xrole=members&xpick=find_drug";
        }
    if (cookieXplan != null && cookieXproduct != null)
        {
        var pageName = "/en/members/find_drug.jsp?xlang=en&xrole=members&xstate=" + cookieXstate + "&xplan=" + cookieXplan + "&xproduct=" + cookieXproduct;
        }
    window.location.href=pageName;
    }

function openPageMemberHandbook()
    {
    if (cookieXplan == null || cookieXproduct == null)
        {
        var pageName = "/en/members/choose_state.jsp?xlang=en&xrole=members&xpick=handbook";
        }
    if (cookieXplan != null && cookieXproduct != null)
        {
        var pageName = "/en/members/handbook.jsp?xlang=en&xrole=members&xstate=" + cookieXstate + "&xplan=" + cookieXplan + "&xproduct=" + cookieXproduct;
        }
    window.location.href=pageName;
    }

function openPageMemberContact()
    {
    if (cookieXplan == null || cookieXproduct == null)
        {
        var pageName = "/en/members/choose_state.jsp?xlang=en&xrole=members&xpick=contact";
        }
    if (cookieXplan != null && cookieXproduct != null)
        {
        var pageName = "/en/members/contact.jsp?xlang=en&xrole=members&xstate=" + cookieXstate + "&xplan=" + cookieXplan + "&xproduct=" + cookieXproduct;
        }
    window.location.href=pageName;
    }

<!--END MEMBER OPEN PAGE FUNCTIONS-->

<!--BEGIN PHYSICIAN OPEN PAGE FUNCTIONS-->

function openPagePhysiciansLink()
    {
    if (cookiePhXplan == null)
        {
        var pageName = "/en/physicians/choose_state.jsp?xrole=physicians&ypick=product_overview";
        }
     if (cookiePhXplan != null)
        {
        var pageName = "/en/physicians/product_overview.jsp?xrole=physicians&xstate=" + cookiePhXstate + "&xplan=" + cookiePhXplan;
        }
    window.location.href=pageName;
    }
 
function openPageSOS()
    {
	if (cookiePhXplan = "uhcfl")
		{
		var pageName = "/en/physicians/unitedhealthcare_online.jsp?xrole=physicians&xstate=fl&xplan=uhcfl";
		}
    if (cookiePhXplan == null)
        {
        var pageName = "/en/physicians/choose_state.jsp?xrole=physicians&ypick=services_overview";
		}
	else (cookiePhXplan  != null)
        {
		var pageName = "https://secure.americhoice.com/portal/";
        }
	window.location.href=pageName;
    }
 
function openPageFindPhysician()
    {
    if (cookiePhXplan == null)
        {
        var pageName = "/en/physicians/choose_state.jsp?xrole=physicians&ypick=find_physician";
        }
    if (cookiePhXplan != null)
        {
        var pageName = "/en/physicians/find_physician.jsp?xrole=physicians&xstate=" + cookiePhXstate + "&xplan=" + cookiePhXplan;
        }
    window.location.href=pageName;
    }
 
function openPageDrugList()
    {
    if (cookiePhXplan == null)
        {
        var pageName = "/en/physicians/choose_state.jsp?xrole=physicians&ypick=drug_list";
        }
    if (cookiePhXplan != null)
        {
        var pageName = "/en/physicians/drug_list.jsp?xrole=physicians&xstate=" + cookiePhXstate + "&xplan=" + cookiePhXplan;
        }
    window.location.href=pageName;
    }
 
function openPagePhysicianContact()
    {
    if (cookiePhXplan == null)
        {
        var pageName = "/en/physicians/choose_state.jsp?xrole=physicians&ypick=contact";
        }
    if (cookiePhXplan != null)
        {
        var pageName = "/en/physicians/contact.jsp?xrole=physicians&xstate=" + cookiePhXstate + "&xplan=" + cookiePhXplan;
        }
    window.location.href=pageName;
    }

<!--END PHYSICIAN OPEN PAGE FUNCTIONS-->


function clearCookies()
    {
    setCookie("xstate","","/en","28 Dec 2001 00:00:00");
    setCookie("xplan","","/en","28 Dec 2001 00:00:00");
    setCookie("xproduct","","/en","28 Dec 2001 00:00:00");
    setCookie("phxstate","","/en","28 Dec 2001 00:00:00");
    setCookie("phxplan","","/en","28 Dec 2001 00:00:00");
    }

function MM_openMyWindow(theURL,winName,features)
    {
    window.open(theURL,winName,features);
    }

function dpSmartLink(u,n,w,h,p)
    { 
    var a,j,k,x,y,f='';if(!n){n='';}if(w){f+='width='+w+',';}if(h){f+='height='+h+',';}
    if(p){p=p.split(':');if(p[0]!='z'){p[0]=='c'?(x=(screen.width-w)/2):x=p[0];f+='left='+x+',';}
    if(p[1]!='z'){if(p[0]=='c'){y=(screen.height-h-p[1])/2;if(navigator.appName.indexOf('Op')!=-1){
    y-=96;y=y<0?0:y;}}else{y=p[1];}f+='top='+y+',';}}a=arguments.length;if(a>5){for (k=5;k<a;k++){
    switch(arguments[k]){case 'all':f+='toolbar,menubar,location,scrollbars,status,resizable,';break;
    case 't':f+='toolbar,';break; case 'm':f+='menubar,';break;case 'l':f+='location,';break;
    case 'sc':f+='scrollbars,';break;case 's':f+='status,';break;case 'r':f+='resizable,';}}}
    if(f.charAt(f.length-1)==','){f=f.slice(0,-1);}j=window.open(u,n,f);j.focus();
    document.MM_returnValue=false;
    }

function MM_openBrWindow(theURL,winName,features)
    {
    window.open(theURL,winName,features);
    }

function MM_preloadImages()
    {
    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()
    {
    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)
    {
    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()
    {
    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];}
    }

function MM_jumpMenu(targ,selObj,restore)
    {
    eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
    if (restore) selObj.selectedIndex=0;
    }

function MM_jumpMenuGo(selName,targ,restore)
    {
    var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
    }

function stickyNews()
    {
    <!--parses current URL to get only the yearName-->
    var yearName = window.location.href;
    var firstChar2 = yearName.lastIndexOf("=") + 1;
    var lastChar2 = yearName.length;
    yearName = yearName.substr(firstChar2, lastChar2);
    <!--sets a particular docName to the equivalent of the parsed link image filename-->
    var imageID2;
    var selectedImage;
    imageID2 = "tab" + yearName;
    if (imageID2 == "tab2006")
        {
	    selectedImage = "grfx/button_latest_news_selected.gif";
	    }
    if (imageID2 == "tab2003")
        {
	    selectedImage = "grfx/button_2003_selected.gif";
	    }
    if (imageID2 == "tab2002")
        {
	    selectedImage = "grfx/button_2002_selected.gif";
	    }
    document.images[imageID2].src=selectedImage; 
    }

<!--STICKY TAPE FUNCTIONS for NAVs-->


function stickyNav()
    {
    var docName = window.location.href;
	// alert("docName is " + docName);
    var firstChar = docName.lastIndexOf("en/") + 3;
    var lastChar = docName.lastIndexOf("/") - firstChar;
    docName = docName.substr(firstChar, lastChar);
	// alert("docName is " + docName);
    var imageID;
    imageID = docName;
	// alert("imageID is " + imageID);
    var imagePath = document.images[imageID].src;
	// alert("imagePath is " + imagePath);
    var startChar = imagePath.indexOf("h");
    var endChar = imagePath.lastIndexOf("-o") - startChar;
    imagePath = imagePath.substr(startChar, endChar);
	// alert("imagePath is " + imagePath);
    stickyButton = imagePath + "-on.gif";
	// alert("stickyButton is " + stickyButton);
    document.images[imageID].src=stickyButton; 
    }


<!--CHANGE STYLE FUNCTION-->
function change(id, newClass) 
    {
    var identity=document.getElementById(id);
    identity.className=newClass;
    }
<!--END CHANGE STYLE FUNCTION-->

function navRollover(tableCellRef, newClass2)
    {
    if (tableCellRef.id!=sessionV) {
    tableCellRef.className=newClass2;}
    }

function navRollout(tableCellRef, oldClass2)
    {
    if (tableCellRef.id!=sessionV) {
    tableCellRef.className=oldClass2;}
    }
	
	
	
	
function expandingWindow(website) {
var windowprops='width=350,height=,autoscroll=yes,scrollbars=yes,status=yes,resizable=yes'
var heightspeed = 2; // vertical scrolling speed (higher = slower)
var widthspeed = 2;  // horizontal scrolling speed (higher = slower)
var leftdist = 635;    // distance to left edge of window
var topdist = 400;     // distance to top edge of window

if (window.resizeTo&&navigator.userAgent.indexOf("Opera")==-1) {
var winwidth = window.screen.availWidth - leftdist;
var winheight = window.screen.availHeight - topdist;
var sizer = window.open("","","left=" + leftdist + ",top=" + topdist +","+ windowprops);
for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed)
sizer.resizeTo("1", sizeheight);
for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed)
sizer.resizeTo(sizewidth, sizeheight);
sizer.location = website;
}
else
window.open(website,'mywindow');
}


function checkCapsLock( e ) {
	var myKeyCode=0;
	var myShiftKey=false;
	var myMsg='Caps Lock Key is ON.\n\nReminder: Username and Password is case-sensitive';

	// Internet Explorer 4+
	if ( document.all ) {
		myKeyCode=e.keyCode;
		myShiftKey=e.shiftKey;

	// Netscape 4
	} else if ( document.layers ) {
		myKeyCode=e.which;
		myShiftKey=( myKeyCode == 16 ) ? true : false;

	// Netscape 6
	} else if ( document.getElementById ) {
		myKeyCode=e.which;
		myShiftKey=( myKeyCode == 16 ) ? true : false;

	}

	// Upper case letters are seen without depressing the Shift key, therefore Caps Lock is on
	if ( ( myKeyCode >= 65 && myKeyCode <= 90 ) && !myShiftKey ) {
		alert( myMsg );

	// Lower case letters are seen while depressing the Shift key, therefore Caps Lock is on
	} else if ( ( myKeyCode >= 97 && myKeyCode <= 122 ) && myShiftKey ) {
		alert( myMsg );

	}
}
