
var showNotice = 'Y';
function trim (str) 
{
	var str = str.replace(/^\s\s*/, ''),
		ws = /\s/,
		i = str.length;
	while (ws.test(str.charAt(--i)));
	return str.slice(0, i + 1);
}



function setCookie(c_name,value,expiredays)
{
	var exdate=new Date();
	var domain = document.domain;
	exdate.setDate(exdate.getDate()+expiredays);
	if(c_name != 'MyVzCom')
		value = escape(value);

	document.cookie=c_name+ "=" + value + ';path=/;domain=.verizon.com'+
		((expiredays==null) ? ";" : ";expires="+exdate.toGMTString());
		//document.cookie=c_name+ "=" +escape(value)+ ';path=/'+
	
	
}

function getSubCookie(c_name, sub_key)
{
	if (document.cookie.length>0)
	{
		c_start=document.cookie.indexOf(c_name + "=")

		if (c_start!=-1)
		{ 
			c_start=c_start + c_name.length+1 
			c_end=document.cookie.indexOf(";",c_start)
			if (c_end==-1) c_end=document.cookie.length
			var subCookie = unescape(document.cookie.substring(c_start,c_end))
			s_start = subCookie.indexOf(sub_key + "=")
			if (s_start != -1)
			{
				s_start=s_start + sub_key.length+1 
				s_end=subCookie.indexOf("&",s_start)
				if (s_end==-1) s_end=subCookie.length
					return subCookie.substring(s_start,s_end);				
			}			
		}
		return null;
	}
    var x = unescape(dc.substring(begin + prefix.length, end));
    return unescape(dc.substring(begin + prefix.length, end));
}



