﻿ var _allinc=0, _optionalinc=0;
function GenerateFBShareURL()
{
    var fbUrl = "http://www.facebook.com/sharer.php?u=";
    var shareUrl = window.location.href.replace("cb.toursqa.com","www.efcollegebreak.com"); 
    var title = document.getElementsByTagName('title')[0];
    var diaSettings = "height=300,width=450 ,left=10,top=10,status=yes,toolbar=no,menubar=no,scrollbars=no,location=no,resizable=no";
    
	var newWin = window.open("","EFCollegebreak",diaSettings);
    
    newWin.location.href = (fbUrl +  encodeURIComponent(shareUrl)+ '&t=' + encodeURIComponent(title));
    newWin.focus();	
    return false;
}
/**  PRICE THIS TOUR - Validation  **/
function dropdownvalidate()
{
var DateDDlobj = document.getElementById('ctl00_MainContent_DepartureDateCtl');
var DateDrop= DateDDlobj.options[DateDDlobj.selectedIndex].value;
var GatewayDDlobj = document.getElementById('ctl00_MainContent_GatewayCtl');
var GatewayDrop= GatewayDDlobj.options[GatewayDDlobj.selectedIndex].value;
	if (GatewayDrop == "" && DateDrop == "")
	{
		alert("Select a Valid Gateway and Date");
		return false;	
	}
	else if (DateDrop == "")
	{
		alert("Select a  Date ");
		return false;
	}
	else if (GatewayDrop == "" )
	{
		alert("Select a Valid Gateway");
		return false;
	} 
	else
	{
		return true;
	}	
}
function Newdropdownvalidate()
{
var DateDDlobj = document.getElementById('ctl00_PageContentPlaceHolder_DepartureDateCtl');
var DateDrop= DateDDlobj.options[DateDDlobj.selectedIndex].value;
var GatewayDDlobj = document.getElementById('ctl00_PageContentPlaceHolder_GatewayCtl');
var GatewayDrop= GatewayDDlobj.options[GatewayDDlobj.selectedIndex].value;
	if (GatewayDrop == "" && DateDrop == "")
	{
		alert("Select a Valid Gateway and Date");
		return false;	
	}
	else if (DateDrop == "")
	{
		alert("Select a  Date ");
		return false;
	}
	else if (GatewayDrop == "" )
	{
		alert("Select a Valid Gateway");
		return false;
	} 
	else
	{
		return true;
	}	
}

/**  MPP Calculator Validation  **/
function CheckMininumAmount(ElementId,TourPrice)
{
    element = document.getElementById(ElementId);                
    var amount = element.value;        
    
                if (amount.length > 0)
                {
                    if (amount.substring(0,1) == "$")
                    {
                        amount = amount.substring(1);
                    }                    
                }   
                 if (TourPrice.length > 0)
                {
                    if (TourPrice.substring(0,1) == "$")
                    {
                        TourPrice = TourPrice.substring(1);
                    }                    
                }                 
                if (element.id == "ctl00_PageContentPlaceHolder_DepositAmountCtl")
                    {
                    var month = document.getElementById('ctl00_PageContentPlaceHolder_PaymentNumberCtl').innerHTML;
                      var minDeposit = 0;
                     if(month == 2)
                            minDeposit = 750;
                        else
                            minDeposit = 150;
                       
                        if ((parseInt(amount)) < parseInt(minDeposit))
    	                {	        
                            alert("Remember we need a minimum of $" + minDeposit + " as a deposit amount.");                            
                            setTimeout("element.focus()", 1);
                            return false;                            
                        }                                                                                                      
                        else if ((parseInt(amount)) > parseInt(TourPrice))
                        {
                            alert("Deposit Amount greater than Tourprice.");                            
                            setTimeout("element.focus()", 1);
                            return false;
                        }
                        else
                        {   
                            return true;
                        }
                    }
                else
                    {
                        if ((parseInt(amount)) <= parseInt("0"))
    	                {	        
                            alert("Amount entered cannot be equal or less than 0 ");
                            setTimeout("element.focus()", 1);
                            return false;
                        }  
                        else if ((parseInt(amount)) > parseInt(TourPrice))
                        {
                            alert("Monthly Amount greater than Tourprice.");                            
                            setTimeout("element.focus()", 1);
                            return false;
                        } 
                        else
                        {
                           return true;
                        }
                    }                                                  
}
/** CLEAR QUOTING **/
function ClearQuotePricing()
{
var DateDDlobj = document.getElementById('ctl00_PageContentPlaceHolder_DepartureDateCtl');
var GatewayDDlobj = document.getElementById('ctl00_PageContentPlaceHolder_GatewayCtl');

DateDDlobj.selectedIndex = 0;
GatewayDDlobj.selectedIndex = 0;

document.getElementById('ctl00_PageContentPlaceHolder_GetQuoteForm').className='show';
document.getElementById('ctl00_PageContentPlaceHolder_QuoteDetails').className='hide';
 document.getElementById('StartingPriceContent').style.display ="block";
 document.getElementById('Restrictionlink').style.display ="inline";
}


