//debugger;
function getStyleObject(a){return document.getElementById&&document.getElementById(a)?document.getElementById(a).style:document.all&&document.all(a)?document.all(a).style:document.layers&&document.layers[a]?document.layers[a]:false}function changeObjectVisibility(a,b){if(a=getStyleObject(a)){a.visibility=b;return true}else return false}function moveObject(a,b,d){if(a=getStyleObject(a)){var c=document.body.clientWidth;if(b+336>c)b=c-386;a.left=b+"px";a.top=d+"px";return true}else return false}
var xOffset=30,yOffset=5;
function showPopup(b,a){if(a){xOffset=0;hideCurrentPopup();a.cancelBubble=true;moveObject(b,a.pageX?a.pageX+xOffset:a.x+xOffset+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:0),a.pageY?a.pageY+yOffset:a.y+yOffset+(document.documentElement.scrollTop?document.documentElement.scrollTop:0));if(changeObjectVisibility(b,"visible"))window.currentlyVisiblePopup=b;else return false}else return false;return false}xOffset=30;
function showPickUp(b,a,c,d,f,e){if(a){hideCurrentPopup();a.cancelBubble=true;moveObject(b,a.pageX?a.pageX+xOffset:a.clientX+xOffset,a.pageY?a.pageY+yOffset:a.clientY+yOffset+(document.documentElement.scrollTop?document.documentElement.scrollTop:0));a=0;a=document.getElementById(e)==null?e:document.getElementById(e).value;GetPickUpPoints(d,f,c,a,true);if(changeObjectVisibility(b,"visible"))window.currentlyVisiblePopup=b}return false}
function showHomePickUp(b,a,c,d){if(a){hideCurrentPopup();a.cancelBubble=true;moveObject(b,a.pageX?a.pageX+xOffset:a.x+xOffset+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:0),a.pageY?a.pageY+yOffset:a.y+yOffset+(document.documentElement.scrollTop?document.documentElement.scrollTop:0));GetHomePickUpPoints(d,0,c,0,false);if(changeObjectVisibility(b,"visible")){window.currentlyVisiblePopup=b;document.getElementById(c).innerHTML=document.getElementById(DataListID).outerHTML;
if(document.getElementById(DataListID).outerHTML==null)document.getElementById(c).innerHTML=document.getElementById(DataListID).innerHTML}}return false}function hideCurrentPopup(){if(window.currentlyVisiblePopup){changeObjectVisibility(window.currentlyVisiblePopup,"hidden");window.currentlyVisiblePopup=false}};
window.onload=initializeHacks;document.onclick=hideCurrentPopup;function initializeHacks(){if(navigator.appVersion.indexOf("MSIE 5")!=-1&&navigator.platform.indexOf("Mac")!=-1&&getStyleObject("blankDiv"))window.onresize=explorerMacResizeFix;resizeBlankDiv();createFakeEventObj()}function createFakeEventObj(){if(!window.event)window.event=false}
function resizeBlankDiv(){if(navigator.appVersion.indexOf("MSIE 5")!=-1&&navigator.platform.indexOf("Mac")!=-1&&getStyleObject("blankDiv")){getStyleObject("blankDiv").width=document.body.clientWidth-20;getStyleObject("blankDiv").height=document.body.clientHeight-20}}function explorerMacResizeFix(){location.reload(false)}
function DoCallback(a,b,c,d,e){a=a+"?callback=true&param1="+b+"&param2="+c+"&param3="+d+"&param4="+e;try{xmlRequest=new XMLHttpRequest}catch(f){try{xmlRequest=new ActiveXObject("Microsoft.XMLHTTP")}catch(g){xmlRequest=false}}xmlRequest.open("GET",a,false);xmlRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlRequest.setRequestHeader("If-Modified-Since","Fri, 31 Dec 1999 00:00:00 GMT");xmlRequest.send(null);return xmlRequest};
function GetPickUpPoints(a,c,b,d,e){document.getElementById(b).innerHTML="";a=DoCallback("AjaxCall.aspx",a,c,d,e).responseText;document.getElementById(b).innerHTML=a}function GetHomePickUpPoints(a,c,b,d,e){document.getElementById(b).innerHTML="";a=DoCallback("AjaxCall.aspx",a,c,d,e).responseText;document.getElementById(b).innerHTML=a};

function RedirectURL(URL,DepartureID,DepartureDate)
{

    var xml = DoCallbackToSetSession("AjaxCall.aspx",DepartureID,DepartureDate);
    window.location.href = URL ;
    //(URL,'_self','copyhistory=yes');
   // return false;
}

function DoCallbackToSetSession(url,DepartureID,DepartureDate)
{ 

   var pageUrl = url + "?DepartureID=" + DepartureID + "&DepartureDate=" + DepartureDate;
   
    try 
    {
        //Mozilla Browsers
        xmlRequest = new XMLHttpRequest();
    } 
    catch (e)
    {
        try 
        {
            //IE
	  
           xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");
		// Branch for native XMLHttpRequest object
        } 
        catch (e) 
        {
            //Something else that won't work with this code...
            xmlRequest=false;
        }
    } 
    // Post our XmlRequest and get our desired string
    xmlRequest.open("GET", pageUrl, false);
    xmlRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    //Check the cache with some previous date
    xmlRequest.setRequestHeader('If-Modified-Since', 'Fri, 31 Dec 1999 00:00:00 GMT');
    xmlRequest.send(null);
    // Return the XmlHttp object
	
    return xmlRequest;
}

