﻿




var currentSubmenu = 0;
var displayedSubmenu, subMenuTimer;
//var m_oLanguage = "1023";
//var m_oHebLang = "1023";
//var m_oEnLang = "1033";
//var m_oRuLang = "1049";
//var m_oTab1 = "_ctl0_ContentPlaceHolder_imgFirstTab"
//var m_oTab2 = "_ctl0_ContentPlaceHolder_imgSecondTab"
//var m_oTab3 = "_ctl0_ContentPlaceHolder_imgThirdTab";

//for validating inputs
var inputFieldsCollection = null;
var InputFieldIdx = 0;

//the variables bellow get their values in MasterPages

//the following variables take their values from CSSIncludes.js
var appPath = "/ELAL";
var curLang_old = "IL";
/*var curLang="IL";
var templateName = "Homepage";   */

//the following variables take their values from SearchBox.ascx
var ObjTxtSearch;
var actionUrl;
var SearchSite;


//the following variables take their values from FrequentFlyerSignIn.ascx
var m_LogedInUserTable; // = '_ctl0_ContentPlaceHolder_FrquentFlyerSignIn1_LogedInUserTable';
var m_logInSpan; // = '_ctl0_ContentPlaceHolder_FrquentFlyerSignIn1_logInSpan';
var m_SecretCode; // = '_ctl0:ContentPlaceHolder:FrquentFlyerSignIn1:SecretCode';
var m_Member; // = '_ctl0:ContentPlaceHolder:FrquentFlyerSignIn1:Member';
//var m_RegionChannel = 'Hebrew'; //<%=regionChannel%>; 
var m_UpdatePasswordUrl = '/States/General/UpdatePassword'; //<%=ELAL.Constants.UpdatePasswordUrl %>

//the following variables take their values from eBooking.ascx
var FromParamId;
var ToParamId;
function geteBookingParams(FromParam, ToParam) {
    FromParamId = FromParam;
    ToParamId = ToParam;
}


var objDdlFrom = document.getElementById(FromParamId);
//document.getElementById('_ctl0_ContentPlaceHolder_AuthoringModeContainer5_eBooking_From');
//document.getElementById('<%=From.ClientID %>');
var objDdlTo = document.getElementById(ToParamId);
//document.getElementById('_ctl0_ContentPlaceHolder_AuthoringModeContainer5_eBooking_To');               
//document.getElementById('<%=To.ClientID %>');
var numOfDayToAdd = 8;
//<%=DatePickerUC2.numOfDaysToAddTo_selectedDay %>;
//for javascript file use (DatePicker)
var objDatePicker_1; // = document.getElementById('_ctl0_ContentPlaceHolder_AuthoringModeContainer5_eBooking_DatePickerUC1_RadDatePicker1');    //<%=DatePickerUC1.RadClientID %>;
var objDatePicker_2; // = document.getElementById('_ctl0_ContentPlaceHolder_AuthoringModeContainer5_eBooking_DatePickerUC2_RadDatePicker1');    //<%=DatePickerUC2.RadClientID %>;
var sRunCabin = 2; // this is the value of <%=CabinIndex %> used in eBooking.ascx
var m_RegionChannel;

var subMenu;

function getLogInParams(logedInUserTable, logInSpan, secretCode, member, cards_bottom, tdErr) {
    m_LogedInUserTable = logedInUserTable;
    m_logInSpan = logInSpan;
    m_SecretCode = secretCode;
    m_Member = member;
    m_cards_bottom = cards_bottom;
    m_tdErr = tdErr;
}
function getRegionChannelParam(regionChannel) {
    //alert(param);
    m_RegionChannel = regionChannel;
}
window.onload = function() {
    if (document.getElementsByName("BrowserType").length > 0)
        document.getElementsByName("BrowserType")[0].value = navigator.appName;

    if (document.getElementsByName("Version").length > 0)
        document.getElementsByName("Version")[0].value = navigator.appVersion;

    if (document.getElementsByName("USR").length > 0)
        document.getElementsByName("USR")[0].value = navigator.userAgent;

    RunCabin(sRunCabin);
}
// this function is needed by the sub menu
function showSubMenu(menuItem) {
    if (displayedSubmenu == null) {
        displayedSubmenu = currentSubmenu;
    }

    window.clearTimeout(subMenuTimer);

    var subMenus = document.getElementById(subMenu).getElementsByTagName("DIV");
    if (subMenus != null) {
        subMenus[displayedSubmenu].style.display = "none";
        subMenus[menuItem].style.display = "block";
    }
    displayedSubmenu = menuItem;
}

//from homepage
//this function hides or shows the div with the terms and conditions
function changeDivDisplay(div) {
    if (div && div.style) {
        if (div.style.display == "none")
            div.style.display = "";
        else
            div.style.display = "none";



    }
}

//used in eBooking.ascx to hide divs

//function that creates a form and submits the informations
function createFormAndSubmit(containerId, formName, formAttributes,
inputsAttributes, submitName, clickSubmitBtn) {


    /*********************** Insructions *****************************
    containerId -> use "" if u dont use container
    formAttributes -> attName1=attValue1$attName2=attValue2
    inputsAttributes -> input1Name=input1Value$input2Name=input2Value
    ******************************************************************/
    // set the form attributes

    var frm = document.createElement('form');
    frm.setAttribute("name", formName);

    var arrFormAttributes = formAttributes.split("$");
    var nameVal, i, valFormAtt;
    for (i = 0; i < arrFormAttributes.length; i++) {
        nameVal = arrFormAttributes[i].split("=");
        valFormAtt = arrFormAttributes[i].substring(nameVal[0].length + 1, arrFormAttributes[i].length)
        frm.setAttribute(nameVal[0], valFormAtt/*nameVal[1]*/);
    }

    // set the inputs attributes
    var arrInputsAttributes = inputsAttributes.split("$");
    var inputHidden;
    for (i = 0; i < arrInputsAttributes.length; i++) {

        nameVal = arrInputsAttributes[i].split("=");
        inputHidden = document.createElement("input");
        inputHidden.setAttribute("name", nameVal[0]);
        inputHidden.setAttribute("type", "hidden");
        var val1 = arrInputsAttributes[i].substring(nameVal[0].length + 1, arrInputsAttributes[i].length);
        inputHidden.setAttribute("value", val1);
        frm.appendChild(inputHidden);
    }
    //  alert(arrInputsAttributes);
    // set the submit button
    var submitBtn = document.createElement("input");
    submitBtn.setAttribute("name", submitName);
    submitBtn.setAttribute("type", "submit");
    submitBtn.setAttribute("value", "");
    frm.appendChild(submitBtn);

    // add the form to the document
    var contId = document.getElementById(containerId);
    if (contId == null) {
        document.body.appendChild(frm);
    }
    else {
        contId.appendChild(frm);
    }

    // submit the form
    if (clickSubmitBtn == true) {
        submitBtn.click();
    }
    else
        frm.submit();

    //alert(frm.innerHTML)

    // remove the form
    if (frm.parentNode) {
        frm.parentNode.removeChild(frm);
    }
}


//use those variables for function OrderBonusFlightClick and function eBookingClicked
sClubMember = "";
sClubCode = "";
//get a string which contains user and password (in the format user#password)
//and init variables sClubMember and sClubCode
function frquentFlyerUserPassword(str) {
    var myArray = str.split("#");

    if (myArray != null && myArray.length > 0) {
        sClubMember = myArray[0];
    }
    if (myArray != null && myArray.length > 1) {
        sClubCode = myArray[1];
    }
}

//used in eBooking.ascx
//OrderBonusFlightClick
//collect form inputs
//and send it to formAction(ex:formAction="http://booking.elal.co.il/bonus/bonusInit.do")
//collect userName and password from session 
//if no date in session take infrmation in the inputUserID and inputPasswordId :-)
//in u dont send inputUserID and inputPasswordId --> it OK (in this case it look only in seesion)
function OrderBonusFlightClick(formAction, inputUserID, inputPasswordId) {
    var formName = "OrderBonusFlightForm";
    var formAttributes =
	"target=_parent" + //if no parent so its ok: it opens like: "_self"
	"$method=post" +
	"$action=" + formAction;
    var inputsAttributes = "";
    //get password and user	FrquentFlyer - from session
    AJAX.syncWithCallback('/ELAL/Pages/AjaxPages/GetFrquentFlyerUserPassword.aspx', "", "frquentFlyerUserPassword");
    inputsAttributes += "prev_page=get_details"
    //matmid user 	
    if (sClubMember.length == 0) {
        //no info in session take from inputUserID
        obj = document.getElementById(inputUserID);
        if (obj != null) {
            sClubMember = obj.value;
        }
    }
    inputsAttributes += "$memberNumber=" + sClubMember; //sClubMember defines in this file
    //matmid password
    if (sClubCode.length == 0) {
        //no info in session take from inputPasswordId
        obj = document.getElementById(inputPasswordId);
        if (obj != null) {
            sClubCode = obj.value;
        }
    }
    inputsAttributes += "$password=" + sClubCode; //sClubCode defines in this file
    createFormAndSubmit("formContainer", formName, formAttributes,
	inputsAttributes, "fares", false);
}


