$(document).ready(function () {
    $(".rest_home").mouseover(function () {
        $(this).siblings('.roleover_home_rest').css('display', 'block');
    });
    $(".roleover_home_rest").mouseout(function () {
        $(this).css('display', 'none');
    });   
    
    var str = document.location.href;
    var num = str.lastIndexOf("/") + 1;
    str = str.slice(0, num);

    function getUrlVars() {
        var vars = [],
            hash;
        var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
        for (var i = 0; i < hashes.length; i++) {
            hash = hashes[i].split('=');
            vars.push(hash[0]);
            vars[hash[0]] = hash[1];
        }
        return vars;
    }
    var first = getUrlVars()["me"] + "";
    if (first == "one") {
        menu1();
    } else if (first == "two") {
        menu2();
    } else if (first == "three") {
        menu3();
    } else if (first == "four") {
        menu4();
    } else if (first == "five") {
        menu5();
    } else if (first == "six") {
        menu6();
    } else if (first == "seven") {
        menu7();
    }
    $('#slideshow').cycle({
        fx: 'scrollHorz',
        easing: 'easeInOutExpo',
        speed: 800,
        timeout: 5000,
        prev: '#prev',
        next: '#next',
        requeueOnImageNotLoaded: true // requeue the slideshow if any image slides are not yet loaded 
        
    });
    $(".various1").fancybox({
        'titlePosition': 'inside',
        'transitionIn': 'none',
        'transitionOut': 'none'
    });
    $(function () {
        var H = 0;
        $(".left_data").each(function (i) {
            var h = $(".left_data").eq(i).height();
            if (h > H) H = h;
        });
        $(".left_data").height(H);
    });
    $(function () {
        $(".slideshow_footer").jCarouselLite({
            btnNext: "#next_footer",
            btnPrev: "#prev_footer",
            speed: 500
        });
    });
    $(".restaurant_inner_ul_list li:last-child a").css("border-bottom", "0");
    $(".night_inner_ul_list li:last-child a").css("border-bottom", "0");
    $(".left_list ul li:last-child").css("border-right", "0");
    $(".fontStyle ul li:last-child").css("border-right", "0");
    $("#rel1").click(function () {
        menu1();
    });
    $("#rel2").click(function () {
        menu2();
    });
    $("#rel3").click(function () {
        menu3();
    });
    $("#rel4").click(function () {
        menu4();
    });
    $("#rel5").click(function () {
        menu5();
    });
    $("#rel6").click(function () {
        menu6();
    });
    $("#rel7").click(function () {
        menu7();
    });

    function menu1() {
        $('#rest1').css("display", "block");
        $('#rest2,#rest3,#rest4,#rest5,#rest6,#rest7').css("display", "none");
        $("#rel1").css("background", "url(img/line1.png) repeat");
        $("#rel2,#rel3,#rel4,#rel5,#rel6,#rel7").css("background", "none");
        $(".nit1").css("background", "url(img/line2.png) repeat");
        $(".nit2,.nit3,.nit4,.nit5,.nit6,.nit7").css("background", "none");
    }

    function menu2() {
        $('#rest2').css("display", "block");
        $('#rest1,#rest3,#rest4,#rest5,#rest6,#rest7').css("display", "none");
        $("#rel2").css("background", "url(img/line1.png) repeat");
        $("#rel1,#rel3,#rel4,#rel5,#rel6,#rel7").css("background", "none");
        $(".nit2").css("background", "url(img/line2.png) repeat");
        $(".nit1,.nit3,.nit4,.nit5,.nit6,.nit7").css("background", "none");
    }

    function menu3() {
        $('#rest3').css("display", "block");
        $('#rest1,#rest2,#rest4,#rest5,#rest6,#rest7').css("display", "none");
        $("#rel3").css("background", "url(img/line1.png) repeat");
        $("#rel1,#rel2,#rel4,#rel5,#rel6,#rel7").css("background", "none");
        $(".nit3").css("background", "url(img/line2.png) repeat");
        $(".nit1,.nit2,.nit4,.nit5,.nit6,.nit7").css("background", "none");
    }

    function menu4() {
        $('#rest4').css("display", "block");
        $('#rest1,#rest2,#rest3,#rest5,#rest6,#rest7').css("display", "none");
        $("#rel4").css("background", "url(img/line1.png) repeat");
        $("#rel1,#rel2,#rel3,#rel5,#rel6,#rel7").css("background", "none");
        $(".nit4").css("background", "url(img/line2.png) repeat");
        $(".nit1,.nit2,.nit3,.nit5,.nit6,.nit7").css("background", "none");
    }

    function menu5() {
        $('#rest5').css("display", "block");
        $('#rest1,#rest2,#rest3,#rest4,#rest6,#rest7').css("display", "none");
        $("#rel5").css("background", "url(img/line1.png) repeat");
        $("#rel1,#rel2,#rel3,#rel4,#rel6,#rel7").css("background", "none");
        $(".nit5").css("background", "url(img/line2.png) repeat");
        $(".nit1,.nit2,.nit3,.nit4,.nit6,.nit7").css("background", "none");
    }

    function menu6() {
        $('#rest6').css("display", "block");
        $('#rest1,#rest2,#rest3,#rest4,#rest5,#rest7').css("display", "none");
        $("#rel6").css("background", "url(img/line1.png) repeat");
        $("#rel1,#rel2,#rel3,#rel4,#rel5,#rel7").css("background", "none");
        $(".nit6").css("background", "url(img/line2.png) repeat");
        $(".nit1,.nit2,.nit3,.nit4,.nit5,.nit7").css("background", "none");
    }

    function menu7() {
        $('#rest7').css("display", "block");
        $('#rest1,#rest2,#rest3,#rest4,#rest5,#rest6').css("display", "none");
        $("#rel7").css("background", "url(img/line1.png) repeat");
        $("#rel1,#rel2,#rel3,#rel4,#rel5,#rel6").css("background", "none");
        $(".nit7").css("background", "url(img/line2.png) repeat");
        $(".nit1,.nit2,.nit3,.nit4,.nit5,.nit6").css("background", "none");
    }
    $("a#show-panel").click(function () {
        $("#lightbox, #lightbox-panel").fadeIn(300);
        var width1 = $(document).width();
        var height1 = $(document).height();
        if (parseInt(navigator.appVersion) > 3) {
            if (navigator.appName == "Netscape") {
                width1 = $(document).width();
                height1 = $(document).height();
            }
            if (navigator.appName.indexOf("Microsoft") != -1) {
                width1 = document.body.offsetWidth;
                height1 = document.body.offsetHeight;
            }
        }
        $("#lightbox").css({
            'width': width1,
            'height': height1
        });
        $("#lightbox-panel").css('left', width1 / 2 - 279);
    });
    $("a#show-panel_enq").click(function () {
        $("#lightbox, #lightbox-panel_enq").fadeIn(300);
        var width1 = $(document).width();
        var height1 = $(document).height();
        if (parseInt(navigator.appVersion) > 3) {
            if (navigator.appName == "Netscape") {
                width1 = $(document).width();
                height1 = $(document).height();
            }
            if (navigator.appName.indexOf("Microsoft") != -1) {
                width1 = document.body.offsetWidth;
                height1 = document.body.offsetHeight;
            }
        }
        $("#lightbox").css({
            'width': width1,
            'height': height1
        });
        $("#lightbox-panel_enq").css('left', width1 / 2 - 279);
    });
    $("a#show-panel_press").click(function () {
        $("#lightbox, #lightbox-panel_press").fadeIn(300);
        var width1 = $(document).width();
        var height1 = $(document).height();
        if (parseInt(navigator.appVersion) > 3) {
            if (navigator.appName == "Netscape") {
                width1 = $(document).width();
                height1 = $(document).height();
            }
            if (navigator.appName.indexOf("Microsoft") != -1) {
                width1 = document.body.offsetWidth;
                height1 = document.body.offsetHeight;
            }
        }
        $("#lightbox").css({
            'width': width1,
            'height': height1
        });
        $("#lightbox-panel_press").css('left', width1 / 2 - 279);
    });
    
    
    $("a#show-panel_floor").click(function () {
        $("#lightbox, #lightbox-panel_floor").fadeIn(300);
        var width1 = $(document).width();
        var height1 = $(document).height();
        if (parseInt(navigator.appVersion) > 3) {
            if (navigator.appName == "Netscape") {
                width1 = $(document).width();
                height1 = $(document).height();
            }
            if (navigator.appName.indexOf("Microsoft") != -1) {
                width1 = document.body.offsetWidth;
                height1 = document.body.offsetHeight;
            }
        }
        $("#lightbox").css({
            'width': width1,
            'height': height1
        });
        $("#lightbox-panel_floor").css('left', width1 / 2 - 279);
    });
    
    
    
    $("a.make_resrvn").click(function () {
        $("#lightbox, #lightbox-night_panel_reserv").fadeIn(300);
        var width1 = $(document).width();
        var height1 = $(document).height();
        if (parseInt(navigator.appVersion) > 3) {
            if (navigator.appName == "Netscape") {
                width1 = $(document).width();
                height1 = $(document).height();
            }
            if (navigator.appName.indexOf("Microsoft") != -1) {
                width1 = document.body.offsetWidth;
                height1 = document.body.offsetHeight;
            }
        }
        $("#lightbox").css({
            'width': width1,
            'height': height1
        });
        $("#lightbox-night_panel_reserv").css('left', width1 / 2 - 279);
    });
    
    
    $("#book_event_nite_Catchroof,#book_event_nite_sl,#book_event_nite_sleast,#book_event_nite_CR,#book_event_nite_tenjune,#book_event_ABE,#book_event_Catch,#book_event_LexiBrass,#book_event_four,#book_event_prod,#book_event_estate").click(function () {
        $("#lightbox, #lightbox-night_panel_event, #lightbox-rest_panel_event").fadeIn(300);
        var width1 = $(document).width();
        var height1 = $(document).height();
        if (parseInt(navigator.appVersion) > 3) {
            if (navigator.appName == "Netscape") {
                width1 = $(document).width();
                height1 = $(document).height();
            }
            if (navigator.appName.indexOf("Microsoft") != -1) {
                width1 = document.body.offsetWidth;
                height1 = document.body.offsetHeight;
            }
        }
        $("#lightbox").css({
            'width': width1,
            'height': height1
        });
        $("#lightbox-night_panel_event,#lightbox-rest_panel_event").css('left', width1 / 2 - 279);
        
    });
    
    $("a#close-panel,a#close-panel1,a#close-panel2,a#close-panel3,a#close-panel4,a#close-panel5").click(function () {
        $("#lightbox, #lightbox-panel, #lightbox-panel_enq, #lightbox-panel_press, #lightbox-panel_floor,#lightbox-night_panel_reserv,#lightbox-night_panel_event,#lightbox-rest_panel_event").fadeOut(300);
        $("#first_name_press").val('');
        $("#email_id_press").val('');
        $(".success_msg_div_press").html('');
        $("#first_name_floor").val('');
        $("#email_id_floor").val('');
        $(".success_msg_div_floor").html('');
        $("#first_name").val('');
        $("#email_id").val('');
        $(".success_msg_div").html('');
        $(".success_msg_div_enq_pop").html('');
        $(".success_msg_four_enq").html('');
        $("#first_name_enq").val('');
        $("#email_id_enq").val('');
        $(".success_msg_div_enq").html('');
        $(".success_msg_div_enq_pop").html('');
        $(".success_msg_four_enq").html('');
        $("#first_name_reservation").val('');
        $("#last_name_reservation").val('');
        $("#email_id_reservation").val('');
        $("#guest_reservation").val('');
        $(".success_msg_div_reserv").html('');
        $("#phone_number_events").val('');
        $("#email_id_events").val('');
        $("#first_name_events").val('');
        $("#last_name_events").val('');
        $(".success_msgrest_event").html('');
        
    });    
    
    $("#book_event_nite_Catchroof,#book_event_nite_sl,#book_event_nite_sleast,#book_event_nite_CR,#book_event_nite_tenjune").click(function(event){
        
            var venueid =event.target.id;           
            if(venueid=='book_event_nite_sl')            
             { 
                 $(".eventnight_venue").html("SL");
             }
             if(venueid=="book_event_nite_tenjune")
            {
                $(".eventnight_venue").html("TENJUNE");
            }
             if(venueid=="book_event_nite_CR")            {
                $(".eventnight_venue").html("CHANDELIER ROOM");
            }
            if(venueid=="book_event_nite_sleast")
            {
                $(".eventnight_venue").html("SL EAST");
            }
            if (venueid=="book_event_nite_Catchroof")
            {
                $(".eventnight_venue").html("CATCH ROOF");
            }

        });
        $("#book_event_ABE,#book_event_Catch,#book_event_LexiBrass").click(function(event){
        
            var venueid =event.target.id;           
            if(venueid=='book_event_ABE')            
             { 
                 $(".eventrest_venue").html("ABE & ARTHUR'S");
             }
             if(venueid=="book_event_Catch")
            {
                $(".eventrest_venue").html("CATCH");
            }
             if(venueid=="book_event_LexiBrass")            {
                $(".eventrest_venue").html("LEXINGTON BRASS");
            }
           
        });
        
        $("#book_event_four,#book_event_prod,#book_event_estate").click(function(event){
  
            var venueid =event.target.id;           
            if(venueid=='book_event_four')            
             { 
                 $(".eventrest_venue").html("FOUR HUNDRED");
             }
             if(venueid=="book_event_prod")
            {
                $(".eventrest_venue").html("EVENT PRODUCTION");
            }
             if(venueid=="book_event_estate")            {
                $(".eventrest_venue").html("THE ESTATE");
            }
           
        });
        
        function changeText(){       
	$("#success_msg_event,#success_msgrest_event,#success_msg_div_reserv").html("");}
        $("#reset_contact").click(function(){
               changeText();
            });    

    
});
