function maxpic(name,name_sm,x,y,id_img) {
pic=document.getElementById(id_img);
pic.style.display='';
pic.style.marginLeft="-"+x+"px";
pic.innerHTML='<img width="'+x+'",height="'+y+'" src="'+name+'" alt="закрыть" onclick="document.getElementById(\''+id_img+'\').style.display=\'none\'" />';

}

function maxpic1(name,titl,x,y) {
	var win = window.open('','_blank',"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+x+",height="+y);
	win.document.open("text/html");
	with (win.document) {
	    write('<html><head><title>'+titl+'</title><script language="JavaScript">self.focus()</script></head><body style="background:#fff;margin:0;padding:0;"><a href="#" onclick="window.close()"><img width="'+x+'",height="'+y+'" src="'+name+'"');
	    write(' alt="закрыть" style="border:0;"></a></body></html>');
	    close();
 }
}

function maxpic_new(name,titl,descr,x,y) { 
	var win = window.open('','_blank',"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+(x+211)+",height="+y);
	win.document.open("text/html");
	with (win.document) {
	    write('<html><head><title>'+titl+'</title><script language="JavaScript">self.focus()</script></head><body style="background:#fff;margin:0;padding:0;"><a href="#" onclick="window.close()"><img width="'+x+'",height="'+y+'" src="'+name+'"');
	    write(' alt="закрыть" style="border:0;float:left;margin-right:10px;"></a><div style="width:200px;float:left;color:#676767;font-family:Tahoma;font-size:80%;margin-top:10px;">'+descr+'</div></body></html>');
	    close();
 	}
}


function MM_preloadImages() { //v3.0
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//MM_preloadImages('/imgs/design/misc_on.png','/imgs/design/beef_on.png','/imgs/design/bird_on.png','/imgs/design/pork_on.png');



function m_over(ob) {

obj = window.document.getElementById(ob);
mas1 = obj.src.split("/");
mas = mas1[mas1.length-1].split(".");

	if(mas[0].indexOf("_on")==-1){
		obj.src="/imgs/design/"+mas[0]+"_on."+mas[1];

	}else{
		img = mas[0].split("_");
		obj.src="/imgs/design/"+img[0]+"."+mas[1];
	}

}
/*function m_out(obj) {
obj=window.document.getElementById(obj);
//window.status=obj.className;
	if(obj.className.indexOf("-a")!=-1){
		str=obj.className.split("-");
		obj.className=str[0];
	}

}*/

function info(det_url,base) { window.open("/cgi-bin/base/result_"+base+".pl?action=see_item&id="+det_url,'details','toolbar=0,location=0,directories=0, status=0,menubar=0,scrollbars=yes,resizable=1,width=300,height=400'); return false; }

function addBookmark(url, title)
{
 if (!url) url = location.href;
 if (!title) title = document.title;
 
 //Gecko
 if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) window.sidebar.addPanel (title, url, "");
 //IE4+
 else if (typeof window.external == "object") window.external.AddFavorite(url, title);
 //Opera7+
 else if (window.opera && document.createElement)
 {
   var a = document.createElement('A');
   if (!a) return false; //IF Opera 6
   a.setAttribute('rel','sidebar');
   a.setAttribute('href',url);
   a.setAttribute('title',title);
   a.click();
 }
 else return false;
 
 return true;
}

function check_it(f)
{
	if(f.q.value==""||f.q.value=="поиск по сайту")
		return false;
	else return true;
}