// JavaScript Document

$(document).ready(function () {	


$("#page-all").css('min-width', $("#menu_line").width()) ;
$("#footer").css('min-width', $("#menu_line").width()) ;



if ( $.browser.msie ) {
	
	$('#port').show();
	$('#cont').show();
}

	
	$('.topmenu').after($('<li class="separ_menu"></li>'));
	$('.topmenu_no').after($('<li class="separ_menu"></li>'));
	
	$("#menu_line li:last").remove();



	$('.left_menu li').after($('<li class="separ_left_menu"></li>'));
	$(".left_menu li:last").remove();


	$('.sub_menu').hide();	
	$('.topmenu').hover(
		function () {
			$('.sub_menu', this).show();
			
			if ( $.browser.msie ) {


			var colWrap = $(".sub_menu", this).parent().width();
			var colWrapli = $(".sub_menu", this).width();
			var ncolWrap = colWrap+35;
			 $(".sub_menu", this).width(colWrapli).css({"margin-left": -ncolWrap+'px'});
			  
			  }

		}, 
		function () {
			$('.sub_menu', this).hide();			
		}
	);
	


  $(".carousel").jCarouselLite({
       btnNext: ".next",
       btnPrev: ".prev",
       mouseWheel: true
  });


	$(".left_seo :header").click(function() 
	{

		$('.left_seo h1').css('background-image', 'url(/design/dvstyle/li_cont_s.gif)');
		var oldString = this.id;
		var newString = oldString.replace("tit", "text");
		var htmlStr = $("#"+newString).html();
		$("#cont_seo").html(htmlStr);
		$('#'+oldString).css('background-image', 'url(/design/dvstyle/li_cont.gif)');
	});
	



/*	if ( $.browser.msie) {
		
	$("#page-empty").empty();
	}
	
	if ( $.browser.webkit) {
		$("#page-empty").empty();
	}
	*/
/*	if ( $.browser.mozilla ) // ||$.browser.msie
	{
		
		if (window.location.pathname == "/")
		{
		//$("#page-empty").remove();
		$("#page-empty").height(20);
		}
	}*/
	
	//alert ($("#cont").height());
	//alert ($("#r_cont").height());
	
	if ($("#cont").height() == 0 || $("#cont").height() == 20) 
	{
		
	$("#page-empty").height(0);
	}
	else
	{
		if (!$.browser.msie) {
		var size = $("#r_cont").height();
		var size_mb = size*-1;
		//alert (size_mb);
			
		$("#page-empty").height(0);
		$("#page-all").css("marginBottom", size_mb+"px");
		//$("#page-all").css("height", size+"px");
		$("#page-all").height(size);
		//margin-bottom: -370px;
		}
	}
	
	if ($("#r_cont").height() == 0 || $("#r_cont").height() == 20) 
	{
		
	$("#page-empty").height(0);
	}
	else
	{
		if (!$.browser.msie) {
		var size = $("#r_cont").height();
		var size_mb = size*-1;
		//alert (size_mb);
		$("#page-empty").height(0);
		$("#page-all").css("marginBottom", size_mb+"px");
		$("#page-all").height(size);
		
		//margin-bottom: -370px;
		}
	}
	
	
	
/*	if ($.browser.msie) {
		
	$("#navig").css("height", "40px");
	}*/

	
	
	
/*	if (!$.browser.msie) {
		
	$("#page-empty").height(20);
	}
	else
	{

	//$("#cont_port .link").css("top", "23px");
	$("#navig").css("height", "40px");

	
	}
*/	
	
	$(".seo_txt").hide();
	var htmlStrF = $("#text1").html();
	$("#cont_seo").html(htmlStrF);

	
$(".left_seo h1").textShadow();
		


$("a[rel='gallery']").colorbox({transition:"fade", close:"Закрыть", current: "Работа {current} из {total}"});





});




