zs++;
var do_drop = (parseInt(navigator.appVersion) >= 4) &&
	(navigator.appName.indexOf("Microsoft Internet Explorer") != -1) &&
	(navigator.appVersion.indexOf("Win") != -1);

function tla(a){a.style.backgroundColor="#DADADA";}
function tlo(a){a.style.backgroundColor="#AAAAAA";}

var MM2K_nLayerTimeoutID = null;

var i = 1;
function colors() {
	if (i==1){c="red";} else if (i==2){c="black";} else if (i==3){c="#80f000";} else {c="blue";i=0;}
	kuku.style.color=c;i++;
	v=setTimeout("colors()",600);
}

function MM2K_overLayer() {
	if (!do_drop) return;

	if ( MM2K_nLayerTimeoutID ) clearTimeout(MM2K_nLayerTimeoutID);
	MM2K_nLayerTimeoutID = null;
}

function MM2K_outLayer() {
	if (!do_drop) return;

	if ( MM2K_nLayerTimeoutID )
		clearTimeout(MM2K_nLayerTimeoutID);
	MM2K_nLayerTimeoutID = setTimeout('MM2K_showHideLayers(\'d_vrachi\',\'\',\'hide\',\'d_student\',\'\',\'hide\',\'d_patient\',\'\',\'hide\')', 9);
}

var MM2K_nButtonTimeoutID = null;

function MM2K_overButton(sJS) {
	if (!do_drop)
		return;
	if ( MM2K_nButtonTimeoutID )
		clearTimeout(MM2K_nButtonTimeoutID);
	MM2K_nButtonTimeoutID = setTimeout(sJS, 130);
}

function MM2K_outButton() {
	if (!do_drop)
		return;

	if ( MM2K_nButtonTimeoutID )
		clearTimeout(MM2K_nButtonTimeoutID);
	MM2K_nButtonTimeoutID = null;
}

function MM2K_hideElement(sElementID, oDOMLayer)  {
	var nIndex;
	var oDOMElement;
	var nLeft;
	var nTop;
	var oDOMParent;

	if ( !document.all )
		return;

	var nX = oDOMLayer.style.top;
	nX = parseInt(nX.substring(0, nX.length - 2));
	var nY = oDOMLayer.style.left;
	nY = parseInt(nY.substring(0, nY.length - 2));

	for (nIndex = 0; nIndex < document.all.tags(sElementID).length; nIndex++) {
		oDOMElement = document.all.tags(sElementID)[nIndex];
		if (( sElementID == 'OBJECT' ) && ( oDOMElement.codeBase.indexOf('/flash/') != -1))
			continue;
		if (( !oDOMElement ) || ( !oDOMElement.offsetParent))
			continue;
		nLeft = oDOMElement.offsetLeft;
		nTop = oDOMElement.offsetTop;
		oDOMParent = oDOMElement.offsetParent;
		while ( oDOMParent.tagName.toUpperCase() != 'BODY') {
			nLeft += oDOMParent.offsetLeft;
			nTop += oDOMParent.offsetTop;
			oDOMParent = oDOMParent.offsetParent;
		}
		nTop = nTop - nX;

		if ( nY > (nLeft + oDOMElement.offsetWidth) || nLeft > (nY + oDOMLayer.offsetWidth))
			;
		else if ( nTop > oDOMLayer.offsetHeight )
			;
		else
			oDOMElement.style.visibility = 'hidden';
	}
}

function MM2K_showElement(sElementID) {
	var nIndex;
	var oDOMElement;

	if ( !d.all ) return;

	for (nIndex = 0; nIndex < d.all.tags(sElementID).length; nIndex++) {
		oDOMElement = d.all.tags(sElementID)[nIndex];
		if (( !oDOMElement ) || ( !oDOMElement.offsetParent))
			continue;
		oDOMElement.style.visibility = '';
	}
}

function MM_findObj(n, d) {
	var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM2K_showHideLayers() {
	var i,p,v,obj,args=MM2K_showHideLayers.arguments;
	var oDOMLayer;
	if ( !do_drop ) return;
	for (i=0; i<(args.length-2); i+=3) {
		if ( (obj=MM_findObj(args[i]))!=null ) {
			v=args[i+2];
			oDOMLayer = obj;
			if (obj.style) {
				obj=obj.style;
				v=(v=='show')?'visible':(v='hide')?'hidden':v;
			}
			if ( v=='visible' ) {
 				MM2K_hideElement('SELECT', oDOMLayer);
				MM2K_hideElement('OBJECT', oDOMLayer);
			} else {
				MM2K_showElement('SELECT');
				MM2K_showElement('OBJECT');
			}
			obj.visibility=v;
		}
	}
}

