
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";

var domain=document.location.hostname
//BEGIN EDITABLE SECTION
//CONFIGURATION VARIABLES
//MULTI-LEVEL CONTENT CATEGORY


if(domain.indexOf("www22")==0 || domain.indexOf('espanol.verizon.com')==0 )  
   hbx.acct="DM550928B8DM;DM560507CPCF62EN3";//ACCOUNT NUMBER(S)
else
   hbx.acct="DM560412PISS;DM56050739DF;"


hbx.pn=document.getElementById("Template_Wrapper_Begin1_HdnPageName").value;//PAGE NAME(S)
hbx.mlc=document.getElementById("Template_Wrapper_Begin1_HdnPageUrl").value;//MultiLevel Content
hbx.pndef=document.getElementById("Template_Wrapper_Begin1_HdnPageTitle").value;//DEFAULT PAGE NAME

hbx.ctdef="full";//DEFAULT CONTENT CATEGORY
hbx.lc="y"; //force lower case page names 

//OPTIONAL PAGE VARIABLES
//ACTION SETTINGS
hbx.fv="";//FORM VALIDATION MINIMUM ELEMENTS OR SUBMIT FUNCTION NAME
hbx.lt="manual";//LINK TRACKING
hbx.dlf="n";//DOWNLOAD FILTER
hbx.dft="n";//DOWNLOAD FILE NAMING
hbx.elf="n";//EXIT LINK FILTER

//SEGMENTS AND FUNNELS
hbx.seg="";//VISITOR SEGMENTATION
hbx.fnl="";//FUNNELS

//CAMPAIGNS
hbx.cmp="";//CAMPAIGN ID
hbx.cmpn="";//CAMPAIGN ID IN QUERY
hbx.dcmp="";//DYNAMIC CAMPAIGN ID
hbx.dcmpn="";//DYNAMIC CAMPAIGN ID IN QUERY
hbx.dcmpe="";//DYNAMIC CAMPAIGN EXPIRATION
hbx.dcmpre="";//DYNAMIC CAMPAIGN RESPONSE EXPIRATION
hbx.hra="";//RESPONSE ATTRIBUTE
hbx.hqsr="";//RESPONSE ATTRIBUTE IN REFERRAL QUERY
hbx.hqsp="";//RESPONSE ATTRIBUTE IN QUERY
hbx.hlt="";//LEAD TRACKING
hbx.hla="";//LEAD ATTRIBUTE
hbx.gp="";//CAMPAIGN GOAL
hbx.gpn="";//CAMPAIGN GOAL IN QUERY
hbx.hcn="";//CONVERSION ATTRIBUTE
hbx.hcv="";//CONVERSION VALUE
hbx.cp="null";//LEGACY CAMPAIGN
hbx.cpd="";//CAMPAIGN DOMAIN

//CUSTOM VARIABLES
hbx.ci="";//CUSTOMER ID
hbx.hc1="";//CUSTOM 1
hbx.hc2="";//CUSTOM 2
hbx.hc3="";//CUSTOM 3
hbx.hc4="";//CUSTOM 4
hbx.hrf="";//CUSTOM REFERRER
hbx.pec="";//ERROR CODES

//INSERT CUSTOM EVENTS
if(domain.indexOf('espanol')==0)
   hbx.hc4="spanish";
else
   hbx.hc4="";
  
//HBX Metrics for GHP page load

//debugger;
var cv = _hbEvent("cv");
var hbxRet    = gethbxCookie("hbxRet");         //alert(hbxRet );
  var hbxBusUnit= gethbxCookie("BusinessUnit");   //alert(hbxBusUnit);
  var hbxLQ     = document.getElementById('hdnLQ').value;   //getSubCookie("VzLQPro","LQ");//alert(hbxLQ );
var hbxGHPInitialVisit = gethbxCookie("GHPInitialVisit");
var hbxGHPIsVisited = gethbxCookie("GHPIsVisited");
var hbxIsPersonal =  document.getElementById('hdnvzpersonal').value; //getSubCookie("VzGlobal_p","Personal");
var cv16="";
var cv17="";
var cv5="";
var cv19="";
var cv13="";


var hbxGHPPreviousLocation = gethbxCookie("GHPPreviousLocation");
var hbxGHPTraceLocation = gethbxCookie("GHPTraceLocation");
var hbxGHPPQSPreviousLocation = gethbxCookie("GHPPQSPreviousLocation");
//by chella
var hbxxpid = getCookie("XPID");