//used in eBooking.ascx
//ebooking flight
//collect form inputs
//and send it to formAction(ex:formAction="http://booking.elal.co.il/ebooking/action/get-elal-booking")
//before send-> clear the choises...
function eBookingClicked(formAction, passportNum, agentName, agent, sessionId, pageType, SunDorCodes) {

    var formName = "requirementsform";

    var objckbBounosAndCash = document.getElementById("ckbEmission2");
    if (objckbBounosAndCash != null) {
        if (objckbBounosAndCash.checked) {
            if (slinkIfChkBonusAndCash != null) {
                formAction = slinkIfChkBonusAndCash;
            }
        }
    }

    var formAttributes =
	"target=" +
	"$method=post" +
	"$action=" + formAction;

    var inputsAttributes = "";
    // origin
    //objDdlFrom defined in usercontrol ebooking.ascx

    if (pageType == "amadeus") /*checking page type - added by Yaron Zada */
    {
        //var originSelectedValue = objFrom.title.toUpperCase();
        var originSelectedValue = objFrom.getAttribute("cityCode").toUpperCase();
        inputsAttributes += "origin=" + originSelectedValue;

        // destination	
        // var destSelectedValue = objTo.title.toUpperCase();
        var destSelectedValue = objTo.getAttribute("cityCode").toUpperCase();
        inputsAttributes += "$destination=" + destSelectedValue;

    }
    else {

        var originSelectedValue = objDdlFrom.options[objDdlFrom.selectedIndex].value;
        //clean * for sundor
        inputsAttributes += "origin=" + originSelectedValue.replace(/\*/g, "");
        //clear choise to default
        objDdlFrom.selectedIndex = 0;

        // destination	
        //objDdlTo defined in usercontrol ebooking.ascx
        var destSelectedValue = objDdlTo.options[objDdlTo.selectedIndex].value;
        inputsAttributes += "$destination=" + destSelectedValue.replace(/\*/g, "");
        //clear choise to default
        objDdlTo.selectedIndex = 0;
    }

    // journeyType
    var journeyTypeValue;
    var objRdbOneWay = document.getElementById("oneWayRadio");
    var objRdbTwoWay = document.getElementById("twoWayRadio");

    if (objRdbOneWay.checked == true) {
        journeyTypeValue = objRdbOneWay.value;
        //when one-way radio button is checked returnFrom & returnTo don't get any value
        inputsAttributes += "$returnFrom=";
        inputsAttributes += "$returnTo=";
    }
    else if (objRdbTwoWay.checked == true) // changed by linoy at 7/4/2008
    {
        journeyTypeValue = objRdbTwoWay.value;
        //when two-way radio button is checked the value in returnFrom & returnTo will switched
        inputsAttributes += "$returnFrom=" + destSelectedValue.replace(/\*/g, "");
        inputsAttributes += "$returnTo=" + originSelectedValue.replace(/\*/g, "");
    }
    else // added by linoy at 7/4/2008 - Edited by Yaron zada at 11/9/2008
    {
        if (pageType == "amadeus") {
            journeyTypeValue = objRdbRadioMultyCity.value;
            //.title if(objDdlreturnFrom.title != "" && objDdlreturnTo.title != "")
            if (objDdlreturnFrom.getAttribute("cityCode") != "" && objDdlreturnTo.getAttribute("cityCode") != "") {
                //inputsAttributes+="$returnFrom="+objDdlreturnFrom.title.toUpperCase();
                //  inputsAttributes+="$returnTo="+objDdlreturnTo.title.toUpperCase();
                inputsAttributes += "$returnFrom=" + objDdlreturnFrom.getAttribute("cityCode").toUpperCase();
                inputsAttributes += "$returnTo=" + objDdlreturnTo.getAttribute("cityCode").toUpperCase();
            }
            else {
                inputsAttributes += "$returnFrom=" + destSelectedValue;
                inputsAttributes += "$returnTo=" + originSelectedValue;
            }
        }
        else {
            journeyTypeValue = document.getElementById('diffrenetDistanation').value;
            inputsAttributes += "$returnFrom=" + objDdlreturnFrom.options[objDdlreturnFrom.selectedIndex].value.replace(/\*/g, "");
            inputsAttributes += "$returnTo=" + objDdlreturnTo.options[objDdlreturnTo.selectedIndex].value.replace(/\*/g, "");
        }

    }

    inputsAttributes += "$journeyType=" + journeyTypeValue;
    //alert(inputsAttributes);
    //clear choise to default
    objRdbOneWay.checked = false;
    objRdbTwoWay.checked = true;

    // departDate
    sDateDepart = objDatePicker_1.GetDate();
    // departMonth
    iMonthDepart = sDateDepart.getMonth();
    inputsAttributes += "$departMonth=" + iMonthDepart;
    // departDay
    iDayDepart = sDateDepart.getDate();
    inputsAttributes += "$departDay=" + iDayDepart;

    // returnDate
    sDateReturn = objDatePicker_2.GetDate();
    // returnMonth
    iMonthReturn = sDateReturn.getMonth();
    inputsAttributes += "$returnMonth=" + iMonthReturn;
    // returnDay
    iDayReturn = sDateReturn.getDate();
    inputsAttributes += "$returnDay=" + iDayReturn;

    // cabin
    var objCabin = document.getElementById("TicketType");
    var cabinSelectedValue = objCabin.options[objCabin.selectedIndex].value;
    inputsAttributes += "$cabin=" + cabinSelectedValue;
    //clear choise to default
    objCabin.selectedIndex = 0;

    // adults
    var objAdults = document.getElementById("NumOfAdults");
    var adultsSelectedValue = objAdults.options[objAdults.selectedIndex].value;
    inputsAttributes += "$adults=" + adultsSelectedValue;
    //clear choise to default
    objAdults.selectedIndex = 0;


    //Golden Ages
    var objGoldenAges = document.getElementById("NumOfGoldenAges");
    var GoldenAgesSelectedValue = objGoldenAges.options[objGoldenAges.selectedIndex].value;
    inputsAttributes += "$goldenAges=" + GoldenAgesSelectedValue;
    //clear choise to default
    objGoldenAges.selectedIndex = 0;

    //Students
    var objStudents = document.getElementById("NumOfStudents");
    var StudentsSelectedValue = objStudents.options[objStudents.selectedIndex].value;
    inputsAttributes += "$students=" + StudentsSelectedValue;
    //clear choise to default
    objStudents.selectedIndex = 0;

    //Youth + Teenagers
    var objYouths = document.getElementById("NumOfYouths");
    var objTeenagers = document.getElementById("NumOfTeenagers");
    var YouthsSelectedValue = objYouths.options[objYouths.selectedIndex].value; 
    var TeenagersSelectedValue = objTeenagers.options[objTeenagers.selectedIndex].value;
    var SumSelectedValue = parseInt(YouthsSelectedValue) + parseInt(TeenagersSelectedValue);
    inputsAttributes += "$youths=" + SumSelectedValue; 
    //inputsAttributes += "$youths=" + YouthsSelectedValue;
    //clear choise to default
    objYouths.selectedIndex = 0;
    objTeenagers.selectedIndex = 0;


    // children
    var objChildren = document.getElementById("NumOfKids");
    var childrenSelectedValue = objChildren.options[objChildren.selectedIndex].value;
    inputsAttributes += "$children=" + childrenSelectedValue;
    //clear choise to default
    objChildren.selectedIndex = 0;

    // infants
    var objInfants = document.getElementById("NumOfBabies");
    var infantsSelectedValue = objInfants.options[objInfants.selectedIndex].value;
    inputsAttributes += "$infants=" + infantsSelectedValue;
    //clear choise to default
    objInfants.selectedIndex = 0;


    //add Bonus 
    var objckbEmission = document.getElementById("ckbEmission");

    // arameter for booking discount with bonus points
    if (objckbBounosAndCash != null) {
        if (objckbBounosAndCash.checked) {
            if (slinkIfChkBonusAndCash != null) {
                inputsAttributes += "$bonusDiscount=on";
            }
        }
    }


    // check if We Arrived from Travel Agent page
    var isAgent = false;
    if (agent != null && agent != "") {
        isAgent = true;
    }

    var sysId = checkSystemId(pageType, originSelectedValue, destSelectedValue, SunDorCodes, isAgent)
    inputsAttributes += "$SYSTEMID=" + sysId;

    //add Voucher
    var objVoucherCode = document.getElementById("txtVoucher");
    var txtVoucherCode = "";
    if (objVoucherCode != null) {
        txtVoucherCode = objVoucherCode.value;
        inputsAttributes += "$coupons=" + txtVoucherCode;
    }
    //add shopper	
    var objCkbFlexible = document.getElementById("ckbFlexible");
    var optDepPeriod = 3; //default value
    var optRetPeriod = 3; //default value
    //if checkbox is checked take value from ddl select_depPeriod and ddl select_retPeriod
    //else put the defulte values

    if (objCkbFlexible != null && objCkbFlexible.checked) {
        //take options from ddl select_depPeriod and ddl select_retPeriod
        try {
            objDepPeriod = document.getElementById("select_depPeriod");
            optDepPeriod = objDepPeriod.selectedIndex;
            objRetPeriod = document.getElementById("select_retPeriod");
            optRetPeriod = objRetPeriod.selectedIndex;
            //clear choise to default
            objDepPeriod.selectedIndex = 3;
            objDepPeriod.style.display = "none";
            objRetPeriod.selectedIndex = 3;
            objRetPeriod.style.display = "none";

        }
        catch (ex) {
            optDepPeriod = 3; //default value
            optRetPeriod = 3; //default value	        
        }


    }

    if (pageType == 'amadeus') {
        optDepPeriod = 3; //
        optRetPeriod = 3; //
    }

    if (objckbEmission != null && objckbEmission.checked) {
        optDepPeriod = 7; //
        optRetPeriod = 7; //
    }
    inputsAttributes += "$depPeriod=" + optDepPeriod;
    inputsAttributes += "$retPeriod=" + optRetPeriod;
    //clear choise to default
    if (objCkbFlexible != null)
        objCkbFlexible.checked = false;
    //end shoper

    //FrquentFlyer - password and user
    //get password and user	FrquentFlyer - from session
    AJAX.syncWithCallback('/ELAL/Pages/AjaxPages/GetFrquentFlyerUserPassword.aspx', "", "frquentFlyerUserPassword");
    //matmid user 
    inputsAttributes += "$userName=" + sClubMember; //sClubMember defines in this file
    //matmid password
    inputsAttributes += "$password=" + sClubCode; //sClubCode defines in this file
    //end FrquentFlyer	


    //inputsAttributes+="$agent=-1";
    inputsAttributes += "$agentGroup=-1";
    inputsAttributes += "$departTime=-1";
    inputsAttributes += "$returnTime=-1";
    inputsAttributes += "$operators=-1";

    //set LANG
    //Note: Important -- temporary there is no support for other languages
    //turn back the code
    if (curLang == "IL") {

        inputsAttributes += "$LANG=" + curLang;
    }
    else {
            if (curLang == "DE") {

                inputsAttributes += "$LANG=GR";
            }
            else{
        inputsAttributes += "$LANG=" + innerLang;
        }
    }

    //	if(curLang == "EN")
    //	{
    //	    inputsAttributes+="$LANG="+innerLang;
    //	}
    //	else
    //	{
    //	    inputsAttributes+="$LANG="+curLang;
    //	}

    //set parameters if it's called by homepagefamily
    //if(templateName != null && templateName == "HomepageFamily")
    
    if (objIsFamily || objIsPartner) {
        inputsAttributes += "$passportNum=" + passportNum;
        inputsAttributes += "$sessionId=" + sessionId;
        //inputsAttributes+="$nextPage=direct";
    }

    if (objIsFamily) {
        inputsAttributes += "$isSpecialSale=TRUE"
        //inputsAttributes+="$nextPage=direct";	   
    }


    // add Agent Code and AgentName
    if (agent != null && agent != "") {
        inputsAttributes += "$agent=" + agent;

        if (agentName != null && agentName != "") {
            inputsAttributes += "$agentName=" + agentName;
        }
    }



    if (sClubMember != '' && sClubCode != '') {
        //add the sessionId to the parameters
        inputsAttributes += "$sessionId=" + sessionId;
    }

    //alert(inputsAttributes);
    createFormAndSubmit("formContainer", formName, formAttributes,
	inputsAttributes, "fares", false);


    //jump
    //END Ebboking !!!

}

//used in FrequentFlyer sign in to validate password input
function validateContainer(containerId) {
    if (!containerId)
        return;

    var rtn = true;

    var inputFields = window.document.getElementById(containerId).getElementsByTagName('input');
    return rtn;
}

//used in FrequentFlyer sign in
//special care for page enterKeyFrquentFlyerSignIn
//when press "enter" go check user and password
//otherwise need to return the "td_orderBonus"(labelShowID) instead of "tdErr"(labelHideID)
function enterKeyFrquentFlyerSignIn(e, btn, container2Check, labelShowID, labelHideID) {
    if (e.keyCode == 13) {
        if (container2Check == null)
            __doPostBack(btn, ''); // without validation
        else {
            if (validateContainer(container2Check) == true)
                __doPostBack(btn, ''); // with validation
        }
    }
    else {
        //make sure that labelShowID is display and labelHideID is not
        objLabelShowID = document.getElementById(labelShowID);
        objLabelHideID = document.getElementById(labelHideID);
        if (objLabelShowID != null && objLabelHideID != null) {
            objLabelShowID.style.display = '';
            objLabelHideID.style.display = 'none';
        }
    }
}

//used in eBooking.ascx
//showHide_select_depRetPeriod
//opposite dispaly value of 2 ddl
//*if ddl style display is none--> change to "" else --> change to "none"
//**allways make sure that the default selected value of the 2 ddl is  option 3     
function showHide_select_depRetPeriod() {
    var objSelectDepPeriod = document.getElementById("select_depPeriod");
    var objSelectRetPeriod = document.getElementById("select_retPeriod");

    if (objSelectDepPeriod != null && objSelectRetPeriod != null) {
        //*change display:
        //if none--> change to ""
        //if "" --> change to "none"

        if (document.getElementById("ckbFlexible").checked == true) {
            objSelectDepPeriod.style.display = "";
            objSelectRetPeriod.style.display = "";
        }
        else {
            objSelectDepPeriod.style.display = "none";
            objSelectRetPeriod.style.display = "none";
        }

        //**allways make sure that the default selected value of the 2 ddl is  option 3     
        if (objSelectDepPeriod.style.display == "" && objSelectRetPeriod.style.display == "") {
            objSelectDepPeriod.selectedIndex = 3;
            objSelectRetPeriod.selectedIndex = 3;
        }
    }

}

