function search_t()
{
	if ( document.search_form.elements("search").value == "" )
	{
	   	alert("Не заполнено поле Поиска");
		document.search_form.elements("search").focus();
		return false;
	}
   	else 
	{
	document.search_form.submit();
	return true;
	}
}
function print_page()
{
	if (navigator.appName=='Netscape') window.print();
	else
	{
		var WebBrowser='<OBJECT ID="WebBrowser1" width=0 height=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
		document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
		WebBrowser1.ExecWB(6, 2);
		WebBrowser1.outerHTML = "";
	}
}
function openpagedetail_old(img)
{
  foto1= new Image();
//var img_source='http://www.elektromarket.ru/ru/images/photo/'+img;
//Т.к. в СА-публикаторе надо писать адрес от корня без / (например, ru/images/ro.gif),то добавляем /
  var img_source='/'+img;
  foto1.src=(img_source);
  if((foto1.width!=0)&&(foto1.height!=0))
  {
//Определяем размер фото и для POPUP окна делаем размер на 10 пикселей больше
		altez=foto1.height+25;
		width_real=foto1.width+25;
		stringa="height="+altez+", width="+width_real;
		var goToPar = 'toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=no, '+stringa;
		Stuff=window.open(img_source, "Stuff", goToPar );
	}
}
function openpagedetail(img)
{
//Эта функция аналогична предыдущей, но открывается не сразу фото, а шаблон popup.php

  foto1= new Image();

//var img_source='http://www.elektromarket.ru/ru/images/photo/'+img;
//Т.к. в СА-публикаторе надо писать адрес от корня без / (например, ru/images/ro.gif),то добавляем /
  var img_source='/'+img;
  var img_temp=img;
  foto1.src=(img_source);

  if((foto1.width!=0)&&(foto1.height!=0))
  {alert("load");
//Определяем размер фото и для POPUP окна делаем размер на 10 пикселей больше
		altez=foto1.height+25;
		width_real=foto1.width+25;
		stringaWin="height="+altez+", width="+width_real;
		var goTo='/ru/templates/popup.php?height='+foto1.height+'&width='+foto1.width+'&src='+img_source;
		var goToPar = 'toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=no, '+stringaWin;
		Stuff=window.open(goTo, "Stuff", goToPar );

  }
  else {alert(img_temp);alert("Where is mistake???");setTimeout( openpagedetail(img_temp),500);}
alert("finish2");
}


function openwin(url,name , width, height) {
						var Win = window.open(url,name,'width=' + width + ',height=' + height + ',resizable=0,scrollbars=1,menubar=0,status=yes' );
						}	
