var status = 0;
function changeMenu() {
	var sender = $(this);

	var currentImage = sender.attr("src");
	var originalImage = sender.parent().attr("rel");

	sender.parent().attr("rel",currentImage);

	if(sender.attr("isClicked") != undefined)
		sender.attr("src",sender.attr("switchImage"));
	else
		sender.attr("src",originalImage);
}
function subNavMouseout() {
    var sender = $(this);
    sender.hide();
    $("#select").css("background", "url(/images/select.gif) no-repeat");
}
$(function () {

    $("#menuList li a").attr("class", "nohover");
    SetCurrently(father, type);
    setDef(main, _index);
    $(".subNav").bind("mouseleave", subNavMouseout);
    $("#menuList li a").mouseover(function () {
        var sender = $(this);

        $(".subNav").hide();
        var panelId = "#nav_" + sender.attr("id").substring(5);
        $(panelId).show();

    });

    var pathname = document.location.pathname.toLowerCase();
    if ($(".currently li a")[0])
        $(".currently li a")[0].className = "hover1";
    $("#sideNav li a").each(function () {

        var sender = $(this);
        var senderPath = sender.attr("href").toLowerCase();
        var regu = "" + senderPath + ""
        var re = new RegExp(regu);
        if (pathname.search(re) != -1) {
            $("#sideNav li a").attr("class", "nohover1")
            sender.attr("class", "hover1")
        }
        else {
            
        }
    })



});


function setDef(main, index) {    
   if(main!=0)
       $("#link_" + main).attr("class", "currently"); ;
    if(index!=0)
        $("#side" + index).attr("class", "currently"); ;
   
}

$(function () {
    $("#brotherSiteWeb").bind("mouseleave", subNavMouseout);
    $("#select").toggle(
    function () {
        $("#brotherSiteWeb").show("");
        var sender = $(this);
       sender.css("background","url(/images/select1.gif) no-repeat");
    },
    function () {
        $("#brotherSiteWeb").hide("");
        var sender = $(this);
        sender.css("background", "url(/images/select.gif) no-repeat");

    }
    )
    $("#select").mouseover(function () {
        $("#brotherSiteWeb").show("");
        var sender = $(this);
        sender.css("background", "url(/images/select1.gif) no-repeat");

    });
    $("#brotherSiteWeb li a").bind("click", function () {
        $("#brotherSiteWeb").hide("");
        var sender = $("#select");
        sender.css("background", "url(/images/select.gif) no-repeat");

        return true;
    })
})

function SetNav(nav) {

    $(".sideNavdiv").hide();
    $("#"+nav).show();

}


$(document).ready(function () {
    /* This code is executed after the DOM has been completely loaded */

    /* Changing thedefault easing effect - will affect the slideUp/slideDown methods: */
    $.easing.def = "easeOutBounce";

    /* Binding a click event handler to the links: */
    $('#sideNav .nohover').click(function (e) {

        /* Finding the drop down list that corresponds to the current section: */
        var dropDown = $(this).next();
        if (dropDown.html() == null) {
            return;
        }
        $('#sideNav dd').attr("class", "");
        $(this).parent().attr("class", "currently");
        /* Closing all other drop down sections, except the current one */
        $('.sideNavdiv').not(dropDown).slideUp('fast');
        dropDown.slideToggle('fast');

        /* Preventing the default event (which would be to navigate the browser to the link's address) */
        e.preventDefault();
    })

});
