//----------------------------------------------------------------------------
function StylePrintOn() {
  var inHead = document.documentElement.firstChild.childNodes;
  for (i=0; i<inHead.length; i++) {
  	if (inHead[i].nodeName == 'LINK') {
  		str = inHead[i].getAttribute("href");
  		str = str.substring(str.length-8);
  		if (str == "null.css") {inHead[i].setAttribute("href","/include/print.css");}
  	}
  }
  var obj = document.getElementById("switch_style");
  obj.innerHTML="Полная версия";
  obj.setAttribute("href","javascript: StylePrintOff()");
}
//----------------------------------------------------------------------------
function StylePrintOff() {
  var inHead = document.documentElement.firstChild.childNodes;
  for (i=0; i<inHead.length; i++) {
  	if (inHead[i].nodeName == 'LINK') {
  		str = inHead[i].getAttribute("href");
  		str = str.substring(str.length-9);
  		if (str == "print.css") {inHead[i].setAttribute("href","/include/null.css");}
  	}
  }
  var obj = document.getElementById("switch_style");
  obj.innerHTML="Версия для печати";
  obj.setAttribute("href","javascript: StylePrintOn()")
}
//----------------------------------------------------------------------------
function _mouseover(node) {
  node.className="over";
}
//----------------------------------------------------------------------------
function _mouseout(node) {
  node.className="";
}
//----------------------------------------------------------------------------
var o;
var o_color = 'red';
var counter = 1;
var o_frm_now;
//----------------------------------------------------------------------------
function CheckRequared(o_frm,vars) {
  for (var k in vars) {
    if (o_frm[vars[k]].value && o_frm[vars[k]].value != '0') {continue;}
    o = o_frm[vars[k]];
    counter = 1;
    o_color = 'red';
    o.value = ' Введите данные';
    o.focus();
    setTimeout("ChangeBg()",10);
    return false;
  }
  if (o_frm.submit) {o_frm_now = o_frm; setTimeout("o_frm_now.submit.disabled = true;",300);}
  return true;
}
//----------------------------------------------------------------------------
function ChangeBg() {
  counter++;
  if (counter > 8) {o.value = ''; return;}
  o_color = (o_color == 'red') ? 'white' : 'red';
  o.style.background = o_color;
  setTimeout("ChangeBg()",300)
}
//----------------------------------------------------------------------------
