<!--

function setMousOv(ob, bgclr, fntclr){
    if(bgclr.length  > 0)	ob.style.backgroundColor=bgclr;
    if(fntclr.length > 0)	ob.style.color=fntclr;
	ob.style.cursor='pointer';
}

function setMousOut(ob){
    ob.style.backgroundColor='';
    ob.style.color='';
	ob.style.cursor='';
}

function shwDiv(s)
{
	obj = document.getElementById(s);
	if(obj.style.display=='block')
		obj.style.display = 'none'
	else
		obj.style.display='block'
}

function expDiv(s)
{
	obj = document.getElementById(s);
	var im_s = 'im_'+s;

	if(obj.style.overflow=='hidden')
	{
		obj.style.height = '';
		obj.style.overflow = 'visible';
		if ( document.images[im_s]!=null && document.images[im_s]!='undefined' )
			document.images[im_s].src='/images/icon-expand_.gif';
	}
	else
	{
		obj.style.overflow='hidden';
		obj.style.height = '140px';
		if (document.images[im_s]!=null && document.images[im_s]!='undefined')
			document.images[im_s].src='/images/icon-expand.gif';
	}
}

var popUpWin=0;
function popup2(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable){
if(popUpWin){ if(!popUpWin.closed) popUpWin.close(); }
var wint=(screen.height - height) / 2;
var winl=(screen.width - width) / 2;
toolbar_str=toolbar ? 'yes' : 'no';
menubar_str=menubar ? 'yes' : 'no';
statusbar_str=statusbar ? 'yes' : 'no';
scrollbar_str=scrollbar ? 'yes' : 'no';
resizable_str=resizable ? 'yes' : 'no';
return popUpWin=window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',status=no,toolbar='+toolbar_str+',menubar='+menubar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}
function MM_swapImgRestore(){
var i,x,a=document.MM_sr;
for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages(){
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];
	}
}
}
function MM_findObj(n, d){
var p,i,x;
if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n];
for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n);
return x;
}
function MM_swapImage(){
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){
	document.MM_sr[j++]=x;
	if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];
}
}
function TboxOver(b){
var c;
if(document.getElementById){
	c=b.parentNode.parentNode.parentNode.parentNode;
	c.className='tbox-tab-over';
}
}
function TboxOut(b){
var c;
if(document.getElementById){
	c=b.parentNode.parentNode.parentNode.parentNode;
	c.className='tbox-tab';
}
}
function ov(){
this.defaultclassName=this.className;
this.className='iselected';
}
function ou(){
if(this.defaultclassName){
	this.className=this.defaultclassName;
} else{
	this.className='';
}
}
function tableruler(){
if (document.getElementById && document.createTextNode){
	var tables=document.getElementsByTagName('table');
	for (var i=0;i<tables.length;i++){
		if(tables[i].className=='data'){
			var trsaved=new Array();
			var trs=tables[i].getElementsByTagName('tr');
			for(var j=0;j<trs.length;j++){
				if(trs[j].parentNode.nodeName=='TBODY'){
					trsaved[j]=trs[j].className;
					trs[j].onmouseover=ov;
					trs[j].onmouseout=ou;
				}
			}
		}
	}
}
}
function mOvr(src){
if(document.getElementById){
	if (!src.contains(event.fromElement)){
		src.style.cursor='hand';
		src.parentNode.parentNode.parentNode.className='tbox-tab-over';
	}
}
}
function mOut(src){
if(document.getElementById){
	if (!src.contains(event.toElement)){
		src.style.cursor='default';
		src.parentNode.parentNode.parentNode.className='tbox-tab';
	}
}
}
function mClk(src){if (event.srcElement.tagName == 'TD') src.children.tags('A')[0].click();}
function CheckAll(frm, mark){
for (i=0; i<=frm.elements.length; i++){
	try{frm.elements[i].checked=mark;}
	catch(er){}
}
}
function pg_reload(hrf){
    var s="'"+ hrf +"'";
    tm=setTimeout('location.href='+s, 1000);
}
function setChk(th){
	var f=th.form;
	var n=f.elements.length;
	for(i= 0; i< n; i++) if(f.elements[i].name==th.name) th.checked ? f.elements[i+1].value=f.elements[i+2].value : f.elements[i+1].value='' ; // --- передаем idcategory в переменную-масив
}

// определяем бровзер
isDOM=document.getElementById //DOM1 browser (MSIE 5+, Netscape 6, Opera 5+)
isOpera=isOpera5=window.opera && isDOM //Opera 5+
isOpera6=isOpera && window.print //Opera 6+
isOpera7=isOpera && document.readyState //Opera 7+
isMSIE=document.all && document.all.item && !isOpera //Microsoft Internet Explorer 4+
isMSIE5=isDOM && isMSIE //MSIE 5+
isNetscape4=document.layers //Netscape 4.*
isMozilla=isDOM && navigator.appName=="Netscape" //Mozilla или Netscape 6.*


// Helen NikitinA
function second_win(img_path,img_alt){
var str, StrBody;
	str = 'resizable=yes,width=189,height=176,screenX=200,screenY=100,left=100,top=100';
	if (document.all){
		//StrBody = '<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="White" onblur="self.window.close();" onresize="self.window.location.reload();">';
		StrBody = '<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="White" onblur="self.window.close();">';
	} else {
		StrBody = '<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="White" onblur="self.window.close();" >';
	}
	var win_op = window.open('','show', str);
	win_op.document.open();
	win_op.document.writeln('<html>');
	win_op.document.writeln('<head>');
	win_op.document.writeln('<title>' + img_alt + '</title>');
	win_op.document.writeln('<script>');
	win_op.document.writeln('function resize_img() {');
	win_op.document.writeln('var width = document.image.width;');
	win_op.document.writeln('var height = document.image.height;');
	win_op.document.writeln('if (!(document.all)){ self.resizeTo(width,height); } else { self.resizeTo((width+12),(height + 31));');
	win_op.document.writeln('self.resizeTo(width,height);');
	win_op.document.writeln(' }');

	win_op.document.writeln('}');

	win_op.document.writeln("</"+"script>");
	win_op.document.writeln("</"+"head>");
	win_op.document.writeln(StrBody);
	win_op.document.writeln('<img name="image" src='+ img_path + ' border=0 alt="'+img_alt+'" onload="resize_img();">');
	win_op.document.writeln("</"+"body>");
	win_op.document.writeln("</"+"html>");
	win_op.document.close();
}
// -->
