﻿// JScript File

function setSubmitted(btn) {

    var isValid;

    if (typeof (Page_ClientValidate) == 'function') {
        isValid = Page_ClientValidate();
    }

    if (isValid) {
        btn.disabled = true;
        if (btn.disabled) btn.value = 'Submitting...';
    }

}


function formSubmit(event, button) {
    if (event.keyCode == 13) {
        document.getElementById(button).click();
        return false;
    }
    if (event.keyCode == 11) {
        document.getElementById(button).click();
        return false;
    }
}
function clickSubmit(event, button) {
    document.getElementById(button).click();
    return false;
}

function setToDate() {
    //    var dt;
    //    dt=document.getElementById('ctl00_ContentPlaceHolder1_Fpsrch1_txtcheckin').value;
    //    var x =Date;
    //    x.parse(dt);
    //    x=x+1
    //    document.getElementById('ctl00_ContentPlaceHolder1_Fpsrch1_txtcheckout').value=x;
}

function showpan() {


    //document.getElementById("progress").innerHTML = "<img src=/images/wait.gif style='Z-Index: 11;' />";
    //main.style.visibility="visible";
    //document.getElementById("proc1").style.visibility="hidden";
    //document.getElementById("progress").innerHTML = "<img src=/images/wait.gif style='Z-Index: 11;' />";

    document.getElementById("blnk").style.display = ""
    document.getElementById("proc1").style.display = ""
    setTimeout("setpbar()", 200);

}

function hidepan() {

    if (typeof (Page_ClientValidate) == 'function') {
        Page_ClientValidate();
    }

    if (Page_IsValid) {

        //main.style.visibility="hidden";
        document.getElementById("blnk").style.visibility = "visible";
        document.getElementById("blnk").style.height = getDocHeight() + 'px'
        document.getElementById("proc1").style.visibility = "visible";
        //document.getElementById("progress").innerHTML = "<img src=/images/wait.gif style='Z-Index: 11;' />";
        document.getElementById("proc1").style.display = ""
        document.getElementById("blnk").style.display = ""
        document.getElementById("blnk").style.visibility = "visible";
        document.getElementById("proc1").style.visibility = "visible";
        setTimeout("setpbar()", 200);
    }
}

function setpbar() {
    try {
        document.getElementById("pbar").src = "/images/wait.gif";
    }
    catch (ex)
         { }

}

function showwait() {
    //document.getElementById("progress").innerHTML = "<img src=/images/wait.gif style='Z-Index: 11;' />";
    document.getElementById("blnk").style.visibility = "visible";
    document.getElementById("blnk").style.height = getDocHeight() + 'px'
    document.getElementById("proc1").style.visibility = "visible";
}

function getDocHeight() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    );
}


function pageLoad() {
    // set form action
    
    try
    {

    $get('aspnetForm').action=    document.location.href;
       
    }
    catch(e)
    {}

        

}

function showrooms_b() {
    var q;
       
    q = document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_dlrooms").value
    
    document.getElementById("rm2").style.display = "none";
    document.getElementById("rm3").style.display = "none";

    if (q >= 2) { document.getElementById("rm2").style.display = "block"; }
    if (q >= 3) { document.getElementById("rm3").style.display = "block"; }

}

function showrooms() {
    var q;
    var h;
    q = document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_dlrooms").value

    h = (q * 19) + 42
    document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_pnrooms").style.height = h + 'px'

}

function showroomtype(x) {
    //		    var q; 
    //		    if (x==1) 
    //		    {
    //		     
    //		     q=document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_dlAd1").value
    //		     if (q==2) 
    //		       document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_dlRm1").style.visibility= 'visible';
    //		     }
    //		     
    //		    if (x==2) 
    //		    {
    //		     
    //		     q=document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_dlAd2").value
    //		     if (q==2) document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_dlRm2").style.visibility= 'visible';
    //		    }
    //		     if (x==3) 
    //		    {
    //		     document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_dlRm3").style.visibility= 'hidden';
    //		     q=document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_dlAd3").value
    //		     if (q==2) document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_dlRm3").style.visibility= 'visible';
    //		    }
}


