d = document;
opera = (navigator.userAgent.indexOf('Opera') >= 0)? true : false;
ie = (document.all && !opera)? true : false;
dom = (document.getElementById && !ie && !opera)? true : false;

var opn;

if (dom || ie)
{
        d.writeln('<STYLE type="text/css">');
        d.writeln('.subcat { display: none; }');
        d.writeln('</STYLE>');
}

function zoom(gal,wid,hei)
{
var n1=parseInt(wid);
var n2=parseInt(hei);
var wid2 = n1+5;
var hei2 = n2+10;
window.open(gal, 'gellery', "scrollbars=0,resizable=no,left=0,top=0,width="+wid2+",height="+hei2);
}

function foto(title, img, width, height, pr) {
	var width=(width ? width : 800);
	var height=(height ? height : 600);
	var win=window.open('', '_blank', 'width='+width+', height='+height+', left='+((screen.width-width)/2)+', top='+((screen.height-height)/2)+', toolbar=no, menubar=no, resizable=yes, status=yes, location=no, alwaysRaised=yes, scrollbars=no');
	win.document.write('<html><head><title>'+title+'</title></head><body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" rightmargin="0"><table width="100%" cellpadding="0" cellspacing="0" border="0" height="100%"><tr><td width="100%" align="center"><img src="/'+img+'" border="0" style="border:1px solid #bbbbbb;"></td></tr></table></body></html>');
}


function prn() {
var texthtml = document.getElementById("prn").innerHTML;
  myWin= open("", "displayWindow", "width=700,height=500,status=yes,toolbar=yes,scrolling=yes,menubar=yes,scrollbars=yes,resizable=yes");
  myWin.document.open();  
  myWin.document.write("<HTML><HEAD><title>Версия для печати</title><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'>");
  myWin.document.write("<meta name='description' content=''><meta name='keywords' content=''><meta name='robots' content='index, follow'>");
  myWin.document.write("<link rel=stylesheet href='/css/site.css' type='text/css'></HEAD>");
  myWin.document.write("<BODY>"+texthtml);
  myWin.document.write("<script>document.getElementById('lk').style.display = 'none';document.getElementById('model').style.display = 'none';</script>");
  myWin.document.write("</BODY></HTML>");
  myWin.document.close(); 
}

function prndoc() {
var texthtml = document.getElementById("prn").innerHTML;
  myWin= open("", "displayWindow", "width=700,height=500,status=yes,toolbar=yes,scrolling=yes,menubar=yes,scrollbars=yes,resizable=yes");
  myWin.document.open();  
  myWin.document.write("<HTML><HEAD><title>Версия для печати</title><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'>");
  myWin.document.write("<meta name='description' content=''><meta name='keywords' content=''><meta name='robots' content='index, follow'>");
  myWin.document.write("<link rel=stylesheet href='/css/site.css' type='text/css'></HEAD>");
  myWin.document.write("<BODY>"+texthtml);
  myWin.document.write("<script>document.getElementById('lk').style.display = 'none';</script>");
  myWin.document.write("</BODY></HTML>");
  myWin.document.close(); 
}

function vz(id) {
document.getElementById(id).style.display = 'block';
}
function vzn(id) {
document.getElementById(id).style.display = 'none';
}

function sh(id){ 
$("#"+id).slideToggle("fast"); 
}


function viev() {

} 

function getOffsetRect(elem) {
    var box = elem.getBoundingClientRect()
    var body = document.body
    var docElem = document.documentElement
    var scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop
    var scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft
    var clientTop = docElem.clientTop || body.clientTop || 0
    var clientLeft = docElem.clientLeft || body.clientLeft || 0
    var top  = box.top +  scrollTop - clientTop
    var left = box.left + scrollLeft - clientLeft
    return { top: Math.round(top), left: Math.round(left) }
}

function headrnd(startValue, endValue) {
    var iChoices = endValue - startValue + 1;
    return Math.floor(Math.random() * iChoices + startValue);
}





























