﻿
/*
* jQuery 1.2.2 - New Wave Javascript
*
* Copyright (c) 2007 John Resig (jquery.com)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* $Date: 2008-01-14 17:56:07 -0500 (Mon, 14 Jan 2008) $
* $Rev: 4454 $
*/
/*
eval(function(p, a, c, k, e, r) { e = function(c) { return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) >
35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) r[e(c)] = k[c]
|| e(c); k = [function(e) { return r[e] } ]; e = function() { return '\\w+' }; c = 1 }; while (c--) if (k[c]) p = p.
replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p } ('(J(){7(1e.19)L w=1e.19;L E=1e.19=J(a,b){K 1D E.
2m.4Y(a,b)};7(1e.$)L D=1e.$;1e.$=E;L u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;L G=/^.[^:#\\[\\.]*$/;E.1i=E.2m={4Y:J(d
,b){d=d||T;7(d.15){6[0]=d;6.M=1;K 6}N 7(1v d=="25"){L c=u.39(d);7(c&&(c[1]||!b)){7(c[1])d=E.5c([c[1]],b);N{L a=T.5N

(c[3]);7(a)7(a.2s!=c[3])K E().2r(d);N{6[0]=a;6.M=1;K 6}N d=[]}}N K 1D E(b).2r(d)}N 7(E.1q(d))K 1D E(T)[E.1i.21?"21":
"43"](d);K 6.6G(d.1n==1N&&d||(d.5j||d.M&&d!=1e&&!d.15&&d[0]!=10&&d[0].15)&&E.2H(d)||[d])},5j:"1.2.2",82:J(){K 6.M},M
:0,22:J(a){K a==10?E.2H(6):6[a]},2E:J(b){L a=E(b);a.56=6;K a},6G:J(a){6.M=0;1N.2m.1h.1j(6,a);K 6},V:J(a,b){K E.V(6,
a,b)},5E:J(b){L a=-1;6.V(J(i){7(6==b)a=i});K a},1K:J(c,a,b){L d=c;7(c.1n==4d)7(a==10)K 6.M&&E[b||"1K"](6[0],c)||10;
N{d={};d[c]=a}K 6.V(J(i){P(c 1r d)E.1K(b?6.Y:6,c,E.1l(6,d[c],b,i,c))})},1m:J(b,a){7((b==\'29\'||b==\'1P\')&&2M(a)<0
)a=10;K 6.1K(b,a,"2q")},1t:J(b){7(1v b!="4D"&&b!=W)K 6.4B().3t((6[0]&&6[0].2u||T).5v(b));L a="";E.V(b||6,J(){E.V(6.
3p,J(){7(6.15!=8)a+=6.15!=1?6.6M:E.1i.1t([6])})});K a},5r:J(b){7(6[0])E(b,6[0].2u).5J().3n(6[0]).2a(J(){L a=6;2e(

a.1B)a=a.1B;K a}).3t(6);K 6},8t:J(a){K 6.V(J(){E(6).6C().5r(a)})},8m:J(a){K 6.V(J(){E(6).5r(a)})},3t:J(){K 6.3P(1a
,R,S,J(a){7(6.15==1)6.3k(a)})},6s:J(){K 6.3P(1a,R,R,J(a){7(6.15==1)6.3n(a,6.1B)})},6o:J(){K 6.3P(1a,S,S,J(a){6.1b
.3n(a,6)})},5a:J(){K 6.3P(1a,S,R,J(a){6.1b.3n(a,6.2J)})},3h:J(){K 6.56||E([])},2r:J(b){L c=E.2a(6,J(a){K E.2r(b,a
)});K 6.2E(/[^+>] [^+>]/.17(b)||b.1g("..")>-1?E.57(c):c)},5J:J(e){L f=6.2a(J(){7(E.14.1d&&!E.3W(6)){L a=6.6c(R),5u=
T.2R("1u"),4T=T.2R("1u");5u.3k(a);4T.38=5u.38;K 4T.1B}N K 6.6c(R)});L d=f.2r("*").4R().V(J(){7(6[F]!=10)6[F]=W});7(e
===R)6.2r("*").4R().V(J(i){7(6.15==3)K;L c=E.Q(6,"2N");P(L a 1r c)P(L b 1r c[a])E.16.1c(d[i],a,c[a][b],c[a][b].Q)});
K f},1F:J(b){K 6.2E(E.1q(b)&&E.3x(6,J(a,i){K b.1O(a,i)})||E.3d(b,6))},4I:J(b){7(b.1n==4d)7(G.17(b))K 6.2E(E.3d(b,6,
R));N b=E.3d(b,6);L a=b.M&&b[b.M-1]!==10&&!b.15;K 6.1F(J(){K a?E.35(6,b)<0:6!=b})},1c:J(a){K!a?6:6.2E(E.34(6.22(),a.1
n==4d?E(a).22():a.M!=10&&(!a.12||E.12(a,"3i"))?a:[a]))},3K:J(a){K a?E.3d(a,6).M>0:S},7g:J(a){K 6.3K("."+a)},5P:J(
b){7(b==10){7(6.M){L c=6[0];7(E.12(c,"2y")){L e=c.44,5L=[],11=c.11,30=c.U=="2y-30";7(e<0)K W;P(L i=30?e:0,2b=30?e+
1:11.M;i<2b;i++){L d=11[i];7(d.2p){b=E.14.1d&&!d.9s.1C.9o?d.1t:d.1C;7(30)K b;5L.1h(b)}}K 5L}N K(6[0].1C||"").1p(/\
\r/g,"")}K 10}K 6.V(J(){7(6.15!=1)K;7(b.1n==1N&&/5w|5y/.17(6.U))6.3o=(E.35(6.1C,b)>=0||E.35(6.37,b)>=0);N 7(E.12(6,

"2y")){L a=b.1n==1N?b:[b];E("90",6).V(J(){6.2p=(E.35(6.1C,a)>=0||E.35(6.1t,a)>=0)});7(!a.M)6.44=-1}N 6.1C=b})},3q:
J(a){K a==10?(6.M?6[0].38:W):6.4B().3t(a)},6P:J(a){K 6.5a(a).1Y()},6N:J(i){K 6.2V(i,i+1)},2V:J(){K 6.2E(1N.2m.2V.1j
(6,1a))},2a:J(b){K 6.2E(E.2a(6,J(a,i){K b.1O(a,i,a)}))},4R:J(){K 6.1c(6.56)},3P:J(g,f,h,d){L e=6.M>1,3m;K 6.V(J(){7
(!3m){3m=E.5c(g,6.2u);7(h)3m.8I()}L b=6;7(f&&E.12(6,"1V")&&E.12(3m[0],"4x"))b=6.3V("1S")[0]||6.3k(6.2u.2R("1S"));L c
=E([]);E.V(3m,J(){L a=e?E(6).5J(R)[0]:6;7(E.12(a,"1o")){c=c.1c(a)}N{7(a.15==1)c=c.1c(E("1o",a).1Y());d.1O(b,a)}})
;c.V(6D)})}};E.2m.4Y.2m=E.2m;J 6D(i,a){7(a.3R)E.3Q({1f:a.3R,3l:S,1G:"1o"});N E.5l(a.1t||a.6A||a.38||"");7(a.1b)a.1b
.2X(a)}E.1s=E.1i.1s=J(){L b=1a[0]||{},i=1,M=1a.M,5i=S,11;7(b.1n==8f){5i=b;b=1a[1]||{};i=2}7(1v b!="4D"&&1v b!="J"

)b={};7(M==1){b=6;i=0}P(;i<M;i++)7((11=1a[i])!=W)P(L a 1r 11){7(b===11[a])6z;7(5i&&11[a]&&1v 11[a]=="4D"&&b[a]&&
!11[a].15)b[a]=E.1s(b[a],11[a]);N 7(11[a]!=10)b[a]=11[a]}K b};L F="19"+(1D 3O()).3N(),6y=0,5e={};L H=/z-?5E|89-?
87|1y|6q|85-?1P/i;E.1s({81:J(a){1e.$=D;7(a)1e.19=w;K E},1q:J(a){K!!a&&1v a!="25"&&!a.12&&a.1n!=1N&&/J/i.17(a+"")}
,3W:J(a){K a.1I&&!a.1k||a.28&&a.2u&&!a.2u.1k},5l:J(a){a=E.3f(a);7(a){L b=T.3V("6k")[0]||T.1I,1o=T.2R("1o");1o.U="1
t/4l";7(E.14.1d)1o.1t=a;N 1o.3k(T.5v(a));b.3k(1o);b.2X(1o)}},12:J(b,a){K b.12&&b.12.2F()==a.2F()},1Q:{},Q:J(c,d,b)
{c=c==1e?5e:c;L a=c[F];7(!a)a=c[F]=++6y;7(d&&!E.1Q[a])E.1Q[a]={};7(b!=10)E.1Q[a][d]=b;K d?E.1Q[a][d]:a},3H:J(c,b){
c=c==1e?5e:c;L a=c[F];7(b){7(E.1Q[a]){2T E.1Q[a][b];b="";P(b 1r E.1Q[a])1T;7(!b)E.3H(c)}}N{1R{2T c[F]}1W(e){7(c.55)c.*/


