var slide = 1;

$(document).ready(function() {			
	var id_href = /^#(.*)/;
	var sub = false;
	$('#top_level a').mouseover(function(){
		$('#navigation div').hide();			
		if (id_href.test($(this).attr('href'))) {
			$($(this).attr('href')).show();
			window.top.document.body.rows = '' + 
				($('#top_level').height() + $($(this).attr('href')).height()) + ',*';					
			return false;
		} else
			window.top.document.body.rows = '' + $('#top_level').height() + ',*';
	});
	
	$('#navigation').mouseleave(function(){
		$('#navigation div').hide();
		$('#navigation .submenu.active').show();
	});
	
	//Set right and left equal;
	/*
	var left = $(".textleft").height();
	var right = $(".textright").height();
	if(left < right){
		$(".textleft").height(right)
	} else {
		$(".textright").height(left)
	}
	*/
	
	
	//Slider init
	$(".slider").hide();
	showSlide(slide);
	setInterval("showSlide()", 13000);
	
});

function showSlide(){
	$(".slider").hide();
	
	$("#" + slide).fadeIn(1000, function() {
        // Animation complete
    });
	
	slide++;
	if(slide > 4){
		slide=1;
	}
}