function GetpixelId(iPixID)
{
  
  var szRandom = Math.random() * 1000000; // number randomization
  var szProtocol = window.location.protocol; // protocol check: secure or not-secure
  var tourCode = document.getElementById('ctl00_PageContentPlaceHolder_SapientTourCode').value
  var adsrc= szProtocol + "//ads.bridgetrack.com/track/j/?id=" + iPixID+ "&PID=trip_iten&TourCode=" + tourCode + "&random=" + szRandom ;
  if (document.location.host == "localhost" ||document.location.host == "cb.toursqa.com" || document.location.host == "10.43.43.242:8083")
 {
    //$.getScript(adsrc,function(data,textStatus){});
 }
  else
  {			
   $.getScript(adsrc,function(data,textStatus){});
  }
}  
    function ShoeTGPopUp()
        {		
   	        setTimeout("TB_show('PopUp','/college-tours/TourGuides.aspx?height=645&amp;width=657&amp;scroll=0&amp;setopacity=1','../images/LoadingAnimation.gif')",100);
        }

function HideShow(spanId)
{
    var spanCtl = document.getElementById(spanId);    
    
    if (spanCtl.style.visibility == "hidden" && spanCtl.style.display == "none")
    {               
        spanCtl.style.visibility = "visible";
        spanCtl.style.display = "block";
        
    }
    else
    {
        spanCtl.style.visibility = "hidden";
        spanCtl.style.display = "none";
        
    }
}

function openWin(theurl)
{
	var newWin = window.open("","printWin","height=600,width=750 ,left=10,top=10,status=yes,toolbar=no,menubar=yes,scrollbars=yes,location=no,resizable=no");
	newWin.location.href=theurl;
	newWin.focus();		
}
  function HotelPopUp()
        {		
   	        setTimeout("TB_show('PopUp','/college-tours/SampleHotels.aspx?height=645&amp;width=657&amp;scroll=0&amp;setopacity=1','../images/LoadingAnimation.gif')",100);
        }
        function ShowMPPPopUp()
        {		
   	        setTimeout("MPP_show()",100);
        }


function MenuClick(linkid,contentid)
{ 
           var containerelement = document.getElementById('TabSection');
		   var divs = containerelement.getElementsByTagName("div");
		   
          if(contentid=="allincluded")
          
          {
             if(_allinc==0)
             {
             EFCB.TrackVisitor.Init(document.getElementById('ctl00_PageContentPlaceHolder_AllIncludedTrackQuery').value);
             _allinc=1;
             }
          }

          else
          {
                         if(_optionalinc==0)
             {
                EFCB.TrackVisitor.Init(document.getElementById('ctl00_PageContentPlaceHolder_OptionalsTrackQuery').value);
                         _optionalinc=1;
             }    
          }
            
//            GetpixelId(iPixID);
           
		for (var i=0 ; i<divs.length ; i++) 
		{
	       var tabid= divs[i].id+"tab";
			if (divs[i].id == contentid) 
			{	
				
				divs[i].style.display = "block";
				if(document.getElementById(tabid).className.indexOf("_on") == -1)
				    document.getElementById(tabid).className = document.getElementById(tabid).className + "_on"	;
			}
			else
			{   
			 
				divs[i].style.display = "none";		
				if(document.getElementById(tabid).className.indexOf("_on") != -1)		 
				    document.getElementById(tabid).className= document.getElementById(tabid).className.replace("_on","");
			}
		 }
		
}
function CloseSapient(wrapperId , containerId)
{
    var wrapper = document.getElementById(wrapperId);
    var container = document.getElementById(containerId);
  
    if(document.getElementById('Uparrow').style.display== 'none')
    {
        wrapper.style.display='none';
        container.style.height=17+'px';
        document.getElementById('Close').style.display='none';
        document.getElementById('Uparrow').style.display = 'block';
    }
    else
    {
        wrapper.style.display='block';
        container.style.height=156+'px';
        document.getElementById('Close').style.display='block';
        document.getElementById('Uparrow').style.display = 'none';
    }
    ChangeHeight();
}

