﻿var urlRegex = new RegExp(/^http:\/\/[^\/]+(\/[^\?]+)$/);

var navigateTab = function(id) {

    $("#info,#gallery").hide();
    $("#tab-info, #tab-gallery").parent().removeClass("selected");
    $("#" + id).show();
    $("#tab-" + id).parent().addClass("selected");
}

var setSelectedNavItem = function() {

    if (urlRegex.exec(location.href)) {
        $("ul.topmenu li a[href='" + urlRegex.exec(location.href)[1] + "']").parent().addClass("selected");
        $("ul.headmenu li a[href='" + urlRegex.exec(location.href)[1] + "']").parent().addClass("selected");
    }

}

var alertMessage = function() {

    if ($("#modalAlert").length > 0)
        tb_show(null, "#TB_inline?height=300&width=300&inlineId=modalAlert&modal=true", false);

    return false;
}

$().ready(function() {

    setSelectedNavItem();

    $(".btnEventAction a").mouseover(function() {
        $(".btnEventAction .bgHover").show();
    }).mouseout(function() {
        $(".btnEventAction .bgHover").hide();
    });

    //
    $(".NxtBck a.back").mouseover(function() {    
        $(this).parent(".NxtBck").find(".btnRight").show();
        //$(".NxtBck .btnRight").show();
    }).mouseout(function() {
         $(this).parent(".NxtBck").find(".btnRight").hide();
        //$(".NxtBck .btnRight").hide();
    });
    $(".NxtBck a.next").mouseover(function() {
        $(this).parent(".NxtBck").find(".btnLeft").show();
        //$(".NxtBck .btnLeft").show();
    }).mouseout(function() {
        $(this).parent(".NxtBck").find(".btnLeft").hide();
        //$(".NxtBck .btnLeft").hide();
    });
    //

    $("#btnAllEventBox a").mouseover(function() {    
        $(this).parent("#btnAllEventBox").find(".bgHover").show();
        $(this).parent("#btnAllEventBox").find(".bg").hide();
    }).mouseout(function() {
        $(this).parent("#btnAllEventBox").find(".bgHover").hide();
        $(this).parent("#btnAllEventBox").find(".bg").show();
    });


    $(".btnAction").mouseover(function() {
        $(this).find(".bgHover").show();
    }).mouseout(function() {
        $(this).find(".bgHover").hide();
    });

    $(".btnActionBox").mouseover(function() {
        $(this).find(".bgHover").show();
        $(this).find(".bg").hide();
    }).mouseout(function() {
        $(this).find(".bgHover").hide();
        $(this).find(".bg").show();
    });

    $(".highlight .thisMounth .eventBox, #actual-content .events .eventBox").mouseover(function() {
        $(this).addClass("on");
    }).mouseout(function() {
        $(this).removeClass("on");
    });


    alertMessage();


    $("#lnkTickets a").click(function() {
        $("div.ticketContent").hide();
        $("span.hdTitle").hide();
        $("div#tickets").show();
        $("span.title1").show();
        $("ul.pagemenu li").removeClass("selected");
        $("#lnkTickets").addClass("selected");
    });
    $("#lnkSeating-plan a").click(function() {
        $("div.ticketContent").hide();
        $("span.hdTitle").hide();
        $("div#seating-plan").show();
        $("span.title2").show();
        $("ul.pagemenu li").removeClass("selected");
        $("#lnkSeating-plan").addClass("selected");
    });
    $("#lnkReminders a").click(function() {
        $("div.ticketContent").hide();
        $("span.hdTitle").hide();
        $("div#reminders").show();
        $("span.title3").show();
        $("ul.pagemenu li").removeClass("selected");
        $("#lnkReminders").addClass("selected");
        
    });


	$(".eventCalendar li").mouseover(function(){
		$(this).addClass("current");
		$(this).find("span").addClass("current");
	}).mouseout(function(){
		$(this).removeClass("current");
    });
    $(".eventCalendar li img").mouseover(function(){$(".eventCalendar li").removeClass("current")});







});