//used in eBooking.ascx
//this function is used by chkEmission for display/hidde ddl with ticket type
function DisableFlexiblity(idString) {

    clearAtherChk(idString)
    var updateReservationLink;
    if (linkToReservationID != null) {
        updateReservationLink = document.getElementById(linkToReservationID);
    }


    var ckbEmission = document.getElementById("ckbEmission");
    var ckbEmission2 = document.getElementById("ckbEmission2");
    var DDL_TicketType = document.getElementById("TicketType");
    var DDL_NumOfGoldenAges = document.getElementById("NumOfGoldenAges");
    var DDL_NumOfYouths = document.getElementById("NumOfYouths");
    var DDL_NumOfStudents = document.getElementById("NumOfStudents");
    var DDL_NumOfBabies = document.getElementById("NumOfBabies");
    var DDL_NumOfKids = document.getElementById("NumOfKids");

    if (ckbEmission.checked == true) {
        if (updateReservationLink != null) {
            updateReservationLink.href = updateReservationLink.href.replace(/RESSYSTEMID=1/, "RESSYSTEMID=4");
        }
        //DDL_TicketType.disabled = true;

        DDL_NumOfGoldenAges.disabled = true;
        DDL_NumOfGoldenAges.value = 0;
        DDL_NumOfGoldenAges.style.backgroundColor = 'LightGrey';

        DDL_NumOfYouths.disabled = true;
        DDL_NumOfYouths.value = 0;
        DDL_NumOfYouths.style.backgroundColor = 'LightGrey';

        DDL_NumOfStudents.disabled = true;
        DDL_NumOfStudents.value = 0;
        DDL_NumOfStudents.style.backgroundColor = 'LightGrey';

        DDL_NumOfBabies.disabled = true;
        DDL_NumOfBabies.value = 0;
        DDL_NumOfBabies.style.backgroundColor = 'LightGrey';

        // DDL_NumOfKids.disabled = true;
        //  DDL_NumOfKids.value = 0;
        // DDL_NumOfStudents.style.backgroundColor='DarkGray';

    }
    else {
        if (updateReservationLink != null) {
            updateReservationLink.href = updateReservationLink.href.replace(/RESSYSTEMID=4/, "RESSYSTEMID=1");
        }
        //DDL_TicketType.disabled = false;

        DDL_NumOfGoldenAges.disabled = false;
        DDL_NumOfGoldenAges.style.backgroundColor = 'White';

        DDL_NumOfYouths.disabled = false;
        DDL_NumOfYouths.style.backgroundColor = 'White';

        DDL_NumOfStudents.disabled = false;
        DDL_NumOfStudents.style.backgroundColor = 'White';

        DDL_NumOfBabies.disabled = false;
        DDL_NumOfBabies.style.backgroundColor = 'White';
        // DDL_NumOfKids.disabled = false;
    }


}


function clearAtherChk(idString) {
    if (idString == "ckbEmission") {
        var ckbEmission = document.getElementById("ckbEmission2");
    }
    if (idString == "ckbEmission2") {
        var ckbEmission = document.getElementById("ckbEmission");
    }
    ckbEmission.checked = false;



}

//this function is used at onMouseOver/onMouseOut event 
function swapImgSrc(id) {
    with (document.getElementById(id)) {
        //alert(attributes["altsrc"].value);
        attributes["altsrc"].value;
        var saveSrc = src;
        src = attributes["altsrc"].value;
        attributes["altsrc"].value = saveSrc;
    }
}


//function used on validating input fields on the form
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };

//function used when validating form input fields
function validateForm(element) {
    var rtn = true;

    if (!element)
    { element = window.document.forms[0] }

    var inputFields = element.getElementsByTagName('input');
    for (var i = inputFields.length - 1; i >= 0; --i) {
        if (inputFields[i].className.indexOf('IWInputField') > -1) {
            if (inputFields[i].attributes["EvaluationID"] == null)
                activateInputField(inputFields[i])

            if (!eval(inputFields[i].attributes["EvaluationID"].value + ".isValid()"))
                rtn = false;
        }
    }

    return rtn;
}

//this function is used at onFocus event
function activateInputField(IFelement) {
    if (inputFieldsCollection == null) {
        inputFieldsCollection = new Array();
    }

    inputFieldsCollection[InputFieldIdx] = new InputField("inputFieldsCollection[" + InputFieldIdx + "]", IFelement);
    InputFieldIdx++;
}

//used in HomePage
//mouse over the Tabs - change the look
function highlightTab(imgTab) {
    //set all tabs to Off
    imgTab1 = document.getElementById(oTab1);
    imgTab2 = document.getElementById(oTab2);
    imgTab3 = document.getElementById(oTab3);

    if (oLanguage == oHebLang) {
        imgTab1.src = imgTab1.src.replace("_hover", "");
        imgTab2.src = imgTab2.src.replace("_hover", "");
        imgTab3.src = imgTab3.src.replace("_hover", "");
        imgTab.src = imgTab.src.replace(".jpg", "_hover.jpg");
    }
    else {
        imgTab1.src = imgTab1.src.replace("_on", "");
        imgTab2.src = imgTab2.src.replace("_on", "");
        imgTab3.src = imgTab3.src.replace("_on", "");
        imgTab.src = imgTab.src.replace(".jpg", "_on.jpg");
    }
}

//used in HomePage
// when we leave the regions of the SecondTab and ThirdTab we
// we will automaticaly select the first tab
function TabMouseOut() {
    oFirstTab = document.getElementById(oTab1);
    highlightTab(oFirstTab);
}

//function used to Trim a string
function Trim(sString) {
    while (sString.substring(0, 1) == ' ')
        sString = sString.substring(1, sString.length);
    while (sString.substring(sString.length - 1, sString.length) == ' ')
        sString = sString.substring(0, sString.length - 1);
    return sString;
}

//used in SearchBox user control
// call search results page with the wannted word
// ObjTxtSearch/actionUrl  is define in UC search.ascx
//function submitSearchBox() {

//    SearchParams = Trim(ObjTxtSearch.value);
//    if (SearchParams.length > 0) {
//        createFormAndSubmit('', 'SRBoxForm', 'action=' + actionUrl, 'q=' + SearchParams + SearchSite + '', 'SRBoxFormSubmit', 'true');
//    }
//}

//this function is used on the "go" button(get BookingDetails)
function SubmitBookingDetails(FormAction, passportNum, agentName, agent, isFamily, sessionId, pageType, SunDorCodes) {

    var StrEror = "";
    var IsEror = false;
    var objFrom = document.getElementById("From");
    var SumPassenger = 0;
    if (IsEror) {
       // alert("test");
    }

    if (IsEror) {
      //  alert("test");
    }
    else {
        /* var ckbEmission = document.getElementById("ckbEmission");
        if(ckbEmission.checked)
        {
        eBookingClicked('http://10.8.5.65:9080/newBooking/initBonus.do','')
        }
        else
        {
        eBookingClicked('http://booking.elal.co.il/ebooking/action/get-elal-booking','')
        } */
        /*eBookingClicked('http://booking.elal.co.il/ebooking/action/get-elal-booking','');*/

        var FormActionBonus = FormAction
     if (document.getElementById("FormActionBonusURL") != null)
    {
       FormActionBonus = document.getElementById("FormActionBonusURL").value;
    
    }
        if (isFamily != null && isFamily == "true") {
            var ckbEmission = document.getElementById("ckbEmission");
            //Note: if ckbEmission == null it means that we arrive here from homepage family
            if (ckbEmission != null && ckbEmission.checked) {
                eBookingClicked(FormActionBonus, passportNum, agentName, agent, sessionId, pageType, SunDorCodes)
            }
            else {
                eBookingClicked(FormAction, passportNum, agentName, agent, sessionId, pageType, SunDorCodes)
            }
        }

        //benny 
        else {

            var ckbEmission = document.getElementById("ckbEmission");
            //Note: if ckbEmission == null it means that we arrive here from homepage family
            if (ckbEmission != null && ckbEmission.checked) {
                eBookingClicked(FormActionBonus, passportNum, agentName, agent, sessionId, pageType, SunDorCodes)
            }
            else {
                eBookingClicked(FormAction, passportNum, agentName, agent, sessionId, pageType, SunDorCodes);
            }

            //eBookingClicked(FormAction,passportNum);
            //end benny
        }
    }
}

//function clearRdb_ebooking
//call this function when click on the AMultyCity radio button
//make the other radiobtns unselected
function clearRdb_ebooking() {

    // journeyType
    var journeyTypeValue;
    var objRdbOneWay = document.getElementById("oneWayRadio");
    var objRdbTwoWay = document.getElementById("twoWayRadio");
    //clear choise
    if (objRdbOneWay != null) {
        objRdbOneWay.checked = false;
    }
    if (objRdbTwoWay != null) {
        objRdbTwoWay.checked = false;
    }
}