/*
$(window).load(function() {

var OrderIdLast = 0;


$(".loading").fadeIn("fast");
var trLastx = $("#ucLoad_Powerful tr:last");
var id = $(".happy");
//  alert(id.val());
// alert(id.val());
//make a async call to fetch the incremental results
//   $.post("/givememore/" + OrderIdLast, function(data) {
//getwc = good/handler.ashx?tempid=

$.post("/getwc/" + "2204", function(data) {
if (data != null) {
//append new result set to last row
trLastx.after(data);
// alert( data );
//   loading = false;
$(".loading").fadeOut("fast");

}
});


});
*/


/*
$(window).load(function() {

var OrderIdLast = 0;


$(".loading").fadeIn("fast");
var trLastx = $("#ucLoad_Powerful tr:last");
var id = $(".happy");
//  alert(id.val());
// alert(id.val());
//make a async call to fetch the incremental results
//   $.post("/givememore/" + OrderIdLast, function(data) {
//getwc = good/handler.ashx?tempid=

$.post("/getwc/" + "2204", function(data) {
if (data != null) {
//append new result set to last row
trLastx.after(data);
// alert( data );
//   loading = false;
$(".loading").fadeOut("fast");

}
});

});
*/


(function($) {
    $(document).ready(function() {
        var OrderIdLast = 0;
        //     $("#slide_tbl").hide();
       /* var id = $(".happy");
        if (id.val() != null) {

            $(".loading").fadeIn("fast");
            var trLastPrice = $("#ucLoad_Powerful tr:last");
            //  alert(id.val());
            //  alert(id.val());
            //make a async call to fetch the incremental results
            //   $.post("/givememore/" + OrderIdLast, function(data) {


            //getwc = good/handler.ashx?tempid=
            $.get("/getwc/" + id.val(), function(data) {
                if (data != null) {
                    //append new result set to last row
                    trLastPrice.after(data);
                    // alert( data );
                    //   loading = false;
                    $(".loading").fadeOut("fast");

                }
            });


            var scriptx = document.createElement("script");
            scriptx.src = "/map/mapxuc.js";
            scriptx.type = "text/javascript";
            document.getElementsByTagName("head")[0].appendChild(scriptx);

            var script = document.createElement("script");
            script.src = "http://maps.google.com/maps/api/js?sensor=false&callback=loaded";
            script.type = "text/javascript";
            document.getElementsByTagName("head")[0].appendChild(script);



        } else {

*/


    ///         tempid = id2.val();



        ///    $(".loading").fadeIn("fast");

            //make a async call to fetch the incremental results
            //   $.post("/givememore/" + OrderIdLast, function(data) {
            /*$.get("/packcon/pss.aspx?tempid=" + id, function(data) {
            if (data != null) {
            trLastx.after(data);

                    // alert( data );
            //   loading = false;alert(id2.val());
            $(".loading").fadeOut("fast");

                }
            });*/




            /*  var trLastSide = $("#tblSide");
            //make a async call to fetch the incremental results
            //   $.post("/givememore/" + OrderIdLast, function(data) {
            $.get("/packcon/hsb.ashx?tempid=" + id, function(data) {
            if (data != null) {
            //append new result set to last row
            trLastSide.append(data);
            // alert( data );
            //   loading = false;
            $(".loading").fadeOut("fast");

                }
            });
            */


            //--------------------------- TRIP OVERVIEW -----------------------------------------
            /*       
            //make a async call to fetch the incremental results
            //   $.post("/givememore/" + OrderIdLast, function(data) {
            $.get("/packcon/htrip.ashx?tempid=" + id, function(data) {
            if (data != null) {
            //append new result set to last row
            trLastTrip.after(data);
            // alert( data );
            //   loading = false;
            //  $(".loading").fadeOut("fast");

                }
            });
            */


            //--------------------------- ITINERARY -----------------------------------------
            // var trLastItinerary = $("#tblItinerary");
            //make a async call to fetch the incremental results
            //   $.post("/givememore/" + OrderIdLast, function(data) {
            /*   $.get("/packcon/hitinerary.ashx?tempid=" + id, function(data) {
            if (data != null) {
            //append new result set to last row
            trLastTrip.after(data);
            // alert( data );
            //   loading = false;
            //      $(".loading").fadeOut("fast");
            $("#uxitinerary").hide();
            }
            });
            */



        var trLastPrice = $("#gax");

            $.get("/uc/gax.aspx", function(data) {
                if (data != null) {
                    //append new result set to last row
                    trLastPrice.append(data);
                    
                    // alert( data );
                    //   loading = false;
                   
                }
            });




            /*   $.get("/packcon/htips.ashx?tempid=" + id, function(data) {
            if (data != null) {
            //append new result set to last row
            trLastTrip.after(data);
            // alert( data );
            //   loading = false;
            //      $(".loading").fadeOut("fast");
            $("#uxtips").hide();
            }
            });*/



       /*///     $.ajax({
                type: "POST",
                url: "/packcon/htips.ashx",
                data: "tempid=" + id2.val(),
                success: function(data) {
                    //    alert("Data Saved: " + id2.val());
                    //
                    trLastTrip.after(data);
                    $("#uxtips").hide();
                }
            });

*/


       // }


    });

})(jQuery);


