

		
/*
***************************************************************************
		-TopLevelTabControl Functionality
		-Coded by Harmeet/Aga/Nagesh/Gopal

      Main functionalities:

                        -- Checking Main Cookie functionality 
                        -- Search Cookie Functionality
                        -- CaseRef Functionality
                        -- TagCloud Functionality
***************************************************************************
***************************************************************************
*/

var cntr=0;



var tabValueG = "";
var tabSelectedVal="";



//To Check the Landing Page Cookie 
function clickanchor()
{
document.getElementById("launchLandingPage").click();
}
  
function CheckLandingPageCookie(tabVal)
{
  OpenPreferencesWindow(tabVal);
  return false;  
}



 // To check the Active Tab

 function CheckActiveTab(activeTab,frompop,solncenter)
  {
     
     
      var url = "" + window.location;
      var queryStringIndex = url.indexOf('=') + 1;
	  //var activeTab = url.substr(queryStringIndex);
	 //var activeTab = <%=tab%> 
	 tabSelectedVal=activeTab;
	 
              if(activeTab.toLowerCase()=="internet")
               {
                document.getElementById('TopMenu1').className='subnavcurrent launcher';
                document.getElementById('TopMenu0').className='subnav';
                document.getElementById('TopMenu2').className='subnav launcher';
                document.getElementById('TopMenu3').className='subnav launcher';
                document.getElementById('TopMenu4').className='subnav';
		
                    if (frompop == 1 || frompop==2)
		            {
			            if(solncenter=="HighSpeed")
                	            window.location.href="/residentialhelp/highspeed";
			            else if (solncenter=="FiOSInternet")
			            window.location.href="/residentialhelp/fiosinternet";
			            else if (solncenter=="DialUp")
			            window.location.href="/residentialhelp/dialup";


		            }
               }
                else if(activeTab.toLowerCase()=="tv")
                {
                document.getElementById('TopMenu2').className='subnavcurrent';
                document.getElementById('TopMenu0').className='subnav';
                document.getElementById('TopMenu1').className='subnav launcher';
                document.getElementById('TopMenu3').className='subnav launcher';
                document.getElementById('TopMenu4').className='subnav';
                 
		  if (frompop == 1 || frompop==2)
		{
			if(solncenter=="FiOSTV")
                	window.location.href="/residentialhelp/fiostv";
			else if (solncenter.toLowerCase()=="directtv")
			window.location.href="/residentialhelp/generic/directv/123626.htm";
			


		}
                }
                
                else if(activeTab.toLowerCase()=="phone")
                {
                document.getElementById('TopMenu3').className='subnavcurrent';
                document.getElementById('TopMenu0').className='subnav';
                document.getElementById('TopMenu1').className='subnav launcher';
                document.getElementById('TopMenu2').className='subnav launcher';
                document.getElementById('TopMenu4').className='subnav';
                
                 
                 if (frompop == 1 || frompop==2)
                 {
                    if((getSubTabCookie('vzapps','STATE')!= null && getSubCookie('ECSPCookies','OOFState') != null) && getSubCookie('ECSPCookies','OOFState') != '')
                    {
                        window.location.href="/residentialHelp/templates/outoffranchise/outoffranchiseState.aspx"; 
                        return true;
                    }
                    else
                    {
                        window.location.href="/residentialhelp/phone"; 
                    }
                 }
                 
                 
                 
                //CheckPhoneCookie(activeTab);
                }
                else if(activeTab.toLowerCase()=="wireless")
                {
                document.getElementById('TopMenu4').className='subnavcurrent';
                document.getElementById('TopMenu0').className='subnav';
                document.getElementById('TopMenu1').className='subnav launcher';
                document.getElementById('TopMenu2').className='subnav launcher';
                document.getElementById('TopMenu3').className='subnav launcher';
                 if (frompop == 1 || frompop==2)
                CheckWirelessCookie(activeTab);
                }
                //else if (activeTab=="Support Home")
                else  
                {
                
                document.getElementById('TopMenu0').className='subnavcurrent';
                document.getElementById('TopMenu1').className='subnav launcher';
                document.getElementById('TopMenu2').className='subnav launcher';
                document.getElementById('TopMenu3').className='subnav launcher';
                document.getElementById('TopMenu4').className='subnav';
                 if (frompop == 1 || frompop==2)
                CheckSupportHomeCookie(activeTab);           
                }
  
  
  }





   
 // TabLevelCookie Checking Functionality
 function getTabValue(tabVal)
 {

   if(tabVal.toLowerCase()=="internet")
    {   
     CheckInterentCookie(tabVal)
    }
    if(tabVal.toLowerCase()=="tv")
      {
      CheckTVCookie(tabVal);
      }
      
    if(tabVal.toLowerCase()=="phone")
      {
     CheckPhoneCookie(tabVal);
      }
 
    if(tabVal.toLowerCase()=="wireless")
      {
     CheckWirelessCookie(tabVal);
      }
      
     if(tabVal=="Support Home")
     {
     CheckSupportHomeCookie(tabVal);
     }
      

  }



   