var strPresentLocation = '';
var expdate=new Date();
expdate.setDate(expdate.getDate()+30);

var straddress = document.getElementById('hdnAddress').value;
var strstate = document.getElementById('hdnState').value;
var strcity = document.getElementById('hdnCity').value;
var strzipcode = document.getElementById('hdnZipcode').value;

if(straddress !=null)
    strPresentLocation = straddress;
if(strstate !=null)
	strPresentLocation = strPresentLocation + strstate;
if(strcity!=null)
	strPresentLocation = strPresentLocation + strcity;
if(strzipcode!=null)
	strPresentLocation = strPresentLocation + strzipcode;    
    
//if(getSubCookie("vzpers","adr1") !=null)
//	strPresentLocation = getSubCookie("vzpers","adr1");
//if(getSubCookie("vzpres","STATE")!=null)
//	strPresentLocation = strPresentLocation + getSubCookie("vzpers","STATE");
//if(getSubCookie("vzpres","CITY")!=null)
//	strPresentLocation = strPresentLocation + getSubCookie("vzpers","CITY");
//if(getSubCookie("vzpres","ZIPCODE")!=null)
//	strPresentLocation = strPresentLocation + getSubCookie("vzpers","ZIPCODE");

//debugger;
  //retun visit
  //if(hbxBusUnit != null && (hbxRet == null || hbxRet == ""))
  
cv16 =document.getElementById('hdnCV16').value;
if(cv16 !=null && cv16 !='')
{
    if(hbxxpid !=null)
        cv.c16 = document.getElementById('hdnCV16').value +'|'+ hbxxpid.replace('|','').replace(' ','');
    else
        cv.c16 = document.getElementById('hdnCV16').value;
}

cv17 =document.getElementById('hdnCV17').value;
if(cv17 !=null && cv17 !='')
{
    if(hbxxpid !=null)
        cv.c17 = document.getElementById('hdnCV17').value +'|'+ hbxxpid.replace('|','').replace(' ','');
    else
        cv.c17 = document.getElementById('hdnCV17').value;
}


if(hbxxpid !=null)
{
    var arrxpid = hbxxpid.split("|");
}
else
{
    var arrxpid = ""
}

if(cv17 !=null && cv17 !='')
	{
		//if(cv17 == "PostQualReturn")
		//{
		    //alert('PQR');
			var firststring = "";
			cv5 = document.getElementById("hdCVC5Val").value;
			if(cv5 != null)
			{
				//var cv5value = document.getElementById("hdCVC5Val").value;
				if(cv5 != "") {
					var array = cv5.split("|");
					array[0] = array[0].replace("initial","pqr");
					//cv.c5 = array[0] + "|" + "PostQualReturn_" + document.getElementById("Xp1VisID").value + "_" + document.getElementById("xp1ProfileId").value;
					//cv.c5 = array[0] + "|" + "PostQualReturn_" + hbxxpid.replace('|','').replace(' ','');
                    if(hbxxpid !=null)
                    {
                        //cv.c5 = array[0] + "|" + "PostQualReturn_" + hbxxpid.replace('|','').replace(' ','');
                        cv.c5 = array[0];
                        }
                    else
                    {
                        //cv.c5 = array[0] + "|" + "PostQualReturn"
                        cv.c5 = array[0];
                        }
				} else {
					cv.c5 = cv5;
				}
			}   
			if(document.getElementById("hdCVC13Val") != null)
			{
				var cv13value = document.getElementById("hdCVC13Val").value;
				if (cv13value != "") {
					var array = cv13value.split("|");
					array[0] = array[0].replace("initial","pqr");
					if(array.length > 1)
					{
						var array2 = array[1].split(" ");
						//cv.c13 = array[0] + "|" + array2[0] + "+" + document.getElementById("xp1ProfileId").value;
						if(hbxxpid !=null)
						{
                            //cv.c13 = array[0] + "|" + array2[0] + "+" + arrxpid[1];
                            cv.c13 = array[0];
                        }
                        else
                        {
                            //cv.c13 = array[0] + "|" + array2[0];
                            cv.c13 = array[0];
                        }
					}
				} else {
					cv.c13 = cv13value;
				}
			}
			if(document.getElementById("hdCVC19Val") != null)
			{
				var cv19value = document.getElementById("hdCVC19Val").value;
				if (cv19value != "") {
					var array = cv19value.split("|");
					array[0] = array[0].replace("initial","pqr");
					//cv.c19 = array[0] + "|" + document.getElementById("xp1ProfileId").value;
					if(hbxxpid !=null)
					{
                        //cv.c19 = array[0] + "|" + arrxpid[1];
                        cv.c19 = array[0];
                    }
                    else
                    {
                        //cv.c19 = array[0] + "|";
                        cv.c19 = array[0];
                    }
					
				} else {
					cv.c19 = cv19value;
				}			
			}
		//}
	}


