// JavaScript Document

function set_searc_text(object)
{
	if (object.search_field.value=="")
		object.search_field.value="Поиск в каталоге";
}

function clear_searc_text(object)
{
	if (object.search_field.value=="Поиск в каталоге")
		object.search_field.value="";
}

function show_big_good(url, width, height)
{
	var wtop  = ( screen.height/2 ) - ( height/2 );
	var wleft = ( screen.width/2  ) - ( width/2  ); 
	NewWindow = open( url, 'NewWindow', 'width=' + width + ', height=' + height + ',top=' + wtop + ',left=' + wleft + ', scrollbars=yes');
}

function load_image(src)
{
	img = new Image();
	img.src = src;
	
}

function img_size(img)
               {               
               img.style.display="none";
               
			   oI = new Image();
			   oI.src = img.src;
			   
			   if (oI.width > 400)
			   {
			   	  wi=400;
                  he=Math.round((wi*oI.height)/oI.width);
                  img.width=wi;
                  img.height=he;
			   }
		
	    img.style.display="block";	
}

function set_podlozhka()
{
	if (screen.width <= 1024)
	{
		podl_left = document.getElementById('podlozhka_left');
		podl_left.style.backgroundImage="none";
		podl_left.style.width=0;

		podl_right = document.getElementById('podlozhka_right');
		podl_right.style.backgroundImage="none";
		podl_right.style.width=0;
		
		podl = document.getElementById('podlozh_table');
		podl.style.width = 0;
	}
}