function CheckInterentCookie(tabvalue)
{

       if (getSubCookie('ECSPCookies',tabvalue) != null)
        {
               var cookieVal = getSubTabCookie('ECSPCookies',tabvalue);
               if(cookieVal!=null && cookieVal!='')
               {
                if (document.getElementById('layer')) document.getElementById('layer').parentNode.removeChild(document.getElementById('layer'));
                if (document.getElementById('overlay')) document.getElementById('overlay').parentNode.removeChild(document.getElementById('overlay'));
                if (document.getElementById('overlay_iframe')) document.getElementById('overlay_iframe').parentNode.removeChild(document.getElementById('overlay_iframe'));
		if(cookieVal.toLowerCase()=="highspeed")
                	setTimeout('window.location.href="/residentialhelp/highspeed"',50);
			else if (cookieVal.toLowerCase()=="fiosinternet")
			setTimeout('window.location.href="/residentialhelp/fiosinternet"',50);
			else if (cookieVal.toLowerCase()=="dialup")
			setTimeout('window.location.href="/residentialhelp/dialup"',50);

               return true;
               }  
               else
               {
                //OpenPreferencesWindow(tabvalue);
                return false;
               }
                       
         }
        else
        {
       // OpenPreferencesWindow(tabvalue);
        return false;
         }
         
         
//     }
//     else
//     {
//      OpenPreferencesWindow(tabvalue);
//        return false;
//      }
}

function CheckTVCookie(tabvalue)
{

//
  if (getSubCookie('ECSPCookies',tabvalue) != null)
    {
//    
       var cookieVal = getSubTabCookie('ECSPCookies',tabvalue);
           if(cookieVal!=null && cookieVal!='')
           {
             if (document.getElementById('layer')) document.getElementById('layer').parentNode.removeChild(document.getElementById('layer'));
             if (document.getElementById('overlay')) document.getElementById('overlay').parentNode.removeChild(document.getElementById('overlay'));
             if (document.getElementById('overlay_iframe')) document.getElementById('overlay_iframe').parentNode.removeChild(document.getElementById('overlay_iframe'));
              
		 if(cookieVal.toLowerCase()=="fiostv")
                	setTimeout('window.location.href="/residentialhelp/fiostv"',50);
			else if (cookieVal.toLowerCase()=="directtv")
			        //window.location.href="/residentialhelp/generic/directv/123626.htm";
			        setTimeout('window.location.href="/residentialhelp/generic/directv/123626.htm"',50);

               return true;
           }  
           else
           {
          // OpenPreferencesWindow(tabvalue);
           return false;
           }
                  
     }
    else
    {
    //OpenPreferencesWindow(tabvalue);
    return false;
    }
 }
 