function showchildage(x) {
    var q;
    document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_labchld").style.visibility = 'hidden';
    if (x == 1) {
        document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_r1ch1").style.visibility = 'hidden';
        document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_r1ch2").style.visibility = 'hidden';

        q = document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_dlChld1").value
        if (q == 1) {
            document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_r1ch1").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_labchld").style.visibility = 'visible';
        }
        if (q == 2) {
            document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_r1ch1").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_r1ch2").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_labchld").style.visibility = 'visible';
        }
    }

    if (x == 2) {
        document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_r2ch1").style.visibility = 'hidden';
        document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_r2ch2").style.visibility = 'hidden';

        q = document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_dlChld2").value
        if (q == 1) {
            document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_r2ch1").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_labchld").style.visibility = 'visible';
        }
        if (q == 2) {
            document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_r2ch1").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_r2ch2").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_labchld").style.visibility = 'visible';
        }
    }

    if (x == 3) {
        document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_r3ch1").style.visibility = 'hidden';
        document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_r3ch2").style.visibility = 'hidden';

        q = document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_dlChld3").value
        if (q == 1) {
            document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_r3ch1").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_labchld").style.visibility = 'visible';
        }
        if (q == 2) {
            document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_r3ch1").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_r3ch2").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_Leftsrch1_labchld").style.visibility = 'visible';
        }
    }
}

function showchildage_b(x) {
    var q;
    document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_labchld").style.visibility = 'hidden';
    if (x == 1) {
        document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_r1ch1").style.visibility = 'hidden';
        document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_r1ch2").style.visibility = 'hidden';

        q = document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_dlChld1").value
        if (q == 1) {
            document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_r1ch1").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_labchld").style.visibility = 'visible';
        }
        if (q == 2) {
            document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_r1ch1").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_r1ch2").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_labchld").style.visibility = 'visible';
        }
    }

    if (x == 2) {
        document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_r2ch1").style.visibility = 'hidden';
        document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_r2ch2").style.visibility = 'hidden';

        q = document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_dlChld2").value
        if (q == 1) {
            document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_r2ch1").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_labchld").style.visibility = 'visible';
        }
        if (q == 2) {
            document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_r2ch1").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_r2ch2").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_labchld").style.visibility = 'visible';
        }
    }

    if (x == 3) {
        document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_r3ch1").style.visibility = 'hidden';
        document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_r3ch2").style.visibility = 'hidden';

        q = document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_dlChld3").value
        if (q == 1) {
            document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_r3ch1").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_labchld").style.visibility = 'visible';
        }
        if (q == 2) {
            document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_r3ch1").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_r3ch2").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_topsrch1_labchld").style.visibility = 'visible';
        }
    }
}

function fpshowrooms() {
    var q;
    var h;
    q = document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_dlrooms").value

    h = (q * 18) + 19
    document.getElementById("pnrooms").style.height = h + 'px'
}

function fpshowroomtype(x) {
    //		    var q; 
    //		    if (x==1) 
    //		    {
    //		     document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_dlRm1").style.visibility= 'hidden';
    //		     q=document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_dlAd1").value
    //		     if (q==2) 
    //		       document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_dlRm1").style.visibility= 'visible';
    //		     }
    //		     
    //		    if (x==2) 
    //		    {
    //		     document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_dlRm2").style.visibility= 'hidden';
    //		     q=document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_dlAd2").value
    //		     if (q==2) document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_dlRm2").style.visibility= 'visible';
    //		    }
    //		     if (x==3) 
    //		    {
    //		     document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_dlRm3").style.visibility= 'hidden';
    //		     q=document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_dlAd3").value
    //		     if (q==2) document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_dlRm3").style.visibility= 'visible';
    //		    }
}

