
var loginOff=-250;
var loginOn=1;

var dly=50;
var out=2;

function resetAccountType(){
	document.login.accounttype.selectedIndex=0;
	choose();
}
function getAccountTypeIndex(){
	sAcctTypeIndex=document.login.accounttype.selectedIndex;
	return sAcctTypeIndex;
}
function choose(){
	sChoice=getAccountTypeIndex();
	if(sChoice==0){dispLayer("gobuttondefault","none");}
	else{dispLayer("gobuttondefault","block");}
}

function setIFRAMEsrc(ifrmName,strSrc){
	var objDIV=fObj(ifrmName);
	if(objDIV!=null){objDIV.src=strSrc;}
}
function mvDIV1(o,p){
	var d=0;
	if(o!=null){
		window.mvDIV1Ag=function(){
			var cp=parseInt(o.style.top);
			if(p>0){
				d=Math.floor((p-cp)/2);
				o.style.top=cp+d;
				if(d!=0){
					setTimeout("mvDIV1Ag()",dly);
				}
			}else{
				if(cp>p){
					if(d==0)d=-1;
					d=d*out;
					o.style.top=cp+d;
					if(d>p&&cp>loginOff){
						setTimeout("mvDIV1Ag()",dly);
					}
				}
			}
		}
		mvDIV1Ag();
	}
}

function sldL1(){
	var obj,args=sldL1.arguments;
	if((obj=fObj(args[0]))!=null){
		mvDIV1(obj,args[1]);
	}
}

function hideLogin(){
	dispLayer("ghlogindiv","none");
}

var hideLoginTimer=0;

function toggleLogin(){
	var objDIV=fObj("ghlogin");
	if(objDIV!=null){
		if(parseInt(objDIV.style.top)<loginOn-1){

			loginIn();
		}else{
			loginOut();
			hideLoginTimer=window.setTimeout("hideLogin()", 400);
		}
	}
}
function loginIn(){
	window.clearTimeout(hideLoginTimer);
	dispLayer("ghlogindiv","block");
	document.login.accounttype.focus();
	swap(document.ghloginbtnimg,"/images/headerfooter/signinarrowup.gif");
	sldL1("ghlogin",loginOn);
}

function loginOut(){
	window.clearTimeout(hideLoginTimer);
	sldL1("ghlogin",loginOff);
	swap(document.ghloginbtnimg,"/images/headerfooter/signinarrowdown.gif");
	resetAccountType();
}



function validateGHLogin(frm){
	frm.action="";
	if(getAccountTypeIndex()==0){
		alert("Please select an account type.");
		frm.accounttype.focus();
		return false;
	}
	sAcctType=getAccountTypeIndex();
	if(sAcctType==1){
		window.location.href=("https://www22.verizon.com/myaccount/");
	}else if(sAcctType==2){
		var w=window.open("http://www22.verizon.com/utilities/redirect/?target=http://www.verizonwireless.com/");
		w.focus();
	}else if(sAcctType==3){
		var w=window.open("http://www22.verizon.com/utilities/redirect/?target=https://sso.verizon.net/ssowebapp/VOLPortalLogin%3FActualTarget=https://netservices.verizon.net/portal/verizon/protected/afterssologin.jsp?a=b");
		w.focus();
	}else if(sAcctType==4){
		var w=window.open("http://www22.verizon.com/utilities/redirect/?target=https://customercenter.verizonbusiness.com/");
		w.focus();
	}
	toggleLogin();
	resetAccountType();
	return false;
}

function resetLocation(){
	if(strResetLocationPage != null){
		var expireDate = new Date();
		expireDate.setTime(expireDate.getTime() + (1000*60*60*24*240));
		fnSetFullCookie('vzapps','NPA=&NXX=&LAST=&STATE=;',expireDate,'/','.verizon.com');
		document.location.href=strResetLocationPage;
	}
}