function CaptureEnterKey(e)
{
    var keyCode = (e.which) ? e.which : e.keyCode;
	 		
    if(keyCode == 13)
    {
	 return submit();
    }		
    return true;
}


        
function checkEmail(emailField)
{
	var reEmail = /^([a-zA-Z0-9_\.\'\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!reEmail.test(emailField.value)||emailField.value==""){return false;}
	else{return true;}
}

domain = document.domain;


function open_popup(strUrl,strName,strWidth,strHeight)
{
	var windowprops = "width=" + strWidth + ",height=" + strHeight;
	popup = window.open(strUrl.href,strName,windowprops);
	
}

function Redirect(obj)
{
    parent.location.href = obj.href;
}

function RedirectURL(strURL)
{
    parent.location.href = strURL;
}


function _hbLink(){}

var userID = 'userID';
var password = 'password';
function submit()
{
if(document.getElementById('target') != null)
{

	document.getElementById('target').id='targets';
	document.getElementById('targets').name='targets';
}
    user = document.getElementById(userID);
    pass = document.getElementById(password);
    document.forms[0].target = '_parent';
    user.value = trim(user.value);

    if(user.value.length == 0) 
    {
        alert('Please enter both your user ID and password.');
        user.focus();
	document.forms[0].target = '';
        return ;
    }
    if(pass.value.length == 0) 
    {
        alert('Please enter both your user ID and password.');
        pass.focus();
	document.forms[0].target = '';
        return ;
    }
    
    //user.value = '';
    //pass.value = '';
    val = document.getElementById('course_code').value;
	var rObj = document.getElementById('realm');
	var gObj = document.getElementById('goto');

	

    
    if(val == 0)
    {
        alert('Please select a destination');

	document.forms[0].target = '';
        return ;
    }
    
    if(val == 1)
    {
        user.id = 'IDToken1';
        userID = 'IDToken1';
        user.name="IDToken1";
        pass.id = 'IDToken2';
        password = 'IDToken2'	
        pass.name="IDToken2";
        //var url = "https://"+ domain +"/foryourhome/registration/regprofile/ergcon.aspx?Target=";
 	var url = "https://"+ domain +"/foryourhome/MyAccount/Protected/Common/ergcon.aspx?Target=";
        //url = 'https://'+ domain +'/sso/redirect/redirect.asp?TARGET=';
        rUrl = 'https://'+domain + document.getElementById('manageLink').value;

	//commented to remove the residnetial drop down
	rUrl = "";
	document.getElementById('manageLink').value = 0;
	//		
       
        //rUrl += '&s=F';
	url += rUrl;
	
	setCookie('LOB_CATEGORY','MYVZ',null);
	setCookie('vzUserType','RetailConsumer',null);
	setCookie('RedirectTarget',"",null);


	

	if(document.getElementById('manageLink').value.indexOf('PaymentOptions.aspx') > -1)
	{
		if(val == 1)
		    _hbLink('wgt_res_pti_paybill');
		else if(val == 8)
		    _hbLink('wgt_sb_pt_paybill');				
	}	
	if(document.getElementById('manageLink').value.indexOf('MyBill.aspx') > -1)
	{
		if(val == 1)
		    _hbLink('wgt_res_pti_viewbill');
		else if(val == 8)
		    _hbLink('wgt_sb_pt_viewbill');				
	}	
	if(document.getElementById('manageLink').value.indexOf('MVPLB') > -1)
	{
		if(val == 1)
		    _hbLink('wgt_res_pti_paperless');
		else if(val == 8)
		    _hbLink('wgt_sb_pt_paperless');				
	}	
	if(document.getElementById('manageLink').value.indexOf('MyAccount.aspx') > -1)
	{
		if(val == 1)
		    _hbLink('wgt_res_pti_account');
		else if(val == 8)
		    _hbLink('wgt_sb_pt_account');				
	}	



        if((document.getElementById('chkbox').checked) && (val == 1))
	{
            url += "&remopt=Y";

	    setCookie("MyVzCom","uid=&remopt=Y",60);	

	}
	else
	{

	    setCookie("MyVzCom","uid=&remopt=N",60);	

	}

	 var targets = document.getElementById('targets');
	 targets.id='target';
	 targets.name='target';

	 targets.value = 'https://'+ domain +'/foryourhome/registration/regprofile/ergcon.aspx?Target=https://' + domain + '/myverizon/?a=1';



         //document.getElementById('').setattribute('','')
         //_hbLink('wgt_sb_pt_viewbill');


	// document.forms[0].action = 'https://'+ domain +'/sso/common/retaillogin.fcc';

	
	if(domain.indexOf('www25') > -1)
		document.forms[0].action = "http://login.verizon.com:8081/amserver/UI/Login?realm=dotcom&module=AIAWC&clientid=myvz&goto="+ url;
	else
		document.forms[0].action = "https://auth.verizon.com/amserver/UI/Login?realm=dotcom&module=AIAWC&clientid=myvz&goto="+ url;

    }
    else if(val == 2)
    {	

        user.setAttribute("id","CentUser");
	user.setAttribute("name","IDToken1");
        pass.setAttribute("id","CentPass");
        pass.setAttribute("name","IDToken2");
	_hbLink('wgt_res_vzcentral');
	document.forms[0].action = 'https://auth.verizon.net/amserver/UI/Login?realm=dotnet&module=LDAP&goto=https://www.verizon.net/ssowebapp/ProcessLoginServlet&clientId=central';
    }
    else if((val == 3) || (val == 6))
    {

        //document.forms[0].name="myaccountForm";
        //document.forms[0].id="myaccountForm";
        document.getElementById('signin').style.top='0px'
        document.getElementById('signin').style.left='0px'
       
        user.id = 'vzwuser1';
        userID = 'vzwuser1';
        user.name = "IDToken1";
        pass.id = 'vzwpass1';
        password = 'vzwpass1'
        pass.name = "IDToken2";
	
	if(val == 3)
	   _hbLink('wgt_vzw_personal');

	if(val == 6)
	   _hbLink('wgt_vzw_prepay');

	rObj.value = 'vzw';
	gObj.value = 'https://myaccount.verizonwireless.com:443/clp/login?lid=//global//my+verizon//personal+account//login';
	document.forms[0].action = 'https://login.verizonwireless.com:443/amserver/UI/Login';
		
    }
    else if(val == 4)
    {

        user.id = 'vzwuser2';
        userID = 'vzwuser2';
        user.name = "IDToken1";
        pass.id = 'vzwpass2';
        password = 'vzwpass2';
        pass.name = "IDToken2";
	rObj.value = 'vzwmb';
	_hbLink('wgt_vzw_business');
	gObj.value = 'https://b2b.verizonwireless.com/tbmb/login/perform.do';
	document.forms[0].action = 'https://mblogin.verizonwireless.com/amserver/UI/Login';
    }
else if(val == 8)
    {
        user.id = 'UserId';
        userID = 'UserId';
        user.name="UserId";
        pass.id = 'Password';
        password = 'Password'	
        pass.name="Password";
        url = 'https://'+ domain +'/sso/redirect/redirect.asp?TARGET=';
        rUrl = 'https://'+ domain +'/foryourbusiness/myaccount/main/erggb.aspx';
        //rUrl = 'https://'+domain + document.getElementById('manageLink').value;
       
        //rUrl += '&s=F';
	url += rUrl;
	//alert(url);
	
	setCookie('LOB_CATEGORY','MYVZ',null);
	
	setCookie('RedirectTarget',rUrl,null);


	

	if(document.getElementById('manageLink').value.indexOf('PaymentOptions.aspx') != -1)
	{
		
		    _hbLink('wgt_sb_pt_paybill');				
	}	
	if(document.getElementById('manageLink').value.indexOf('ViewBill.aspx') != -1)
	{
		    _hbLink('wgt_sb_pt_viewbill');				
	}	
	if(document.getElementById('manageLink').value == '/myverizon/?type=plb')
	{
		    _hbLink('wgt_sb_pt_paperless');				
	}	
	if(document.getElementById('manageLink').value.indexOf('MyAccount.aspx') != -1)
	{
		    _hbLink('wgt_sb_pt_account');				
	}	


	 var targets = document.getElementById('targets');
	 targets.id='target';
	 targets.name='target';

         targets.value = url;

         //document.getElementById('').setattribute('','')
         //_hbLink('wgt_sb_pt_viewbill');

	 deleteCookie('MyVzCom');
         document.forms[0].action = 'https://'+ domain +'/sso/common/retaillogin.fcc';
	 //document.forms[0].action = 'https://'+ domain +'/foryourbusiness/myaccount/main/erggb.aspx';
    }
    else if((val == 5) || (val == 9))
    {

        user.id = 'entuser';
        userID = 'entuser';
        user.name = "UserId";
        password='entpass'
        pass.id = 'entpass';
        pass.name = "PASSWORD";
	var targets = document.getElementById('targets');
	targets.id= 'target';
	targets.name= 'target';
        targets.value = 'https://EnterpriseCenter.verizon.com/enterprisesolutions/Home/LoginRedirect.jsp';

        //document.forms[0].action = 'https://EnterpriseCenter.verizon.com/enterprisesolutions/Default/login.fcc';

	if(val == 5)
	{
            _hbLink('wgt_vzw_enterprise');
	}
	if(val == 9)
	{
            _hbLink('wgt_vzt_enterprise');
	}
    }
    else
    {

        if(checkEmail(user))
	{
            document.forms[0].action = 'https://www22.business.verizon.net/SMBPortalWeb/emailredirect.jsp?redirectUrl=SMBPortal_desktop_page_MyEmail';
	}
	else
	{
	    document.forms[0].action = 'https://auth.verizon.net/amserver/UI/Login?realm=dotnet&module=LDAP&goto=https%3A%2F%2Fwww.verizon.net%2Fssowebapp%2FProcessLoginServlet%3Fsrc%3DBusinessSaas%26target%3Dhttps%253A%252F%252Fbusiness.verizon.net%253A443%252FSMBPortalWeb%252Fsso%252FfromSSO.jsp%253Ftarget%253D%2525252FSMBPortalWeb%2525252Fappmanager%2525252FSMBPortal%2525252Fsmb%2525253F_nfpb%2525253Dtrue%25252526_pageLabel%2525253D%2526pgLabelCheck%253DSMBPortal_page_main_overview&clientId=businessSAAS';
	}

	_hbLink('wgt_sb_center');
        user.id = 'smbuser';
        userID = 'smbuser';
        user.name = "IDToken1";
        pass.id = 'smbpass';
        password = 'smbpass'
        pass.name = "IDToken2";
    }
    
    setCookie("scbMyVzType",val,30);
    deleteCookie('CenterSelected');
    document.forms[0].submit();
}


function getAllCookie(cookieName)
{
	cookieValue = '';
	cookieValue1 = ''; 
	cStart=document.cookie.indexOf(cookieName + "=");
	if (cStart!=-1)
		{ 
			cStart=cStart + cookieName.length+1; 
			cEnd=document.cookie.indexOf(";",cStart);
			if (cEnd==-1) cEnd=document.cookie.length;
				cookieValue =  unescape(document.cookie.substring(cStart,cEnd));
		} 

	cStart = cStart +1;
	cStart=document.cookie.indexOf(cookieName + "=",cStart);
	if (cStart!=-1)
		{ 
			cStart=cStart + cookieName.length+1; 
			cEnd=document.cookie.indexOf(";",cStart);
			if (cEnd==-1) cEnd=document.cookie.length;
				cookieValue1 =  unescape(document.cookie.substring(cStart,cEnd));
		} 
	if(cookieValue1.length > cookieValue.length )
		return cookieValue1;
	else
		return cookieValue;
	
}
function getCookie(cookieName)
{	
	if (document.cookie.length>0)
	{	
		if(cookieName.toLowerCase() == 'myvzcom')
		{
			var allValue = '';
			try{
			allValue = getAllCookie('MyVzCom');
			}catch(e){};
			return allValue;
		}

		cStart=document.cookie.indexOf(cookieName + "=");
		if (cStart!=-1)
		{ 
			cStart=cStart + cookieName.length+1; 
			cEnd=document.cookie.indexOf(";",cStart);
			if (cEnd==-1) cEnd=document.cookie.length;
				return unescape(document.cookie.substring(cStart,cEnd));
		} 
	}

	return "";
}


/*
function getCookie(cookieName)
{	
	if (document.cookie.length>0)
	{
		cStart=document.cookie.indexOf(cookieName + "=");
		if (cStart!=-1)
		{ 
			cStart=cStart + cookieName.length+1; 
			cEnd=document.cookie.indexOf(";",cStart);
			if (cEnd==-1) cEnd=document.cookie.length;
				return unescape(document.cookie.substring(cStart,cEnd));
		} 
	}

	return "";
}*/

function deleteCookie(name) 
{
	if (getCookie(name).length > 0)
	{ 
		document.cookie = name + "=" + ';path=/;domain=.verizon.com' + ";expires=Thu, 01-Jan-1970 00:00:01 GMT;";
		//document.cookie = name + "=" + ';path=/' + ";expires=Thu, 01-Jan-1970 00:00:01 GMT;";
	}
}


		
function display(obj)
{


	//setCookie('scbMyVzType',obj.value,null);
	setCookie('CenterSelected',obj.value,null);
	option = obj.value;

	if(signInDrop.indexOf('Select') == -1 )
	{
		document.getElementById(userID).value = '';
		document.getElementById(password).value = '';
	}
	try{
	//document.getElementById(userID).focus();
	}catch(e){}
        
	rem = document.getElementById('remember');
	mObj = document.getElementById('manage');

	fObj = document.getElementById('forgotPwd');
	idObj = document.getElementById('forgotId');
	rObj = document.getElementById('register');
	demoObj = document.getElementById('demo');
	document.getElementById('sDivider').style.display = '';
	dObj = document.getElementById('divider');
	dObj.style.display = '';
	demoObj.style.display = '';
	mObj.style.display = 'none';
	document.getElementById('manage1').style.display = 'none';
	rem.style.display = 'none';
	fObj.parentNode.style.display = '';
	fText1 = 'Forgot user ID or password?';
	fText2 = 'Forgot password?';
	fText3 = 'Forgot user ID?';
	var signInToObj = document.getElementById('signInTo');
	nObj = document.getElementById('notice');
	//nObj.style.display = 'none';
	iframe_shim(nObj,false);
	frm = document.getElementById('signSubmit');
	hideNotice();
	if(option != 0)
	{
		if(document.getElementById('course_code').options[0].text.indexOf('Select') != -1)
			document.getElementById('course_code').remove(0);
		signInDrop = '';
	}
	if(option == 0)
	{
		fObj.parentNode.style.display = 'none';
		rObj.style.display = '';
		rObj.href = 'https://' + domain + '/foryourbusiness/registration/registration/single_Reg/Profile.aspx';
		document.getElementById('sDivider').style.display = 'none';		
		rObj.setAttribute("name","&lid=wgt_nodestination_register");
		//rObj.href = 'https://'+ domain +'/foryourhome/registration/Reg/RegisterBTN.aspx';
		//demoObj.setAttribute("name","&lid=wgt_nodestination_viewdemo");
		//demoObj.href = 'https://'+ domain + '/myverizon/demo/';
		demoObj.style.display = 'none';
		mObj.style.display = '';
		//rObj.style.display = '';
		//demoObj.style.display = '';
		mObj.style.display = 'none';
		//rObj.href = 'https://www98.verizon.com/foryourhome/registration/Reg/RegisterBTN.aspx';
		//demoObj.href = 'https://www98.verizon.com/myverizon/demo/';
		signInToObj.innerHTML = '';
	}
	else if(option == 1)
	{
		mObj.style.display = '';
		fObj.innerHTML = fText1;
		idObj.style.display = 'none';
		//strRempot = getSubCookie('foryourhome','USER_COOKIE_REG');
		rem.style.display = '';
		check = getSubCookie('MyVzCom','remopt');

		/*if((strRempot != null) && (rempot == 'Y'))
		{
			document.getElementById('chkbox').checked = true;
			document.getElementById(userID).value = strRempot;
		}*/
		if(check == 'Y')
		{
			document.getElementById('chkbox').checked = true;
			document.getElementById(userID).value = uid;
		}
		
		dObj.style.display = 'none';
		
		fObj.setAttribute("name","&lid=wgt_res_pti_forgot_both");
		fObj.href = 'https://' + domain + '/foryourhome/registration/forgotuid/ForgotCredentials.aspx';
		
		rObj.style.display = '';		
		rObj.setAttribute("name","&lid=wgt_res_pti_register");
		rObj.href = 'https://'+ domain +'/foryourhome/registration/Reg/RegisterBTN.aspx';
		
		//demoObj.href = 'javascript:open_popup('https://'+ domain +'/myverizon/demo/','300','200');';
		demoObj.style.display='';
		demoObj.setAttribute("name","&lid=wgt_res_pti_viewdemo");
		demoObj.href = 'https://'+ domain + '/myverizon/demo/';
		rem.style.display = '';
		frm.action = 'https://'+ domain +'/sso/redirect/redirect.asp?TARGET=';
		signInToObj.innerHTML = 'Residential';		
	}
	else if(option == 2)
	{
		fObj.innerHTML = fText2;
		idObj.style.display = 'none';
		dObj.style.display = 'none';
		fObj.setAttribute("name","&lid=wgt_res_vzcentral_forgot_password");
		fObj.setAttribute("href","https://netservices.verizon.net/portal/msa/bookmark?forgotpassword");
		rObj.style.display = '';
		rObj.setAttribute("name","&lid=wgt_res_vzcentral_register");
		rObj.setAttribute("href","https://activate.verizon.net");
		demoObj.style.display = 'none';
		document.getElementById('sDivider').style.display = 'none';
		//demoObj.href = 'https://'+ domain +'/myverizon/demo/';
		//frm.action = 'https://auth.verizon.net/amserver/UI/Login?realm=dotnet&module=LDAP&goto=https://www.verizon.net/ssowebapp/ProcessLoginServlet';
		frm.action = 'https://auth.verizon.net/amserver/UI/Login?realm=dotnet&module=LDAP&goto=https://www.verizon.net/ssowebapp/ProcessLoginServlet&clientId=central';
		signInToObj.innerHTML = 'Residential';
	}
	else if(option == 3)
	{
		idObj.innetHTML = fText2;
		fObj.innerHTML = fText3;
		idObj.style.display = '';
		fObj.setAttribute("name","&lid=wgt_vzw_personal_forgot_userid");
		fObj.setAttribute("href","https://myaccount.verizonwireless.com/accessmanager/public/controller?action=displayForgotUserName");	
		idObj.setAttribute("name","&lid=wgt_vzw_personal_forgot_password");
		idObj.setAttribute("href","https://myaccount.verizonwireless.com/accessmanager/public/controller?action=displayForgotPassword");
		rObj.style.display = '';		
		rObj.setAttribute("name","&lid=wgt_vzw_personal_register");
		rObj.setAttribute("href","https://myaccount.verizonwireless.com/accessmanager/public/controller?action=displayRegistration");
		demoObj.style.display = '';
		demoObj.setAttribute("name","&lid=wgt_vzw_personal_viewdemo");
		demoObj.setAttribute("href","http://www.verizonwireless.com/myaccountdemo");
		frm.action = 'https://login.verizonwireless.com:443/amserver/UI/Login';
		signInToObj.innerHTML = 'Wireless';
		
	}
	else if(option == 4)
	{
		fObj.innerHTML = fText3;
		idObj.style.display = '';
		fObj.setAttribute("name","&lid=wgt_vzw_business_forgot_userid");
		fObj.setAttribute("href","https://b2b.verizonwireless.com/tbmb/forgotUsername.do");
		idObj.setAttribute("name","name","&lid=wgt_vzw_business_forgot_password");
		idObj.setAttribute("href","https://b2b.verizonwireless.com/tbmb/forgotPassword.do");
		//rObj.style.display = '';
		document.getElementById('sDivider').style.display = '';
		//rObj.setAttribute("name","&lid=wgt_vzw_business_register");
		//rObj.setAttribute("href","https://b2b.verizonwireless.com/tbmb/onlineEnrollShow.do");
		rObj.style.display = '';
		rObj.setAttribute("name","&lid=wgt_sb_pt_register");
		rObj.href = 'https://' + domain + '/foryourbusiness/registration/registration/single_Reg/Profile.aspx';

		if((bUnit == 'Business') && (scbMyVzType != '4') )
		{
			document.getElementById('notice3').style.display='block';
			
		}
		demoObj.style.display = '';
		demoObj.setAttribute("name","&lid=wgt_vzw_business_viewdemo");
		demoObj.setAttribute("href","http://demo.vzw.com/MyBusinessAcct/home.html");
		frm.action = 'https://mblogin.verizonwireless.com/amserver/UI/Login';
		signInToObj.innerHTML = 'Wireless';
	}
	else if(option == 5)
	{
		fObj.innerHTML = fText2;
		idObj.style.display = 'none';
		dObj.style.display = 'none';
		fObj.setAttribute("name","&lid=wgt_vzw_enterprise_forgot_password");
		fObj.setAttribute("href","https://enterprisecenter.verizon.com/enterprisesolutions/default/selfreg/forgotPwdUserID.do");
		rObj.style.display = '';	
		rObj.setAttribute("name","&lid=wgt_vzw_enterprise_register");
		rObj.setAttribute("href","https://enterprisecenter.verizon.com/enterprisesolutions/default/selfreg/enrollmentProfileInfo.do");
		demoObj.style.display = '';

		demoObj.setAttribute("name","&lid=wgt_vzw_enterprise_viewdemo");
demoObj.setAttribute("href","https://enterpriseportalcontent.mci.com/mCampaign/DisplayFlash.aspx?flashfile=20081114_VEC_demo_en-US_1.swf&flashwidth=994&flashheight=570&flashquality=Best&flashplay=True&flashloop=True&flashmenu=True");
		frm.action = 'https://EnterpriseCenter.verizon.com/enterprisesolutions/Default/login.fcc';
		signInToObj.innerHTML = 'Wireless';
	}
	else if(option == 6)
	{
		fObj.innerHTML = fText3;
		idObj.style.display = '';
		fObj.setAttribute("name","&lid=wgt_vzw_prepay_forgot_userid");
		fObj.setAttribute("href","https://myaccount.verizonwireless.com/accessmanager/public/controller?action=displayForgotUserName");
		idObj.setAttribute("name","&lid=wgt_vzw_prepay_forgot_password");
		idObj.setAttribute("href","https://myaccount.verizonwireless.com/accessmanager/public/controller?action=displayForgotPassword");
		rObj.style.display = '';
		rObj.setAttribute("name","&lid=wgt_vzw_prepay_register");
		rObj.setAttribute("href","https://myaccount.verizonwireless.com/accessmanager/public/controller?action=displayRegistration");
		demoObj.style.display = '';
		demoObj.setAttribute("name","&lid=wgt_vzw_prepay_viewdemo");
		demoObj.setAttribute("href","http://www.verizonwireless.com/myaccountdemo");
		frm.action = 'https://login.verizonwireless.com:443/amserver/UI/Login';
		signInToObj.innerHTML = 'Wireless';
	}
	else if(option == 7)
	{
		fObj.innerHTML = fText3;
		idObj.style.display = '';
		fObj.setAttribute("name","&lid=wgt_sb_center_forgot_userid");
		fObj.setAttribute("href","https://www22.business.verizon.net/SMBPortalWeb/appmanager/SMBPortal/smb?_nfpb=true&_pageLabel=SMBPortal_page_main_support&case=c1604");
		idObj.setAttribute("name","&lid=wgt_sb_center_forgot_password");
		idObj.setAttribute("href","https://www22.business.verizon.net/SMBPortalWeb/appmanager/SMBPortal/smb?_nfpb=true&_pageLabel=SMBPortal_page_Resetpwd");
		rObj.style.display = 'none';
		//rObj.setAttribute("name","&lid=wgt_sb_center_register");
		//rObj.setAttribute("href","https://activate.verizon.net/");
		document.getElementById('sDivider').style.display = 'none';
		demoObj.style.display = '';
		demoObj.setAttribute("name","&lid=wgt_sb_center_viewdemo");
		demoObj.setAttribute("href","http://www22.business.verizon.net/sitetour/smb_teasertour.html");
		if((bUnit == 'Business') && (scbMyVzType != '7') )
		{
			document.getElementById('notice2').style.display='block';


		}

		//check mail
		frm.action = 'https://auth.verizon.net/amserver/UI/Login?realm=dotnet&module=LDAP&goto=https%3A%2F%2Fwww.verizon.net%2Fssowebapp%2FProcessLoginServlet%3Fsrc%3DBusinessSaas%26target%3Dhttps%253A%252F%252Fbusiness.verizon.net%253A443%252FSMBPortalWeb%252Fsso%252FfromSSO.jsp%253Ftarget%253D%2525252FSMBPortalWeb%2525252Fappmanager%2525252FSMBPortal%2525252Fsmb%2525253F_nfpb%2525253Dtrue%25252526_pageLabel%2525253D%2526pgLabelCheck%253DSMBPortal_page_main_overview&clientId=businessSAAS';
		signInToObj.innerHTML = 'Business';

		
	
	}
	else if(option == 8)
	{
	    	document.getElementById('manage1').style.display = '';
		fObj.innerHTML = fText1;
		idObj.style.display = 'none';
		dObj.style.display = 'none';
		try{
		fObj.setAttribute("name","&lid=wgt_sb_pt_forgot_both");
		}catch(e){}
		fObj.href = 'https://' + domain + '/ForyourBusiness/Registration/Registration/ForgotUid/ForgotCredentials.aspx';
		rObj.style.display = '';
		rObj.setAttribute("name","&lid=wgt_sb_pt_register");
		rObj.href = 'https://' + domain + '/foryourbusiness/registration/registration/single_Reg/Profile.aspx';
		//rem.style.display = '';
		document.getElementById('sDivider').style.display = 'none';
		frm.action = 'https://' + domain + '/sso/redirect/redirect.asp?TARGET=';
		demoObj.style.display = 'none';
		signInToObj.innerHTML = 'Business';
		if((bUnit == 'Business') )
		{
			document.getElementById('manage').style.display = '';
			document.getElementById('manage1').style.display = 'none';
			document.getElementById('notice').style.display='block';

		}
	}
	else if(option == 9)
	{
		fObj.innerHTML = fText2;
		idObj.style.display = 'none';
		dObj.style.display = 'none';
		demoObj.style.display = '';
		demoObj.setAttribute("name","&lid=wgt_vzt_enterprise_viewdemo");	
		demoObj.setAttribute("href","https://enterpriseportalcontent.mci.com/mCampaign/DisplayFlash.aspx?flashfile=20081114_VEC_demo_en-US_1.swf&flashwidth=994&flashheight=570&flashquality=Best&flashplay=True&flashloop=True&flashmenu=True");
		rObj.style.display = '';

		if((bUnit == 'Business') && (scbMyVzType != '9') )
		{
			document.getElementById('notice1').style.display='block';
	

		}

		rObj.setAttribute("name","&lid=wgt_vzt_enterprise_register");
		rObj.setAttribute("href","https://enterprisecenter.verizon.com/enterprisesolutions/default/selfreg/enrollmentProfileInfo.do");
		fObj.setAttribute("name","&lid=wgt_vzt_enterprise_forgot_password");
		fObj.setAttribute("href","https://enterprisecenter.verizon.com/enterprisesolutions/default/selfreg/forgotPwdUserID.do");
		frm.action = 'https://EnterpriseCenter.verizon.com/enterprisesolutions/Default/login.fcc';
		signInToObj.innerHTML = 'Business';
	}	

	if(bUnit=='Business')
		signInToObj.innerHTML = 'Business';
}

function toggleDiv(id,flagit) 
{
	var oDiv = document.getElementById(id);
	
	if (flagit=="1")
	{
		if (document.layers) document.layers[''+id+''].visibility = "show"
		else if (document.all) document.all[''+id+''].style.visibility = "visible"
		else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "visible"
		iframe_shim(oDiv, true);
		//document.all.blur() //IE only
		document.getElementById("course_code").blur();
	}
	else if (flagit=="0")
	{
		if (document.layers) document.layers[''+id+''].visibility = "hide"
		else if (document.all) document.all[''+id+''].style.visibility = "hidden"
		else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden"
		iframe_shim(oDiv, false);
	}
}

function hideIframe()
{
	document.getElementById('notice').style.display = 'none';
	iframe_shim(document.getElementById('notice'), false);
}

function hideNotice(divId)
{

	document.getElementById('notice').style.display = 'none';
	document.getElementById('notice1').style.display = 'none';
	document.getElementById('notice2').style.display = 'none';
	document.getElementById('notice3').style.display = 'none';


	
}

function open_layers(sURL, w, h)	
{		
	newwindow = window.open(sURL,"Popup","width="+ w+" ,height="+h+ " ,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");
	if (window.focus) 
	{
		newwindow.focus()
	}
}	

function iframe_shim(oDiv, show) 
{
	var iframe_id = oDiv.id + '_iframe_shim';
	var iframe = document.getElementById(iframe_id);
	if (show) 
	{
		if (!iframe) 
		{
			var iframe = document.createElement('iframe');
			iframe.id = iframe_id;
			iframe.src = 'about:blank';
			iframe.frameBorder = 0;
			iframe.scrolling = 'no';
			iframe.style.position = 'absolute';
			iframe.style.zIndex = oDiv.style.zIndex - 1;
			iframe.style.width = oDiv.offsetWidth + 'px';
			iframe.style.height = oDiv.offsetHeight + 'px';
			iframe.style.left = oDiv.offsetLeft + 'px';
			iframe.style.top = oDiv.offsetTop + 'px';
			iframe.style.display = oDiv.style.display;
			oDiv.parentNode.insertBefore(iframe, oDiv);
		}
		iframe.style.display = 'block';
	}
	else if (!show) 
	{
		if (iframe) iframe.style.display = 'none';
	}
}

var myVZ = getSubCookie('MyVzCom','uid');

if((myVZ != null) && (myVZ.length == 0))
	deleteCookie('MyVzCom');