function fpshowchildage(x) {
    var q;
    document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_labchld").style.visibility = 'hidden';
    if (x == 1) {
        document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_r1ch1").style.visibility = 'hidden';
        document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_r1ch2").style.visibility = 'hidden';

        q = document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_dlChld1").value
        if (q == 1) {
            document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_r1ch1").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_labchld").style.visibility = 'visible';
        }
        if (q == 2) {
            document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_r1ch1").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_r1ch2").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_labchld").style.visibility = 'visible';
        }
    }

    if (x == 2) {
        document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_r2ch1").style.visibility = 'hidden';
        document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_r2ch2").style.visibility = 'hidden';

        q = document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_dlChld2").value
        if (q == 1) {
            document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_r2ch1").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_labchld").style.visibility = 'visible';
        }
        if (q == 2) {
            document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_r2ch1").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_r2ch2").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_labchld").style.visibility = 'visible';
        }
    }

    if (x == 3) {
        document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_r3ch1").style.visibility = 'hidden';
        document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_r3ch2").style.visibility = 'hidden';

        q = document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_dlChld3").value
        if (q == 1) {
            document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_r3ch1").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_labchld").style.visibility = 'visible';
        }
        if (q == 2) {
            document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_r3ch1").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_r3ch2").style.visibility = 'visible';
            document.getElementById("ctl00_ContentPlaceHolder1_fpsrch1_labchld").style.visibility = 'visible';
        }
    }


}

function dtshowrooms() {
    var q;
    var h;
    q = document.getElementById("dlrooms").value

    h = (q * 18) + 19
    document.getElementById("pnrooms").style.height = h + 'px'
}

function dtshowroomtype(x) {
    var q;
    if (x == 1) {
        document.getElementById("dlRm1").style.visibility = 'hidden';
        q = document.getElementById("dlAd1").value
        if (q == 2)
            document.getElementById("dlRm1").style.visibility = 'visible';
    }

    if (x == 2) {
        document.getElementById("dlRm2").style.visibility = 'hidden';
        q = document.getElementById("dlAd2").value
        if (q == 2) document.getElementById("dlRm2").style.visibility = 'visible';
    }
    if (x == 3) {
        document.getElementById("dlRm3").style.visibility = 'hidden';
        q = document.getElementById("dlAd3").value
        if (q == 2) document.getElementById("dlRm3").style.visibility = 'visible';
    }
}

// JScript File
var xx
var yy
var city
var url

function openw(url) {
    window.open(url, "book");
}

function openmap(city, xx) {
    window.open("/maps/vmap.aspx?city=" + city + "&pid=" + xx, "viewmap", "resizable=yes,Width=800, Height=600");
}


function sw(pl, aid) {

    var theForm = document.forms['aspnetForm'];
    if (!theForm) {
        theForm = document.getElementById("img1");
    }

    if (pl == 1) theForm.src = "/fs/" + aid + "/" + aid + "-1.jpg";
    if (pl == 2) theForm.src = "/fs/" + aid + "/" + aid + "-2.jpg";
    if (pl == 3) theForm.src = "/fs/" + aid + "/" + aid + "-3.jpg";
    if (pl == 4) theForm.src = "/fs/" + aid + "/" + aid + "-4.jpg";
    if (pl == 5) theForm.src = "/fs/" + aid + "/" + aid + "-5.jpg";
    if (pl == 6) theForm.src = "/fs/" + aid + "/" + aid + "-6.jpg";
    if (pl == 7) theForm.src = "/fs/" + aid + "/" + aid + "-7.jpg";
    if (pl == 8) theForm.src = "/fs/" + aid + "/" + aid + "-8.jpg";
    if (pl == 9) theForm.src = "/fs/" + aid + "/" + aid + "-9.jpg";
    if (pl == 10) theForm.src = "/fs/" + aid + "/" + aid + "-10.jpg";
    if (pl == 11) theForm.src = "/fs/" + aid + "/" + aid + "-11.jpg";
    if (pl == 12) theForm.src = "/fs/" + aid + "/" + aid + "-12.jpg";
    if (pl == 13) theForm.src = "/fs/" + aid + "/" + aid + "-13.jpg";
    if (pl == 14) theForm.src = "/fs/" + aid + "/" + aid + "-14.jpg";
    if (pl == 15) theForm.src = "/fs/" + aid + "/" + aid + "-15.jpg";
    if (pl == 16) theForm.src = "/fs/" + aid + "/" + aid + "-16.jpg";
    if (pl == 17) theForm.src = "/fs/" + aid + "/" + aid + "-17.jpg";
    if (pl == 18) theForm.src = "/fs/" + aid + "/" + aid + "-18.jpg";
    if (pl == 19) theForm.src = "/fs/" + aid + "/" + aid + "-19.jpg";
    if (pl == 20) theForm.src = "/fs/" + aid + "/" + aid + "-20.jpg";

}


