function otz_open(n) {
    $(".a_open"+n).hide();
    $(".otz"+n).show();
}
function otz_close(n) {
    $(".a_open"+n).show();
    $(".otz"+n).hide();
}


function otz_closeq(n) {
    $(".d"+n,"> span").css("color","red");
}
function spec_open(n) {
  $(".spec_open"+n).hide();
  $(".long"+n).show();
}
function spec_close(n) {
  $(".spec_open"+n).show();
  $(".long"+n).hide();
}

$(document).ready(
  function()
  {
    $("tr:nth-child(even)").addClass("td_bg");
  }
);


function open_wind(id){
    var h;
    h = document.getElementById('wrap').offsetHeight;
    document.getElementById('alles').style.height = h+ 'px';
    document.getElementById('alles').style.display = 'block';
    document.getElementById('popup_'+id).style.display = 'block';
    // $("select").css("visibility","hidden");
}

function close_wind(id){
    document.getElementById('alles').style.display = 'none';
    document.getElementById('popup_'+id).style.display = 'none';
    $("#mon_cat").show();
  	$("#mon_item").show();
	  $("#mon_money").show();
    // $("select").css("visibility","visible"); 
}

$(function(){
	if ($(".assortiment li").length) {
		$(".assortiment li").each(function(i, item){
			var img = new Image;
			img.src = $(item).attr("rel");
			$("a", this).mouseover(function(){
				var src = $(this).parent().attr("rel");
				$(".assortiment-pic").css("background", "url("+src+") right top no-repeat");
			}).mouseout(function(){
				var src = $(this).parent().attr("rel");
				$(".assortiment-pic").css("background", "url(/media/images/assortiment/main.jpg) right top no-repeat");
			});
		});
	}
});

function getPriceSub()
{
	open_wind('price');
	$("#mon_cat").hide();
	$("#mon_item").hide();
	$("#mon_money").hide();
}



function slideBanner(selector)
{
	// Общее кол-во баннеров
	var count = $(selector).length;
	if ( count<2)
		return;
	
	var current = 0;
	// Определяем текущий баннер
	$(selector).each(function(i, item){
		if ( $(item).css("display") != 'none') 
			current = i;
	});
	

	current++;
	if ( current==count)
		current=0;

	$(selector).fadeOut("");
	$(selector).eq(current).fadeIn("slow"); 

	setTimeout(function(){slideBanner(selector)}, 9000/count);
}

$(function(){
	setTimeout("slideBanner('.rb_1')", 3000);
	setTimeout("slideBanner('.rb_2')", 3000);
	setTimeout("slideBanner('.rb_3')", 3000);
})


/*
$(function(){
  $(".center_col img").each(function(i, item) {
    ictinus.roundCorners.RADIUS = 20;
    ictinus.roundCorners.DRAW_PARAMS = {
            strokeWidth: 2,
            strokeColor: '#ff0000'
    };
    ictinus.roundCorners(item);
  });
});


$(function(){
	$("img", ".content").each(function(i, item) {
		
		if ( $(item).parent().parent().attr('class') == 'img_blo' ||
			 $(item).parent().parent().attr('class') == 'main_banner' ||
			 $(item).parent().parent().attr('class') == 'banner_block' ||
			 $(item).parent().parent().parent().attr('class') == 'dillers_ul' ||
			 $(item).parent().attr('class')
			)
			return;

		var simg = $(item).get(0).outerHTML;
		if ( !simg)
			return;

		var alt = $(item).attr('alt');
		if ( !alt) 
			alt = '';

		var width = parseInt($(item).css('width'));
		
		if ( width > 150) {
		  setTimeout(function(){
			  $(item).replaceWith('<div class="img_blo"><div class="img_block"><div class="im1">&nbsp;</div><div class="im2">&nbsp;</div><div class="im3">&nbsp;</div><div class="im4">&nbsp;</div>'+simg+'</div><br />'+alt+'</div><div class="clear"></div>');
		  }, 10);
		}
	});
});
*/