function ChangeHeight()
{
  
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])
var ie = (navigator.userAgent.indexOf("MSIE") > -1) ? true : false;

if(ie) {
    if ((version >= 5.5) && (document.body.filters) && (version < 7)) 
    {
    if(document.body.clientHeight != null && document.body.clientHeight > 0)
    {
        var sapScrollTop =(document.documentElement.scrollTop+document.documentElement.clientHeight)-document.getElementById('SapientContainer').clientHeight;
        var sapWrapScrollTop =(document.documentElement.scrollTop+document.documentElement.clientHeight)-document.getElementById('SapientWrapper').clientHeight;
    
        document.getElementById('SapientContainer').style.top= sapScrollTop;
        document.getElementById('SapientWrapper').style.top= sapWrapScrollTop;
    }
}
}
}



function ShowDepartureDates(PrevDatesBlock , NextDatesBlock , PrevLinkText , NextLinkText , SpanLink)
{

    if(document.getElementById(PrevDatesBlock).style.display == '' || document.getElementById(PrevDatesBlock).style.display == 'inline')
    {
        document.getElementById(PrevDatesBlock).style.display = 'none';
        document.getElementById(NextDatesBlock).style.display = 'inline';
        document.getElementById(SpanLink).innerHTML = NextLinkText;
			//alert(document.getElementById(PrevDatesBlock).style.float);
		if(document.getElementById(NextDatesBlock).style.styleFloat== 'none')
            document.getElementById(SpanLink).style.marginTop = '3px';
    }
    else
    {
        document.getElementById(PrevDatesBlock).style.display = 'inline';
        document.getElementById(NextDatesBlock).style.display = 'none';
        document.getElementById(SpanLink).innerHTML = PrevLinkText;
		//alert(document.getElementById(NextDatesBlock).style.styleFloat);
		if(document.getElementById(NextDatesBlock).style.styleFloat == 'none')
             document.getElementById(SpanLink).style.marginTop = '6px';
    }
}

function EmailPopUp(tourName,tourCode,tourdate,progfee,depfee,touryear,gateway,emailTo)
        {		
           var url='/college-trips/EmailQuote.aspx?height=720&width=694&scroll=0&setopacity=1&TourName=' + tourName + '&TourCode=' + tourCode + '&TourDate='+ tourdate + '&progfee='+ progfee + '&depfee=' + depfee + '&touryear='+ touryear + '&gateway='+ gateway +'&emailto='+emailTo;
     		// GetpixelId('6802');
                EFCB.TrackVisitor.Init(document.getElementById('ctl00_PageContentPlaceHolder_EmailEncryptTrackQuery').value);
   	       document.getElementById("ctl00_PageContentPlaceHolder_Iframe1").src=url;   		   
     		 if(emailTo =='friend')
   	       {
   	            document.getElementById("ctl00_PageContentPlaceHolder_Iframe1").style.height='1000px';
   	             document.getElementById("EmailFrame").style.height='760px';
		     setTimeout("TB_MPPshow('EmailFrame','694','1000','0')",100);
   	       }    
   	       else
   	       {
   	            document.getElementById("ctl00_PageContentPlaceHolder_Iframe1").style.height='900px';
   	             document.getElementById("EmailFrame").style.height='880px';
		    setTimeout("TB_MPPshow('EmailFrame','694','900','0;')",100);
   	       }
   	      
        }
