$('#hide_link').click(function() {
 $('.header_link').animate({opacity:'0'}, 700);
 $('.header_link').css({display:'none'});
 $('#show_link').animate({opacity:'1'}, 500);
 cookie_link('header_link', '1');
});

$('#show_link').click(function() {
 $('#show_link').css({opacity:'0'});
 $('.header_link').animate({opacity:'1'}, 500);
 $('.header_link').css({display:'block'});
 cookie_link('header_link', '0');
});

$('#bot1').hover(function() {
 $('#bot1 span').animate({opacity:'.9'}, 700)
});

var h_link = get_cookie_link('header_link');

if(h_link == 0) {
 $('.header_link').css({display:'block'});
 $('#show_link').css({opacity:'0'});
}

if(h_link == 1) {
 $('.header_link').css({display:'none'});
 $('#show_link').css({opacity:'1'});
}

//COOKIE
function cookie_link(cookieName, cookieValue) {
    if (!cookieName || !cookieValue) {
        return false;
    };
    var cookieDate = new Date('01/01/2500');;
    cookieValue = escape(cookieValue.toString());
    document.cookie = cookieName + '=' + cookieValue + '; expires=' + cookieDate.toGMTString() + '; path=/';
    return true;
};

function get_cookie_link(cookieName) {
    if (!cookieName) {
        return false;
    };

    var cookieArray = document.cookie.split('; ');
    for (var i = 0; i < cookieArray.length; i++) {
        var name_valueCookie = cookieArray[i].split('=');
        if (name_valueCookie[0] == cookieName) {
            return unescape(name_valueCookie[1]);
        };
    };
    return false;
};


$(document).ready(function(){
	$(".header_pop").css('display','none');
	$("#bot1").click(function () {
		
		$('.header_pop').parent().css('zIndex','auto');
		$('.header_pop').fadeOut(300);
		
		$(this).parent().css('zIndex','5');
		if ($.browser.msie) {$(this).parent().find('.header_pop').css('display','block')} else {$(this).parent().find('.header_pop').fadeIn(300);};
		return false;
	});
	
	$(".header_pop_close").click(function () {
		if ($.browser.msie) {$(this).parents('.header_pop').css('display','none')} else {$(this).parents('.header_pop').fadeOut(300);};
		return false;
	});
});

