$(document).ready(function() {


	$("#submit2").live("mousedown", function()
	{

		//var id_item = $(this).attr('class').substr(2);

    						$(this).fancybox(
						{
							'hideOnContentClick': false,
							'overlayOpacity': 0.3,
							'centerOnScroll': false,
							'frameWidth': 400,
							'frameHeight': 150,
							'titleShow' : false,
							'href': '#inline1'
						});
		addProductBasket(this);
	});

	/*PNG fix for IE6*/
	if ($.browser.msie && $.browser.version == 6) {
		DD_belatedPNG.fix('.transp_ie6, #ind_third_line h2, #prev, #next, #fonform, .logo a');
	}

	$("input.text, textarea").focus( function (){
			$(this).prev().css("display","none");
			$("input.focused", "textarea.focused").removeClass("focused");
			$(this).addClass("focused");
		});
	$("input.text, textarea").blur( function (){
			if (!$(this).val()){
			$(this).removeClass("focused");
			$(this).prev().css('display','block');}
		});

	$("label").click( function (){
			$(this).css("display","none");
			$(this).next().focus();
			return false
		});


function reSize() {
  if ($('html').width() >= 1160){
	  $('#wrapper, #footer, #fourth_l_wrapp').css({'max-width' : 1180, 'padding-left' : 80, 'padding-right' : 80} );
	  $('#ind_third_line #rotator_border').css({'max-width' : 980, 'padding-left' : 30, 'padding-right' : 30} );
	  $('#prev, .ind_third_line .portfolio h2').css({'left' : 80} );
	  $('#next').css({'right' : 80} );
	  }
  else{
	  $('#wrapper, #footer, #fourth_l_wrapp').css({'max-width' : 990, 'padding-left' : 0, 'padding-right' : 0} );
	  $('#ind_third_line #rotator_border').css({'max-width' : 890,'padding-left' : 50, 'padding-right' : 50} );
	   $('#prev, .ind_third_line .portfolio h2').css({'left' : 0} );
	  $('#next').css({'right' : 0} );
	  }
}
	if ($.browser.msie && $.browser.version !== 6) {
		$(function() { reSize(); });
		$(window).resize(function() { reSize();  });
	}

	if (!$.browser.msie) {
		$(function() { reSize(); });
		$(window).resize(function() { reSize();  });
	}

//	$(window).resize(function() { $("#count").text("wrapper" + $("#wrapper").attr("clientWidth") + "body" +  $("body").attr("clientWidth")) });

if("#rotator_links_list_box".length){
$("#rotator_links_list_box").jCarouselLite({
       btnNext: "#next",
       btnPrev: "#prev",
       mouseWheel: true,
	   visible: 10,
	   circular: true
  });
}

if("#list".length){
$("#list").jCarouselLite({
       btnNext: "#down",
	   btnPrev: "#up",
	   mouseWheel: true,
	   visible: 2,
	   circular: true,
	   vertical: true
  });
}


});


	function addProductBasket(el)
	{

				$(el).parents("form:first").ajaxSubmit(function(d){

                      $("#inline1").html(d);
              	});

	}

