﻿var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-1306698-1']);
_gaq.push(['_trackPageview']);
_gaq.push(['_trackPageLoadTime']);
(function () {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

function getCookie(c_name) {
    var i, x, y, ARRcookies = document.cookie.split(";");
    for (i = 0; i < ARRcookies.length; i++) {
        x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
        y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
        x = x.replace(/^\s+|\s+$/g, "");
        if (x == c_name) {
            return unescape(y);
        }
    }
}
function setCookie(c_name, value, exdays) {
    var exdate = new Date();
    exdate.setDate(exdate.getDate() + exdays);
    var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString());
    document.cookie = c_name + "=" + c_value;
}

//var userAgent = window.navigator.userAgent;
//if (screen.width < 699 || navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || userAgent.match(/iPhone/i)) {
//    window.location.replace('http://www.netravel.co.il/mobile/');
//}
var userAgent = window.navigator.userAgent;
if ((userAgent.search("android") > -1) && !(userAgent.search("mobile") > -1)) {
    // Tabs
}
else {
    if (screen.width < 699 || navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || userAgent.match(/iPhone/i)) {
        var mobileSite = getCookie("mobileSite");
        if ((mobileSite == undefined) || (mobileSite == "")) {
            // alert("goto conf");
            if (confirm("אם ברצונך לגלוש בגרסת האתר למכשירים ניידים לחץ אישור \n גרסה נייד הינה מקוצרת")) {
                setCookie("mobileSite", "YES", 1);
                window.location = "http://www.netravel.co.il/mobile/";
            }
            else {
                setCookie("mobileSite", "NO", 1);
            }
        }
        else {
            if (mobileSite == "YES") {
                window.location = "http://www.netravel.co.il/mobile/"; 
             }
        }
    }
}
$(function () {
    $.post('NetServices/GetDestinationsForDepartment.aspx',
    {
        Dep: "package"
    },
    function (data) {
        $("#popupDes").html(data);
    }
    );
    $.post('NetServices/GetCountrysForDepartment.aspx',
    {
        MainDep: "package"
    },
    function (data) {
        $("#divCountryPopup").html(data);
    }
    );
    $("#divDestinationPopup").html("<select ID='DestinationPopup' name='DestinationPopup' class='field' style='Width:130px;Height:20px;' dir='rtl' />");
    $("#textExample").verticaltabs({ speed: 500, slideShow: false, activeIndex: 0 });
});
var myRtr = new Array(5)
myRtr[0] = "hpRtrPackage"
myRtr[1] = "hpRtrFlight"
myRtr[2] = "hpRtrOrg"
myRtr[3] = "hpRtrSki"
myRtr[4] = "hpRtrLockal"
var nsecn = 0;
var sRot = 5;
var rtPage = 1;
var falgrt = true;
function RotatorSetCssHover(idLink) {
    document.getElementById("hpRtrPackage").className = "butt_gry";
    document.getElementById("hpRtrFlight").className = "butt_gry";
    document.getElementById("hpRtrOrg").className = "butt_gry";
    document.getElementById("hpRtrSki").className = "butt_gry";
    //document.getElementById("hpRtrSportCruise").className="mumlatzTitle";
    document.getElementById("hpRtrLockal").className = "butt_gry";
    switch (idLink) {
        case "hpRtrPackage":
            document.getElementById("hpRtrPackage").className = "butt_gry_select"; break;
        case "hpRtrFlight":
            document.getElementById("hpRtrFlight").className = "butt_gry_select"; break;
        case "hpRtrOrg":
            document.getElementById("hpRtrOrg").className = "butt_gry_select"; break;
        case "hpRtrSki":
            document.getElementById("hpRtrSki").className = "butt_gry_select"; break;
        case "hpRtrSportCruise":
            document.getElementById("hpRtrSportCruise").className = "butt_gry_select"; break;
        case "hpRtrLockal":
            document.getElementById("hpRtrLockal").className = "butt_gry_select"; break;
    }
}
function setCssHover(idLink) {
    document.getElementById("hpRtrPackage").className = "butt_gry";
    document.getElementById("hpRtrFlight").className = "butt_gry";
    document.getElementById("hpRtrOrg").className = "butt_gry";
    document.getElementById("hpRtrSki").className = "butt_gry";
    //document.getElementById("hpRtrSportCruise").className="mumlatzTitle";
    document.getElementById("hpRtrLockal").className = "butt_gry";
    switch (idLink) {
        case "hpRtrPackage":
            document.getElementById("hpRtrPackage").className = "butt_gry_select"; break;
        case "hpRtrFlight":
            document.getElementById("hpRtrFlight").className = "butt_gry_select"; break;
        case "hpRtrOrg":
            document.getElementById("hpRtrOrg").className = "butt_gry_select"; break;
        case "hpRtrSki":
            document.getElementById("hpRtrSki").className = "butt_gry_select"; break;
        case "hpRtrSportCruise":
            document.getElementById("hpRtrSportCruise").className = "butt_gry_select"; break;
        case "hpRtrLockal":
            document.getElementById("hpRtrLockal").className = "butt_gry_select"; break;
    }
}

var objRtr = null;
function setRotator(file) {
    nsecn = 0;
    setCssHover(file);
    try {
        objRtr = new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari
    }
    catch (e) {  // Internet Explorer
        try {objRtr = new ActiveXObject("Msxml2.XMLHTTP");}
        catch (e) {objRtr = new ActiveXObject("Microsoft.XMLHTTP");}
    }
    if (objRtr != null) {
        objRtr.onreadystatechange = RotatorResponse;
        objRtr.open("GET", "NetServices/hpRotator.aspx?file=" + file, true);
        objRtr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        objRtr.send(null);
    }
    return false;
}
function RotatorResponse() {
    if (objRtr.readyState == 4) {
        if (objRtr.status == 200 || objRtr.status == 0) {document.getElementById("DivRotator").innerHTML = objRtr.responseText;}
        else { alert("Error retrieving data!"); }
    }
}
function showSearchPopup() {
    if ($('input[name=chkSE]:checked').val() == "") { $('input[name=chkSE]:checked').val() = "package";chkSE_change(); }
    document.getElementById("searchPopup").style.display = "inline";
    var point = document.getElementById("SearchPoint");
    var top = point.style.top;
    document.getElementById("searchPopup").style.top = 245;
    document.getElementById("searchPopup").style.left = point.style.left;
    document.getElementById("searchPopup").style.display = "inline";
    document.getElementById("CountryPopup").focus();
}
function popupSelectDes(country, des, DesHe) {
    //   $('#searchPopup').css({ 'display': 'none' });
    document.getElementById("searchPopup").style.display = "none";
    document.getElementById("Country").value = country;
    document.getElementById("Destination").value = des;
    document.getElementById("DestinationHeb").value = DesHe;
}
function closeSEPopup() {
    document.getElementById("searchPopup").style.display = "none";
    document.getElementById("depDate").focus();
}
function chkSE_change() {
    var Dep = $('input[name=chkSE]:checked').val();
    if (Dep == "") { Dep = "package"; }
    switch ( $('input[name=chkSE]:checked').val()) {
        case "orgtours":
            document.getElementById("popupDesTitle").style.display = "none"; break;
        case "families":
            document.getElementById("popupDesTitle").style.display = "none"; break;
        case "RentCur":
            CalUrl = "http://www.netravel.co.il/basic/transport/"; window.open(CalUrl, '_self'); break;
        case "diving":
            CalUrl = "http://www.netravel.co.il/se/Default.aspx?tac=sclub"; window.open(CalUrl, '_self'); break;
        case "local":
            CalUrl = "http://www.netravelfly.co.il/israel/"; window.open(CalUrl, '_self'); break;
          //   $('input[name=chkSE]:checked').val() = ""; break;
        case "ski":
            CalUrl = "http://www.netravel.co.il/basic/ski/"; window.open(CalUrl, '_self'); break;
        case "hotel":
            CalUrl = "http://www.netravelfly.co.il/hotels/?ref=NT"; window.open(CalUrl, '_self'); break;
        case "package":
            document.getElementById("popupDesTitle").style.display = "inline";break;
        case "flight":
            document.getElementById("popupDesTitle").style.display = "inline";break;
    }
    document.getElementById("Country").value = "";
    document.getElementById("Destination").value = "";
    document.getElementById("DestinationHeb").value = "";
    $.post('NetServices/GetDestinationsForDepartment.aspx',
            {
                Dep: Dep
            },
            function (data) {
                $("#popupDes").html(data);
            }
            );
    $.post('NetServices/GetCountrysForDepartment.aspx',
            {
                MainDep: Dep
            },
            function (data) {
                $("#divCountryPopup").html(data);
            }
            );
    $("#divDestinationPopup").html("<select ID='DestinationPopup' name='DestinationPopup' class='field' style='Width:130px;Height:20px;' dir='rtl' />");
}
function CountryPopup_change() {
    var chkSE = "package";
    for (i = 0; i < document.frmSE.chkSE.length; i++) {
        if (document.frmSE.chkSE[i].checked) {
           chkSE = document.frmSE.chkSE[i].value;
        }
    }
    document.getElementById("DestinationHeb").value = "";
    document.getElementById("Destination").value = "";
    document.getElementById("Country").value = $("#CountryPopup").val();
    $.get('NetServices/GetDestinationCmb.aspx',
    {
        Dep: chkSE,
        Country: $("#CountryPopup").val()
    },
    function (data) {
        $("#divDestinationPopup").html(data);
    }
    );
}
function DestinationPopup_change() {
    document.getElementById("Destination").value = $("#DestinationPopup").val();
    var variable = $("#DestinationPopup");
    var actualText = variable.find(":selected").text();
    document.getElementById("DestinationHeb").value = actualText;
    document.getElementById("searchPopup").style.display = "none";
    document.getElementById("depDate").focus();
}
function selectDesPopup() {
    if (document.getElementById("DestinationPopup").value == "") {
        alert("נא בחר יעד \n יעד - שדה חובה");document.getElementById("DestinationPopup").focus();return false;
    }
    DestinationPopup_change();
}
function gt(link) {SearchWin = window.open(link, '_self');}
function btnSearch_Submit() {
    var SearchWinLink
    var link
    var Des = document.getElementById("Destination").value;
    var country = document.getElementById("Country").value;
    var depDate = document.getElementById("depDate").value;
    var ReturnDate = document.getElementById("ReturnDate").value;
    if (document.frmSE.chkSE.value == "") {alert("נא בחר קטגוריה \n קטגוריה - שדה חובה");return false;}
    if (Des == "") {
        alert("נא הקלד יעד לנסיעה \n יעד שדה חובה");document.getElementById("Destination").focus(); return false;
    }
    //	switch ( $('input[name=chkSE]:checked').val()){
    //        case "package":
    //            link = "http://www.netravel.co.il/package/?Des="+Des+"&Country="+country+"&depDate="+depDate+"&ReturnDate="+ReturnDate;
    //            break; 
    //       case "AIG":
    //            link="http://media.next-in.com/AIG/travel_0306/redir.asp?src=netravel";
    //            break;
    //    }
    link = "http://www.netravel.co.il/wait.aspx?dep=" +  $('input[name=chkSE]:checked').val() + "&Des=" + Des + "&Country=" + country + "&depDate=" + depDate + "&ReturnDate=" + ReturnDate;
    SearchWin = window.open(link, '_self');
}
function showCalendarWin() {
    closeCalendar();
    var chkSE =  $('input[name=chkSE]:checked').val();
    var Des = document.getElementById("Destination").value;
    if (chkSE == "") {alert("נא בחר קטגוריה \n קטגוריה - שדה חובה");return false;}
    if (Des == "") { alert("נא הקלד יעד לנסיעה \n יעד שדה חובה"); return false; }
    $("#calendarPopup").css("display", "inline");
    var CalUrl = "http://www.netravel.co.il/lib/calendarNet/Calendar.aspx?Des=" + Des + "&flddepDate=frmSE.depDate&CurDate=" + document.getElementById("depDate").value + "&fldReturnDate=frmSE.ReturnDate&ReturnDate=" + document.getElementById("ReturnDate").value + "&Dep=" + chkSE;
    var ifr = "<iframe id='ifrmCalendar' name='ifrmCalendar' src='" + CalUrl + "' width='500' height='260' frameborder='0' />"
    $("#frmCalendarPopup").append(ifr);
}
function closeCalendar() {
    $("#calendarPopup").css("display", "none");
    $("#frmCalendarPopup").empty();
}
function btnSubmit() {
    document.getElementById("depDate").value = $("#ifrmCalendar").contents().find("#lblDepartureDate").text();
    document.getElementById("ReturnDate").value = $("#ifrmCalendar").contents().find("#lblReturnDate").text();
    btnSearch_Submit();
}
// File default-Ajax.js
var setCmb = "";
function setCountry() {
    setCmb = "country";
    setCountryBlank();
    SetDesBlank();
    switch ( $('input[name=chkSE]:checked').val()) {
        case "package":
            GetDataViaAJAX("country")
            break;
        case "flight":
            GetDataViaAJAX("country")
            break;
        case "orgtours":
            GetDataViaAJAX("country")
            break;
        case "cruise":
            GetDataViaAJAX("country")
            break;
    }
}
function setDestination() { setCmb = "des"; GetDataViaAJAX("des"); }
var objSE = null;
function GetDataViaAJAX(cmb) {
    var page
    if (cmb == "country") { page = "http://www.netravel.co.il/NetServices/GetCountrysXML.aspx"; }
    else { page = "http://www.netravel.co.il/NetServices/GetDestinationsXML.aspx"; }
    if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
        objSE = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {// code for IE6, IE5
        objSE = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else { alert("Your browser does not support XMLHTTP!"); }
    if (objSE != null) {
        objSE.onreadystatechange = ProcessResponseXML;
        var url = page + "?MainDep=" +  $('input[name=chkSE]:checked').val() + "&Country=" + document.getElementById("Country").value;
        objSE.open("POST", url, true);
        objSE.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        objSE.send(null);
    }
    return false;
}
function ProcessResponseXML() {
    if (objSE.readyState == 4) {
        if (objSE.status == 200) { initTraverse(objSE.responseText); }
        else { alert("Error retrieving data!"); }
    }
}
var desHe, desEn;
var ddlDestination = document.getElementById("Destination");
var xmlDoc;
function traverse(tree) {
    if (tree.hasChildNodes()) {
        var nodes = tree.childNodes.length;
        if (setCmb == "des") {

            for (var i = 0; i < tree.childNodes.length; i++) {
                traverse(tree.childNodes(i));
                if (tree.tagName == "DesEn") { desEn = tree.text; }
                if (tree.tagName == "DesHe") {
                    var listItem;
                    desHe = tree.text;
                    listItem = new Option(desHe, desEn, false, false);
                    document.all["Destination"].add(listItem);
                }
            }
        } else {
            for (var i = 0; i < tree.childNodes.length; i++) {
                traverse(tree.childNodes(i));
                if (tree.tagName == "CountryEn") { desEn = tree.text; }
                if (tree.tagName == "CountryHe") {
                    var listItem;
                    desHe = tree.text;
                    listItem = new Option(desHe, desEn, false, false);
                    document.all["Country"].add(listItem);
                }
            }
        }
    }
}
function initTraverse(file) {
    loadXML(file);
    var doc = xmlDoc.documentElement;
    alert("initTraverse = ddlDestination.options.length = " + ddlDestination.options.length);
    for (var count = ddlDestination.options.length - 1; count > -1; count--) {
        ddlDestination.options[count] = null;
    }
    traverse(doc);
}
function setCountryBlank() {
    var ddlCountry = document.getElementById("Country");
    for (var count = ddlCountry.options.length - 1; count > -1; count--) {
        ddlCountry.options[count] = null;
    }
    listItem = new Option("נא בחר מדינה", "", false, false);
    document.all["Country"].add(listItem);
}
function SetDesBlank() {
    var ddlDestination = document.getElementById("Destination");
    for (var count = ddlDestination.options.length - 1; count > -1; count--) {
        ddlDestination.options[count] = null;
    }
    var listItem;
    listItem = new Option("נא בחר יעד", "", false, false);
    document.all["Destination"].add(listItem);
}
//-------------------------------------------//
//  Ogusta
var cityArr = new Array();
cityArr['411'] = new Array();
cityArr['411'][0] = new Array();
cityArr['411'][0]['ID'] = 45;
cityArr['411'][0]['Title'] = "מרסיי";
cityArr['411'][1] = new Array();
cityArr['411'][1]['ID'] = 64;
cityArr['411'][1]['Title'] = "אלזאס";
cityArr['411'][2] = new Array();
cityArr['411'][2]['ID'] = 14;
cityArr['411'][2]['Title'] = "ליון";
cityArr['411'][3] = new Array();
cityArr['411'][3]['ID'] = 12;
cityArr['411'][3]['Title'] = "פריז";
cityArr['411'][4] = new Array();
cityArr['411'][4]['ID'] = 59;
cityArr['411'][4]['Title'] = "סטרסבורג";
cityArr['411'][5] = new Array();
cityArr['411'][5]['ID'] = 46;
cityArr['411'][5]['Title'] = "אקס אן פרובאנס";
cityArr['411'][6] = new Array();
cityArr['411'][6]['ID'] = 28;
cityArr['411'][6]['Title'] = "פרובאנס";
cityArr['411'][7] = new Array();
cityArr['411'][7]['ID'] = 29;
cityArr['411'][7]['Title'] = "נורמנדי";
cityArr['411'][8] = new Array();
cityArr['411'][8]['ID'] = 37;
cityArr['411'][8]['Title'] = "איזור פריז";
cityArr['412'] = new Array();
cityArr['412'][0] = new Array();
cityArr['412'][0]['ID'] = 17;
cityArr['412'][0]['Title'] = "ברוז'";
cityArr['412'][1] = new Array();
cityArr['412'][1]['ID'] = 16;
cityArr['412'][1]['Title'] = "בריסל";
cityArr['413'] = new Array();
cityArr['413'][0] = new Array();
cityArr['413'][0]['ID'] = 63;
cityArr['413'][0]['Title'] = "מיאמי";
cityArr['413'][1] = new Array();
cityArr['413'][1]['ID'] = 21;
cityArr['413'][1]['Title'] = "סן פרנסיסקו";
cityArr['413'][2] = new Array();
cityArr['413'][2]['ID'] = 20;
cityArr['413'][2]['Title'] = "בוסטון";
cityArr['413'][3] = new Array();
cityArr['413'][3]['ID'] = 19;
cityArr['413'][3]['Title'] = "וושינגטון";
cityArr['413'][4] = new Array();
cityArr['413'][4]['ID'] = 18;
cityArr['413'][4]['Title'] = "ניו יורק";
cityArr['413'][5] = new Array();
cityArr['413'][5]['ID'] = 42;
cityArr['413'][5]['Title'] = "לוס אנג'לס";
cityArr['413'][6] = new Array();
cityArr['413'][6]['ID'] = 43;
cityArr['413'][6]['Title'] = "שיקאגו";
cityArr['414'] = new Array();
cityArr['414'][0] = new Array();
cityArr['414'][0]['ID'] = 38;
cityArr['414'][0]['Title'] = "איזור לונדון";
cityArr['414'][1] = new Array();
cityArr['414'][1]['ID'] = 13;
cityArr['414'][1]['Title'] = "לונדון";
cityArr['415'] = new Array();
cityArr['415'][0] = new Array();
cityArr['415'][0]['ID'] = 47;
cityArr['415'][0]['Title'] = "קרדיף";
cityArr['415'][1] = new Array();
cityArr['415'][1]['ID'] = 66;
cityArr['415'][1]['Title'] = "דרום ווילס";
cityArr['415'][2] = new Array();
cityArr['415'][2]['ID'] = 65;
cityArr['415'][2]['Title'] = "צפון ווילס";
cityArr['415'][3] = new Array();
cityArr['415'][3]['ID'] = 67;
cityArr['415'][3]['Title'] = "מרכז ווילס";
cityArr['415'][4] = new Array();
cityArr['415'][4]['ID'] = 68;
cityArr['415'][4]['Title'] = "מערב ווילס";
cityArr['415'][5] = new Array();
cityArr['415'][5]['ID'] = 69;
cityArr['415'][5]['Title'] = "מזרח ווילס";
cityArr['416'] = new Array();
cityArr['416'][0] = new Array();
cityArr['416'][0]['ID'] = 49;
cityArr['416'][0]['Title'] = "אדינבורו";
cityArr['416'][1] = new Array();
cityArr['416'][1]['ID'] = 48;
cityArr['416'][1]['Title'] = "גלזגו";
cityArr['417'] = new Array();
cityArr['417'][0] = new Array();
cityArr['417'][0]['ID'] = 22;
cityArr['417'][0]['Title'] = "דבלין";
cityArr['418'] = new Array();
cityArr['418'][0] = new Array();
cityArr['418'][0]['ID'] = 24;
cityArr['418'][0]['Title'] = "ברצלונה";
cityArr['418'][1] = new Array();
cityArr['418'][1]['ID'] = 25;
cityArr['418'][1]['Title'] = "מדריד";
cityArr['418'][2] = new Array();
cityArr['418'][2]['ID'] = 27;
cityArr['418'][2]['Title'] = "גליסיה";
cityArr['418'][3] = new Array();
cityArr['418'][3]['ID'] = 56;
cityArr['418'][3]['Title'] = "קנטאבריה";
cityArr['418'][4] = new Array();
cityArr['418'][4]['ID'] = 26;
cityArr['418'][4]['Title'] = "אנדלוסיה";
cityArr['418'][5] = new Array();
cityArr['418'][5]['ID'] = 61;
cityArr['418'][5]['Title'] = "קטאלוניה";
cityArr['418'][6] = new Array();
cityArr['418'][6]['ID'] = 44;
cityArr['418'][6]['Title'] = "אסטוריה";
cityArr['419'] = new Array();
cityArr['419'][0] = new Array();
cityArr['419'][0]['ID'] = 50;
cityArr['419'][0]['Title'] = "פירנצה";
cityArr['419'][1] = new Array();
cityArr['419'][1]['ID'] = 2;
cityArr['419'][1]['Title'] = "רומא";
cityArr['420'] = new Array();
cityArr['420'][0] = new Array();
cityArr['420'][0]['ID'] = 15;
cityArr['420'][0]['Title'] = "אמסטרדם";
cityArr['420'][1] = new Array();
cityArr['420'][1]['ID'] = 51;
cityArr['420'][1]['Title'] = "האג";
cityArr['421'] = new Array();
cityArr['421'][0] = new Array();
cityArr['421'][0]['ID'] = 41;
cityArr['421'][0]['Title'] = "פרנקפורט";
cityArr['421'][1] = new Array();
cityArr['421'][1]['ID'] = 62;
cityArr['421'][1]['Title'] = "המבורג";
cityArr['421'][2] = new Array();
cityArr['421'][2]['ID'] = 33;
cityArr['421'][2]['Title'] = "מינכן";
cityArr['421'][3] = new Array();
cityArr['421'][3]['ID'] = 32;
cityArr['421'][3]['Title'] = "ברלין";
cityArr['423'] = new Array();
cityArr['423'][0] = new Array();
cityArr['423'][0]['ID'] = 31;
cityArr['423'][0]['Title'] = "פראג";
cityArr['424'] = new Array();
cityArr['424'][0] = new Array();
cityArr['424'][0]['ID'] = 30;
cityArr['424'][0]['Title'] = "אתונה";
cityArr['425'] = new Array();
cityArr['425'][0] = new Array();
cityArr['425'][0]['ID'] = 39;
cityArr['425'][0]['Title'] = "איסטנבול";
cityArr['426'] = new Array();
cityArr['426'][0] = new Array();
cityArr['426'][0]['ID'] = 36;
cityArr['426'][0]['Title'] = "ציריך";
cityArr['427'] = new Array();
cityArr['427'][0] = new Array();
cityArr['427'][0]['ID'] = 40;
cityArr['427'][0]['Title'] = "קייפטאון";
cityArr['429'] = new Array();
cityArr['429'][0] = new Array();
cityArr['429'][0]['ID'] = 54;
cityArr['429'][0]['Title'] = "ליובליאנה";
cityArr['430'] = new Array();
cityArr['430'][0] = new Array();
cityArr['430'][0]['ID'] = 60;
cityArr['430'][0]['Title'] = "בודפסט";
cityArr['431'] = new Array();
cityArr['431'][0] = new Array();
cityArr['431'][0]['ID'] = 35;
cityArr['431'][0]['Title'] = "וינה";
cityArr['431'][1] = new Array();
cityArr['431'][1]['ID'] = 34;
cityArr['431'][1]['Title'] = "זלצבורג";
function addOption(selectCnt, optValue, optText) {
    var opt = document.createElement("OPTION");
    selectCnt.options[selectCnt.options.length] = opt
    opt.value = optValue
    opt.innerHTML = optText
}
function removeOptions(cnt) {
    while (cnt.options[0] != null)
        cnt.options[0] = null
}
function onCountryChanged(val) {
    var currentCountry = cityArr[val]
    var cityCnt = document.getElementById('ID_HeaderCity')
    removeOptions(cityCnt)
    for (var i = 0; i < currentCountry.length; i++) {
        current = currentCountry[i];
        addOption(cityCnt, current['ID'], current['Title']);
    }
}
function ogu_submit() {
    var msg = "";
    var coun = document.getElementById("FORM_HeaderCountry").value;
    var city = document.getElementById("ID_HeaderCity").value;
    var cat = document.getElementById("ID_HeaderCategory").value;
    if (coun == "") {msg = msg + "אנא בחר מדינה \n";}
    if (city == "") {msg = msg + "אנא בחר עיר/איזור \n";}
    if (cat == "") {msg = msg + "אנא בחר נושא \n";}
    if (msg != "") {alert(msg); return false;}
    var link = "http://www.netravel.co.il/ogusta/?reUrl=http://www.ogusta.mobi/search.php$$$FORM_HeaderCountry=" + coun + "$$FORM_HeaderCity=" + city + "$$FORM_HeaderCategory=" + cat;
    SearchWin = window.open(link, '_top');
    SearchWin.focus();
}
