﻿// JScript File
/*Page Script*/
 var prevId="";
    function ToggleFooterLinks(currentid,anchorid)
  {      
	var divid=document.getElementById(currentid);
	var blocks =document.getElementsByTagName("div");
	var aid=document.getElementById(anchorid);
	if(prevId != '')
	    document.getElementById(prevId).style.color ="";
	prevId=anchorid;
	
	if(divid.style.display=="block")
	    divid.style.display="none";
	else
	{
	    for (var i=0 ; i < blocks.length ; i++)
	    {
	        if(blocks[i].className=="FooterLinks")
	        {
	         blocks[i].style.display="none";
	         divid.style.display="block";
	         aid.style.color="#4a4a4a";
			 
	        }
	    }
		window.scroll(0,5000);
	}	
}

/**SEARCH***/

   function RemoveDefaultText(txtCtl,defaultValue)
    {
        if(txtCtl.value == defaultValue)
            txtCtl.value = "";
    }
    function AddDefaultText(txtCtl,defaultValue)
    {
         if(txtCtl.value == "")
            txtCtl.value = defaultValue;
    }
    function Search(txtCtlId,defaultValue,isParent)
    {
         var searchText =  document.getElementById(txtCtlId).value;         
         if(searchText !="" && searchText != defaultValue)
         {
            if(isParent)
                window.location.href ='/Parents/SiteSearch.aspx?cx=017759667894180240273%3Au5shgb3rhkc&cof=FORID%3A11&ie=UTF-8&q=' + searchText + '&sa=Search';
            else
                window.location.href ='/SiteSearch.aspx?cx=017759667894180240273%3Au5shgb3rhkc&cof=FORID%3A11&ie=UTF-8&q=' + searchText + '&sa=Search';
         }   
         return false;
    }
	function login(isHoverEnabled)
        {		
            if(typeof(EF)!=null && typeof(EF)!='undefined' && isHoverEnabled == "true")
                EF.HoverLead.killTimer();
             
             if(document.getElementById('Flashvideo') !=null)
            
             {
                if( document.getElementById('Flashvideo').className=='ShowFlashimage')
                  document.getElementById('Flashvideo').className='Flashimage'
                  document.getElementById('Videoimage').style.display='block'
             }
   	        setTimeout("TB_show('PopUp','/login.aspx?height=292&amp;width=343','~/_Images/Redesign/BookATrip/Phoenix/ajax-loader.gif')",100);

        }


    
        function cookie2010(value)
        {	    
            //document.cookie='ViewTrips=Categories=' + value + '; path=/' ;
            window.location.href = '/college-trips/viewtrips.aspx';                        
        }
function ShowRollover(img)
{
    img.style.display ='none';
    document.getElementById(img.id.replace("Off", "On")).style.display ='block';
}
function HideRollover(img)
{
    img.style.display ='none';
    document.getElementById(img.id.replace("On", "Off")).style.display ='block';
}
 function agents_available()
  {
   document.getElementById('smartbutton').innerHTML ='<a href="" onClick="NavChatPopup();' + 'return false;">' +
                                                        '<img src="/_Images/ShrinkBGLayout/LiveChat/livechat_button.png" id="LiveChatOffImg" alt="Click To Chat" onmouseover="javascript:ShowRollover(this);"/>' +
                                                        '<img src="/_Images/ShrinkBGLayout/LiveChat/livechat_button_hover.png" id="LiveChatOnImg" alt="Click To Chat" class="hide" onmouseout="javascript:HideRollover(this);"/></a>';
   return true;
  }

  function NavChatPopup()
  {
        if (!EF.Global.Utilities.CookieManager.Check("EFLIV", "Viewed")) 
            EF.Global.Utilities.CookieManager.Session("EFLIV", escape("Viewed=True"));
        window.open('/LiveChat/CustomerForm.aspx','chat_client','width=560,height=310,scrollbars=0');
  }

 function agents_not_available()
  {
   //document.getElementById('smartbutton').innerHTML ='<a href="mailto:info@efcollegebreak.com">contact</a>';
   return true;
  }