function CheckPhoneCookie(tabvalue)
{

 if((getSubTabCookie('vzapps','STATE')!= null && getSubCookie('ECSPCookies','OOFState') != null) && getSubCookie('ECSPCookies','OOFState') != '')
    {
	if (document.getElementById('layer')) document.getElementById('layer').parentNode.removeChild(document.getElementById('layer'));
            if (document.getElementById('overlay')) document.getElementById('overlay').parentNode.removeChild(document.getElementById('overlay'));
            if (document.getElementById('overlay_iframe')) document.getElementById('overlay_iframe').parentNode.removeChild(document.getElementById('overlay_iframe'));

           //window.location.href="/ResidentialHelp/templates/OutOfFranchise/outoffranchiseState.aspx"; 
		setTimeout('window.location.href="/ResidentialHelp/templates/OutOfFranchise/outoffranchiseState.aspx"',50);
           return true;
    }


  if (getSubCookie('vzapps','STATE') != null)
    {


         var cookieVal = getSubTabCookie('vzapps','STATE');
           if(cookieVal!=null && cookieVal!='')
           {
            if (document.getElementById('layer')) document.getElementById('layer').parentNode.removeChild(document.getElementById('layer'));
            if (document.getElementById('overlay')) document.getElementById('overlay').parentNode.removeChild(document.getElementById('overlay'));
            if (document.getElementById('overlay_iframe')) document.getElementById('overlay_iframe').parentNode.removeChild(document.getElementById('overlay_iframe'));

               //window.location.href="/residentialhelp/phone"; 
               	setTimeout('window.location.href="/residentialhelp/phone"',50);
               return true;
           }  
           else
           {
           //OpenPreferencesWindow(tabvalue);
           return false;
           }       
     }
    else
    {
     //OpenPreferencesWindow(tabvalue);
     return false;
     }  
 }
 