function showwait() {
    document.getElementById("progress").innerHTML = "<img src=/images/wait.gif />";
}

function nophoto(object) {
    object.src = "http://img.go4travel.net/fs/nophoto1.jpg";
}

$(document).ready(function () {

    //Adjust panel height
    $.fn.adjustPanel = function () {
        $(this).find("ul, .subpanel").css({ 'height': 'auto' }); //Reset subpanel and ul height

        var windowHeight = $(window).height(); //Get the height of the browser viewport
        var panelsub = $(this).find(".subpanel").height(); //Get the height of subpanel	
        var panelAdjust = windowHeight - 100; //Viewport height - 100px (Sets max height of subpanel)
        var ulAdjust = panelAdjust - 25; //Calculate ul size after adjusting sub-panel (27px is the height of the base panel)

        if (panelsub >= panelAdjust) {	 //If subpanel is taller than max height...
            $(this).find(".subpanel").css({ 'height': panelAdjust }); //Adjust subpanel to max height
            $(this).find("ul").css({ 'height': ulAdjust }); //Adjust subpanel ul to new size
        }
        else if (panelsub < panelAdjust) { //If subpanel is smaller than max height...
            $(this).find("ul").css({ 'height': 'auto' }); //Set subpanel ul to auto (default size)
        }
    };

    //Execute function on load
    $("#chatpanel").adjustPanel(); //Run the adjustPanel function on #chatpanel
    $("#alertpanel").adjustPanel(); //Run the adjustPanel function on #alertpanel

    //Each time the viewport is adjusted/resized, execute the function
    $(window).resize(function () {
        $("#chatpanel").adjustPanel();
        $("#alertpanel").adjustPanel();
    });

    //Click event on Chat Panel + Alert Panel	
    $("#chatpanel a:first, #alertpanel a:first").click(function () { //If clicked on the first link of #chatpanel and #alertpanel...
        if ($(this).next(".subpanel").is(':visible')) { //If subpanel is already active...
            $(this).next(".subpanel").hide(); //Hide active subpanel
            $("#footpanel li a").removeClass('active'); //Remove active class on the subpanel trigger
        }
        else { //if subpanel is not active...
            $(".subpanel").hide(); //Hide all subpanels
            $(this).next(".subpanel").toggle(); //Toggle the subpanel to make active
            $("#footpanel li a").removeClass('active'); //Remove active class on all subpanel trigger
            $(this).toggleClass('active'); //Toggle the active class on the subpanel trigger
        }
        return false; //Prevent browser jump to link anchor
    });

    //Click event outside of subpanel
    $(document).click(function () { //Click anywhere and...
        $(".subpanel").hide(); //hide subpanel
        $("#footpanel li a").removeClass('active'); //remove active class on subpanel trigger
    });
    $('.subpanel ul').click(function (e) {
        e.stopPropagation(); //Prevents the subpanel ul from closing on click
    });

    //Delete icons on Alert Panel
    $("#alertpanel li").hover(function () {
        $(this).find("a.delete").css({ 'visibility': 'visible' }); //Show delete icon on hover
    }, function () {
        $(this).find("a.delete").css({ 'visibility': 'hidden' }); //Hide delete icon on hover out
    });

});