//this function is used for the login part
function InputField(evalID, IFelement) {

    this.isValid = function(doFocus) {
        if (this.validateInput())
            return true;

        window.setTimeout(this.getElementAttribute("EvaluationID") + ".blinkErrMsg()", 50);

        if (doFocus != false)
            this.element.focus();

        return false;
    }

    this.blinkErrMsg = function() {
        var errorSpan = document.getElementById(this.element.id + 'ErrSpan');
        if (this.times > 0) {
            --this.times;
            if (errorSpan != null) {
                var curStatus = errorSpan.style.visibility;
                errorSpan.style.visibility = ((curStatus == "visible") ? "hidden" : "visible");
                window.setTimeout(this.getElementAttribute("EvaluationID") + ".blinkErrMsg()", 100);
            }
        }
        else {
            this.times = this.getElementAttribute("blinkingTimes");
            if (errorSpan != null)
                errorSpan.style.visibility = "visible";
        }
    }

    this.doFormat = function() {
        var FORMAT = this.getElementAttribute("format");
        if (this.element.value != "" && FORMAT != null && FORMAT.toLowerCase().indexOf('commadelimiter') > -1) {
            this.element.value = parseFloat(this.element.value.replace(new RegExp(/,/g), ""));

            var idx = (this.element.value.lastIndexOf('.') > -1) ? this.element.value.lastIndexOf('.') : this.element.value.length;

            for (var i = idx - 1; i > 0; --i) {
                if (((i - idx) % 3) == 0)
                    this.element.value = this.element.value.substr(0, i) + "," + this.element.value.substr(i, this.element.value.length);
            }
        }
    }

    this.undoFormatting = function() {
        var FORMAT = this.getElementAttribute("FORMAT");
        var rtn = this.element.value;

        if (FORMAT != null && FORMAT.toLowerCase().indexOf('commadelimiter') > -1)
            rtn = this.element.value.replace(new RegExp(/,/g), "");

        return rtn;
    }
    this.getElementAttribute = function(attName) {
        attValue = this.element.attributes[attName];
        return attValue != null ? attValue.value : attValue;
    }
    this.setElementAttribute = function(attName, attValue) {
        this.element.setAttribute(attName, attValue);
    }

    // Initialize the element
    this.initialize = function() {
        if (this.getElementAttribute("allowed_chars") == null)
            this.setElementAttribute("allowed_chars", "");

        this.ALLOWED_CHARS = this.getElementAttribute("allowed_chars");
        if (this.getElementAttribute("accepts") != null)
            this.fillAllowedChars();

        if (this.getElementAttribute("blinkingTimes") == null)
            this.setElementAttribute("blinkingTimes", 7);

        this.times = this.getElementAttribute("blinkingTimes");

        this.doFormat();
        this.handlePropertyChange();
    }

    this.handlePropertyChange = function() {
        var REQUIRED = this.getElementAttribute("required");
        if (REQUIRED != null && REQUIRED != false && this.element.className.toLowerCase().indexOf('required') < 0) {
            this.element.className += " required";
            this.setElementAttribute("required", "TRUE")
        }
        if (this.getElementAttribute("readonly") == true && this.element.className.toLowerCase().indexOf('readonly') < 0) {
            this.element.className += " " + readonlycss;
        }
    }

    this.markFailedValidation = function() {
        this.element.className = this.element.className.replace(' failedvalidation', '');
        this.element.className += " failedvalidation";
        if (document.getElementById(this.element.id + 'ErrSpan') != null)
            document.getElementById(this.element.id + 'ErrSpan').style.visibility = "visible";

        return false;
    }

    this.markPassedValidation = function() {
        this.element.className = this.element.className.replace(' failedvalidation', '');

        if (document.getElementById(this.element.id + 'ErrSpan') != null)
            document.getElementById(this.element.id + 'ErrSpan').style.visibility = "hidden";

        return true;
    }



    // Internal function to assist validate ID numbers
    function f_add_digits(al_num) {

        var ls_num = String(al_num);

        var ll_sum = 0
        for (var i = 0; i < ls_num.length; i++) {
            ll_sum += parseInt(ls_num.substr(i, 1));
        }
        if (ll_sum > 9) {
            return f_add_digits(ll_sum);
        }
        else {
            return ll_sum;
        }
    }

    this.validateNumericRange = function(rawValue) {
        var numericValue = parseInt(rawValue);
        maxValue = this.getElementAttribute("maxValue");
        minValue = this.getElementAttribute("minValue");
        return ((maxValue == null || numericValue <= maxValue) && (minValue == null || numericValue >= minValue));
    }

    this.validateInput = function() {
        this.element.value = this.element.value.replace(/^\s+|\s+$/, '');

        this.markPassedValidation();

        if (this.element.disabled)
            return true;

        if (this.element.value.length == 0) {
            if (this.getElementAttribute("required"))
                return this.markFailedValidation();
            else
                return true;
        }

        var rawValue = this.undoFormatting();
        if (rawValue.length < this.getElementAttribute("MinLength") || !this.validateNumericRange(rawValue))
            return this.markFailedValidation();

        VALIDATE = this.getElementAttribute("validate");
        VALIDATE = (VALIDATE != null ? VALIDATE.toLowerCase() : "");

        // Email Validation
        if (VALIDATE == "email") {
            if (this.element.value.search(/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/) == -1)
                return this.markFailedValidation();
        }
        else
        // Israel ID Number
            if (VALIDATE == "tznum") {
            var ll_sum = 0;
            ls_num = this.element.value;
            // Get the number and the "Sifrat Bikoret"
            ll_idnum = ls_num.substr(0, ls_num.length - 1);
            ll_sb = ls_num.substr(ls_num.length - 1);

            // Add 0's to the number, if less than 8 digits
            for (var i = 0; i < (9 - ls_num.length); i++) {
                ll_idnum = '0' + ll_idnum;
            }
            // Calculate the resulting number
            for (var i = 0; i < 8; i++) {
                ll_multi = i % 2;
                ll_multi++;
                var ll_digit = f_add_digits(parseInt(ll_idnum.substr(i, 1)) * ll_multi);
                ll_sum += ll_digit;
            }

            // Calculate the Sifrat Bikoret
            ll_csb = 10 - (ll_sum % 10);
            if (ll_csb == 10) ll_csb = 0;
            if (String(ll_csb) != String(ll_sb))
                return this.markFailedValidation();
            else
                this.element.value = ll_idnum + ll_sb;
        }
        else
        // Date DD/MM/YYYY
            if (VALIDATE == "date") {
            var dt = new Date(this.element.value);
            if (dt.toString() == 'NaN')
                return this.markFailedValidation();
        }
        else
        // Everything Else : handle validate as Regular Expression
            if (VALIDATE.length != 0 && this.value.search(VALIDATE) == -1)
            return this.markFailedValidation();


        return true;
    }

    this.fillAllowedChars = function() {
        var ACCEPTS = this.getElementAttribute("accepts").toLowerCase();
        if (ACCEPTS.indexOf('txt') > -1)		//heb, eng, num
        {
            this.rangedFill(32, 126); 		// eng & nums & symbols
            this.rangedFill(1488, 1514); 	// heb
            this.rangedFill(1040, 1103);        // rus

            this.ALLOWED_CHARS += " ";
        }

        if (ACCEPTS.indexOf('heb') > -1)		//only heb
            this.rangedFill(1488, 1514);

        if (ACCEPTS.indexOf('rus') > -1)      //only rus
        {
            this.rangedFill(1040, 1103);
            this.rangedFill(1025, 1025);
            this.rangedFill(1105, 1105);
        }
        if (ACCEPTS.indexOf('eng') > -1)		//only eng
        {
            this.rangedFill(65, 90);
            this.rangedFill(97, 122);
        }

        if (ACCEPTS.indexOf('num') > -1)		//only num
            this.rangedFill(48, 57);

        if (ACCEPTS.indexOf('sym') > -1)		//only symbols
        {
            this.rangedFill(33, 47);
            this.rangedFill(58, 64);
            this.rangedFill(91, 96);
            this.rangedFill(123, 126);
        }
        this.setElementAttribute("allowed_chars", this.ALLOWED_CHARS);
    }

    this.rangedFill = function(from, to) {
        for (var i = from; i <= to; ++i) {
            this.ALLOWED_CHARS += String.fromCharCode(i);
        }
    }


    // Checks if certain character exist in a given string
    charExist = function(chr, str) {
        if (str == "" || str == null)
            return null;
        else
            return (str.indexOf(chr) > -1);
    }

    // Validate by entered char
    validateLength = function(keyCode) {
        return true;
    }


    this.doPaste = function() {
        var maxAllowedLen = this.getElementAttribute("maxLength") - this.element.value.length;


        pastedStringBack = clipboardData.getData("Text");

        var index = 0;
        var pastedString = "";

        while (index < pastedStringBack.length && pastedString.length < maxAllowedLen) {
            var ch = pastedStringBack.charAt(index);

            if ((charExist(ch, this.getElementAttribute("block_chars")) != true
				    && charExist(ch, this.getElementAttribute("allowed_chars")) != false))
                pastedString += ch;

            index++;
        }

        clipboardData.setData("Text", pastedString);

        setTimeout(function() { clipboardData.setData('Text', pastedStringBack); }, 100);
    }


    // Constructor //
    this.isIE = document.all && window.ActiveXObject && navigator.userAgent.toLowerCase().indexOf("msie") > -1 && navigator.userAgent.toLowerCase().indexOf("opera") == -1;
    this.containerIDX = InputFieldIdx;
    this.element = IFelement;
    this.element.setAttribute("EvaluationID", evalID);
    this.ALLOWED_CHARS = "";
    this.times = 7;

    this.initialize();

    this.element.onkeypress = function(ev) {
        if (ev == null) ev = event;

        var keyPressed = eval(this.attributes["EvaluationID"].value + ".isIE") ? ev.keyCode : ev.charCode;

        if (keyPressed != 0) {
            var blockedChars = this.attributes["block_chars"];
            passedValidation = (charExist(String.fromCharCode(keyPressed), blockedChars == null ? null : blockedChars.value) != true &&
			        charExist(String.fromCharCode(keyPressed), this.attributes["allowed_chars"].value) != false);
        }
        else
            passedValidation = true;

        if (!passedValidation) {
            if (!eval(this.attributes["EvaluationID"].value + ".isIE"))
                ev.preventDefault();

            ev.returnValue = false;

            this.className += " wrongKey";
            window.setTimeout(this.attributes["EvaluationID"].value + ".element.className=" + this.attributes["EvaluationID"].value + ".element.className.replace(' wrongKey','')", 100);
        }

        return passedValidation;
    }

    this.element.onkeydown = function(ev) {
        if (ev == null) ev = event;

        var keyPressed = ev.keyCode;

        if (keyPressed == 13) {

            eval(this.attributes["EvaluationID"].value + ".doFormat()");
            if (this.attributes["nextField"] != null) {
                if (eval(this.attributes["EvaluationID"].value + ".validateInput()")) {
                    if (this.attributes["nextField"].value.indexOf("javascript:") == 0)
                        eval(this.attributes["nextField"].value);

                    nextFieldName = this.attributes["nextField"];

                    if (document.getElementById(nextFieldName.value) != null)
                        while (nextFieldName != null && document.getElementById(nextFieldName.value).disabled == true) {
                        nextFieldObj = document.getElementById(nextFieldName.value);

                        if (nextField != null)
                            nextFieldName = nextFieldObj.attributes["nextField"];
                        else
                            break;
                    }
                    if (document.getElementById(nextFieldName.value) != null)
                        document.getElementById(nextFieldName.value).focus();

                    ev.returnValue = false;
                }
            }
        }

        if (ev.shiftKey && (keyPressed == 188 || keyPressed == 190 || keyPressed == 219 || keyPressed == 221)) {
            ev.returnValue = false;
            ev.preventDefault();
            return;
        }
    }

    this.element.onblur = function() {
        eval(this.attributes["EvaluationID"].value + ".validateInput()")
    }

    this.element.onpaste = function() {
        eval(this.attributes["EvaluationID"].value + ".doPaste()")
    }
    this.element.onfocus = function() {
        this.select();
    }
    this.element.onchange = function() {
        eval(this.attributes["EvaluationID"].value + ".doFormat()")
    }
}


// shows relevant span and unselects other tabs
function tabClicked(id) {
    var clickedTab = document.getElementById(id);

    if (clickedTab.attributes["selected"].value == "no") // not currently selected tab
    {
        // show selected tab
        for (var i = 1; i <= 5; i++) {
            var span = document.getElementById("tabTr" + i);

            if (id.charAt(id.length - 1) == ("" + i))   // hide the tab only if not selected
                span.style.display = "";
            else
                span.style.display = "none";
        }

        // unselect other tabs
        swapImgSrcIF(selectedTabId, "yes");
        document.getElementById(selectedTabId).attributes["selected"].value = "no";
        clickedTab.attributes["selected"].value = "yes"
        selectedTabId = id;
    }
}

//used when selecting a departure location in homepage
function arrivalsAndDeparturesClicked(reqType, regionChannel) {
    // get the select value

    var tdSel = document.getElementById("tdSelect");
    var selObj = tdSel.getElementsByTagName("select")[0];
    if (selObj.selectedIndex == 0)
        return;
    var selectedVal = selObj.options[selObj.selectedIndex].value;
    window.open(appPath + "/Pages/CmsTemplates/ArrivalsAndDepartures.aspx?airport=" + selectedVal + "&reqType=" + reqType + "&regionChannel=" + regionChannel, "adWindow", "scrollbars=1,resizable=yes,width=720,height=480,top=100,left=100");
}

//used in eBooking.ascx
function fillDDdlDest111(p_AllDestinations, p_sRegionChannel) {
    fillDDdlDest(p_AllDestinations, p_sRegionChannel);
}

//fill dropdown list with destinations on eBooking.ascx
function fillDDdlDest(allDestId, regionChannel) {
    var AllDestinationSelect = document.getElementById(allDestId);
    var arrSelCont = document.getElementById("selContainer").getElementsByTagName("select");

    var selFrom = arrSelCont[0];
    var selTo = arrSelCont[1];
    removeOptionsOutOf1(selTo);
    var oOption, i;
    if (selFrom.options[selFrom.selectedIndex].value != "-1") {
        if (selFrom.options[selFrom.selectedIndex].value == "TLV") {	// tel-aviv was select
            for (i = 0; i < AllDestinationSelect.options.length; i++) {
                if (AllDestinationSelect.options[i].value != "TLV") {
                    var sText = AllDestinationSelect.options[i].text;
                    var sValue = AllDestinationSelect.options[i].value;
                    selTo.options[selTo.length] = new Option(sText, sValue);
                }
            }
            if (selTo.options.length > 1) {
                selTo.options.selectedIndex = 0;
            }
        }
        else// tel-aviv was not selected
        {
            // add tel aviv
            var tlvStr = document.getElementById("tlvDestenation");

            var sText = tlvStr.value;
            var sValue = "TLV";
            selTo.options[selTo.length] = new Option(sText, sValue);
            if (selTo.options.length > 1) {
                selTo.options.selectedIndex = 1;
            }

            // los angeles was selected
            if (selFrom.options[selFrom.selectedIndex].value == "LAX") {
                // add toronto
                /*oOption = document.createElement("OPTION");
                selTo.options.add(oOption);
                if(regionChannel == "Hebrew")
                oOption.innerHTML = "טורונטו";
                else if(regionChannel == "English")
                oOption.innerHTML = "TORONTO";
                oOption.value = "YTO";*/
            }

            // toronto was selected
            else if (selFrom.options[selFrom.selectedIndex].value == "YTO") {
                // add los angeles
                /*oOption = document.createElement("OPTION");
                selTo.options.add(oOption);
				
				if(regionChannel == "Hebrew")
                oOption.innerHTML = "לוס אנג'לס";
                else if(regionChannel == "English")
                oOption.innerHTML = "LOS ANGELES";
                oOption.value = "LAX";*/
            }
        }
    }
    else {
        selTo.options.selectedIndex = 0;
    }
}

