bV=parseInt(navigator.appVersion);
dom=(!document.layers && !document.all && bV>=4) ? true : false;
ie4 = (document.all)? true:false;
if (window.navigator.userAgent.indexOf ("Opera") > 0)
opera=true
else 
opera=false;
var pr=0;

function OVER(num)
{
		for (i=0; i<b.length; i++)
		{
		if (b[i]!=13 && eval("document.all.m"+b[i]))
		eval("document.all.m"+b[i]).style.visibility="hidden";
		}

		for (i=0; i<b.length; i++)
		if (b[i]==num && eval("document.all.m"+b[i]))
		{
			if (dom)
			{
				eval("document.all.ms"+num).style.left=0;
				eval("document.all.ms"+num).style.top=0;
			}
			else
			if (opera)
			{
				eval("document.all.ms"+num).style.left=0;
				eval("document.all.ms"+num).style.top=0;
			}
			eval("document.all.m"+num).style.visibility="visible";
		}
		clearTimeout(pr);
}

function OUT()
{
	for (i=0; i<b.length; i++)
	{
	if (b[i]!=13 && eval("document.all.m"+b[i]))
	eval("document.all.m"+b[i]).style.visibility="hidden";
	}
	clearTimeout(pr);
}
function DELAYS()
{
	pr=setTimeout("OUT()",1000);
}
function PAVS(num, regs)
{
	W=window.open("../misc/onepav.php?id="+num+"&regs="+regs+"&sum_win="+sum_win,"b_ph","width=600,height=700,left=100,top=100,status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=no");
}

function MENU(num)
{
	if (document.getElementById("menu"+num).style.display=='none')
	{
		document.getElementById("menu"+num).style.display='inline';
		document.getElementById("menut"+num).style.color='#ff0000';
		document.getElementById("menut"+num).style.fontWeight='bold';
	}
	else
	{
		document.getElementById("menu"+num).style.display='none';
		document.getElementById("menut"+num).style.color='#006A9B';
		document.getElementById("menut"+num).style.fontWeight='normal';
	}
}
function PrintVersion()
{
	if (document.print_form)
	{
		PR=window.open("","wndPrint","alwaysRaised=yes,left=0,top=0,height=500,width=800,menubar=yes,toolbar=yes,resizable=yes,status=yes,scrollbars=yes");
		document.print_form.submit();
	}else{
		alert("Для этой страницы принт-версия отсутствует!");
	}
}
//////////////////////////////// Ajax ////////////////////////////////////////////////////////////////
function createRequestObject() 
{
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        ro = new XMLHttpRequest();
    }
    return ro;
}

function sndReq(idm) 
{
	if (document.getElementById("menu"+idm).style.display=='inline')
	{
		document.getElementById("menu"+idm).style.display='none'
		document.getElementById("menut"+idm).style.color='#006A9B';
		document.getElementById("menut"+idm).style.fontWeight='normal';
	}
	else
	{
		document.getElementById("menut"+idm).style.color='#ff0000';
		document.getElementById("menut"+idm).style.fontWeight='bold';
		http.open('get', '/misc/menu.php?idm='+idm);
		http.onreadystatechange = handleResponse;
		http.send(null);
	}
}

function handleResponse()
{
    if(http.readyState == 4)
	{
        var response = http.responseText;
        var update = new Array();
        if(response.indexOf('|' != -1))
		{
            update = response.split('|');
			document.getElementById(update[0]).style.display='inline';		
            document.getElementById(update[0]).innerHTML = update[1];
        }
    }
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////// Popup //////////////////////////////////////////////////////
function popup_img(img)
{
	viewer=window.open("../misc/popup.php?name='"+img+"'", "wPopup", "width=10, height=10, toolbar=no, status=no, menubar=no, resizable=no");
	viewer.focus();
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////


