// JavaScript Document
	window.name = "zakladne_web";
			function otvor_okno(url, width, height)
			{
				dx = Math.round((screen.width-800)/2);
				window.open(url, 'okeenko', 'width='+width+', height='+height+', toolbar=no, resizable=yes, directories=no, scrollbars=yes,  left='+dx+', top=0').focus();
			}

			function open_photo(form, element, linka)
			{
				dx = Math.round((screen.width-800)/2);
				window.open('urob.php?what=select_content&form='+form+'&element='+element+'&linka='+linka,'hehe','width=800,height=700,toolbar=no,directories=no,scrollbars=yes,location=no,left='+dx+',top=0').focus();
			}

			function checkAll(theForm, str)
			{
			    for (i=0,n=theForm.elements.length;i<n;i++)
			      if (theForm.elements[i].name.indexOf(str)==0)
			                theForm.elements[i].checked=true;
			}

var itext_posx = 0;
var itext_posy = 0;

var itext_onlink = 0;
var itext_ondiv  = 0;
var itext_t;
var itext;
var itext_content;
var itext_pWord = 0;
var itext_pLink = 1;
var itext_pBody = 2;

function itext_onover(itext)
{
	//eval('var itext=/([\\s,.]+)(' + itex + ')([\\s,.]+)/i;');
  	clearTimeout(itext_t);
    itext_timedCount(itext);
    itext_onlink = 1;

}
function itext_onout(itext)
{
    clearTimeout(itext_t);
    itext_timedCount(-1);
    itext_onlink = 0;
}

function itext_pw() {
    if (window.innerWidth != null) return window.innerWidth;
    if (document.body.clientWidth != null) return document.body.clientWidth;
    return (null);
}

function  itext_show_div(itext){

    el = document.getElementById('itext');
    if (el.style.visibility != 'hidden')
        el.style.visibility = 'hidden';

    el.innerHTML = itext;

    var wp = itext_pw();

    st = el.style.visibility;
    tv = 0;

     if (el.offsetWidth) ew = el.offsetWidth;
     else if (el.clip.width) ew = el.clip.width;

     if (st != "visible" && st != "show") {
        tv = itext_posy + 0 + document.body.scrollTop;
        lv = itext_posx - (ew/4) + 70 + document.body.scrollLeft;

        if (lv < 2) lv = 2;
        else if (lv + ew > wp) lv -= ew/2;

        lv += 'px';
        tv += 'px';

        el.style.left = lv;
        el.style.top = tv;
        el.style.visibility = "visible";
    }

}

function itext_hide_div() {
    if (itext_onlink == 0 && itext_ondiv == 0)
        document.getElementById('itext').style.visibility = 'hidden';
}


function itext_timedCount(itext) {
    if (itext == -1)
        itext_t = setTimeout("itext_hide_div()", 200);

    else
        itext_t = setTimeout("itext_show_div('"+itext+"')", 200);
}

function itext_getMousePos(e) {
    if (document.all)
        e = event;
    itext_posx = e.clientX;
    itext_posy = e.clientY;
}

function itext_over_div(obj) {
    clearTimeout(itext_t);
    obj.className = 'itext-overtip';
    itext_ondiv = 1;
}

function out_div(obj) {
    itext_ondiv = 0;
    obj.className = 'itext-tip';
    itext_timedCount(-1);
}

document.onmousemove = itext_getMousePos;

function ViewHide(id)
{
   var obj = document.getElementById(id);

   if (obj.style.display == "none")
      obj.style.display = "inline";
   else
      obj.style.display = "none";
}