//fill schedule dropdownlist on eBooking.ascx
function fillScheduleDDdlDest(id) {
    var arrSelCont = document.getElementById(id).getElementsByTagName("select");
    var selFrom = arrSelCont[0];
    var selTo = arrSelCont[1];
    removeOptionsOutOf1(selTo);
    var oOption, i;

    if (selFrom != null && selTo != null)
        removeOptionsOutOf1(selTo);
    var oOption, i;
    if (selFrom.options[selFrom.selectedIndex].value != "-1") {
        if (selFrom.options[selFrom.selectedIndex].value == "TLV") {	// tel-aviv was select
            for (i = 1; i < selFrom.options.length; i++) {
                if (selFrom.options[i].value != "TLV") {
                    var sText = selFrom.options[i].text;
                    var sValue = selFrom.options[i].value;
                    selTo.options[selTo.length] = new Option(sText, sValue);
                }
            }
        }
        else// tel-aviv was not selected
        {
            // add tel aviv
            var tlvStr = document.getElementById("tlvDestenation");
            var sText = tlvStr.value;
            var sValue = "TLV";
            selTo.options[selTo.length] = new Option(sText, sValue);

            // los angeles was selected
            if (selFrom.options[selFrom.selectedIndex].value == "LAX") {
                // add toronto
                var sText = "TORONTO";
                var sValue = "YTO";
                selTo.options[selTo.length] = new Option(sText, sValue);
            }

            // toronto was selected
            else if (selFrom.options[selFrom.selectedIndex].value == "YTO") {
                // add los angeles
                var sText = "LOS ANGELES";
                var sValue = "LAX";
                selTo.options[selTo.length] = new Option(sText, sValue);
            }
        }
        if (selTo.options.length > 1) {
            selTo.options.selectedIndex = 1;
        }
        else {
            selTo.options.selectedIndex = 0;
        }
    }
    else {
        selTo.options.selectedIndex = 0;
    }
}

//function used to clear drop down list
function removeOptionsOutOf1(sel) {
    sel.options.length = 1;
}


// JScript File to handel radcontrol datepicker (Calendar)
/*********************************************************************/
//in order to use this jscript file, put in the aspx/ascx page:
//              * two datepicker
//              * define objDatePicker_1 and objDatePicker_2
//                 (** for example : objDatePicker_1 = "<%= RadDatePicker1.ClientID%>";)
//              *  optinal to define numOfDayToAdd. 
//                 the minimum days between the first date to the second date
//                 if numOfDayToAdd not define -> default value is 7 days
/*********************************************************************/

var oIFrame = null;    //retains the current shown iframe
var isShow;     //tells if we should/shouldn't show the iframe under the popup
var prevId = "";    //retains the previous iframe that was shown
var bToggle = true; //tells to hide or show popup
var width;
//function OnDateSelected
//fired when a date is selected
//only when the event fired by objDatePicker_1 do this function
//what: 
//   after the first date was selected (objDatePicker_1)
//   set the second datepicker to a larger date (objDatePicker_2)
//   (objDatePicker_1 date + numOfDayToAdd <= objDatePicker_2)
//   optinal to define numOfDayToAdd. 
//                 the minimum days between the first date to the second date
//                 if numOfDayToAdd not define -> default value is 7 days
//notice: objDatePicker_1 and objDatePicker_2 are define where the two datepicker are placed   
//if they are not define - exist.
function OnDateSelected(datepickerInstance, args) {
    if (isBrowserIE6()) {
        if (oIFrame != null)
            oIFrame.style.display = "none";
    }
    bToggle = false;

    if (typeof (objDatePicker_1) == 'undefined' || objDatePicker_1 == null ||
         typeof (objDatePicker_2) == 'undefined' || objDatePicker_2 == null) {
        //objDatePicker_1 and objDatePicker_2 are not define              
        return;
    }
    if (datepickerInstance.ClientID != objDatePicker_1.ClientID &&
         datepickerInstance.ClientID != objDatePicker_2.ClientID) {
        //datepickerInstance is not objDatePicker_1 or objDatePicker_2
        return;
    }
    if (datepickerInstance.ClientID == objDatePicker_1.ClientID) {
        //do it only if the sender is objDatePicker_1
        if (typeof (numOfDayToAdd) == 'undefined' || numOfDayToAdd == null) {
            numOfDayToAdd = 7;
        }
        var date = objDatePicker_1.GetDate();
        date.setDate(date.getDate() + numOfDayToAdd);
        objDatePicker_2.SetDate(date);
        objDatePicker_2.MinDate = date;
        objDatePicker_2.FocusedDate = date;
    }

}

//function TogglePopup
//open the popup when click on the dateInput
function TogglePopup(DatePickerId) {

    if (isBrowserIE6()) {
        //modifications needed for the internet explorer 6.0 bug (comboboxes visible over div)
        var datePicker = eval(DatePickerId);

        var textBox = datePicker.GetTextBox();
        var position = datePicker.GetElementPosition(textBox);
        var dimensionText = datePicker.GetElementDimensions(textBox);

        var oCtrl1 = document.getElementById(DatePickerId + "_calendar");
        var oCtrl2 = document.getElementById(DatePickerId + "_wrapper");

        var dimensions = new Object();

        //hide the other datePicker iframe
        if (prevId != (DatePickerId + "_frame")) {
            if (document.getElementById(prevId) != null)
                document.getElementById(prevId).style.display = "none";
            bToggle = false;
        }

        if (document.getElementById(DatePickerId + "_frame") == null) {
            dimensions.x = position.x;
            dimensions.y = position.y;
            dimensions.width = width;
            dimensions.height = oCtrl1.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.clientHeight + oCtrl2.offsetParent.clientHeight;

            //create an iframe element to hide the comboboxes
            oIFrame = document.createElement("iframe");
            oIFrame.id = DatePickerId + "_frame";
            oIFrame.style.position = "absolute";
            oIFrame.style.width = dimensions.width;
            oIFrame.style.height = dimensions.height - dimensionText.height;
            oIFrame.style.top = dimensions.y + dimensionText.height;
            oIFrame.style.left = dimensions.x;
            oIFrame.src = "";
            oIFrame.frameBorder = "0";
            oIFrame.style.display = "inline";
            document.body.appendChild(oIFrame);
            isShow = true;
        }
        else {
            //if the iframe is already created, just show it
            oIFrame = document.getElementById(DatePickerId + "_frame");
            oIFrame.style.display = "inline";
            isShow = true;
        }
        prevId = oIFrame.id;
    }
    //toggle show/hide popup and iframe 
    if (bToggle == false) {
        bToggle = true;
        eval(DatePickerId).ShowPopup();
    }
    else {
        if (oIFrame != null)
            oIFrame.style.display = "none";
        eval(DatePickerId).HidePopup();
        bToggle = false;
    }
}

//function needed for internet explorer 6.0 bug (for the radDatePicker control)
document.onclick = function() {
    if (isBrowserIE6()) {
        //on click anywhere on the page, hide the iframe behind the datePicker control
        if (oIFrame != null) {
            if (isShow != true) {
                //if is not the first time hide the iframe
                //(the click apears even on the text box)
                oIFrame.style.display = "none";
                prevId = "";
            }
            else {
                //if is the first time then do nothing
                isShow = false;
            }
        }
    }
}

//check if broser is Internet Explorer version 6.0
function isBrowserIE6() {
    if (navigator.appName.indexOf('Microsoft') > -1) {
        if (navigator.appVersion.indexOf('MSIE 6.0') > -1)
            return true;
    }
    return false;
}

//function used when loging in with FrequentFlyer
function signInUserByAjax(sPass, sMemberNumber, region, action) {

    //inputsAttributes -> input1Name=input1Value$input2Name=input2Value
    var obj = document.getElementById('loadingDiv');
    obj.style.display = 'block';
    createFormAndSubmit('clubs', 'SRBoxForm', 'target=clubs$method=post$action=' + action + '', 'MemberNum=' + sMemberNumber + '$MemberPass=' + sPass + '$Method=sign' + '$Caller=FFBox' + '$region=' + region + '', '', 'true');

}

//function used when loging out with FrequentFlyer
function signOutUserByAjax() {
    AJAX.asyncWithCallback('/ELAL/Pages/AjaxPages/AjaxFrequentFlyerSingIn.aspx', 'Method=Logoff', "frquentFlyerSignOutAnswer");
}

//used in FrequentFlyerSignIn.ascx
function validateContainerPassword(p_sErrorMsg, p_sRegionChannel, formAction) {

    var inputTXT = document.getElementById(m_SecretCode).value;
    var length = inputTXT.length;
    var MemberTXT = document.getElementById(m_Member).value;
    var tdErr = document.getElementById(m_tdErr);
    if (Trim(MemberTXT) == "" || Trim(inputTXT) == "") {
        tdErr.innerHTML = p_sErrorMsg;
        tdErr.style.display = '';
    }
    else {
        tdErr.style.display = 'none';


        for (var j = 0; j < length; j++) {

            if ((inputTXT.charCodeAt(j) >= 48 && inputTXT.charCodeAt(j) <= 57) || (inputTXT.charCodeAt(j) >= 97 && inputTXT.charCodeAt(j) <= 122) || (inputTXT.charCodeAt(j) >= 65 && inputTXT.charCodeAt(j) <= 90)) {
                //NUM OR EN
            }
            else {
                alert(p_sErrorMsg);
                return false;
            }
        }
        //sign in : password,user,languge, call back function
        //the ajax return the log in status to the call back function /*****************/
        var DivTbl = document.getElementById('mainLoginTBL');
        DivTbl.style.display = 'none';
        document.getElementById('loadingDiv').style.display = '';
        signInUserByAjax(document.getElementById(m_SecretCode).value, document.getElementById(m_Member).value, p_sRegionChannel, formAction);
    }
}
function validateForgotPassword(p_sRegionChannel, formAction, InsertMemberNumErr) {

    var MemberTXT = document.getElementById(m_Member).value;
    var tdErr = document.getElementById(m_tdErr);
    if (Trim(MemberTXT) == "") {

        tdErr.innerHTML = InsertMemberNumErr;
        tdErr.style.display = '';
    }
    else {
        tdErr.style.display = 'none';
        AJAX.asyncWithCallback('/ELAL/Pages/AjaxPages/AjaxFrequentFlyerSingIn.aspx', 'Method=password_reminder&MemberNum=' + MemberTXT + '&region=' + p_sRegionChannel, "frquentFlyerForgotPasswordAnswer");

    }
}
function CountLinkesCampaign(url, MessagType, MessagCode) {

    AJAX.asyncWithCallback('/ELAL/Pages/AjaxPages/AjaxFrequentFlyerSingIn.aspx', 'Method=CountLinkesCampaign&MessagType=' + MessagType + '&MessagCode=' + MessagCode, "CountLinkesCampaignAnser");

    window.open(url, "");
}
function CountLinkesCampaignAnser(anser) {

}

//used in FrequentFlyerSignIn.ascx
function goToMatmid(p_sRegionChannel) {

    window.parent.location = appPath + "/" + p_sRegionChannel + "/MatmidFrequentFlyer/MyAccount/FrequentFlyerInternal";
}

//used in FrequentFlyerSignIn.ascx

