﻿var obj;

function GetDataViaAJAX() {
    if (window.XMLHttpRequest) {
        // code for IE7+, Firefox, Chrome, Opera, Safari
        obj = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        // code for IE6, IE5
        obj = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else {
        alert("Your browser does not support XMLHTTP!");
    }
    if (obj != null) {
        obj.onreadystatechange = ProcessResponseXML;

        var url = "http://www.netravel.co.il/NetServices/seFlightDes.aspx";
        url = url + "?country=" + document.getElementById("Country").value;
        obj.open("GET", url, true);
        obj.send(null);
    }
    return false;
}

function ProcessResponseXML() {
    if (obj.readyState == 4) {
        if (obj.status == 200) {
            document.getElementById("divDestination").innerHTML = obj.responseText;
        }
    }
}
function showCalendarWin() {
    var CalUrl
 
    var chkSE = "flight";
    var Des = document.all.Destination.value;
    if (Des != "0") {
    } else {
        alert("נא בחר יעד לנסיעה \n יעד שדה חובה");
        return false;
    }
    CalUrl = "../../lib/calendarNet/setParam.asp?Des=" + Des + "&flddepDate=frmSE.tbFromDate&CurDate=&fldReturnDate=frmSE.tbReturnDate&ReturnDate=&Dep=" + chkSE;
    window.open(CalUrl, "CalWin", "width=550,height=270,resizable=yes,left=230,top=170");

}
function CheckData() {
    if ((document.getElementById("Destination").value == "") || (document.getElementById("Destination").value == "0")) {
        alert("אנא בחר יעד");
        document.getElementById("Destination").focus();
        return false;
    }
    //	var Dep ="flight"// document.getElementById("DepartmentID").value;
    //	if(Dep=="0"){Dep="";}
    //	var link ="../../flight/?Des=" + document.getElementById("Destination").value + "&Country=" + document.getElementById("Country").value + "&DepID=" + Dep
    //    link = link + "&depDate=" + document.getElementById("tbFromDate").value + "&ReturnDate=" + document.getElementById("tbReturnDate").value;

    var link = "http://www.netravel.co.il/wait.aspx?dep=flight&Des=" + document.getElementById("Destination").value + "&Country=" + document.getElementById("Country").value + "&depDate=" + document.getElementById("tbFromDate").value + "&ReturnDate=" + document.getElementById("tbReturnDate").value;
    SearchWin = window.open(link, "_self");
}