<!--
var isNav = false;
var isIE = false;
var isOP = false;
var pos= 0; 
var direction= false;

function init() {
  if (parseInt(navigator.appVersion) >= 4) {
    if (navigator.appName.indexOf("Netscape") != -1) isNav = true;
    if (navigator.appName.indexOf("Microsoft") != -1) isIE = true;
    if (navigator.appName.indexOf("Opera") != -1) isOP = true;
  }
  if (isNav || isIE) setInterval('move()', 20);
}  

function move() {
  if (isNav) {document.layers["text"].zIndex= 1;}
  else {if (isOP) {document.all["text"].style.visibility='hidden';}
  else {document.all["text"].style.zIndex= 1;}}
}

function SubmitControl(tocheack){
  if (document.all || document.getElementById){
    for (i=0; i < tocheack.length;i++){
      if(tocheack.elements[i].type.toLowerCase()=="submit"||tocheack.elements[i].type.toLowerCase()=="reset") {
        tocheack.elements[i].value = tocheack.elements[i].value;
        tocheack.elements[i].disabled = true
      }
    }
  }
}

function popup(images, width, height, target){
	if(images == "" || images == null) return;
	if(target == "" || target == null) var target = "_blank";
	
	if (width == "" || width == null || height == "" || height == null) {
		var width = screen.availWidth/2;
		var height = screen.availHeight/2;
	} else {
		var width = width + 70;
		var height = height + 70;
	}
	
	var wx = (screen.availWidth/2)-(width/2);
	var wy = (screen.availHeight/2)-(height/2);

	if (document.all) {
		var sizer = window.open("",target,"left="+wx+",top="+wy+",width="+width+",height="+height+",scrollbars=no,fullscreen=no");
		sizer.location = images;
	} else {
		wnd = window.open(images, target, "width="+width+",height="+height+",menubar=no,toolbar=no,status=no,location=no,scrollbars=auto,fullscreen=no,directories=no,resizable=yes,screenX="+wx+",screenY="+wy);
		window.wnd.moveTo(wx, wy);
	}
  return false;
}

function popupmax(images, width, height){
	if(images == "" || images == null) return;

	if (width == "" || width == null || height == "" || height == null) {
		var width = screen.availWidth;
		var height = screen.availHeight;
	}
	
	if (document.all) {
		var sizer = window.open("","","left=0,top=0,width="+width+",height="+height+",scrollbars=no,fullscreen=yes");
		sizer.location = images;
	} else {
		wnd = window.open(images,"_blank","width=width,height=height,menubar=no,toolbar=no,status=no,location=no,scrollbars=auto,fullscreen=yes,directories=no,resizable=yes");
	}
  return false;
}

function calendar_open(_url,x,y,target,form) {
  if(_url == "" || _url == null) return;
  if(target == "" || target == null) var target = "_blank";
  if(x == "" || x == null) x=100
  if(y == "" || y == null) y=100
  if(form == "" || form == null) var form = "search";
  var cUrl = parse_str(_url);
  _url+="&date="+window.document[form][cUrl.variable].value;
  if (typeof(showModalDialog)=='undefined') return popup(_url,x,y,target);
  else {
    var sFeatures = 'dialogWidth:'+x*2+'px;dialogHeight:'+y*1.6+'px;center:yes;help:no;status:no;unadorned:yes;resizable:yes;returnValue:yes;';
    var results = window.showModalDialog(_url, target, sFeatures);
    window.focus();
//    var mode = _url.replace(/(.*?)variable=(.*?)/gm,'$2');
    var mode = _url.match(/(.*?)variable=(.*?)&(.*?)/);
    mode = mode[2];
    if(typeof results != 'undefined' && results != null) eval('window.document.'+form+'.'+mode+'.value = results;');
    else eval('window.document.'+form+'.'+mode+'.value = "'+(mode=='workto'||mode=='teachto'?'н/время':'')+'";');
  }
  return false;
}

function home_page(thiz,address){
  thiz.style.behavior='url(#default#homepage)';
  thiz.setHomePage(address);
  return false;
}

function addBookmark(address,name){
  if ((navigator.userAgent.indexOf("MSIE") >= 0) && (parseInt(navigator.appVersion)>3)){
    window.external.AddFavorite(address,name);
  }
  return false;
}

var browser_name = navigator.appName;
function printit(){
  if (browser_name == "Netscape") {
    window.print();
  } else {
    var WebBrowser = '<object id="WebBrowser1" width=0 height=0 classid="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></object>';
    document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);
  }
  return false;
}

var objCount = 0;
function preload(name, first, second) {
  if (browserOK) {
    pics[objCount] = new Array();
    pics[objCount][0] = new Image();
    pics[objCount][0].src = first;
    pics[objCount][1] = new Image();
    pics[objCount][1].src = second;
    pics[objCount][2] = name;
    objCount++;
  }
}

