/* Web navigation
 * Designed by Logan
 */
var navcookie=[1,0]; 
var isre = true;
var picurl;
var newurl; 
var $url = location.href;
var state =  getQueStr($url,"state");

$(function(){
    $(".menu2").find(".home_sec_ul").animate({"opacity":0},1);
    $(".menu2").hover(function(){
        picurl = $(this).find("img").eq(0).attr("src");
        newurl = picurl.replace("off","over").replace("off","on");
            $(this).find("img").eq(0).attr("src",newurl);
    },function(){
        $(this).find("img").eq(0).attr("src",picurl);
    })
    
    var i = parseInt(state.substring(0,1))-1;
    if(i>=0)
    {
        var thisurl = $(".menu2 > a > img").eq(i).attr("src").replace("off","over").replace("off","on");
        $(".menu2 > a > img").eq(i).attr("src",thisurl);
    }
});

function getQueStr(url,ref) 
{ 
    var str = url.substr(url.indexOf('?')+1); 
    if(str.indexOf('&')!=-1) 
    { 
        var arr = str.split('&'); 
        for(i in arr) 
        { 

        if(arr[i].split('=')[0]==ref) 
        return arr[i].split('=')[1]; 
        } 
    }
    else 
    { 
        return url.substr(url.indexOf('=')+1) 
    } 
}

function fadeInFooter()
{
    if(getQueStr( $url,"return") == "true")
    {
         $(".fade_txt").animate({"opacity":1,"height":150},1);
    }
    else
    {
        $(".fade_txt").show();
        $(".fade_txt").animate({"opacity":0},1);
        $(".fade_txt").animate({"opacity":1,"height":150},800);
    }
}
$(function() {
    $.cookie("isHavecome", "true");
})