function frquentFlyerSignAnswer(responseFromSingIn) {
   

    var DivTbl = document.getElementById('mainLoginTBL');

    DivTbl.style.display = '';
    var obj = document.getElementById('loadingDiv');
    obj.innerHTML = "";
    obj.style.display = 'none';
    var status = responseFromSingIn.split('#')[0];
    if (status == 'ok') {
        //addSeesionId to FlyBuy
        var ChLinkFlyBuy = document.getElementById("ChLink_FlyBuy").href;

        if (isFlyBuyEnable = "true") {
            if (ChLinkFlyBuy.indexOf(sFlyBuyQueryString < 0)) {
                if (ChLinkFlyBuy.indexOf('?') < 0) {
                    document.getElementById("ChLink_FlyBuy").href = ChLinkFlyBuy + "?" + sFlyBuyQueryString;

                }
                else {
                    document.getElementById("ChLink_FlyBuy").href = ChLinkFlyBuy + "&" + sFlyBuyQueryString;

                }
            }
        }

        //set spontany link 
        if (sIsSpontanyEnable == "true") {
            var spontanyLink = document.getElementById(sSPontanyClientID).href;
            var spontanyLink_EN = document.getElementById(sSPontanyClientID_EN).href;
            if (spontanyLink.indexOf(sSpontanyQueryString < 0)) {
                document.getElementById(sSPontanyClientID).href = spontanyLink + sSpontanyQueryString;
                document.getElementById(sSPontanyClientID_EN).href = spontanyLink_EN + sSpontanyQueryString;
            }
        }



        document.getElementById(m_LogedInUserTable).style.display = '';
        document.getElementById(m_logInSpan).style.display = 'none';
        if (responseFromSingIn.split('#')[1] != null) {
            document.getElementById('numberOfPoints').innerHTML = responseFromSingIn.split('#')[1];
        }
        if (responseFromSingIn.split('#')[2] != null) {
            document.getElementById('MatmidMemberName').innerHTML = responseFromSingIn.split('#')[2];
        }
        if (responseFromSingIn.split('#')[3] != null) {
            document.getElementById('cards_bottom').style.backgroundImage = responseFromSingIn.split('#')[3];
        }
        if (responseFromSingIn.split('#')[4] != null) {
            document.getElementById('specialOfferLink').innerHTML = responseFromSingIn.split('#')[4];
        }
        //setTimeout('goToMatmid(m_RegionChannel)', 2000);

    }
    else if (status == 'expired') {
        var memberType = '';
        var memberNumber = '';

        if (responseFromSingIn.split('#')[1] != null) {
            memberType = responseFromSingIn.split('#')[1];
        }
        if (responseFromSingIn.split('#')[2] != null) {
            memberNumber = responseFromSingIn.split('#')[2];
        }
        var ExpiredPassUrlLocaation = appPath + "/" + m_RegionChannel + m_UpdatePasswordUrl;
        window.parent.location = ExpiredPassUrlLocaation + '?Willingly=False&memberNumber=' + memberNumber + '&memberType=' + memberType;
    }
    else {

        document.getElementById('tdErr').innerHTML = status;
        document.getElementById('tdErr').style.display = '';
        //special case for blocked members
        if (responseFromSingIn.split('#')[2] != null) {
            var blockedUrl = 'https://app.elal.co.il/clubs/BlockedMember' + responseFromSingIn.split('#')[2] + '.html';

            window.parent.open(blockedUrl);

        }

    }
}

//used in FrequentFlyerSignIn.ascx
//function frquentFlyerSignOutAnswer() {
//    document.getElementById(m_SecretCode).value = '';
//    document.getElementById(m_Member).value = '';
//    document.getElementById(m_LogedInUserTable).style.display = 'none';
//    document.getElementById(m_logInSpan).style.display = '';
//    document.getElementById(m_cards_bottom).style.backgroundImage = 'url(/ELAL/Images/HomePage/cards_bottom.jpg)';
//    document.getElementById(m_tdErr).style.display = 'none';
//    //CLEAR SPONTANY LINK

//    if (sIsSpontanyEnable == "true") {
//        var spontanyLink = document.getElementById(sSPontanyClientID).href;
//        var spontanyLink = document.getElementById(sSPontanyClientID_EN).href;
//        if (spontanyLink.indexOf(sSpontanyQueryString < 0)) {
//            document.getElementById(sSPontanyClientID).href = document.getElementById(sSPontanyClientID).href.replace(sSpontanyQueryString, '');
//            document.getElementById(sSPontanyClientID_EN).href = document.getElementById(sSPontanyClientID_EN).href.replace(sSpontanyQueryString, '');
//        }
//    }

//    document.getElementById("ChLink_FlyBuy").href = document.getElementById("ChLink_FlyBuy").href.replace(sFlyBuyQueryString, '');

//}

function frquentFlyerForgotPasswordAnswer(responseFromForgotPass) {

    var stdErr = document.getElementById(m_tdErr);

    stdErr.style.display = '';
    stdErr.innerHTML = responseFromForgotPass;
}


//used in eBooking.ascx
function TermsPopUp(p_sLang) {
    newwindow2 = window.open(appPath + "/" + p_sLang + "/TermsAndConditions", "", "scrollbars=yes height=480 width=720");
}

//used in eBooking.ascx
function RunCabin(p_iCabinIndex) {

    var CabinDDL = document.getElementById('TicketType');
    if (CabinDDL != null) {
        var cabID = p_iCabinIndex;
        if (cabID == "0") {
            CabinDDL.selectedIndex = 0;
        }
        else if (cabID == "1") {
            CabinDDL.selectedIndex = 1;
        }
        else if (cabID == "2") {
            CabinDDL.selectedIndex = 2;
        }
        else if (cabID == "3") {
            CabinDDL.selectedIndex = 3;
        }
        else if (cabID == "4") {
            CabinDDL.selectedIndex = 4;
        }
        else {
            CabinDDL.selectedIndex = 5;
        }
    }

}

//used in eBooking.ascx    
function journeyTypeChanged(p_RadioMultyCity) {
    /* var lbl2= document.getElementById("label2");
    var lbl3= document.getElementById("label3");
    var lbl1= document.getElementById("label1");
    var lbl4= document.getElementById("label4");*/
    var combo = document.getElementById("ReturnSelContainer");

    combo.style.display = "none";
    /*  lbl2.innerText = lbl2.innerText.replace(" 1","");
    lbl3.innerText = lbl3.innerText.replace(" 1","");
    lbl1.innerText = lbl1.innerText.replace(" 2","");
    lbl4.innerText = lbl4.innerText.replace(" 2","");*/

    var oneWay = document.getElementById("oneWayRadio");
    //document.getElementById("select_retPeriod").disabled = oneWay.checked;

    objDatePicker = objDatePicker_2;
    if (oneWay.checked && objDatePicker != null) {
        //make datapicker Disable
        objDatePicker.DateInput.Disable();
        objDatePicker.PopupButton.onclick = null;
        objDatePicker.PopupButton.style.cursor = "default";
    }
    else if (!oneWay.checked && objDatePicker != null) {
        // make datapicker Enable
        objDatePicker.DateInput.Enable();
        objDatePicker.PopupButton.style.cursor = "pointer";
        objDatePicker.PopupButton.onclick = function tog() {
            objDatePicker.TogglePopup();
            return false;
        };
    }
    //make sure : btn 'AMultyCity' unselected
    objAMultyCity = document.getElementById(p_RadioMultyCity);
    if (objAMultyCity != null) {
        objAMultyCity.checked = false;
    }
}


function ValidateBookingData(pageType, StrValidBonus, StrValidNumberPassenger, StrValidNumberAdult, StrValidInfant, StrValidChild, StrValidTeenager, StrValidDeparture, StrValiddestination, StrValidReturnDate, StrValidReturnFlight, FormAction, passportNum, agentName, agent, isFamily, sessionId, SunDorCodes) {
    //alert("q");
   
    var StrEror = "";
    var IsEror = false;
    var objNumOfAdults = Number(document.getElementById("NumOfAdults").value);
    var objNumOfGoldenAges = Number(document.getElementById("NumOfGoldenAges").value);
    var objNumOfStudents = Number(document.getElementById("NumOfStudents").value);
    var objNumOfYouths = Number(document.getElementById("NumOfYouths").value);
    var objNumOfKids = Number(document.getElementById("NumOfKids").value);
    var objNumOfBabies = Number(document.getElementById("NumOfBabies").value);
    var objNumOfTeenagers = Number(document.getElementById("NumOfTeenagers").value);
    var bounosFlight = document.getElementById("ckbEmission");
    var SumAdultsPassenger = objNumOfAdults + objNumOfGoldenAges + objNumOfStudents + objNumOfYouths;

    //Bounos flight is not allowed to ,בוסטון,דאלאס,וושינגטון,סאן פרנסיסקו ושיקגו

    //var notAllowedFlights = "BOS,DFW,DCA,SFO,CHI";
    var notAllowedFlightsRegExp = new RegExp("^(BOS|DFW|DCA|SFO|CHI)|[/*]");


    //added by Sergey on 06/05/2009
    if (pageType != 'amadeus') {
       //   var SunDorSplit = SunDorCodes.split("#");
       //  for (iCodes = 0; iCodes < SunDorSplit.length; iCodes++)
          //         notAllowedFlights += ',' + SunDorSplit[iCodes].toUpperCase(); 

        if (bounosFlight != null && bounosFlight.checked == true) {
           //if (notAllowedFlights.indexOf(objDdlTo.value) > -1 || notAllowedFlights.indexOf(objDdlFrom.value) > -1)
            if (notAllowedFlightsRegExp.test(objDdlTo.value) || notAllowedFlightsRegExp.test(objDdlFrom.value)) 
            {    StrEror += StrValidBonus + "\n";
                IsEror = true;
            }

        }
    }

    if ((SumAdultsPassenger) > 9) {
        StrEror += StrValidNumberPassenger + "\n"; //'<%=Resources.InputFieldNames.ValidNumberPassenger %>'+"\n";  
        IsEror = true;
    }
    if (SumAdultsPassenger < 1) {
        StrEror += StrValidNumberAdult + "\n"; //'<%=Resources.InputFieldNames.ValidChild %>'+"\n";   
        IsEror = true;
    }

    if (objNumOfBabies > SumAdultsPassenger) {
        StrEror += StrValidInfant + "\n"; //'<%=Resources.InputFieldNames.ValidInfant %>'+"\n";   
        IsEror = true;
    }



    if (objNumOfKids > 0 && !SumAdultsPassenger > 0) {
        StrEror += StrValidChild + "\n"; //'<%=Resources.InputFieldNames.ValidChild %>'+"\n";   
        IsEror = true;
    }
    if (objNumOfTeenagers > 0 && !SumAdultsPassenger > 0) {
        StrEror += StrValidTeenager + "\n"; //'<%=Resources.InputFieldNames.ValidChild %>'+"\n";   
        IsEror = true;
    }

    if (pageType == 'amadeus') {
        if (objFrom == null || objFrom.value == "") {
            StrEror += StrValidDeparture + "\n"; //'<%=Resources.InputFieldNames.ValidDeparture %>'+"\n";   
            IsEror = true;
        }
        if (objTo == null || objTo.value == "") {
            StrEror += StrValiddestination + "\n"; //'<%=Resources.InputFieldNames.Validdestination %>'+"\n";   
            IsEror = true;
        }
    }
    else {
        if (objDdlFrom == null || objDdlFrom.value == -1) {
            StrEror += StrValidDeparture + "\n"; //'<%=Resources.InputFieldNames.ValidDeparture %>'+"\n";   
            IsEror = true;
        }

        if (objDdlTo == null || objDdlTo.value == -1) {
            StrEror += StrValiddestination + "\n"; //'<%=Resources.InputFieldNames.Validdestination %>'+"\n";   
            IsEror = true;
        }

        var objDiffrenetDistanation = document.getElementById("diffrenetDistanation");

        if (objDiffrenetDistanation.checked == true) {
            if (objDdlreturnFrom == null || objDdlreturnFrom.value == -1) {
                StrEror += StrValidReturnFlight + "\n";
                IsEror = true;
            }
        }

    }


    // departDate
    sDateDepart = objDatePicker_1.GetDate();
    // returnDate
    sDateReturn = objDatePicker_2.GetDate();
    if (sDateDepart > sDateReturn) {
        StrEror += StrValidReturnDate + "\n"; //'<%=Resources.InputFieldNames.ValidReturnDate %>'+"\n";   
        IsEror = true;
    }
    if (IsEror) {
        alert(StrEror);
        return false;
    }
    else {
        SubmitBookingDetails(FormAction, passportNum, agentName, agent, isFamily, sessionId, pageType, SunDorCodes);

    }
}

function changeRadiosVisability(sunDorCodes) {
    var radio = document.getElementById("radioButtonsVisability");
    var combo = document.getElementById("ReturnSelContainer");
    var startOver = document.getElementById("startOver");
    var oneWay = document.getElementById("oneWayRadio");
    /*   var lbl2= document.getElementById("label2");
    var lbl3= document.getElementById("label3");
    var lbl1= document.getElementById("label1");
    var lbl4= document.getElementById("label4");*/

    //  document.getElementById("select_retPeriod").disabled = oneWay.checked;
    objDatePicker = objDatePicker_2;
    objDatePicker.DateInput.Enable();
    objDatePicker.PopupButton.style.cursor = "pointer";
    objDatePicker.PopupButton.onclick = function tog() {
        objDatePicker.TogglePopup();
        return false;
    };


    //    if (radio.style.display == "none")
    //    {
    //        radio.style.display = "block";
    //        combo.style.display = "none";
    //        startOver.style.visibility = "hidden";
    //    }
    //    else
    //    {
    //        radio.style.display = "none";
    combo.style.display = "block";
    /*   lbl2.innerText = lbl2.innerText + " 1";
    lbl3.innerText = lbl3.innerText + " 1";
    lbl1.innerText = lbl1.innerHTML + " 2";
    lbl4.innerHTML = lbl4.innerHTML + " 2";
    lbl3.style.marginRight="-7px";
    lbl3.style.marginRight="-7px";*/
    //        startOver.style.visibility = "visible";
    //    }
    fillDDdlDestGoHP(sunDorCodes);
}