function btnSearch_Click() {

    var id2 = $("#Engex1_ddlcity");
    var id3 = $("#Engex1_ddlCountry");
    var resortid = $("#Engex1_ddlBrand");
    var budget = $("#Engex1_ddlBudget");





   // var trLastTrip = $("#resort_css");
    //var ifx = $("#ifrax");

    if (id3.val() == "" || id3.val() == "Select City" || id3.val() == " ") {
        alert("Select a country");
    }
    else 
    {
        var valuex = "";


        if (budget.val() == "" ) {




            if (id3.val() == "Thailand" || id3.val() == "Indonesia") {


             /*  
                if (resortid.val() != "") {
                    //     valuex = "city=" + id2.val() + "&" + "country=" + id3.val() + "&" + "resortid=" + resortid.val();
                    window.location = "/packages/searching.aspx?/luxury/" + id3.val() + "/" + id2.val() + "/" + resortid.val() + "/" + $("#Engex1_ddlBrand option:selected").text().replace("&", "_") + "";

                }
                else if (id2.val() != "") {
                    //  valuex = "city=" + id2.val() + "&" + "country=" + id3.val();
                window.location = "/packages/searching.aspx?/luxury/" + id3.val() + "/" + id2.val() + "";
                }
                else if (id3.val() != "") {
                    //  valuex = "country=" + id3.val();

                window.location = "/packages/searching.aspx?/luxury/" + id3.val() + "";


                }*/


                if (resortid.val() != "") {
                    //     valuex = "city=" + id2.val() + "&" + "country=" + id3.val() + "&" + "resortid=" + resortid.val();
                    window.location = "/luxury/" + id3.val() + "/" + id2.val() + "/" + resortid.val() + "/" + $("#Engex1_ddlBrand option:selected").text().replace("&", "_") + "";

                }
                else if (id2.val() != "") {
                    //  valuex = "city=" + id2.val() + "&" + "country=" + id3.val();
                    window.location = "/luxury/" + id3.val() + "/" + id2.val() + "";
                }
                else if (id3.val() != "") {
                    //  valuex = "country=" + id3.val();

                    window.location = "/luxury/" + id3.val() + "";
                }
                


            } else {


                if (resortid.val() != "") {
                    //     valuex = "city=" + id2.val() + "&" + "country=" + id3.val() + "&" + "resortid=" + resortid.val();
                    window.location = "/luxury/" + id3.val() + "/" + id2.val() + "/" + resortid.val() + "/" + $("#Engex1_ddlBrand option:selected").text().replace("&", "_") + "";

                }
                else if (id2.val() != "") {
                    //  valuex = "city=" + id2.val() + "&" + "country=" + id3.val();
                window.location = "/luxury/" + id3.val() + "/" + id2.val() + "";
                }
                else if (id3.val() != "") {
                    //  valuex = "country=" + id3.val();

                window.location = "/luxury/" + id3.val() + "";


                }

            }


        }
        else {



            if (resortid.val() != "") {
                //     valuex = "city=" + id2.val() + "&" + "country=" + id3.val() + "&" + "resortid=" + resortid.val();
                window.location = "/luxuries/" + budget.val() + "/" + id3.val() + "/" + id2.val() + "/" + resortid.val() + "/" + $("#Engex1_ddlBrand option:selected").text().replace("&", "_") + "";

            }
            else if (id2.val() != "") {
                //  valuex = "city=" + id2.val() + "&" + "country=" + id3.val();
                window.location = "/luxuries/" + budget.val() + "/" + id3.val() + "/" + id2.val() + "";
            }
            else if (id3.val() != "") {
                //  valuex = "country=" + id3.val();

                window.location = "/luxuries/" + budget.val() + "/" + id3.val() + "";



            }

        }


       /* $.ajax({
            type: "POST",
            url: "/resort_1/ld",
            data: valuex,
            success: function(data) {
                //    alert("Data Saved: " + id2.val());
                //
                ///  $(".loading_slide").hide();
                ifx.hide();
                trLastTrip.empty();
                trLastTrip.append(data);

                ///    BindBlarx();
                ///     flapx();
                //     $("#slide_tbl").show();
            }
        });
*/

    }


}