function ShowAmountValidationMsg(popupMsg)
{
    var depositAmt = document.getElementById('ctl00_PageContentPlaceHolder_DepositAmountCtl').value;
 var month = document.getElementById('ctl00_PageContentPlaceHolder_PaymentNumberCtl').innerHTML;
    var minDeposit = 0;

    if(month == 2){
        popupMsg = popupMsg.replace("150","750");
        minDeposit = 750;
    }else
        minDeposit = 150; 

if (depositAmt.length > 0)
                {
                    if (depositAmt.substring(0,1) == "$")
                    {
                        depositAmt = depositAmt.substring(1);
                    }                    
                }   
    if ((parseInt(depositAmt)) < minDeposit){
        alert(popupMsg);
    } 
}
function AddDescPopupEvents(wrapperId)
{
    var headerItem = document.getElementById(wrapperId).getElementsByTagName('A');
   
    var i = 0;
    for(i=0;i<headerItem.length;i++)
    {
        headerItem[i].onmouseover = function(){ShowInfoPopup(this)}
        headerItem[i].onmouseout = function(){HideInfoPopup(this)}
    }
}
function ShowInfoPopup(anchorObj)
{   
   var descBlock = anchorObj.nextSibling;
   descBlock.style.display = 'inline';
}
function HideInfoPopup(anchorObj)
{
    var descBlock = anchorObj.nextSibling;
     descBlock.style.display = 'none';
}

/*New Design*/
function ImageSwap(imageid)
{
   var imgobj=document.getElementById(imageid);
   if(imgobj.src.indexOf("_onHover")!=-1)
   {
       imgobj.src=imgobj.src.replace("_onHover","");
   }
   else if (imgobj.src.indexOf("_onClick")!=-1)
   {
       imgobj.src=imgobj.src.replace("_onClick","");
   }
   else
   {
     if(imageid.indexOf("GetQuote")!=-1)
     {
        imgobj.src=imgobj.src.replace("calculate","calculate_onHover");
     }
     else if(imageid.indexOf("BookNow")!=-1)
     {
        imgobj.src=imgobj.src.replace("booknow","booknow_onHover");
     }
     else
    {
       imgobj.src=imgobj.src.replace(imageid,imageid+"_onHover");
    } 
  }
}
function ImageClick(imageid)
{
   var imgobj=document.getElementById(imageid);
   if(imgobj.src.indexOf("_onHover")!=-1)
   {
       imgobj.src=imgobj.src.replace("_onHover","");
        if(imageid.indexOf("GetQuote")!=-1)
     {
        imgobj.src=imgobj.src.replace("calculate","calculate_onClick");
     }
     else if(imageid.indexOf("BookNow")!=-1)
     {
        imgobj.src=imgobj.src.replace("booknow","booknow_onClick");
     }
     else
    {
       imgobj.src=imgobj.src.replace(imageid,imageid+"_onClick");
     }
   }
}

function HideShow(anchorobj, divid)
{
   var divobj=document.getElementById(divid);
   if(divobj.className=="Day ScheduleBorder")
   {
    	divobj.className="DayExpand ScheduleBorder";
    	anchorobj.className="DaylinkExpand";
		GetScrollHeight();
   }
   else
   {
    	divobj.className="Day ScheduleBorder";
    	anchorobj.className="Daylink";
		GetScrollHeight();
   }
}

function SwapThumbnail(span)
{
   if(span.className=="Active")
      span.className="Inactive";
   else
      span.className="Active";
}

function DisplaySights(span)
{
    var spanid=span.id;
    var startindex=spanid.indexOf("_");
    startindex=startindex+1;
    var index=spanid.substring(startindex);
    index=index-1;
    HideAll('SightsHeader','p');
    HideAll('Sightsimage','img');
    HideAll('SightsThumbnail','span');
    var paragrapharr=document.getElementById('SightsHeader').getElementsByTagName('p');
    var imgarr=document.getElementById('Sightsimage').getElementsByTagName('img');
    var spanarr=document.getElementById('SightsThumbnail').getElementsByTagName('span');
    paragrapharr[index].className='Active';
    imgarr[index].className='Active';
    spanarr[index].className='Clicked';
}

