var req ;
var t1;
var cufOff = false;
var xpDecisions="";
var cid1="";
var cid2="";
var cid3="";
var cid4="";
var objAjax=null;
var clickreq;
var TryCountAjax = 0;
var TryCountD = 0;
var refresh = 1;
var strDp="N";
var iCo = 0;

function trim(str) { return str.replace(/^\s+|\s+$/g, ""); };

var _hbEC=0;var _hbE=new Array;function _hbEvent(a,b){b=_hbE[_hbEC++]=new Object();b._N=a;b._C=0;return b;}
var hbx=_hbEvent("pv");hbx.vpc="HBX0200u";hbx.gn="ehg-verizon.hitbox.com";

function hbxPers()
{
////debugger;
  var hbxLQ     = getSubCookie("VzLQPro","LQ");//alert(hbxLQ );


//  //retun visit
  var cv = _hbEvent("cv");
  
   if(hbxLQ==null || hbxLQ=="")
    {
      cv.c16 = "PreQual";
    }
    else
    {
     cv.c16 = "PostQual";
    }
  


}


function clearSaleTags()
{
var domainName =window.document.domain; domainName = domainName.substring(0,5);  
if(domainName == "www25" || domainName == "www26" || domainName == "www98")
	{
	    var fileref=document.createElement('script');
        fileref.setAttribute("type","text/javascript");
        fileref.setAttribute("src", 'http://dsa.csdata1.com/data/js/19000734/csgather.js');
        document.getElementsByTagName("head")[0].appendChild(fileref);
	}
else if(domainName == "www22")
    {
        var fileref=document.createElement('script');
        fileref.setAttribute("type","text/javascript");
        fileref.setAttribute("src", 'http://dsa.csdata1.com/data/js/19000367/csgather.js');
        document.getElementsByTagName("head")[0].appendChild(fileref);
    }
   
}	
function clearSaleTagonLoad()
{
try{
var domainName =window.document.domain; domainName = domainName.substring(0,5);  
if(domainName == "www25" || domainName == "www26" || domainName == "www98")
	{ 
	    csCookieDomain = 'verizon.com';
	    	document.write("<SCR"+"IPT TYPE='text/javascript' SRC='https://dsa.csdata1.com/data/js/19000734/csgather.js'><\/SCR"+"IPT>"); 
	}
else if(domainName == "www22")
{
	    csCookieDomain = 'verizon.com';
	    document.write("<SCR"+"IPT TYPE='text/javascript' SRC='https://dsa.csdata1.com/data/js/19000367/csgather.js'><\/SCR"+"IPT>");
	}
	
	}catch(e){}

}


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 setHeader(appName, tab , pageTitle , Metatags)
	{

	    document.title = pageTitle;
        if(tab != null && tab != undefined)
            tab = tab.toLowerCase();
            
    if (appName == 'aboutfios')
    {
        if (tab == 'features'){document.title = 'Verizon | FiOS Digital TV and High-Speed Internet Features';}
        else if (tab == 'spotlight'){document.title = 'Verizon | Wi-Fi Connectivity, Flex View, TV-to-Go, HBO Go and More | FiOS Spotlight';}
        else if (tab == 'widgets'){document.title = 'Verizon | FiOS TV Widgets | Cool Widgets | Interactive Television | Free TV Widget';}
        else if (tab == 'labs'){document.title = 'Verizon | FiOS Labs - Upcoming Verizon FiOS Features';}
        else if (tab == 'reviews'){document.title = 'Verizon | FiOS Broadband Internet & Digital TV | Reviews & Testimonials';}
        else if (tab == 'customerexperiences'){document.title = 'Verizon | FiOS Broadband Internet & Digital TV | Reviews & Testimonials';}
	    else { document.title = 'Verizon | FiOS Digital TV and High-Speed Internet Features'; }
    }
    

    if (appName == 'fiostv')
    {
        if (tab == 'plans'){document.title = 'Verizon | FiOS TV Plans & Packages | Digital, HD & Premium Channels';}
        else if (tab == 'channels'){document.title = 'Verizon | FiOS TV Channels | HDTV Channels';}
        else if (tab == 'features'){document.title = 'Verizon | FiOS TV | Features';}
        else if (tab == 'using'){document.title = 'Verizon | FiOS TV | Using FiOS TV';}
        else if (tab == 'equipment'){document.title = 'Verizon | FiOS TV | Equipment and Installation';}
        else if (tab == 'equip'){document.title = 'Verizon | FiOS TV | Equipment and Installation';}
	    else {document.title = 'Verizon | FiOS TV | Packages and Plans';}
    }
    
    if (appName == 'fiosinternet')
    {
        if (tab == 'features'){document.title = 'Verizon | FiOS Internet | Broadband Internet Service (DSL) | FiOS Features';}
        else if (tab == 'plans'){document.title = 'Verizon | FiOS Internet | Broadband Internet Service (DSL) | FiOS Plans';}
        else if (tab == 'equipment'){document.title = 'Verizon | FiOS Internet | Broadband Internet Service (DSL) | FiOS Equipment & Installation';}
        else if (tab == 'equip'){document.title = 'Verizon | FiOS Internet | Broadband Internet Service (DSL) | FiOS Equipment & Installation';}
	    else {document.title = 'Verizon | FiOS Internet | Broadband Internet Service (DSL) | FiOS Features';}
    }    
    
    if (appName == 'highspeedinternet')
    {
        if (tab == 'features'){document.title = 'Verizon | Residential High Speed Internet/Broadband(DSL)';}
        else if (tab == 'overview'){document.title = 'Verizon | Residential High Speed Internet/Broadband(DSL)';}
        else if (tab == 'plans'){document.title = 'Verizon | High Speed Internet Plans | Home DSL Service';}
        else if (tab == 'equipment'){document.title = 'Verizon | High Speed Internet | Equipment and Installation';}
	     else {document.title = 'Verizon | Residential High Speed Internet/Broadband(DSL)';}
    } 
    
    if (appName == 'bundles')
    {
        if (tab == 'overview'){document.title = 'Verizon | Digital TV, Broadband Internet, and Phone Packages | FiOS Bundles';}
        else if (tab == 'standard'){document.title = 'Verizon | DSL, DirecTV, and Phone Packages | Internet, Satellite TV, and Phone Bundles';}
        else if (tab == 'laconexion'){document.title = 'Verizon | TV Spanish and English-Language, Broadband Internet, and Phone Packages | La Conexión Bundles';}
	    else {document.title = 'Verizon | Digital TV, Broadband Internet, and Phone Packages | FiOS Bundles';}
    } 


//	    var  s= Metatags;
//            var keyContent = "";
//            var description = "";
//            var sI = s.indexOf('content=');
//            if(sI != -1)
//            {
//	            sI = sI + "content=".length +1;
//	            eI =s.indexOf("\"",sI);
//	            keyContent = s.substring(sI,eI);

//            }

//            var sI = s.indexOf('content=',eI);
//            if(sI != -1)
//            {
//	            sI = sI + "content=".length +1;
//	            eI =s.indexOf("\"",sI);
//	            description = s.substring(sI,eI);

//            }
//            metaList = document.getElementsByTagName('meta');
//            for(var i =0;i < metaList.length;i++)
//            {
//	            if(metaList[i].name == "keywords")
//		            metaList[i].content = keyContent;

//	            if(metaList[i].name == "description")
//		            metaList[i].content = description;	
//            }     


         }

 
 function HighlightHeader()
        {
           var loc = document.location.href.toLowerCase();
           var className = 'aboutfioslink' ;
           if (loc.indexOf("aboutfios")>-1)
             {
                 className = 'aboutfioslink'
             }
             else if ((loc.indexOf("residential/tv")>-1)||(loc.indexOf("residential/fiostv")>-1)||(loc.indexOf("residential/directv")>-1))
             {
                className = 'tvlink'
             }
              else if ((loc.indexOf("residential/internet")>-1)||(loc.indexOf("residential/fiosinternet")>-1)||(loc.indexOf("residential/highspeedinternet")>-1))
             {
                className = 'internetlink'
             }
              else if (loc.indexOf("residential/homephone")>-1)
             {
                className = 'phonelink'
             }
             else if (loc.indexOf("residential/bundles")>-1)
             {
                className = 'bundleslink'
             }

	     try {
             document.getElementById(className).className = 'hlink current';
             } catch(e){}

         } 
          
	
	
	function open_popup(sURL, w, h)	
{		
	if (w == undefined && h == undefined)
	{		
		if(typeof(sURL)!='string')
			newwindow = window.open(sURL.link,sURL.title,"menubar="+sURL.menubar+",resizable="+sURL.resizeable+",width="+sURL.width+",height="+sURL.height);
		else 
			newwindow = window.open(sURL,"Popup","width="+ 550+" ,height="+500+ ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");
	} else
	{
		if(typeof(sURL)!='string')
			newwindow = window.open(sURL.link,sURL.title,"menubar="+sURL.menubar+",resizable="+sURL.resizeable+",width="+sURL.width+",height="+sURL.height);
		else 
			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 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 setCookie(name, value,  path, domain) {
		var curCookie = name + "=" + escape(value) +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") ; 
			document.cookie = curCookie;
	}
	

function ShowDiv(curTab) 
{    
	document.getElementById("PageElement_tab").className ='';
	document.getElementById("Metadata_tab").className ='';
	
	
	if (curTab == "PageElement_tab")
	{
		document.getElementById("PageElement_tab").className ='active_tab';
		document.getElementById("Metadata_tab").className = '';

		document.getElementById("PageElement_Flow").style.display ='block';
		document.getElementById("Metadata_Flow").style.display = 'none';
		
	 }
	 
	 if (curTab == "Metadata_tab")
	{
		document.getElementById("Metadata_tab").className ='active_tab';
		document.getElementById("PageElement_tab").className = '';
		
		document.getElementById("Metadata_Flow").style.display ='block';
		document.getElementById("PageElement_Flow").style.display ='none';
	 }
}
	
	
	//Channellineup pages scripts

	function GetXmlHttpObject()	
		{
			try
			{
				return new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch(e)
			{
				try
				{
					return new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch(e1)
				{
					try
					{
						return new XMLHttpRequest();
					}
					catch(e2)
					{
						return null;
					}
				}
			}
		}
			
	function cleartList()
	{
//		for(var loop=0;loop<document.getElementById('city').options.length; loop++)
//		{
//			document.getElementById('city').options[loop] = null;
//		}
        var selbox = document.getElementById('city');
        for(i = selbox.length -1 ;i>=0;i--)
        {
            selbox.remove(i);
        }
	}
	
	function addOption(selectbox, text, value, index)
	{
		var optn = document.createElement("OPTION");
		optn.text = text;
		optn.value = value;
		selectbox.options.add(optn);
	}
	
	function stateChangedCity()
	{

		if(xmlhttp.readyState == 4)
		{
		try{
			

		        var flag = 0;
			  var states = xmlhttp.responseText.split(",");

			    cleartList();
			    for (i=0;i<states.length;i++) 
			    {

				    if(trim(states[i]) != "")
				    {
				        addOption(document.getElementById('city'),states[i],states[i],i);
				        flag = 1;

				    }
			    }
			    if(flag == 1)
			    {

			        document.getElementById('city').selectedIndex = 0;
				var url = document.location.href.toLowerCase();
				if(url.indexOf("channels")>-1)
				{
					setVals();
				}
			        
			        VZT.AppCore.Events.Notify('request_channels',null);
	     		    }
			     else
			     {
			        
			        VZT.AppCore.Events.Notify('fios_unavail', null);
			     }

			}catch(e){}
		}    
	}
	
	function ShowCityOrRegion(tarcode)
	{
		var zipCode = document.getElementById('zip_code').value;
		//alert('zipCode : ' + zipCode);

        var _tarcode  = tarcode;
	    //var _tarcode  = "75039";

		//if(zipCode.length < 5)
		//{
		//	alert("Please enter valid zip code.");
		//	return;
		//}

		if(zipCode.length < 5 || zipCode.length > 5)
		{
			return;
		}

		xmlhttp = GetXmlHttpObject();
		if(xmlhttp != null)
		{
			//alert('wow');
			var url = "/Content/LearnShop/Templates/FiOSTV/GetRegionsAJAX.aspx";
			url = url + "?zipTextBox="+zipCode+"&tarcode="+_tarcode;
			//alert('wowurl :' + url);

			xmlhttp.onreadystatechange = stateChangedCity;
			xmlhttp.open("POST",url,true);
			xmlhttp.send(null);        
		}
	}
	
	
	function chooseplans()
		{   
		 var zipCode ="";
		 var region = "";
		 var errortext = "";
			if(document.getElementById("zip_code"))
				zipCode = document.getElementById("zip_code").value;
			if(document.getElementById("city"))
				region  = document.getElementById("city").options[document.getElementById("city").selectedIndex].text;
			if(zipCode == "") errortext = errortext + "Please enter Zip code \n";
			if(zipCode != "" && region == "") errortext = errortext + "Please select Region \n";
			if(errortext.length > 1){ alert(errortext); return; }
			var url = "/Residential/FiOSTV/ComparePlans/ChoosePlans/ChoosePlans.htm";
			url = url + "?zipCode=" + zipCode + "&region=" + region;
			window.open(url,"myWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");		    
		}


    function CLU_CaptureEnterKey(e)
    {	
	    if(e != null || typeof(e) != "undefined")
	    {
		    var isNN = (navigator.appName.indexOf("Netscape")!=-1);
		    var targid;
    		
		    if(isNN == false) 
		    {
			    targid = e.srcElement.id
		    }
		    else
		    {
			    targid = e.target.id;
		    }
		    if(targid == 'txtAreaCode' || targid == 'txtPrefix' || targid == 'txtPhoneNumber' || targid == 'imgGO')
		    {
			    var isNN = (navigator.appName.indexOf("Netscape")!=-1);
			    var keyCode = (isNN) ? e.which : event.keyCode; 
    				
			    if(keyCode == 13)
				    getTNQeuryString();           
		    }
		    else if(targid == "zipcode")
		    {
			    if(keyCode == 13)
			    {
				    validateZipCodeCLU();
				    return;
			    }
		    }
		    else
		    {
			    ValidateZipCodeCLU(e);
			    return;
		    }
	    }
	    else
	    {
		    ValidateZipCodeCLU(e);
		    return;
	    }
    } 

    function ValidateZipCodeCLU(e)
    {
	    var isNN = (navigator.appName.indexOf("Netscape")!=-1);
	    var keyCode = (isNN) ? e.which : e.keyCode; 

	    if((keyCode>47&&keyCode<58)||(keyCode==8)||(keyCode==9) ||(keyCode==13)) 
	    {
    		
	    }
	    else
	    {
		    if(isNN == false) 
		    {
			    window.event.returnValue = false;
			    return;
		    }
		    else
		    {
			    e.preventDefault();
			    return;
		    }

	    }
	    var zipCode = document.getElementById('zip_code').value;
	    if(keyCode == 13)
	    {
		    ShowCityOrRegion();
		    if(isNN == false) 
		    {
			    window.event.returnValue = false;
			    return;
		    }
		    else
		    {
			    e.preventDefault();
			    return;
		    }
    		
	    }
    }


function HighlightTheBundlesMenu(iVal)
        {
	    //if(iVal = 1) tabname == 'fios';
	    //if(iVal = 2) tabname == 'tv';
	    //if(iVal = 3) tabname == 'internet';
	    //if(iVal = 4) tabname == 'reviews';
	    //if(iVal = 5) tabname == 'compare';
	    //onTabClick(tabname);
                    
            try
{
var lochref = document.location.href.toLowerCase();
if(lochref.indexOf('160') > 0 && iVal == 1)
{
    if(document.getElementById('fiosTabHero') != null && document.getElementById('this-is-fios') != null)
    {
        if(document.getElementById('fiosTabHero') != undefined && document.getElementById('this-is-fios') != undefined)
        {
            if(document.getElementById('this-is-fios').className.substring(document.getElementById('this-is-fios').className.indexOf('#')).indexOf('hidden') > -1)
            {
                document.getElementById('fiosTabHero').style.backgroundColor = document.getElementById('this-is-fios').className.substring(document.getElementById('this-is-fios').className.indexOf('#')).substring(0,7);
            }
            else
            {//debugger;
                document.getElementById('fiosTabHero').style.backgroundColor = document.getElementById('this-is-fios').className.substring(document.getElementById('this-is-fios').className.indexOf('#'));
            }
        }
    }
}
}
catch(err)
{
}
                                                                                            
            var isNN = (navigator.appName.indexOf("Netscape")!=-1);
            var sTabID = 'tab'+iVal;
            if(isNN)
                document.getElementById(sTabID).setAttribute('class','active');
            else
                document.getElementById(sTabID).className = 'active';

            for(var i=1;i<=5;i++)
            {   
                sTabOnDivID = 'tab'+i;
                if(iVal!=i)
                {
                   if(isNN)
                        document.getElementById(sTabOnDivID).removeAttribute('class');
                   else
                        document.getElementById(sTabOnDivID).className = '';
                }
            }
        }


function onTabClick(tabname)
{
	if(tabname == 'fios')
		_hbPageView('pz2+8999+1yr+no+contract+fios+tp+overview+v'+a_lnk_append,'/vz/residential/learn shop/landing/fios/bundle/acq/national');

	if(tabname == 'tv')
		_hbPageView('pz2+8999+1yr+no+contract+fios+tp+ftv+hero+v'+a_lnk_append,'/vz/residential/learn shop/landing/fios/bundle/acq/national');

	if(tabname == 'internet')
		_hbPageView('pz2+8999+1yr+no+contract+fios+tp+internet+hero+v'+a_lnk_append,'/vz/residential/learn shop/landing/fios/bundle/acq/national');

	if(tabname == 'reviews')
		_hbPageView('pz2+8999+1yr+no+contract+fios+tp+reviews+hero+v'+a_lnk_append,'/vz/residential/learn shop/landing/fios/bundle/acq/national');

	if(tabname == 'compare')
		_hbPageView('pz2+8999+1yr+no+contract+fios+tp+compare+hero+v'+a_lnk_append,'/vz/residential/learn shop/landing/fios/bundle/acq/national');

}
function BTagScript(obj)
{

if(obj.options[obj.selectedIndex].text.toLowerCase() == 'sports')
{
	fnAjaxCallBTagScript('sports')
}
else if(obj.options[obj.selectedIndex].text.toLowerCase() == 'family and kids')
{
	fnAjaxCallBTagScript('family')
}
else if(obj.options[obj.selectedIndex].text.toLowerCase() == 'premiums and movies')
{
	fnAjaxCallBTagScript('movies/tv')
}

}


function BTagScriptAB(ccl)
{

if(ccl == "navaction::content:home")
{
fnAjaxCallBTagScript('home')
}
else if(ccl == "navaction::content:moviestv") {fnAjaxCallBTagScript('movies/tv') }
else if(ccl == "navaction::content:family") {fnAjaxCallBTagScript('family') }
else if(ccl == "navaction::content:sports") {fnAjaxCallBTagScript('sports') }
else if(ccl == "navaction::content:gaming") {fnAjaxCallBTagScript('internet') }

}


function fnAjaxCallBTagScript(strValue)
{

	if(document.getElementById('BTagiFrame')!=null)
		document.getElementById('BTagiFrame').contentWindow.document.write(fnCallBTagScript(strValue));
}
function fnCallBTagScript(strValue)
{
    var strScriptuRL = '';
    var BTagRequired = '';
    BTagRequired = 'Y';//getCookie('BTagRequired');
    
    //if(document.getElementById('hdnBTagRequired').value == "Y")
    
    if(BTagRequired == "Y")
    {
	var setdomain = "stg.xp1.ru4.com";
        if((document.domain + "").toLowerCase().indexOf('www22')>-1)
        {
            setdomain = "s.xp1.ru4.com";
        }

        if(strValue.toLowerCase() == 'sports')
        {
            strScriptuRL = "<script type='text/javascript' src='http://" + setdomain + "/meta?_o=15772&_t=behavioral&ssv_001=sports'>"+''+"</script>";
        }
        else if(strValue.toLowerCase() == 'movies/tv')
        {
            strScriptuRL = "<script type='text/javascript' src='http://" + setdomain + "/meta?_o=15772&_t=behavioral&ssv_001=movies-tv'>"+''+"</script>";
        }		
	    else if(strValue.toLowerCase() == 'family')
        {
            strScriptuRL = "<script type='text/javascript' src='http://" + setdomain + "/meta?_o=15772&_t=behavioral&ssv_001=family'>"+''+"</script>";
        }	
	    else if(strValue.toLowerCase() == 'tv')
        {
            strScriptuRL = "<script type='text/javascript' src='http://" + setdomain + "/meta?_o=15772&_t=behavioral&ssv_002=tv'>"+''+"</script>";
        }	
	    else if(strValue.toLowerCase() == 'internet')
        {
            strScriptuRL = "<script type='text/javascript' src='http://" + setdomain + "/meta?_o=15772&_t=behavioral&ssv_002=internet'>"+''+"</script>";
        }		
	    else if(strValue.toLowerCase() == 'phone')
        {
            strScriptuRL = "<script type='text/javascript' src='http://" + setdomain + "/meta?_o=15772&_t=behavioral&ssv_002=phone'>"+''+"</script>";
        }	
	    else if(strValue.toLowerCase() == 'bundle')
        {
            strScriptuRL = "<script type='text/javascript' src='http://" + setdomain + "/meta?_o=15772&_t=behavioral&ssv_002=bundles'>"+''+"</script>";
        }
        else if(strValue.toLowerCase() == 'ops')
        {
            strScriptuRL = "<script type='text/javascript' src='http://" + setdomain + "/meta?_o=15772&_t=behavioral&ssv_020=ops'>"+''+"</script>";
        }		
		else if(strValue.toLowerCase() == 'internet-met')
        {
			strScriptuRL = "<script type='text/javascript' src='http://" + setdomain + "/meta?_o=15772&_t=behavioral&ssv_002=internet'>"+''+"</script>"; 
			strScriptuRL += "<script type='text/javascript' src='http://" + setdomain + "/meta?_o=15772&_t=behavioral&ssv_020=met'>"+''+"</script>";
        }
		else if(strValue.toLowerCase() == 'tv-met')
        {
			strScriptuRL = "<script type='text/javascript' src='http://" + setdomain + "/meta?_o=15772&_t=behavioral&ssv_002=tv'>"+''+"</script>";
			strScriptuRL += "<script type='text/javascript' src='http://" + setdomain + "/meta?_o=15772&_t=behavioral&ssv_020=met'>"+''+"</script>";
        }	
        else if(strValue.toLowerCase() == 'yad')
        {
            strScriptuRL = "<script type='text/javascript' src='http://" + setdomain + "/meta?_o=15772&_t=behavioral&ssv_019=YAD'>"+''+"</script>";
        }
    }
	return strScriptuRL;	
}
function ToggleLID(obj)
{
//debugger;
if(obj.id.indexOf('1_1') > -1)
{
    if(document.getElementById('btnCTA1').name.indexOf('no+phn') > -1 )
        document.getElementById('btnCTA1').name = document.getElementById('btnCTA1').name.replace('no+phn','phn');
    else
        document.getElementById('btnCTA1').name = document.getElementById('btnCTA1').name.replace('phn','no+phn');
}
else if(obj.id.indexOf('1_2') > -1)
{
    if(document.getElementById('btnCTA1').name.indexOf('no+phn') > -1 )
        document.getElementById('btnCTA1').name = document.getElementById('btnCTA1').name.replace('no+phn','phn');
    else
        document.getElementById('btnCTA1').name = document.getElementById('btnCTA1').name.replace('phn','no+phn');
}
else if(obj.id.indexOf('2_1') > -1)
{
    if(document.getElementById('btnCTA2').name.indexOf('no+phn') > -1 )
        document.getElementById('btnCTA2').name = document.getElementById('btnCTA2').name.replace('no+phn','phn');
    else
        document.getElementById('btnCTA2').name = document.getElementById('btnCTA2').name.replace('phn','no+phn');
}
else if(obj.id.indexOf('2_2') > -1)
{
    if(document.getElementById('btnCTA2').name.indexOf('no+phn') > -1 )
        document.getElementById('btnCTA2').name = document.getElementById('btnCTA2').name.replace('no+phn','phn');
    else
        document.getElementById('btnCTA2').name = document.getElementById('btnCTA2').name.replace('phn','no+phn');
}
else if(obj.id.indexOf('3_1') > -1)
{
    if(document.getElementById('btnCTA3').name.indexOf('no+phn') > -1 )
        document.getElementById('btnCTA3').name = document.getElementById('btnCTA3').name.replace('no+phn','phn');
    else
        document.getElementById('btnCTA3').name = document.getElementById('btnCTA3').name.replace('phn','no+phn');
}
else if(obj.id.indexOf('3_2') > -1)
{
    if(document.getElementById('btnCTA3').name.indexOf('no+phn') > -1 )
        document.getElementById('btnCTA3').name = document.getElementById('btnCTA3').name.replace('no+phn','phn');
    else
        document.getElementById('btnCTA3').name = document.getElementById('btnCTA3').name.replace('phn','no+phn');
}
}
function callHBX(obj,strLid)
{//debugger;
    if(obj.id.indexOf('1') > -1)
    {
        if(document.getElementById('tier1_1').checked)
        {
            strLid = strLid.replace('no+phn','phn');
            _hbLink(strLid,'table');
        }
        if(document.getElementById('tier1_2').checked)
        {
            strLid = strLid.replace('m+phn','m+no+phn')
            _hbLink(strLid,'table');
        }
    }
    else if(obj.id.indexOf('2') > -1)
    {
        if(document.getElementById('tier2_1').checked)
        {
            strLid = strLid.replace('no+phn','phn');
            _hbLink(strLid,'table');
        }
        if(document.getElementById('tier2_2').checked)
        {
            strLid = strLid.replace('m+phn','m+no+phn')
            _hbLink(strLid,'table');
        }
    }
    else if(obj.id.indexOf('3') > -1)
    {
        if(document.getElementById('tier3_1').checked)
        {
            strLid = strLid.replace('no+phn','phn');
            _hbLink(strLid,'table');
        }
        if(document.getElementById('tier3_2').checked)
        {
            strLid = strLid.replace('m+phn','m+no+phn')
            _hbLink(strLid,'table');
        }
    }
    
}
function hbxPers_Old(visit,value)
{
    try
    {
    var cv = _hbEvent("cv");
    if (visit.toLowerCase() == 'qv')
    {
        cv.c16 = value;
    }
    else if (visit.toLowerCase() == 'pqrv')
    {
    cv.c17 = value;
    }
    }catch(e){} 
}

var xmlhttp;
var vzCookie;

function LoadOfferWidget(strTv,strInternet,strPhone,strContract,strVzPhoneAvailable,strPage,strDefault)
{
if(document.getElementById('hdnDefault') != null)
{
    if(document.getElementById('hdnDefault').value == "")
    {
        document.getElementById('hdnDefault').value =   "1";
    }
}

	xmlhttp = GetXmlHttpObject();
	if(xmlhttp != null)
	{
	    var Qurl=document.location.href.toLowerCase();
        if(Qurl.indexOf("dp")>-1 && strPage=="fiostv")
        {
            var a=Qurl.split("?");
            var b=a[1].split("=");
            if(b[1].toUpperCase()=="Y")
            {
                strDp="Y";
            }
        }


		var url = "/Content/LearnShop/Templates/Common/OfferFilterUI.aspx?Tv="+ strTv +"&Internet="+ strInternet +"&Phone="+ strPhone +"&Contract="+ strContract +"&VzPhoneAvailable="+ strVzPhoneAvailable +"&Page="+ strPage +"&default="+ strDefault +"&dp="+strDp+"";
		//alert(url);
		xmlhttp.onreadystatechange = OfferWidget;
		xmlhttp.open("POST",url,true);
	    xmlhttp.send('');        
	}
}
function OfferWidget()
	{
		if(xmlhttp.readyState == 4)
		{
		try{
		      
		       
			    var OfferText = xmlhttp.responseText;
                             var res_array = OfferText .split("$$$")
				
			    document.getElementById('divoffer').innerHTML=res_array[0];//OffierText;
			    VZT.AppCore.Events.Notify("content_loaded", document.body); 
			    if(strDp=="Y")
                {
                    document.getElementById('divoffer').scrollIntoView(true);
                } 

			

			}catch(e){}
		}    
	}
		function GetXmlHttpObject()
		{
			try
			{
				return new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch(e)
			{
				try
				{
					return new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch(e1)
				{
					try
					{
						return new XMLHttpRequest();
					}
					catch(e2)
					{
						return null;
					}
				}
			}
		}

   function showList()
      {
              
        var dropList = document.getElementById("catDropList");
        if(dropList.style.display == 'none')
        {
          dropList.style.display  = 'block'
        }
        else
        {
         
          dropList.style.display  = 'none'
        
        }
      }
      
      
      
           function changeBV(obj)
         {

          if (document.getElementById('BVSYContainer') != null)
           {
             try{ 
                  var sel = document.getElementById(obj.id);
                  var catID = sel.name; 
                  
                  if(catID =='all_stories')
                  {
                   $BV.ui("sy", "show_home", {subjectType: "all"});
                  }
                  else{
                   $BV.ui("sy", "show_stories", {categoryId: catID,subjectType: "category"});
                  }
                  
                   document.getElementById("selItem").innerHTML = document.getElementById(obj.id).innerHTML;
                    var inElements = document.getElementById("catDropList");
                    var list = inElements.getElementsByTagName("li");
                    for(var i =0; i< list.length; i++)
                    {
                  if (list[i].className == 'active' )
                  {
                        list[i].className = '';
                  }
                  if(list[i].innerHTML.indexOf(obj.id) > -1)
                  {
                    list[i].className = 'active';
                  }
            }
                   showList();
             } 
             catch(ex)
             {
             }
           }
          

        }
