document.onkeydown = NavigateThrough;

function NavigateThrough (event)
{
        if (!document.getElementById) return;

        if (window.event) event = window.event;

        if (event.ctrlKey)
        {
                var link = null;
                var href = null;
                switch (event.keyCode ? event.keyCode : event.which ? event.which : null)
                {
                        case 0x25:
                                link = document.getElementById ('PrevLink');
                                break;
                        case 0x27:
                                link = document.getElementById ('NextLink');
                                break;
                }

                if (link && link.href) document.location = link.href;
                if (href) document.location = href;
        }                       
}


//Main menu hover
function main_menu_hover (){		
	$('#top_menu > li').hoverIntent(
		function () {
			$('#top_menu li.open').removeClass('open');
			$('#top_menu li ul:visible').slideUp("fast");
			$(this).find('>ul').slideDown("fast");
			$(this).addClass('open');
		},
		function () {	
			$("#top_menu li ul").slideUp("fast");
			$('#top_menu li.open').removeClass('open');
		}
	);
}

//Footer menu hover
function footer_menu_hover (){
	$('#footer_menu > li ').hoverIntent(
		function () {
			$('#footer_menu li.open').removeClass('open');
			$('#footer_menu li ul:visible').css("visibility", "hidden");
			$(this).find('>ul').css("visibility", "visible");
			$(this).addClass('open');
		},
		function () {	
			$("#footer_menu li ul").css("visibility", "hidden");
			$('#footer_menu li.open').removeClass('open');
		}
	);
}

//Heart colors
		
var color_timeout = 6000;


//Colors

function heart_colors (){
	var heart = $('#heart');
	var col_1 = '#490a3d';
	var col_2 = '#bd1550';
	var col_3 = '#ff5d9e';
	var col_4 = '#e97f02';
	var col_5 = '#f8ca00';
	var col_6 = '#8a9b0f';
	var col_7 = '#48c873';
	var col_8 = '#add8c7';
	var col_9 = '#025d8c';
	heart.animate( { backgroundColor: col_2 }, color_timeout);
	heart.animate( { backgroundColor: col_3 }, color_timeout);
	heart.animate( { backgroundColor: col_4 }, color_timeout);
	heart.animate( { backgroundColor: col_5 }, color_timeout);
	heart.animate( { backgroundColor: col_6 }, color_timeout);
	heart.animate( { backgroundColor: col_7 }, color_timeout);
	heart.animate( { backgroundColor: col_8 }, color_timeout);
	heart.animate( { backgroundColor: col_9 }, color_timeout);  
	heart.animate( { backgroundColor: col_1 }, color_timeout);
	setTimeout('heart_colors();', color_timeout);
}

//Header Login Block
function header_login_block (){
	$('#login_block #login_links #header_login_btn').click (function () { 
		$('#login_block #login_links').fadeOut();
		$('#login_block #login_form').fadeIn();
	});
}

//Container Login Block
function container_login_block (){
	$('#right_login_block').hoverIntent (
		function () { 
			$('#right_login_block #green_block').fadeOut(200);
			$('#right_login_block #right_login_form').fadeIn(200);
		},
		function () { 
			
		}
	);
}