function HideAll(wrapperId,tagName)
{
    var arr = document.getElementById(wrapperId).getElementsByTagName(tagName);
    
    for(var i=0;i<arr.length;i++)
    {
        if(tagName!="span")
        {
           if(arr[i].className=='Active')
             arr[i].className = '';
        }
        else
        {
            if(arr[i].className=='Active')
             arr[i].className = 'NotClicked';
        }
    }
}

function ImageHover(obj)
{
  
    if (obj.className.indexOf("_hover")!=-1)
   {
      obj.className=obj.className.replace("_hover","");
   }
   else  if (obj.className.indexOf("_hover")==-1 && obj.className.indexOf("_on")==-1)
   {
      obj.className=obj.className+"_hover";
   }
 
}

function GeneralEmailPopUp(tourName,tourCode,touryear,emailTo, quote)
        {		
           var url='/college-trips/EmailQuote.aspx?height=720&width=694&scroll=0&setopacity=1&TourName=' + tourName + '&TourCode=' + tourCode + '&touryear='+ touryear + '&emailto='+emailTo + '&quote='+quote;
            EFCB.TrackVisitor.Init(document.getElementById('ctl00_PageContentPlaceHolder_EmailEncryptTrackQuery').value);
     		 //GetpixelId('6802');
   	       document.getElementById("ctl00_PageContentPlaceHolder_Iframe1").src=url;   		   
     		 if(emailTo =='friend')
   	       {
   	            document.getElementById("ctl00_PageContentPlaceHolder_Iframe1").style.height='1000px';
   	             document.getElementById("EmailFrame").style.height='760px';
		     setTimeout("TB_MPPshow('EmailFrame','694','1000','0')",100);
   	       }    
   	       else
   	       {
   	            document.getElementById("ctl00_PageContentPlaceHolder_Iframe1").style.height='900px';
   	             document.getElementById("EmailFrame").style.height='880px';
		    setTimeout("TB_MPPshow('EmailFrame','694','900','0;')",100);
   	       }
   	      
        }