function CheckWirelessCookie(tabvalue)
{
// if (getSubCookie('ECSPCookies',tabvalue) != null)
//    {
//         var cookieVal = getSubCookie('ECSPCookies',tabvalue);
//           if(cookieVal!=null)
//           {
           
           window.location.href="/residentialhelp/wireless/wireless.htm";
//           return true;
//           }          
//           else
//           {
//           OpenPreferencesWindow(tabvalue);
//           return false;
//           }
//     }
//   else
//    {
//    OpenPreferencesWindow(tabvalue);
//    return false;
//    }
 }
 
 function CheckSupportHomeCookie(tabvalue)
 {
 // window.location.href="/residentialhelp/";
 window.location.href="/residentialhelp?Called=Yes";
  return false;
 }






 
 
 function getSubTabCookie(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 OpenPreferencesWindow_Search(tabVal,ctrl,caseRefID,tags, displayTags)
 {
 var sURL ='/ResidentialHelp/templates/layers/setpreferences_generic.aspx?TabValue=' +tabVal +'&SelectedCtrl='+ctrl +'&modal=Y' +'&caseRefID='+caseRefID +'&Tags='+tags +'&displayTags='+displayTags

 mywindow=window.showModalDialog(sURL,window,"dialogHeight:400px;dialogWidth:800px;center:yes");
// mywindow=window.showModalDialog(sURL,window,"location=1,status=1,scrollbars=no,menubar=no,toolbar=no,status=no,location=no,width=980,height=300,model=yes,padding=0,margin=11")
 

 }


 
 
  function OpenPreferencesWindow(tabVal)
 {

 var sURL ='/ResidentialHelp/templates/layers/setpreferences_generic.aspx?TabValue=' +tabVal +'&modal=Y';
 mywindow=window.showModalDialog(sURL,window,"dialogHeight:400px;dialogWidth:800px;center:yes");
 //mywindow=window.showModalDialog(sURL,window,"location=1,status=1,scrollbars=no,menubar=no,toolbar=no,status=no,location=no,width=2000,height=300,model=yes,padding=0,margin=11")
 
}



//Search Functionality


 function TopLevelSearch(tabValue,e)
 {

 _hbLink('btnSearchDiv');
 //tabValue='Support Home';
 //var SolutionCenter;
 
  //getSearchCookie();
  
  var isNN = (navigator.appName.indexOf("Netscape")!=-1);
  try
  {
  
			var keyCode = (isNN) ? e.which : event.keyCode; 

			if(keyCode == 13)
			{

				getSearchCookie();
			} 
			else if(tabValue!="Call")
			{
					tabValue='Support Home';
					var SolutionCenter; 
					getSearchCookie();				
			}  
  }
  catch(ex)
  {
   getSearchCookie();
  }
  
  
        
      
 }
 
 function CaptureEnterkey_Go(e)
		{
			var isNN = (navigator.appName.indexOf("Netscape")!=-1);
			var keyCode = (isNN) ? e.which : event.keyCode; 

			if(keyCode == 13)
			{
				//getSearchCookie();
			}          
		}
	
 
 
 function getSearchCookie()
 {
     var ddlValue=document.getElementById('ddlSolutionCenter');
      var varQuestion = document.getElementById('foo');
      if(ddlValue.selectedIndex==0)
         {
         alert('Please Select a Solution Center');  
          ddlValue.focus();  
         return false;
        }        
	    else if (varQuestion == null || varQuestion.value == null || varQuestion.value == '' || varQuestion.value == 'Please enter phrase or keyword' || varQuestion.value =='Search support')
	     {
           alert('Please enter a Search phrase');  
           document.getElementById('foo').focus();        
           return false;
         }
         else if(ddlValue.selectedIndex==1)
         {
          //Internet --ddlValue.sleectedIndex==1
            ddlValue=document.getElementById('ddlSolutionCenter');
            //set recently searched cookie
            setCookie('SearchQuestion',varQuestion.value,null);
            //SetRecentSearchCookie(); 
               
           SolutionCenter=InternetSearchCookie(ddlValue.value);  
           if(SolutionCenter == null ||SolutionCenter=='')
           {
              /*
              document.getElementById('TopMenu1').className='subnavcurrent launcher';
              document.getElementById('TopMenu0').className='subnav';
              document.getElementById('TopMenu2').className='subnav launcher';
              document.getElementById('TopMenu3').className='subnav launcher';
              document.getElementById('TopMenu4').className='subnav';                 
              */
              OpenPreferencesWindow_Search('internet',2,'');
             return false;
            } 
           else
           {
            TempSearch(SolutionCenter);
            return false;
           }     
           
         }      
         else if(ddlValue.selectedIndex==2)
           {
             //set recently searched cookie
             setCookie('SearchQuestion',varQuestion.value,null);
            //SetRecentSearchCookie(); 
            setblankECSPCookie();

             // for TV we always pass fiostv
             TempSearch('FiOSTV');
             return false;
              /* ddlValue=document.getElementById('ddlSolutionCenter');
               SolutionCenter=TVSearchCookie(ddlValue.value);
                if(SolutionCenter == null ||SolutionCenter=='')
               {
                 document.getElementById('TopMenu2').className='subnavcurrent';
                 document.getElementById('TopMenu0').className='subnav';
                 document.getElementById('TopMenu1').className='subnav launcher';
                 document.getElementById('TopMenu3').className='subnav launcher';
                 document.getElementById('TopMenu4').className='subnav';  
                
                OpenPreferencesWindow_Search('tv',2);           
               }
               else
               {
                TempSearch(SolutionCenter);
               }  */
           
          }
          else if(ddlValue.selectedIndex==3)
          {

         //Phone
               //set recently searched cookie
           setCookie('SearchQuestion',varQuestion.value,null);
            //SetRecentSearchCookie(); 
            setblankECSPCookie();

            ddlValue=document.getElementById('ddlSolutionCenter');
            SolutionCenter=PhoneSearchCookie(ddlValue.value);
             if(SolutionCenter==null || SolutionCenter=="")
              {
              /*
              document.getElementById('TopMenu3').className='subnavcurrent';
              document.getElementById('TopMenu0').className='subnav';
              document.getElementById('TopMenu1').className='subnav launcher';
              document.getElementById('TopMenu2').className='subnav launcher';
              document.getElementById('TopMenu4').className='subnav';  
              */
              OpenPreferencesWindow_Search('phone',2,'');  
             return false;    
              }
              else
              {
              TempSearch("Phone"); 
              return false;
              }              
          }
          else if(ddlValue.selectedIndex==4)
           {
            //wireless   
            //SetRecentSearchCookie();   
            setCookie('SearchQuestion',varQuestion.value,null);           
            setblankECSPCookie();
             TempSearch('Wireless');
             return false;         
           
          }    
 
 }
 
 
 
 function setblankECSPCookie()
 {
 if((getCookie('ECSPCookies')== null) || (getCookie('ECSPCookies').length < 0))
      setCookie('ECSPCookies','',null);     
 }
 

function TempSearch(SolutionCenter)
 {
  // alert(SolutionCenter)
  search(SolutionCenter);
 }
 
 function InternetSearchCookie(tabValue)
 {

     var PrefCookie; 
      if (getSubCookie('ECSPCookies',tabValue) != null)
        {
               var cookieVal = getSubCookie('ECSPCookies',tabValue);
               if(cookieVal!=null && cookieVal!='')
               {
               PrefCookie=cookieVal;
               }               
          return PrefCookie      
         }       
 }
 
 function searchTemp(popularSearch)
     {
     
     _hbLink('PopularSearch');
      var SolutionCenter;
      document.getElementById('foo').value = popularSearch;     
      //SetRecentSearchCookie();
      setCookie('SearchQuestion',popularSearch,null);
      
      //pass solution center
      
      ddlValue=document.getElementById('ddlSolutionCenter');
      
       if(ddlValue.selectedIndex==0)
        {
          alert('Please Select a Solution Center');  
          ddlValue.focus(); 
           return;
        }
      
      else if(ddlValue.selectedIndex==1)
         {                 
           SolutionCenter=InternetSearchCookie(ddlValue.value);  
           if(SolutionCenter != null)           
             {
            search(SolutionCenter);
             }
           else
             {
            OpenPreferencesWindow_Search('internet',2,'');           
             return;
             }             
           
         }      
         //else if(ddlValue.selectedIndex==2 || ddlValue.selectedIndex==0)
         else if(ddlValue.selectedIndex==2)
           {            
             search('FiOSTV');
            }
          else if(ddlValue.selectedIndex==3)
          {
              //  search("Phone");   
           SolutionCenter=PhoneSearchCookie(ddlValue.value);  
           if(SolutionCenter != null)
             {           
            search("Phone");  
             }
             else
             {
	       OpenPreferencesWindow_Search('phone',2,''); 
              return;      
             }     
                
          }
          else if(ddlValue.selectedIndex==4)
           {
                        
             search('Wireless');
          }    

     }
    
    
 function TVSearchCookie(tabValue)
 {
  var PrefCookie;
      if (getSubCookie('ECSPCookies',tabValue) != null)
        {
               var cookieVal = getSubCookie('ECSPCookies',tabValue);
               if(cookieVal!=null && cookieVal!='')
               {
               PrefCookie=cookieVal;
               }
          return PrefCookie 
          }
         
 }
 function PhoneSearchCookie(tabValue)
 {
     var PrefCookie;
      if (getSubCookie('vzapps','ZIPCODE') != null)
      {
         var cookieVal = getSubTabCookie('vzapps','ZIPCODE');
           if(cookieVal!=null && cookieVal!='')
           {     
               PrefCookie=cookieVal;
           }
      return PrefCookie 
        }

       
 }
 
 
 function setCookie(c_name,value,expiredays)
    {
    var exdate=new Date();
    var domain = document.domain;
    exdate.setDate(exdate.getDate()+expiredays);
    //document.cookie=c_name+ "=" +escape(value)+ ';path=/;domain=.verizon.com'+
    document.cookie=c_name+ "=" +escape(value)+ ';path=/'+
    ((expiredays==null) ? ";" : ";expires="+exdate.toGMTString());
    }
 
// TO Set default Search Center in drop down

function setDefaultSearchCenter(tabValue) 
 { 
  
    if (tabValue.toLowerCase()== "internet") 
     { 
     document.getElementById('ddlSolutionCenter').selectedIndex=1; 
     } 
    else if (tabValue.toLowerCase()== "tv") 
     { 
     document.getElementById('ddlSolutionCenter').selectedIndex=2; 
      } 
    else if (tabValue.toLowerCase()== "phone") 
     { 
     document.getElementById('ddlSolutionCenter').selectedIndex=3; 
     } 
    else if (tabValue.toLowerCase()== "wireless") 
     { 
     document.getElementById('ddlSolutionCenter').selectedIndex=4; 
     } 
    else 
     { 
     document.getElementById('ddlSolutionCenter').selectedIndex=0; 
     } 
 } 


//Recent Searches.

function UpdateRecentSearch()
{
 var cookieVal = getCookie('SearchQuestion');
 if(cookieVal==null || cookieVal=='')
   {
      document.getElementById('recentSearch').innerHTML = '';
      return;
    }   
    else
    {  
   html = ' <strong>Recent Searches: </strong>'; 
    html += '<a href="javascript:searchTemp(\''+cookieVal+'\')">'+cookieVal+'</a> ';
   document.getElementById('recentSearch').innerHTML = html;
   }
} 





    
 function checkCaseRef(tabValue,caseRef) 
 { 
  var SolutionCenter; 
  
      if(tabValue.toLowerCase()=="internet") 
       { 
          SolutionCenter=InternetSearchCookie(tabValue);   
           if(SolutionCenter == null ||SolutionCenter=='') 
           { 
              
              //document.getElementById('TopMenu1').className='subnavcurrent launcher'; 
              //document.getElementById('TopMenu0').className='subnav'; 
              //document.getElementById('TopMenu2').className='subnav launcher'; 
              //document.getElementById('TopMenu3').className='subnav launcher'; 
             // document.getElementById('TopMenu4').className='subnav';                 
              
              OpenPreferencesWindow_Search(tabValue,3,caseRef)   

		 SolutionCenter=InternetSearchCookie(tabValue);   
         	 if(SolutionCenter == null ||SolutionCenter=='') 
          	 { }
		 else 
		 {
		   var sURL='/ResidentialHelp/Templates/Redirect.aspx?TabValue='+SolutionCenter +'&caseRefId='+caseRef 
               window.location.href=sURL; 

		 }
            } 
           else 
            { 
                //Redirect to Redirect Page with qurerystrings 
               var sURL='/ResidentialHelp/Templates/Redirect.aspx?TabValue='+SolutionCenter +'&caseRefId='+caseRef 
               window.location.href=sURL; 
               return false; 
             } 
         }
       else if(tabValue.toLowerCase()=="tv") 
         { 
            SolutionCenter=TVSearchCookie(tabValue);   
            if(SolutionCenter == null ||SolutionCenter=='') 
              {               
             //document.getElementById('TopMenu2').className='subnavcurrent'; 
             //document.getElementById('TopMenu0').className='subnav'; 
            // document.getElementById('TopMenu1').className='subnav launcher'; 
             //document.getElementById('TopMenu3').className='subnav launcher'; 
             //document.getElementById('TopMenu4').className='subnav'; 
            // OpenPreferencesWindow_Search(tabValue,3,caseRef)                                                                         

			 SolutionCenter=TVSearchCookie(tabValue);   
	            if(SolutionCenter == null ||SolutionCenter=='') 
	     	      {}
			else               
			{
				
                var sURL='/ResidentialHelp/Templates/Redirect.aspx?TabValue='+SolutionCenter+'&caseRefId='+caseRef 
               window.location.href=sURL; 
			}

              } 
              else 
              { 
                
                var sURL='/ResidentialHelp/Templates/Redirect.aspx?TabValue='+SolutionCenter+'&caseRefId='+caseRef 
               window.location.href=sURL; 
                return false; 
              } 
          } 
        else if(tabValue.toLowerCase()=="phone") 
         { 
            SolutionCenter=PhoneSearchCookie(tabValue);   
            if(SolutionCenter == null ||SolutionCenter=='') 
              {               
             //document.getElementById('TopMenu3').className='subnavcurrent'; 
             //document.getElementById('TopMenu0').className='subnav'; 
            // document.getElementById('TopMenu1').className='subnav launcher'; 
            // document.getElementById('TopMenu2').className='subnav launcher'; 
             //document.getElementById('TopMenu4').className='subnav'; 
             
             OpenPreferencesWindow_Search(tabValue,3,caseRef)                                                                  

		      SolutionCenter=PhoneSearchCookie(tabValue);   
            	if(SolutionCenter == null ||SolutionCenter=='') 
	              {  }else{             
	     //var sURL='/ResidentialHelp/Templates/Redirect.aspx?TabValue=Phone&caseRefId='+caseRef 
	           var sURL= caseRef;
               window.location.href=sURL; 
            
			  }

 
              } 
              else 
              { 
                
                // var sURL='/ResidentialHelp/Templates/Redirect.aspx?TabValue=Phone&caseRefId='+caseRef 
               var sURL= caseRef; 
               window.location.href=sURL; 
                return false; 
              } 
          } 
  
 } 

//For tags 

function displayTagClouds(tabValue,tags,display_tags) 
 { 
  var SolutionCenter; 
  var strCltr =4;  
  
 
      if(tabValue.toLowerCase()=="internet") 
       { 
          SolutionCenter=InternetSearchCookie(tabValue);   
           if(SolutionCenter == null ||SolutionCenter=='') 
           { 
              
             // document.getElementById('TopMenu1').className='subnavcurrent launcher'; 
              //document.getElementById('TopMenu0').className='subnav'; 
              //document.getElementById('TopMenu2').className='subnav launcher'; 
              //document.getElementById('TopMenu3').className='subnav launcher'; 
             // document.getElementById('TopMenu4').className='subnav';                 

              OpenPreferencesWindow_Search(tabValue,strCltr,'',tags,display_tags)   ;
		SolutionCenter=InternetSearchCookie(tabValue); 

	     if(SolutionCenter == null ||SolutionCenter=='') 
           {
		   
		}
		else
		{
	var sURL='/residentialhelp/TagSearchResults/TagSearchresults.htm?solncenter='+SolutionCenter +'&tag='+tags + '&display_tag=' + display_tags
               window.location.href=sURL; 
		}
             //return true; 
            } 
           else 
            { 
                //Redirect to Redirect Page with qurerystrings 
                var sURL='/residentialhelp/TagSearchResults/TagSearchresults.htm?solncenter='+SolutionCenter +'&tag='+tags + '&display_tag=' + display_tags
               window.location.href=sURL; 

             } 
         }
       else if(tabValue.toLowerCase()=="tv") 
         { 
            SolutionCenter=TVSearchCookie(tabValue);   
            if(SolutionCenter == null ||SolutionCenter=='') 
              {               
             //document.getElementById('TopMenu2').className='subnavcurrent'; 
             //document.getElementById('TopMenu0').className='subnav'; 
             //document.getElementById('TopMenu1').className='subnav launcher'; 
             //document.getElementById('TopMenu3').className='subnav launcher'; 
             //document.getElementById('TopMenu4').className='subnav'; 
              OpenPreferencesWindow_Search(tabValue,strCltr,'',tags,display_tags)   ;
SolutionCenter=TVSearchCookie(tabValue);   
	     if(SolutionCenter == null ||SolutionCenter=='') 
           {}else{
		   var sURL='/residentialhelp/TagSearchResults/TagSearchresults.htm?solncenter='+SolutionCenter +'&tag='+tags + '&display_tag=' + display_tags
               window.location.href=sURL; 
		}
            // return true; 
              } 
              else 
              { 
                
                var sURL='/residentialhelp/TagSearchResults/TagSearchresults.htm?solncenter='+SolutionCenter +'&tag='+tags + '&display_tag=' + display_tags
               window.location.href=sURL; 
                //return false; 
              } 
          } 
        else if(tabValue.toLowerCase()=="phone") 
         { 
            SolutionCenter=PhoneSearchCookie(tabValue);   
            if(SolutionCenter == null ||SolutionCenter=='') 
              {               
             //document.getElementById('TopMenu3').className='subnavcurrent'; 
             //document.getElementById('TopMenu0').className='subnav'; 
            // document.getElementById('TopMenu1').className='subnav launcher'; 
            // document.getElementById('TopMenu2').className='subnav launcher'; 
             //document.getElementById('TopMenu4').className='subnav'; 
              OpenPreferencesWindow_Search(tabValue,strCltr,'',tags,display_tags)   ;
	SolutionCenter=PhoneSearchCookie(tabValue);   

 	     if(SolutionCenter == null ||SolutionCenter=='') 
           {}else{
		   var sURL='/residentialhelp/TagSearchResults/TagSearchresults.htm?solncenter=Phone&tag='+tags + '&display_tag=' + display_tags
               window.location.href=sURL; 
		}


   
              } 
              else 
              { 
                
                var sURL='/residentialhelp/TagSearchResults/TagSearchresults.htm?solncenter=Phone&tag='+tags + '&display_tag=' + display_tags
               window.location.href=sURL; 

              } 
          } 
  
 } 

// Support Search Functionality for contact us - Starts
function TopLevelSearch_ContactUs(tabValue,e)
{

_hbLink('btnSearchDivContactus');

  var isNN = (navigator.appName.indexOf("Netscape")!=-1);
  try
  {  
		var keyCode = (isNN) ? e.which : event.keyCode; 

		if(keyCode == 13)
		{
			getSearchCookie_ContactUs();
		} 
		else if(tabValue!="Call")
		{
				tabValue='Support Home';
				getSearchCookie_ContactUs();			
		}  
  }
  catch(ex)
  {
    getSearchCookie_ContactUs();
  }  
}

function CaptureEnterkeyContactUs_Go(e)
{

_hbLink('btnSearchDivContactus');
try
{
			var isNN = (navigator.appName.indexOf("Netscape")!=-1);
			var keyCode = (isNN) ? e.which : event.keyCode; 

			if(keyCode == 13)
			{
                getSearchCookie_ContactUs();
			}          
}
  
catch(ex1)
{
    getSearchCookie_ContactUs();
}  	
}

 function getSearchCookie_ContactUs()  
 {
   try
   {  
	var varQuestion = document.getElementById('foocontactus');
	var varOption = 'Search All';

	if (varQuestion == null || varQuestion.value == null || varQuestion.value == '' || varQuestion.value == 'Please enter phrase or keyword' || varQuestion.value.toLowerCase() =='search support')
	{
		alert('Please enter the Search phrase')
		//document.getElementById('ctl00_GlobalHeader_btnGetZipcode').detachEvent();
		//document.getElementById('ctl00_GlobalHeader_btnGetZipcode').onkeypress = function();
		return false;
	}
	 
	
    if (varQuestion != null && varQuestion.value != '')
    { 
   	    document.forms['question_form'].ECSPKeyWord.Value = varQuestion.value;
    }
        
     if (varOption != null && varOption.value != '')
     {
	    document.forms['question_form'].ECSPOption.Value=varOption;
     }
  
    	 
    var SolutionCenter = "Search All";
    setCookieValue('SearchCenter',SolutionCenter ,null);
    cntr=0;
    setCookieValue('SearchQuestion',varQuestion.value,null);
    cntr=0;
    setCookieValue('SearchOption',varOption,null);
    cntr=0;
     
     if(document.cookie.toLowerCase().indexOf("ecspcookies=") == -1)
     {
        setCookieValue("ECSPCookies","",1);
     }
    cntr=0;
    var locurl = document.location.href;
    setCookieValue("refURL",locurl,1);    

    if (varQuestion != null && varQuestion.value != '')
    { 
        __CMS_CurrentUrl='/supportsearch/';
        document.forms[0].action='/supportsearch/';
        document.forms[0].submit();
        window.location.href="/supportsearch/";
    }
}
catch(ex2)
{

}
}
 
function deleteCookie1(name) 
{
 
	if (getCookie1(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;";
	}
}

/* Arun - start - 05/20/11 */

/* Cookies of same names gets appended to document.cookie can be avoided */

function setCookieValue(c_name,value,expiredays)
{
    cntr=cntr+1;
    var exdate=new Date();
    var domain = document.domain;
   
    var cookieval=getCookie(c_name);

    if(cookieval==null || cookieval=="")
    {
	exdate.setDate(exdate.getDate()+expiredays); 

    	document.cookie=c_name+ "=" +escape(value)+ ';path=/'+
    	((expiredays==null) ? ";" : ";expires="+exdate.toGMTString()); 
    }
    else if(cookieval==value)
    {
    
    }
    else
    {
      exdate.setDate(exdate.getDate()-2); 
	expiredays=(expiredays==null)?1:expiredays;

	document.cookie=c_name+ "=" +escape(cookieval)+ ';path=/'+
    	((expiredays==null) ? ";" : ";expires="+exdate.toGMTString()); 
    if(cntr==1){
      setCookieValue(c_name,value,expiredays);
      }
    }
    
}

/* Arun - End - 05/20/11 */

// Support Search Functionality for contact us - ends