//cv.c17 = document.getElementById('hdnCV17').value;
//if(hbxGHPIsVisited != null && hbxGHPInitialVisit == null )

//  {

//   if(hbxLQ==null || hbxLQ=="")
//    {
//      cv.c17 = "PostQualPublic";
//    }
//    else
//    {
//         if(hbxGHPTraceLocation !=null)
//		    {
//			    if(hbxGHPPreviousLocation !=null)
//			    {
//				    if(hbxGHPPreviousLocation != strPresentLocation)
//					 {
//						cv.c17 = "PostQualChange";
//					 }
//				    else
//					{
//						if(hbxIsPersonal == 'Y')
//						{
//							cv.c17 = "PostQualReturn";
//						}
//						else
//						{
//							cv.c17 = "PostQualPublic";
//						}
//					}	
//			    }
//			    else
//			    {
//				    if(hbxGHPPQSPreviousLocation ==null)
//				    {
//					    cv.c17 = "PostQualSession";//cv.c17 = "PostQualReturn";//cv.c16 = "PostQual";
//					    document.cookie="GHPPQSPreviousLocation="+ strPresentLocation +";path=/;domain=.verizon.com;";
//                    }
//                    else
//                    {
//			                        if(hbxGHPPQSPreviousLocation != strPresentLocation)
//									{
//				                        cv.c17 = "PostQualChange";
//									}
//			                        else
//									{
//				                        cv.c17 = "PostQualSession";
//									}
//                    }
//			    }
//		    }
//		    else
//		    {
//     			   if(hbxIsPersonal == 'Y')
//			    {
//			        cv.c17 = "PostQualReturn";
//			    }
//			    else
//			    {
//			        cv.c17 = "PostQualPublic";
//			    }
//			        document.cookie="GHPPreviousLocation="+ strPresentLocation +";path=/;domain=.verizon.com;expires="+expdate.toGMTString();
//		    }
//    }
//  }
//  else  // initial visit
//  {
//   if(hbxLQ==null || hbxLQ=="")
//    {
//      cv.c16 = "PreQual";
//    }
//    else
//    {
//     		if(hbxGHPPreviousLocation !=null)
//		{
//			if(hbxGHPPreviousLocation != strPresentLocation)
//				{
//					cv.c16 = "PostQualChange";
//				}
//			else
//			{
//			    if(hbxIsPersonal == 'Y')
//			    {
//			        cv.c16 = "PostQual";
//			    }
//			    else
//			    {
//			        cv.c16 = "PostQualPublic";
//			    }
//			}
//		}
//		else
//		{
//     			if(hbxIsPersonal == 'Y')
//			    {
//			        cv.c16 = "PostQual";
//			    }
//			    else
//			    {
//			        cv.c16 = "PostQualPublic";
//			    }
//			document.cookie="GHPPreviousLocation="+ strPresentLocation +";path=/;domain=.verizon.com;expires="+expdate.toGMTString(); 
//		}
//  }
//    document.cookie="GHPIsVisited=Y;path=/;domain=.verizon.com;expires="+expdate.toGMTString(); 
//    document.cookie="GHPInitialVisit=Y;path=/;domain=.verizon.com;";               
//                   
//  }
//document.cookie="GHPTraceLocation=Y;path=/;domain=.verizon.com;";
try { cv.c18= xpID; } catch(e) {}

function gethbxCookie (name) { var dcookie = document.cookie; var cname = name + "="; var clen = dcookie.length; var cbegin = 0; while (cbegin < clen) { var vbegin = cbegin + cname.length; if (dcookie.substring(cbegin, vbegin) == cname) { var vend = dcookie.indexOf (";", vbegin); if (vend == -1) vend = clen; return unescape(dcookie.substring(vbegin, vend)); } cbegin = dcookie.indexOf(" ", cbegin) + 1; if (cbegin == 0) break; } return null; }