var viewportwidth;
var viewportheight;
var leftdivheight;
var rightdivheight;

        function GetScrollHeight()
        {
           var arVersion = navigator.appVersion.split("MSIE")
           var version = parseFloat(arVersion[1])
            var ie = (navigator.userAgent.indexOf("MSIE") > -1) ? true : false;
           if (typeof window.innerWidth != 'undefined')
         {
            viewportheight = window.innerHeight;
         }
 
        // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

            else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth !='undefined' && document.documentElement.clientWidth != 0)
            {
                viewportheight = document.documentElement.clientHeight;
             }     
           // alert(viewportheight);   
            var constheight=215;
			 var bottompix="100px";
            var toppix="571px";
          //  var bottompixel=100px;
            var leftdivheight=document.getElementById('TripItinLeftContent').clientHeight;
            var leftcontentheight=leftdivheight+constheight;
            var scrollheight;
           
            if (typeof window.pageYOffset !='undefined')
            {
              scrollheight=window.pageYOffset;
            }
            else
            scrollheight=document.documentElement.scrollTop;
         
          //  alert(scrollheight);
            var rightdivheight=document.getElementById('TripItinRightContent').offsetHeight;
           
             var rightcontentheight=rightdivheight + constheight;
           // alert(rightdivheight);
           if((scrollheight+viewportheight) >( rightcontentheight))
           {
           
             var toppixel= parseInt(scrollheight+ viewportheight)-(rightcontentheight);
            // alert(rightcontentheight+toppixel);
             //alert(leftcontentheight);
             if((rightcontentheight+toppixel)<leftcontentheight)
             {

                if(ie) {
                if ((version >= 5.5) && (document.body.filters) && (version < 7)) 
                 document.getElementById('TripItinRightContent').style.marginTop =toppixel+"px";
                else if(version==7)
                {
                document.getElementById('TripItinRightContent').style.position="fixed";
                 document.getElementById('TripItinRightContent').style.bottom=bottompix;
                }
                else
                {
                 document.getElementById('TripItinRightContent').style.position="fixed";
                 document.getElementById('TripItinRightContent').style.bottom=bottompix;
                document.getElementById('TripItinRightContent').style.marginLeft=toppix;
                }
               }
               else
              {
                 document.getElementById('TripItinRightContent').style.position="fixed";
               document.getElementById('TripItinRightContent').style.bottom=bottompix;
               document.getElementById('TripItinRightContent').style.marginLeft=toppix;
              }

            }
             else
             {
              if(ie) {
             if ((version >= 5.5) && (document.body.filters) && (version < 7)) 
             {
                var h = document.getElementById('TripItinRightContent').style.marginTop;
                h=h.replace("px","");
                h = h  - ((rightcontentheight+toppixel)-leftcontentheight);
                document.getElementById('TripItinRightContent').style.marginTop = h + "px";
              }
               else if(version==7)
                {
                document.getElementById('TripItinRightContent').style.position="fixed";
                 document.getElementById('TripItinRightContent').style.bottom=bottompix;
                }
              else
             {
                document.getElementById('TripItinRightContent').style.position="fixed";
                document.getElementById('TripItinRightContent').style.bottom=bottompix;
                document.getElementById('TripItinRightContent').style.marginLeft=toppix;
             }
             }
             else
             {
                document.getElementById('TripItinRightContent').style.position="fixed";
                 document.getElementById('TripItinRightContent').style.bottom=bottompix;
                 document.getElementById('TripItinRightContent').style.marginLeft=toppix;
             }
                 
             }
                
              //else
             // document.getElementById('TripItinRightContent').style.marginTop ="0px";
            // alert(document.getElementById('TripItinRightContent').style.marginTop);
            
           }
            else
           {
            if(ie) {
             if ((version >= 5.5) && (document.body.filters) && (version < 7)) 
                document.getElementById('TripItinRightContent').style.marginTop ="0px";
             else 
             {
             document.getElementById('TripItinRightContent').style.position="";
                 document.getElementById('TripItinRightContent').style.bottom="";
				 document.getElementById('TripItinRightContent').style.marginLeft=""; 
             }
             }
              else 
             {
             document.getElementById('TripItinRightContent').style.position="";
                 document.getElementById('TripItinRightContent').style.bottom="";
              document.getElementById('TripItinRightContent').style.marginLeft="";
             }
           }
        }

 function CloseSapient(wrapperId , containerId)
{
    var wrapper = document.getElementById(wrapperId);
    var container = document.getElementById(containerId);
  
    if(document.getElementById('Uparrow').style.display== 'none')
    {
        wrapper.style.display='none';
        container.style.height=17+'px';
        document.getElementById('Close').style.display='none';
        document.getElementById('Uparrow').style.display = 'block';
    }
    else
    {
        wrapper.style.display='block';
        container.style.height=156+'px';
        document.getElementById('Close').style.display='block';
        document.getElementById('Uparrow').style.display = 'none';
    }
    ChangeHeight();
}

function ChangeHeight()
{
    var arVersion = navigator.appVersion.split("MSIE")
    var version = parseFloat(arVersion[1])
    var ie = (navigator.userAgent.indexOf("MSIE") > -1) ? true : false;

    if(ie) {
        if ((version >= 5.5) && (document.body.filters) && (version < 7)) 
        {
            if(document.body.clientHeight != null && document.body.clientHeight > 0)
            {
                var sapScrollTop =(document.documentElement.scrollTop+document.documentElement.clientHeight)-document.getElementById('SapientContainer').clientHeight;
                var sapWrapScrollTop =(document.documentElement.scrollTop+document.documentElement.clientHeight)-document.getElementById('SapientWrapper').clientHeight;
    
                document.getElementById('SapientContainer').style.top= sapScrollTop;
                document.getElementById('SapientWrapper').style.top= sapWrapScrollTop;
            }
        }
    }
}

 function cookieset(value,Season)
        {
            document.cookie='ViewTrips ='+Season+'=' + value ;
            window.location.href = '/college-trips/viewtrips.aspx';    
		return false;                    
        }

