﻿/// <reference name="MicrosoftAjax.js"/>

 var ctl_prefix = "Engine1";
        
function toggleMode_BookingEngine2(id) {        
    //alert("id:" + id);
    var displayMode = "block";
    
    // ctl00_Engine1_divFrom
    
    if(id!='package') { displayMode = "none"; }        
    document.getElementById("ctl00_" + ctl_prefix + "_drpFrom").style.display = displayMode;
    document.getElementById("ctl00_" + ctl_prefix + "_lblFrom").style.display = displayMode;
    //document.getElementById("ctl00_" + ctl_prefix + "_divFrom").style.display = displayMode;
    
   // for (var i=1; i <= 4; i++) { document.getElementById("ctl00_" + ctl_prefix + "_lblDate" + i).style.display = "none"; }        
    
   // if(id=='package') { document.getElementById("ctl00_" + ctl_prefix + "_lblDate1").style.display='block'; document.getElementById("ctl00_" + ctl_prefix + "_lblDate2").style.display='block' }
    //else { document.getElementById("ctl00_" + ctl_prefix + "_lblDate3").style.display='block'; document.getElementById("ctl00_" + ctl_prefix + "_lblDate4").style.display='block' }                
}
 function toggleModeRooms_BookingEngine2(id) {                
    var selectedIndex = document.getElementById("ctl00_" + ctl_prefix + "_drpChildrenRoom2").selectedIndex;
    
    if(id=='1') { document.getElementById("ctl00_" + ctl_prefix + "_divPassengerRoom2").style.display='none'; document.getElementById("ctl00_" + ctl_prefix + "_divChildAgesRoom2").style.display = "none"; }
    else { 
        document.getElementById("ctl00_" + ctl_prefix + "_divPassengerRoom2").style.display='block'; 
        if(selectedIndex > 0) { document.getElementById("ctl00_" + ctl_prefix + "_divChildAgesRoom2").style.display = "block";  }        
    }
    //if(id=='2') { displayChildAgesControls(id); }        
}    
 function displayChildAgesControls_BookingEngine2(id) {
    // toggle display <div>
    var selectedIndex = document.getElementById("ctl00_" + ctl_prefix + "_drpChildrenRoom" + id).selectedIndex;
    if(selectedIndex == 0) { document.getElementById("ctl00_" + ctl_prefix + "_divChildAgesRoom" + id).style.display = "none"; }
    else { document.getElementById("ctl00_" + ctl_prefix + "_divChildAgesRoom" + id).style.display = "block"; }        
        //hide all child age dropdowns
    for (var i=1; i <= 4; i++) { document.getElementById("ctl00_" + ctl_prefix + "_drpRoom" + id + "Child" + i).style.display = "none"; }        
        //display/hide child age dropdowns
    for (var i=1; i <= selectedIndex; i++) { document.getElementById("ctl00_" + ctl_prefix + "_drpRoom" + id + "Child" + i).style.display = "block"; }
}

function displayChildAgesControls_BookingEngine2_ORIGINAL(id) {
    // toggle display <div>
    var selectedIndex = document.getElementById("ctl00_" + ctl_prefix + "_drpChildrenRoom" + id).selectedIndex;
    if(selectedIndex == 0) { document.getElementById("ctl00_" + ctl_prefix + "_divChildAgesRoom" + id).style.display = "none"; }
    else { document.getElementById("ctl00_" + ctl_prefix + "_divChildAgesRoom" + id).style.display = "block"; }        
    //hide all child age dropdowns
    for (var i=1; i <= 4; i++) { document.getElementById("ctl00_" + ctl_prefix + "_drpRoom" + id + "Child" + i).style.display = "none"; }        
    //display/hide child age dropdowns
    for (var i=1; i <= selectedIndex; i++) { document.getElementById("ctl00_" + ctl_prefix + "_drpRoom" + id + "Child" + i).style.display = "block"; }
}