$(document).ready(function(){

// horisontal navigation	
	$("input:text").each(
	function()
	{
		$(this).attr('val',this.value);
		$(this).addClass('text');
			$(this).focus(
				function()
				{
					if(this.value == $(this).attr('val'))
					{
						this.value = '';
					}
				}
			)
			$(this).blur(
				function()
				{
					if(this.value == '')
					{
						this.value = $(this).attr('val');
					}
				}
			)
	}
	)
	
	
	$("#hor_nav_div div.main_out").each(
	function()
	{
		$(this).click(
		function()
		{
			document.location.href = $('a',this).get(0).href;
		}
		)

		n = $('a span span',this).text();
		m = $('a',this).get(0).href;
		this.innerHTML = '<table><tr><td><a href="' + m + '">' + n + '</a></td></tr></table>';
	}
	)

	$("#hor_nav_div td.link").each(
	function()
	{
		$(this).mouseover(
		function()
		{
			$(this).addClass('over');
			$('div.hidden',this).addClass('over');
		}
		)
		$(this).mouseout(
		function()
		{
			$(this).removeClass('over');
			$('div.hidden',this).removeClass('over');
		}
		)
	}
	)

	$("#right_nav_inner div.header").each(
	function()
	{
		$(this).mouseover(
		function()
		{
			$(this).addClass('over');
		}
		)
		$(this).mouseout(
		function()
		{
			$(this).removeClass('over');
		}
		)
	}
	)

	//blocks in left part at main page
	if($('#right_nav_inner').length>0)
	{
		jQuery('#right_nav_inner').accordion({
			header: '.header',
			active: false,
			alwaysOpen: false,
			animated: 'slide',
			autoheight: false
		});
	}
	
	mrh = $("#main_right").get(0).offsetHeight;
	mlh = $("#main_left").get(0).offsetHeight;
	if(mlh<mrh) 
	{
		$("#main_left_inner_br").css('height',mrh-64);
	}
	
});


