$(document).ready(function() {

	$(".header_phone").clone().addClass("header_phone_grey").appendTo(".container");
	
	$(".popup .close").click(function(){
		$(".popup").slideUp(300, function(){$(".shade").animate({opacity: 0},500, function(){$(this).css("display","none");})});
		return false;
	});
	$(".big_pic_popup .close").click(function(){
		$(".big_pic_popup").slideUp(300, function(){$(".shade").animate({opacity: 0},500, function(){$(this).css("display","none");})});
		return false;
	});
	
	/*
	if ($(".trail a").length>0){$(".trail a").not(".trail ul li:last-child a").after(" /");}
	$(".trail ul li:last-child a").css("textDecoration","none");
	*/
	
	//$(".left_column .menu ul ul li:first-child ul").css("display","block");
	$(".left_column .menu ul ul a").not(".left_column .menu ul ul ul a").click(function(){
		$(this).next().slideToggle(500);
		return false;
	});
	
	$(".action_catalogue td:last-child").css("backgroundImage","none");
	$(".action_catalogue tr:first-child .bg").not(".series_catalogue tr:first-child .bg").css("backgroundImage","none");
	$(".series_catalogue tr:last-child").after('<tr><td colspan="2"><div class="bg">&nbsp;</div></td></tr>');
	$(".series_catalogue tr:last-child td").css("backgroundImage","none");
	
	$(".top_nav ul li").hover(
		function(){
			$(this).children("ul").slideDown(200);
		},
		function(){
			$(".top_nav ul li ul").stop(true,true);
			$(this).children("ul").slideUp(100);
		});
	
	$(".my_orders tr:even").css("backgroundColor","#F4F4F4");
	
	$(".salons td:first-child").addClass("firstinrow");
	$(".salons td:last-child").css("backgroundImage","none");
	
	$(".cart_table th:first-child, .cart_table td:first-child").not(".summary th, .summary td").addClass("firstinrow");
	
	$(".collection_colors li:last-child").after('<br clear="all" />');

	$(".series_catalogue .color .big, .collection_colors .big").append('<div class="lb"></div><div class="b"></div><div class="rb"></div><div class="r"></div><div class="rt"></div>');
	$(".series_catalogue .color, .collection_colors li").hover(
		function(){
			$(this).css("zIndex","600").children(".big").fadeIn(200);
		},
		function(){
			$(this).css("zIndex","500").children(".big").fadeOut(200);
		});
	
	colorTable('.order_table');
	
});

function colorTable(tbl) {
	
	$(tbl + " tr").not(tbl + " tr.nocoloring").css("backgroundColor", "");
	$(tbl + " tr:visible:even").not(tbl + " tr.nocoloring").css("backgroundColor","#EAEAEA");
	
}