function fillDDdlDestGoHP(sunDorCodes) {

    var w = objAllDestinations;
    var y = objRegionChannel;
    fillDDdlDestHP(w, y, sunDorCodes);
}

function removeOptionsOutOfDest(sel) {
    sel.options.length = 0;
    sel.options[0] = new Option(objSelectDestAirport, "-1");
}

function removeOptionsOutOfExit(sel) {
    sel.options.length = 0;
    sel.options[0] = new Option(objSelectExitAirport, "-1");
}
function removeOptionsOutOf(sel) {
    sel.options.length = 0;
}

function FillDDL(CodesSundor, alldest) {
    //added by Sergey on 06/05/2009 fill dropDowns


    var arrSelCont = document.getElementById("selContainer").getElementsByTagName("select");

    var selFrom = arrSelCont[0];
    var selTo = arrSelCont[1];
    var objAllDest = document.getElementById(alldest);
    var oAllSource = document.getElementById(objAllSource);
    selTo.options.length = 0;
    selFrom.options.length = 0;

    if (m_RegionChannel == "Hebrew") {
        selFrom.options[0] = new Option('----יעדי אל על----', '');
        selFrom.options[1] = new Option('תל אביב', 'TLV');
        selFrom.options[2] = new Option('אילת', 'ETH');
    }
    else {
        selFrom.options[0] = new Option('----From----', '');
        selFrom.options[1] = new Option('TEL AVIV', 'TLV');
        selFrom.options[2] = new Option('EILAT', 'ETH');
    }
    counter = 2;
    for (i = 0; i < oAllSource.options.length; i++) {

        var sText = oAllSource.options[i].text;
        var sValue = oAllSource.options[i].value;
        if (sValue != "TLV") {
            selFrom.options[counter] = new Option(sText, sValue);
            if (CodesSundor.indexOf(sValue.toLowerCase()) != -1 && sValue.toLowerCase().substring(0, 1) == '*') {
                selFrom.options[counter].className = "sunDor";
            }
            counter++;

        }


    }

    selFrom.value = 'TLV';

    fillDDdlDestHP(alldest, m_RegionChannel, CodesSundor);

    ///////////Sergey
}

function fillDDdlDestHP(allDestId, regionChannel, CodesunDor) {

    var AllDestinationSelect = document.getElementById(allDestId); //.getElementsByTagName("select");;
    var arrSelCont = document.getElementById("selContainer").getElementsByTagName("select");
    var selFrom = arrSelCont[0]; //document.getElementById("selContainer").childNodes[1];
    var selTo = arrSelCont[1]; //document.getElementById("To");

    var arrSelContRet = document.getElementById("ReturnSelContainer").getElementsByTagName("select");
    var selReturnFrom = arrSelContRet[0]; //document.getElementById("returnFrom");
    var selReturnTo = arrSelContRet[1]; //document.getElementById("returnTo");

    var sTlvStr = document.getElementById("tlvDestenation").value;
    var sTlvValue = "TLV";

    var sEilatStr = "";
    if (m_RegionChannel == "Hebrew") {
        sEilatStr = "אילת"
    }
    else {
        sEilatStr = "Eilat"
    }
    var sEilatValue = "ETH";

    //added by Sergey 06/05/2009 (SunDor destinations are not included in returnTo and returnFrom dropdowns)
    var DifferentDestDDL = document.getElementById('diffrenetDistanation');
    if (DifferentDestDDL.checked == true) {
        var FromLength = selFrom.length;
        var iCount = 0;
        var bOK = true;
        var bNone = true;
        while (bOK) {
            if (CodesunDor.indexOf(selFrom.options[iCount].value.toLowerCase()) > -1 && selFrom.options[iCount].value.toLowerCase().substring(0, 1) == '*') {
                selFrom.options[iCount] = null;
                bNone = false;
            }
            else {
                iCount++;
            }
            if (iCount == selFrom.length) {
                iCount = 0;
                if (bNone)
                    bOK = false;
                bNone = true;
            }
        }
    }
    removeOptionsOutOfDest(selTo);
    removeOptionsOutOfExit(selReturnFrom);

    removeOptionsOutOfDest(selReturnTo);
    var oOption, i;
    var sText, sValue;
  
    if (selFrom.options[selFrom.selectedIndex].value != "-1") {
        if (selFrom.options[selFrom.selectedIndex].value == "TLV") {
            // tel-aviv was select
            selReturnTo.options[selReturnTo.length] = new Option(sTlvStr, sTlvValue); //the first value is tel-aviv
            selReturnTo.options[selReturnTo.length] = new Option(sEilatStr, sEilatValue);   
            for (i = 0; i < AllDestinationSelect.options.length; i++) {

                if (AllDestinationSelect.options[i].value != "TLV") {
                    sText = AllDestinationSelect.options[i].text;
                    sValue = AllDestinationSelect.options[i].value;
                    //fill DDL_To 
                    if (DifferentDestDDL.checked == true) {
                        if (CodesunDor.indexOf(sValue.toLowerCase()) < 0 && sValue.toLowerCase().substring(0, 1) != '*') {

                            selTo.options[selTo.length] = new Option(sText, sValue);
                            selTo.options[selTo.length - 1].className = AllDestinationSelect.options[i].className;
                        }
                        //special case for family - destanation same destanation for sundor and elal
                        if (CodesunDor.indexOf(sValue.toLowerCase()) > -1 && sValue.toLowerCase().substring(0, 1) != '*') {
                            selTo.options[selTo.length] = new Option(sText, sValue);
                            selTo.options[selTo.length - 1].className = AllDestinationSelect.options[i].className;
                        }
                    }
                    else {
                        selTo.options[selTo.length] = new Option(sText, sValue);
                        selTo.options[selTo.length - 1].className = AllDestinationSelect.options[i].className;
                    }


                    //fill DDL return_From
                    //added by Sergey 30/04/2009 (SunDor destinations are not included in returnTo and returnFrom dropdowns)
                    if (CodesunDor.indexOf(sValue.toLowerCase()) == -1 && sValue.toLowerCase().substring(0, 1) != '*') {
                        selReturnFrom.options[selReturnFrom.length] = new Option(sText, sValue);
                        //selReturnTo.options[selReturnTo.length] = new Option(sText, sValue);

                        //fill DDL returnTo tel aviv					
                       // selReturnTo.options[selReturnTo.length] = new Option(sTlvStr, sTlvValue);
                        //choose the value Tel-Aviv as selected
                       // selReturnTo.options[selReturnTo.length - 1].selected = true;
                       // selReturnTo.disabled = true;
                    }
                    //special case for family - destanation same destanation for sundor and elal
                    if (CodesunDor.indexOf(sValue.toLowerCase()) > -1 && sValue.toLowerCase().substring(0, 1) != '*') {
                        selReturnFrom.options[selReturnFrom.length] = new Option(sText, sValue);
                        selReturnTo.options[selReturnTo.length] = new Option(sText, sValue);

                    }
                }
            }
            /*    if (selTo.options.length > 1)
            {
            selTo.options.selectedIndex = 0;
            }
            if (selReturnFrom.options.length > 1)
            {
            selReturnFrom.options.selectedIndex = 0;
            }
            if( selReturnTo.options.lenght > 1)
            {
            selReturnTo.options.selectedIndex = 0;
            }*/

        }
        else// tel-aviv was not selected
        {
       
            selReturnTo.disabled = false;
            removeOptionsOutOf(selTo);
            removeOptionsOutOf(selReturnFrom);
            sText = selFrom.options[selFrom.selectedIndex].text;
            sValue = selFrom.options[selFrom.selectedIndex].value;
            //fill DDL_To by tel aviv value
            // selTo.options[selTo.length] = new Option(sTlvStr, sTlvValue);
            if (selFrom.options[selFrom.selectedIndex].value != "ETH") {
                
                    selTo.options[selTo.length] = new Option(sTlvStr, sTlvValue);
                    selTo.options[selTo.length] = new Option(sEilatStr, sEilatValue);

            }
            else {              
                    selTo.options[selTo.length] = new Option(sTlvStr, sTlvValue);
            }
            
            //fill DDL_returnFrom by tel aviv value
            selReturnFrom.options[selReturnFrom.length] = new Option(sTlvStr, sTlvValue);
           
                selReturnFrom.options[selReturnFrom.length] = new Option(sEilatStr, sEilatValue);
                //selReturnFrom.options[selReturnFrom.length] = new Option('תל אביב', 'TLV');


                //fill DDL_returnTo by all values not include tel-aviv

                if (selFrom.options[selFrom.selectedIndex].value != "ETH") {
                    for (i = 0; i < AllDestinationSelect.options.length; i++) {
                        if (AllDestinationSelect.options[i].value != "TLV") {

                            sText = AllDestinationSelect.options[i].text;
                            sValue = AllDestinationSelect.options[i].value;
                            //sergey
                            if (CodesunDor.indexOf(sValue.toLowerCase()) == -1 && sValue.toLowerCase().substring(0, 1) != '*') {
                                selReturnTo.options[selReturnTo.length] = new Option(sText, sValue);
                                selReturnTo.options[selReturnTo.length - 1].className = AllDestinationSelect.options[i].className;
                            }
                        }
                    }
                }
                else {
                    selReturnTo.options[selReturnTo.length] = new Option(sTlvStr, sTlvValue); //the first value is tel-aviv
                    selReturnTo.options[selReturnTo.length] = new Option(sEilatStr, sEilatValue);   
                }
            
            /*
            //fill DDL_returnTo by chosen value in DDL_From		    
            selReturnTo.options[selReturnTo.length] = new Option(sText,sValue);
            selReturnTo.options[selReturnTo.length - 1].selected = true;	*/
            

            if (selTo.options.length > 2) {
                selTo.options.selectedIndex = 2;
            }
            if (selReturnFrom.options.length > 2) {
                selReturnFrom.options.selectedIndex = 2;
            }
            //		    if(selReturnTo.options.lenght > 1)
            //		    {
            //		        selReturnTo.options.selectedIndex = 1;
            //		    }

            //EILAT
            if (selFrom.options[selFrom.selectedIndex].value == "ETH")
             {
                for (i = 0; i < AllDestinationSelect.options.length; i++) {

                    if (AllDestinationSelect.options[i].value != "ETH" ) 
                    {
                        sText = AllDestinationSelect.options[i].text;
                        sValue = AllDestinationSelect.options[i].value;
                        //fill DDL_To
                        if (DifferentDestDDL.checked == true) 
                        {
                            if (CodesunDor.indexOf(sValue.toLowerCase()) < 0 && sValue.toLowerCase().substring(0, 1) != '*') {

                                selTo.options[selTo.length] = new Option(sText, sValue);
                                selTo.options[selTo.length - 1].className = AllDestinationSelect.options[i].className;
                            }
                            //special case for family - destanation same destanation for sundor and elal
                            if (CodesunDor.indexOf(sValue.toLowerCase()) > -1 && sValue.toLowerCase().substring(0, 1) != '*') {
                                selTo.options[selTo.length] = new Option(sText, sValue);
                                selTo.options[selTo.length - 1].className = AllDestinationSelect.options[i].className;
                            }
                        }
                        else {
                            selTo.options[selTo.length] = new Option(sText, sValue);
                            selTo.options[selTo.length - 1].className = AllDestinationSelect.options[i].className;
                        }


                        //fill DDL return_From
                        //added by Sergey 30/04/2009 (SunDor destinations are not included in returnTo and returnFrom dropdowns)
                        if (CodesunDor.indexOf(sValue.toLowerCase()) == -1 && sValue.toLowerCase().substring(0, 1) != '*') {
                            selReturnFrom.options[selReturnFrom.length] = new Option(sText, sValue);
                            //selReturnTo.options[selReturnTo.length] = new Option(sText, sValue);

                            //fill DDL returnTo tel aviv					
                           // selReturnTo.options[selReturnTo.length] = new Option(sTlvStr, sTlvValue);
                            //choose the value Tel-Aviv as selected
                           // selReturnTo.options[selReturnTo.length - 1].selected = true;
                            //selReturnTo.disabled = true;
                        }
                        //special case for family - destanation same destanation for sundor and elal
                        if (CodesunDor.indexOf(sValue.toLowerCase()) > -1 && sValue.toLowerCase().substring(0, 1) != '*') {
                            selReturnFrom.options[selReturnFrom.length] = new Option(sText, sValue);
                            selReturnTo.options[selReturnTo.length] = new Option(sText, sValue);

                        }
                    }
                }
                //fill DDL_To by tel aviv value
                // selTo.options[selTo.length] = new Option(sTlvStr, sTlvValue);
                
                //selFrom.value = 'TLV';
            }
           else if (selFrom.options[selFrom.selectedIndex].value == "AMS") {
                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "בומביי מומבאיי";
                else
                    oOption.innerHTML = "BOMBAY";
                oOption.value = "BOM";
            }



            else if (selFrom.options[selFrom.selectedIndex].value == "FRA") {
                /*oOption = document.createElement("OPTION");
                selTo.options.add(oOption);
                if(regionChannel == "Hebrew")
                oOption.innerHTML = "בייג'ין";
                else 
                oOption.innerHTML = "BEIJING";
                oOption.value = "BJS";*/



                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "בנגקוק";
                else
                    oOption.innerHTML = "BANGKOK";
                oOption.value = "BKK";

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "בומביי מומבאיי";
                else
                    oOption.innerHTML = "BOMBAY";
                oOption.value = "BOM";

            }

            else if (selFrom.options[selFrom.selectedIndex].value == "LAX") {
                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "בייג'ין";
                else
                    oOption.innerHTML = "BEIJING";
                oOption.value = "BJS";

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "בנגקוק";
                else
                    oOption.innerHTML = "BANGKOK";
                oOption.value = "BKK";

                /*oOption = document.createElement("OPTION");
                selTo.options.add(oOption);
				
				if(regionChannel == "Hebrew")
                oOption.innerHTML = "בומביי מומבאיי";
                else 
                oOption.innerHTML = "BOMBAY";
                oOption.value = "BOM";*/

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "הונג קונג";
                else
                    oOption.innerHTML = "HONGKONG";
                oOption.value = "HKG";

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "יוהנסבורג";
                else
                    oOption.innerHTML = "JOHANNESBURG";
                oOption.value = "JNB";

            }


            else if (selFrom.options[selFrom.selectedIndex].value == "NYC") {
                /*oOption = document.createElement("OPTION");
                selTo.options.add(oOption);
                if(regionChannel == "Hebrew")
                oOption.innerHTML = "בייג'ין";//	oOption.innerHTML = "בייג'ין";				
                else 
                oOption.innerHTML = "BEIJING";
                oOption.value = "BJS";*/

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "בנגקוק";
                else
                    oOption.innerHTML = "BANGKOK";
                oOption.value = "BKK";

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "בומביי מומבאיי";
                else
                    oOption.innerHTML = "BOMBAY";
                oOption.value = "BOM";

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "הונג קונג";
                else
                    oOption.innerHTML = "HONGKONG";
                oOption.value = "HKG";

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "יוהנסבורג";
                else
                    oOption.innerHTML = "JOHANNESBURG";
                oOption.value = "JNB";

            }
            else if (selFrom.options[selFrom.selectedIndex].value == "LON") {
                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);
                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "בייג'ין"; //	oOption.innerHTML = "בייג'ין";				
                else
                    oOption.innerHTML = "BEIJING";
                oOption.value = "BJS";

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "בנגקוק";
                else
                    oOption.innerHTML = "BANGKOK";
                oOption.value = "BKK";

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "בומביי מומבאיי";
                else
                    oOption.innerHTML = "BOMBAY";
                oOption.value = "BOM";

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "הונג קונג";
                else
                    oOption.innerHTML = "HONGKONG";
                oOption.value = "HKG";
                
                
                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "יוהנסבורג";
                else
                    oOption.innerHTML = "JOHANNESBURG";
                oOption.value = "JNB";

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);




            }

            else if (selFrom.options[selFrom.selectedIndex].value == "JNB") {

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "בנגקוק";
                else
                    oOption.innerHTML = "BANGKOK";
                oOption.value = "BKK";

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "טורונטו";
                else
                    oOption.innerHTML = "TORONTO";
                oOption.value = "YYZ";

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "לונדון";
                else
                    oOption.innerHTML = "LONDON";
                oOption.value = "LON";

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "ניו יורק";
                else
                    oOption.innerHTML = "NEW YORK";
                oOption.value = "NYC";
            }
            else if (selFrom.options[selFrom.selectedIndex].value == "ZRH") {
                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);


                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "בייג'ין";
                else
                    oOption.innerHTML = "BEIJING";
                oOption.value = "BJS";

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "בנגקוק";
                else
                    oOption.innerHTML = "BANGKOK";
                oOption.value = "BKK";

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "בומביי מומבאיי";
                else
                    oOption.innerHTML = "BOMBAY";
                oOption.value = "BOM";

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "הונג קונג";
                else
                    oOption.innerHTML = "HONGKONG";
                oOption.value = "HKG";

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "יוהנסבורג";
                else
                    oOption.innerHTML = "JOHANNESBURG";
                oOption.value = "JNB";

            }
            else if (selFrom.options[selFrom.selectedIndex].value == "PAR") {
                /*	oOption = document.createElement("OPTION");
                selTo.options.add(oOption);
				
				if(regionChannel == "Hebrew")
                oOption.innerHTML = "בייג'ין";
                else 
                oOption.innerHTML = "BEIJING";
                oOption.value = "BJS";*/

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "בנגקוק";
                else
                    oOption.innerHTML = "BANGKOK";
                oOption.value = "BKK";

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "בומביי מומבאיי";
                else
                    oOption.innerHTML = "BOMBAY";
                oOption.value = "BOM";

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "הונג קונג";
                else
                    oOption.innerHTML = "HONGKONG";
                oOption.value = "HKG";

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "יוהנסבורג";
                else
                    oOption.innerHTML = "JOHANNESBURG";
                oOption.value = "JNB";

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "קהיר";
                else
                    oOption.innerHTML = "CAIRO";
                oOption.value = "CAI";

            }
            else if (selFrom.options[selFrom.selectedIndex].value == "BRU") {
                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "בייג'ין";
                else
                    oOption.innerHTML = "BEIJING";
                oOption.value = "BJS";

                /*	oOption = document.createElement("OPTION");
                selTo.options.add(oOption);
				
				if(regionChannel == "Hebrew")
                oOption.innerHTML = "בנגקוק";
                else 
                oOption.innerHTML = "BANGKOK";
                oOption.value = "BKK";*/

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "בומביי מומבאיי";
                else
                    oOption.innerHTML = "BOMBAY";
                oOption.value = "BOM";

                oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

                if (regionChannel == "Hebrew")
                    oOption.innerHTML = "הונג קונג";
                else
                    oOption.innerHTML = "HONGKONG";
                oOption.value = "HKG";

                /*oOption = document.createElement("OPTION");
                selTo.options.add(oOption);

				if(regionChannel == "Hebrew")
                oOption.innerHTML = "יוהנסבורג";
                else 
                oOption.innerHTML = "JOHANNESBURG";
                oOption.value = "JNB";*/

            }





        }

    }
    else {
        selTo.options.selectedIndex = 0;
    }
}