window.onscroll=function()
{
GetScrollHeight();ChangeHeight();
}

function GetGatewayMessage(ddObj,spanid )
{
    
    var msg;
    msg=EF.Global.GetInterchangableGateway(ddObj);
 
    document.getElementById(spanid).innerHTML=msg;
}
 function SetGateway(checkobj)
 {
   if(document.getElementById('ctl00_PageContentPlaceHolder_GatewayCtl').selectedIndex !=0 && checkobj.checked==true)
  {
  
   var gatewaycode=document.getElementById('ctl00_PageContentPlaceHolder_GatewayCtl').options[document.getElementById('ctl00_PageContentPlaceHolder_GatewayCtl').selectedIndex].value;
EFCB.TrackVisitor.Init("EventType=Event&EventName=TripItineray - Gateway&GatewayCode="+ gatewaycode);
   EF.Global.Utilities.CookieManager.Bake("GatewayCode", gatewaycode, "3650");
  }
   else
   
   EF.Global.Utilities.CookieManager.Bake("GatewayCode", gatewaycode, "-1");
 }
 
 /*DOT*/
 function showpopup(infocontent,imgobj)
{
   generatepopup(infocontent, imgobj);
    var infoelement = document.getElementById(infocontent); 
    if (imgobj.id=="Restrictionlink" && ( infoelement.style.display=="none" || infoelement.style.display==""))
    {
	infoelement.style.visibility = "visible";
	infoelement.style.display = "block";
	}
	else if(imgobj.id=="Restrictionlink" && ( infoelement.style.display=="block"))	
	{
	   hideinfopopup(infocontent);
	}
	else
	{
	  	infoelement.style.visibility = "visible";
	infoelement.style.display = "block"; 
	}
}

function generatepopup(infocontent,imgobj)
{         
          
    var popupobj = document.getElementById(infocontent);   
    var browsername = navigator.appName.toLowerCase();        
    var Xoffsetvalue;
    var Yoffsetvalue;
    var Xcoord ; 
    var Ycoord ;   
   
    if( popupobj.style.left !='')
        {		 
    //position of the element
    if(infocontent == 'PricePopup')
    {
        Xoffsetvalue = '-300';    
        Yoffsetvalue = '300';  
    }
    else
    {
        Xoffsetvalue = '-280';    
        Yoffsetvalue = '100';   
    }     
       
           
    	Xcoord = parseInt(findPosX(imgobj)) + parseInt(Xoffsetvalue);
    	 Ycoord = parseInt(findPosY(imgobj))- parseInt(Yoffsetvalue);     	  

    	if (browsername == "netscape")
    	{   	
        	Xcoord = Xcoord + "px";     
        	Ycoord = Ycoord + "px";
    	}                
    	
    	//attributes for the element            	
    	popupobj.style.left = Xcoord;
    	popupobj.style.top = Ycoord;			
	}
}
function hideinfopopup(infoid)
{
    var infoelement = document.getElementById(infoid);
	infoelement.style.visibility = "hidden";
	infoelement.style.display = "none";	
}
//Function to find X and Y coordinates of a element respectively


// For the X coordinate of a specific element

function findPosX(obj) 
{
    var curleft = 0;
    if (obj.offsetParent) 
    {
        while (1) 
        {
            curleft+=obj.offsetLeft;
            if (!obj.offsetParent) 
            {
                break;
            }
            obj=obj.offsetParent;
        }
    } 
    else if (obj.x) 
    {
        curleft+=obj.x;
    }
    return curleft;}

//Returns Y coordinate of a specific element
function findPosY(obj) 
{
    var curtop = 0;
    if (obj.offsetParent) 
    {
        while (1) 
        {
            curtop+=obj.offsetTop;
            if (!obj.offsetParent)
            {
                break;
            }
            obj=obj.offsetParent;
        }
    } 
    else if (obj.y) 
    {
        curtop+=obj.y;
    }
    return curtop;
}