function btnSearch_Click2() {

    var id2 = $("#ddlcity");
    var id3 = $("#ddlCountry");
    var resortid = $("#ddlBrand");
    var budget = $("#ddlBudget");

    // var trLastTrip = $("#resort_css");
    //var ifx = $("#ifrax");

    if (id3.val() == "" || id3.val() == "Select City" || id3.val() == " ") {
        alert("Select a country");
    }
    else {
        var valuex = "";


        if (budget.val() == "") {



            if (resortid.val() != "") {
                //     valuex = "city=" + id2.val() + "&" + "country=" + id3.val() + "&" + "resortid=" + resortid.val();
                window.location = "/luxury/" + id3.val() + "/" + id2.val() + "/" + resortid.val() + "/" + $("#ddlBrand option:selected").text().replace("&", "_") + "";

            }
            else if (id2.val() != "") {
                //  valuex = "city=" + id2.val() + "&" + "country=" + id3.val();
                window.location = "/luxury/" + id3.val() + "/" + id2.val() + "";
            }
            else if (id3.val() != "") {
                //  valuex = "country=" + id3.val();

                window.location = "/luxury/" + id3.val() + "";


            }


        }
        else {



            if (resortid.val() != "") {
                //     valuex = "city=" + id2.val() + "&" + "country=" + id3.val() + "&" + "resortid=" + resortid.val();
                window.location = "/luxuries/" + budget.val() + "/" + id3.val() + "/" + id2.val() + "/" + resortid.val() + "/" + $("ddlBrand option:selected").text().replace("&", "_") + "";

            }
            else if (id2.val() != "") {
                //  valuex = "city=" + id2.val() + "&" + "country=" + id3.val();
                window.location = "/luxuries/" + budget.val() + "/" + id3.val() + "/" + id2.val() + "";
            }
            else if (id3.val() != "") {
                //  valuex = "country=" + id3.val();

                window.location = "/luxuries/" + budget.val() + "/" + id3.val() + "";



            }

        }


        /* $.ajax({
        type: "POST",
        url: "/resort_1/ld",
        data: valuex,
        success: function(data) {
        //    alert("Data Saved: " + id2.val());
        //
        ///  $(".loading_slide").hide();
        ifx.hide();
        trLastTrip.empty();
        trLastTrip.append(data);

                ///    BindBlarx();
        ///     flapx();
        //     $("#slide_tbl").show();
        }
        });
        */

    }


}



