﻿function menu_hover(a) {
    var img = $(a).find("img");
    var oldSrc = img.attr("src");
    
    if(oldSrc.substr(oldSrc.length-10)!="active.jpg")
        img.attr("src",oldSrc.replace(".jpg","_hover.jpg"));
}

function menu_unhover(a) {
    var img = $(a).find("img");
    var oldSrc = img.attr("src");

    img.attr("src", oldSrc.replace("_hover", ""));
}

function hideOverview(categoryId)
{
    $("#menu_overview").fadeOut(300);
    
    //set cookie to hide the shit
    Set_Cookie("hideoverview_" + categoryId, "true", 1,"/","","");
}

function showOverview(autoFadeOut)
{
    $("#menu_overview").fadeIn(300);
    
    if(autoFadeOut)
    {
        setTimeout(function(){
            $("#menu_overview").fadeOut(300);
        },10000);
    }
}

//3rd party cookie function
function Set_Cookie( name, value, expires, path, domain, secure )
{
    
    var expires_date = new Date();
    
    expires_date.setHours(23,59,59,999);

    document.cookie = name + "=" +escape( value ) +
    ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
    ( ( path ) ? ";path=" + path : "" ) +
    ( ( domain ) ? ";domain=" + domain : "" ) +
    ( ( secure ) ? ";secure" : "" );
}

function initOverview()
{

}
	
