
function config()
{
	this.ver = navigator.appVersion.toLowerCase();
	this.agent = navigator.userAgent.toLowerCase();
	this.dom = document.getElementById ? 1 : 0;
	this.opera = (navigator.userAgent.indexOf("opera")>-1 && document.getElementById) ? 1 : 0;
	this.opera7 = (this.opera && parseInt(navigator.appVersion) >= 7);
	this.ie = (this.ver.indexOf("msie") > -1 && this.dom && !this.opera) ? 1 : 0;
	this.macOS = this.agent.indexOf("mac") > -1;
	this.mac = (this.macOS && parseInt(this.ver) >= 7) ? 1 : 0;
	this.moz = (this.agent.indexOf("gecko")>-1)
	this.ns6 = (this.dom && this.agent.indexOf("netscape")>-1 && parseInt(this.ver) >= 5) ? 1 : 0;
	this.b = (this.ie || this.ns6 || this.opera7 || this.mac || this.moz || this.dom);
	return this;
}

var config = new config();



function showImage (url, name, w, h) {
	var n3 = (navigator.appName.indexOf('Netscape')!=-1 && navigator.appVersion.indexOf('3.')!=-1)?true:false;
	var ww = (n3)?(parseInt(w)+15):parseInt(w);
	var wh = (n3)?(parseInt(h)+15):parseInt(h);
	var winname = (name.indexOf(' ')!=-1)?name.substring(0, name.indexOf(' ')):name;
	var wnd = window.open('', winname, 'width='+ww+',height='+(wh));
 	var code = '<html><head>\n<title>'+name+'</title></head>\n'+
			   '<body bgcolor="White" marginwidth=0 marginheight=0 leftmargin=0 topmargin=0>\n'+
			   '<center><img src=' + url + ' onLoad="window.focus();" style="cursor:hand" alt="Закрыть" onClick="window.close();" name="main_img"><br><font face=sans-serif size=11px><span style=\"font:11px sans-serif">'+
			   name + '</span></font></center></body></html>';
	wnd.document.write(code);
	wnd.document.close();
}
// onLoad="window.moveTo((screen.width - this.width) / 2 , (screen.height - this.height) / 2); if (navigator.appName==\'Netscape\'){window.outerWidth = this.width;	window.outerHeight = this.height+25;}else window.resizeTo(this.width, this.height+25); "

function MM_jumpMenu(targ,selObj,restore){ //v3.0
if(!selObj.options[selObj.selectedIndex].value) return;
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_findObj(n, d) { //v4.01
  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_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}

function print_r(theObj){
  if(theObj.constructor == Array ||
     theObj.constructor == Object){
    document.write("<ul>")
    for(var p in theObj){
      if(theObj[p].constructor == Array||
         theObj[p].constructor == Object){
document.write("<li>["+p+"] => "+typeof(theObj)+"</li>");
        document.write("<ul>")
        print_r(theObj[p]);
        document.write("</ul>")
      } else {
document.write("<li>["+p+"] => "+theObj[p]+"</li>");
      }
    }
    document.write("</ul>")
  } else alert("Object empty");
}

function remove_image(variable,sub)
{
	
 				 document.getElementById(variable).src = 'site/graphics/spacer.gif';
				 document.getElementById(variable+'_src').value = '';
				
				 document.getElementById(variable+'_alt').value = '';
				
				 if(sub) document.forms['edit'].submit();
}	
