//var nscp = (navigator.appName == "Netscape")
var ismc = (navigator.appVersion.indexOf("Mac") != -1)
var vers = parseFloat(navigator.appVersion.substring(22,25))

function getheight(id) { // function returns height of the element with id passed to the function as argument
	if (dom) { x = new String(document.getElementById(id).style.height); }
	else if (nscp) { x = new String(document.layers[id].height); }
	else if (ie4) { x = new String(document.all[id].style.height); }
	else { x=24; }
	if (x.indexOf("px")) { x=x.substr(0,2); }
	return x;
}
function unhighlightbg2(id) {
	if (dom) {
		id=(Number(id)+1)*2-1;
		document.getElementById(id).style.backgroundColor="#526D68";
		document.getElementById(Number(id)+1).style.backgroundColor="#526D68";
	 }
	else if (nscp) { /*document.layers[id].bgColor="#F9DBAF";*/ }
	else if (ie4) { 
		document.all(id).style.backgroundColor="#526D68";
		document.all(Number(id)+1).style.backgroundColor="#526D68";
	}
return true;
}

function highlightbg2(id) {
	if (dom) {
		id=(Number(id)+1)*2-1;
		document.getElementById(id).style.backgroundColor="#526D68";
		document.getElementById(Number(id)+1).style.backgroundColor="#526D68";
	 }
	else if (nscp) { /*document.layers[id].bgColor="#F9DBAF";*/ }
	else if (ie4) { 
		document.all(id).style.backgroundColor="#526D68";
		document.all(Number(id)+1).style.backgroundColor="#526D68";
	}
return true;
}

function highlightbg(id) {
	unhighlightbg(id);
	if (dom) { document.getElementById("mainNav"+id).style.backgroundColor="#F9DBAF"; }
	else if (nscp) { /*document.layers[id].bgColor="#F9DBAF";*/ }
	else if (ie4) { document.all(id).style.backgroundColor="#F9DBAF"; }
	return true;
}

function unhighlightbg(id2) {
	id="mainNav";
	for(i=0; i<nofmenu; i++) {
		if (i!==elementactive) {
			if (dom) { document.getElementById(id+i).style.backgroundColor="#F0F0CF"; }
			else if (nscp) { /*document.layers[id].bgColor="#F9DBAF";*/ }
			else if (ie4) { document.all(id+i).style.backgroundColor="#F0F0CF"; }
		}
	}

//	for (id2=0; id2<nofmenu; id2++) {
//		unhighlightbg2(Number(id2)+1);
//	}
	return true;
}


function getObj(obj) {
	if (dom) { compLayr=document.getElementById(obj); return compLayr; }
	if (nscp) { compLayr = document.layers[obj]; }
	else { compLayr = eval("document.all." + obj + ".style"); }
	return compLayr;
}

function setTop(layr,num) {
	obj = getObj(layr);
	if (nscp) {	obj.top = num; }
	else { obj.posTop = num; }
}

function show(layr) {
	obj = getObj(layr);
	if (dom) obj.style.visibility="visible";
	else obj.visibility = "visible"
}

function hide(layr) {
	obj = getObj(layr);
	if (dom) obj.style.visibility="hidden";
	else obj.visibility = "hidden";
}

function layerHeight(layr) {
	if (dom) { return (obj.offsetHeight);}
	if (nscp) {	return eval("document." + layr + ".document.height"); }
	else { return eval("document.all." + layr + ".scrollHeight"); }
}

function layerWidth(layr) { 
	if (dom) { return obj.offsetWidth; }
	if (nscp) {	return eval("document." + layr + ".document.width"); }
	else { return eval("document.all." + layr + ".scrollWidth"); }
}

function getLeft(layr) {
	obj = getObj(layr);
	if (dom) { return obj.offsetLeft; }
	if (nscp) {	return (obj.left); }
	else { 
		x = eval(layr + ".offsetLeft");
		return (x);
	}
}
/*
function imgOn(layerName,imgName)
{	if (nscp)
	{	
		eval("document." + layerName + ".document[imgName].src = " + imgName + "on.src");
	}
	else
	{	
		document[imgName].src = eval(imgName + "on.src");
	}
}

function imgOff(layerName,imgName)
{	if (nscp)
	{	
		eval("document." + layerName + ".document[imgName].src = " + imgName + "off.src");
	}
	else
	{	
		document[imgName].src = eval(imgName + "off.src");
	}
}
*/
/* swaps images */

function imgCh(imgname, mode) { 
	if (document.images) {
	if (mode=='on') { appendix='_a.gif'; }
	else { appendix='_n.gif'; }
	el_src=new String(document[imgname].src);
	el_src=el_src.substr(0, el_src.length-6)+appendix;
	document[imgname].src = el_src;
	}
}

function get_date() {
var date_current=new Date();	// текущая дата
day=date_current.getDate();		// текущий день
month=date_current.getMonth(); 	// текущий месяц
year=date_current.getYear();			// текущий год
if (month==0)  month_name="января";
else if (month==1)  month_name="февраля";
else if (month==2)  month_name="марта";
else if (month==3)  month_name="апреля";
else if (month==4)  month_name="мая";
else if (month==5)  month_name="июня";
else if (month==6)  month_name="июля";
else if (month==7)  month_name="августа";
else if (month==8)  month_name="сентября";
else if (month==9)  month_name="октября";
else if (month==10)  month_name="ноября";
else if (month==11)  month_name="декабря";
if (year<2000) year=1900+(year);
return (day+"&nbsp;"+month_name+"&nbsp;"+year);
}