function on(name){
  if (browserOK) {
    for (i = 0; i < objCount; i++) {
      if (document.images[pics[i][2]] != null)
      if (name != pics[i][2]) {
        document.images[pics[i][2]].src = pics[i][0].src;
      } else {
        document.images[pics[i][2]].src = pics[i][1].src;
      }
    }
  }
}

function off(){
  if (browserOK) {
    for (i = 0; i < objCount; i++) {
      if (document.images[pics[i][2]] != null) document.images[pics[i][2]].src = pics[i][0].src;
    }
  }
}

function Tags(obj){
 if (document.getElementsByTagName) var d = document.getElementsByTagName(obj);
 else if (document.all) var d = document.all.tags(obj); 
 return d;
}

function div_element(){
 return Tags('div')
}

function GetElementById(id) {
  if (document.getElementById(id)) {
	  return document.getElementById(id);
	} else if (document.all[id]) {
		return document.all[id];
		} else if (document.layers && document.layers[id]) {
			return (document.layers[id]);
			} else {
				return false;
			}
}

function toggle_visibility(id, flag)  {
  if (GetElementById(id)) {
	  if (typeof(GetElementById(id)) == 'object') GetElementById(id).style.visibility = (flag) ? 'visible' : 'hidden';
	}
}

function set_wnd_size(_w, _h, debug) {
   var w=_w;
   var h=_h;
   if (w<=0) w=100;
   if (h<=0) h=100;
   if (w>sw) w=Math.round(sw);
   if (h>sh) h=Math.round(sh);
   if (debug) alert('SIZE: w='+w+', h='+h+'; sw='+sw+', sh='+sh);
   if (is_dlg) {
     window.dialogWidth=w+"px";
     window.dialogHeight=h+"px";
   } else {
     window.resizeTo(w, h);
   }
}

function set_wnd_pos(l, t, debug) {
   if (l<0) l=0;
   if (t<0) t=0;
   if (l>sw) l=Math.round(sw);
   if (t>sh) t=Math.round(sh);
   if (debug) alert('POS: l='+l+', t='+t+'; sw='+sw+', sh='+sh);
   if (is_dlg) {
     window.dialogLeft=l+"px";
     window.dialogTop=t+"px";
   } else {
     window.moveTo(l, t);
   }
}

function calc_wnd_size(debug) {
   var w=0;
   var h=0;
   var lp=0;
   var tp=0;
   
   set_wnd_size(w, h, debug);
   w = document.all.tb1.scrollWidth;
   h = document.all.tb1.scrollHeight;
   set_wnd_size(w, h, debug);
   if (debug) alert('table: '+w+','+ h);
   lp = Math.round((sw/2)-(w/2));
   tp = Math.round((sh/2)-(h/2));
   set_wnd_pos(lp, tp, debug);

   if (is_dlg) {
     for (var i=0;i<5;i++) {
       dw = document.body.scrollWidth-document.body.clientWidth;
       dh = document.body.scrollHeight-document.body.clientHeight;
       if (debug) alert('delta: '+dw+','+ dh);
       if (dw==0 & dh==0) break;
       w += dw;
       h += dh;
       if (debug) alert('size: '+w+','+ h);
       set_wnd_size(w, h, debug);
     }
   } else {
       w += document.body.scrollWidth-document.body.clientWidth;
       h += document.body.scrollHeight-document.body.clientHeight;
       set_wnd_size(w, h, debug);
   }

   lp = Math.round((sw/2)-(w/2));
   tp = Math.round((sh/2)-(h/2));
   set_wnd_pos(lp, tp, debug);
  
}

function var_r(d,l) {
    if (l == null) l = 1;
    var s = '';
    if (typeof(d) == "object") {
        s += typeof(d) + " {\n";
        for (var k in d) {
            for (var i=0; i<l; i++) s += "  ";
            s += k+": " + var_r(d[k],l+1);
        }
        for (var i=0; i<l-1; i++) s += "  ";
        s += "}\n"
    } else {
        s += "" + d + "\n";
    }
    return s;
}

function alert_r(d) {
  for(var k in d) if(d[k]) alert(k+'='+d[k]);
}

function parse_str(Str) {
  var Parse = ''; var Str = Str.split('?'); Str = Str[1].split('&');
  for(i=0;i<Str.length;i++) {var Pstr = Str[i].split('=');Parse+= (i!=0?',':'')+"'"+Pstr[0]+"':"+(typeof(Pstr[1])!="undefined"?"'"+Pstr[1]+"'":"''");}
  eval("var Parse = {"+Parse+"};");
  return Parse;
}

function trim(a){
  return a.replace(/(^\s+|\s+$)/, "");

	var tmp=new Array();
	for(j=0;j<a.length;j++)	if(a[j]!='') tmp[tmp.length]=a[j];
	a.length=tmp.length;
	for(j=0;j<tmp.length;j++)	a[j]=tmp[j];
	return a;
}
// -->