function checkSystemId(pageType, origin, dest, SunDorCodes, isAgent) {
   
    var objckbBounosAndCach = document.getElementById("ckbEmission2");
    var objckbBounos = document.getElementById("ckbEmission");
    if (pageType == "amadeus") {

        if (objIsFamily) {
            //We Arrived from Elal family page
            return '18';
        }
        //We Arrived from - ELAL Beyond - always pass 10( amadeus advanced search)
        return '10';
    }

    //added by Sergey on 30/04/2009
    if (SunDorCodes != null) {
        if (SunDorCodes.indexOf(origin.toLowerCase()) > -1 || SunDorCodes.indexOf(dest.toLowerCase()) > -1) {
            if (dest.toLowerCase().substring(0, 1) == '*' || origin.toLowerCase().substring(0, 1) == '*') {
                if (objIsFamily) {
                    return '13';
                }
                else {
                    return '7';
                }
            }
        }
    }
    if (objIsFamily) {
        //We Arrived from Elal family page
        return '2';
    }

    if (objIsPartner) {
        if (objckbBounos != null && objckbBounos.checked) {
            //if its checked  - bounus flight
            return '4';
        }
        //elal small company
        return '12';
    }


    if (objckbBounos != null && objckbBounos.checked) {
        //if its checked  - bounus flight
        return '4';
    }


    if (isAgent) // We Arrived from Travel Agents page
    {
        return '15';
    }


    //if its not checked and we are in regular homepage
    return '1';

}
//END CHECK SYSTEM ID
function showSpecialAges() {
    document.getElementById("linkToSpecialAges").style.display = "none";
    document.getElementById("specialAgesBabies").style.display = "block";
    document.getElementById("specialAgesTeenagers").style.display = "block";
    document.getElementById("specialAgesYoyth").style.display = "block";
    document.getElementById("specialAgesStudent").style.display = "block";
    document.getElementById("specialAgesGolden").style.display = "block";
}

function showSpecialAgesAmadeus(idLink) {
    idLink.style.display = "none";
    if (getBrowserType() == 'IE') {
        
        document.getElementById("specialAgesYoyth").style.display = "block";
        document.getElementById("specialAgesTeenagers").style.display = "block";
        document.getElementById("specialAgesInfants").style.display = "block";
        document.getElementById("specialAgesStudent").style.display = "block";
        document.getElementById("specialAgesGolden").style.display = "block";
        
        document.getElementById("lblSpecialAgesInfants").style.display = "block";
        document.getElementById("lblSpecialAgesYouths").style.display = "block";
        document.getElementById("lblSpecialAgesTeenagers").style.display = "block";
        document.getElementById("lblSpecialAgesStudents").style.display = "block";
        document.getElementById("lblSpecialAgesGolden").style.display = "block";

        document.getElementById("spSpecialAgesYoyth").style.display = "block";
        document.getElementById("spSpecialAgesTeenagers").style.display = "block";
        document.getElementById("spSpecialAgesInfants").style.display = "block";
        document.getElementById("spSpecialAgesStudent").style.display = "block";
       // document.getElementById("spSpecialAgesGolden").style.display = "block";
        
        document.getElementById("space1").style.display = "block";
        document.getElementById("space2").style.display = "block";
        document.getElementById("space3").style.display = "block";
        document.getElementById("space4").style.display = "block";
    }
    else //for Mozilla
    {
        document.getElementById("specialAgesYoyth").style.display = "table-cell";
        document.getElementById("specialAgesStudent").style.display = "table-cell";
        document.getElementById("specialAgesGolden").style.display = "table-cell";
        document.getElementById("specialAgesTeenagers").style.display = "table-cell";
        document.getElementById("specialAgesInfants").style.display = "table-cell";

        document.getElementById("lblSpecialAgesYouths").style.display = "table-cell";
        document.getElementById("lblSpecialAgesInfants").style.display = "table-cell";
        document.getElementById("lblSpecialAgesStudents").style.display = "table-cell";
        document.getElementById("lblSpecialAgesGolden").style.display = "table-cell";
        document.getElementById("lblSpecialAgesTeenagers").style.display = "table-cell";

        document.getElementById("spSpecialAgesYoyth").style.display = "table-cell";
        document.getElementById("spSpecialAgesInfants").style.display = "table-cell";
        document.getElementById("spSpecialAgesStudent").style.display = "table-cell";
        document.getElementById("spSpecialAgesTeenagers").style.display = "table-cell";
        
        document.getElementById("space1").style.display = "table-cell";
        document.getElementById("space2").style.display = "table-cell";
        document.getElementById("space3").style.display = "table-cell";
        document.getElementById("space4").style.display = "table-cell";
    }
}

function displayUnderLine(obj, flag) {
    if (flag == 'true') {
        obj.className = obj.className + " underlineText ";
    }
    else {
        obj.className = obj.className.replace("underlineText", "");
    }

}
