isDOM=document.getElementById?true:false
isOpera=isOpera5=window.opera && isDOM
isOpera6=isOpera && window.print
isOpera7=isOpera && document.readyState
isMSIE=isIE=document.all && document.all.item && !isOpera
isStrict=document.compatMode=='CSS1Compat'
isNN=isNC=navigator.appName=="Netscape"
isNN4=isNC4=isNN && !isDOM
isMozilla=isNN6=isNN && isDOM

global_tpArea = 297;
btmArea = 56;
if (document.location.toString().indexOf("/forums") == -1)
  window.onresize = doResize;

if (document.images)
{
 klBtnOn = new Image();
 klBtnOn.src = "/img/kl-yellow-dot.gif";
 klBtnOff = new Image();
 klBtnOff.src = "/img/kl-blue-dot.gif";

 insBtnOn = new Image();
 insBtnOn.src = "/img/ins-menu-yellow-dot.gif";
 insBtnOff = new Image();
 insBtnOff.src = "/img/ins-menu-dot.gif";

 insRightBtnOn = new Image();
 insRightBtnOn.src = "/img/ins-menu-yellow-dot-right.gif";
 insRightBtnOff = new Image();
 insRightBtnOff.src = "/img/ins-menu-dot-right.gif";
}

function swOn(imageName, prefix)
{
 if (document.images)
 {
  document[imageName].src = eval(prefix + "BtnOn.src");
 }
}

function swOff(imageName, prefix) 
{
 if (document.images)
 {
  document[imageName].src = eval(prefix + "BtnOff.src");
 }
}

function doResize() {
  window_height=(window.innerHeight)?window.innerHeight:((document.all)?document.body.offsetHeight:400);
  if ((window_height-global_tpArea-btmArea) > 0)
    document.getElementById('bufImg').style.height=window_height-global_tpArea-btmArea;
  else
    document.getElementById('bufImg').style.height=30;
}

function makeDocHeight (tpArea) {
  global_tpArea = tpArea;
  window_height=(window.innerHeight)?window.innerHeight:((document.all)?document.body.offsetHeight:400); 
  if ((window_height-global_tpArea-btmArea) > 0)
    document.write("<img src='/img/1x1t.gif' width='1' height='" + (window_height-global_tpArea-btmArea) + "' border='0' id='bufImg'>");
  else
    document.write("<img src='/img/1x1t.gif' width='1' height='30' border='0' id='bufImg'>");
}

function makeImgHeight () {
  document.all["bufImg"].style.height = (iPx-tpArea-btmArea);
}


function openMainD() {
  if (isOpera || isNN || isNN4) {
//    document.write("<div id='mainD' style='position:relative;height:"+(window.innerHeight-tpArea-btmArea)+"'>");  
    document.write("<table width='100%' height='"+(window.innerHeight-tpArea-btmArea)+"' cellspacing='0' cellpadding='0' border='0' bgcolor='#B6D3EF'>");
  } else {
//    document.write("<div id='mainD' style='position:relative;'>");
    alert(document.all["bufImg"].style.height);
    document.all["bufImg"].style.height = 100;
    alert(document.all["bufImg"].style.height);
    document.write("<table width='100%' cellspacing='0' cellpadding='0' border='0' bgcolor='#B6D3EF'>");
  }
}

function closeMainD(name) {
  document.write("</table>");
//  document.write("</div>");
//  if (isNN || isNN4)
//    document.getElementById(name).style.height = window.innerHeight-tpArea-btmArea;
}

function bgChangeOn(name) {
  _name = eval(name);
  _name.style.backgroundColor = "#E98725";
  _name.style.cursor = "pointer";
}

function bgChangeOff(name) {
  _name = eval(name);
  _name.style.backgroundColor = "#B6D3EF";
  _name.style.cursor = "default";
}

function _submit() {
  if (document.getElementById('ms').value == "") {
    alert("Ââåäèòå ïàðàìåòðû ïîèñêà");
    return;
  }
  else
  {
    document.getElementById('srcForm').submit();
  }
}