$(document).ready(function() {	
	$("a[rel^='prettyPhoto']").prettyPhoto({
		animationSpeed: 'normal', /* fast/slow/normal */
		padding: 40, /* padding for each side of the picture */
		opacity: 0.35, /* Value betwee 0 and 1 */
		showTitle: true, /* true/false */
		allowresize: true, /* true/false */
		counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
		theme: 'light_rounded', /* light_rounded / dark_rounded / light_square / dark_square */
		callback: function(){}
	});
});

function color(id)
{
	$.get('/catalog/color?id='+id, null, 
	function(data) {
		$(".b-covers span a").removeClass("selected");
		$("#color"+id).addClass("selected");
		
		$("#show_product_color").html(data);
	});
}

function door(id)
{
	$("#dim").fadeIn();
	$.get('/catalog/product?id='+id, null, 
	function(data) {
		$(".text_lnk").css("color","#CD3202");
		$("#text"+id).css("color","#000000");
		$("#show_product").html(data);
		$("#dim").fadeOut();
	});
}

function checkSearch() {
	var errMsg = '';
	var art_id = $.trim($("input[name='query']").val());
	
	if (art_id.length == 0 || art_id == 'Поиск по сайту'){
		errMsg += 'Необходимо заполнить поле поиска\n';
	}
	if (errMsg.length == 0)
		return true;
	alert(errMsg);
	
	return false;
}

