var MenuOn=0, MenuSH = new Array, TimeId;

browser_name = navigator.appName;
browser_version = parseFloat(navigator.appVersion);

if (browser_name == "Netscape" && browser_version >= 3.0) { roll = 'true'; }
else if (browser_name == "Microsoft Internet Explorer" && browser_version >= 3.0) { roll = 'true'; }
else { roll = 'false'; }


function over(img,ref) { if (roll == 'true') { document.images[img].src = ref; } }
function out(img,ref)  { if (roll == 'true') { document.images[img].src = ref; } }


function preloadImg(file){
  image = new Image();
  image.src = file;
}

function rol_img() {	
	preloadImg('img/icons/arrow.gif');
	//preloadImg('img/menu/contacts-on.gif');
	//preloadImg('img/menu/support-on.gif');
	//preloadImg('img/menu/clients-on.gif');
	//preloadImg('img/menu/demo-on.gif');
	//preloadImg('img/menu/tariffs-on.gif');
	//preloadImg('img/menu/features-on.gif');
	//preloadImg('img/menu/news-on.gif');
	//preloadImg('img/menu/about-on.gif');
}

function topFlash() {
if (isOpera) {
	flash="anime_opera.swf";
} else {
	flash="anime.swf";
}
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="327" height="241" id="anime" align="middle">');
document.write('<param name="allowScriptAccess" value="sameDomain" />');
document.write('<param name="movie" value="flash/'+flash+'" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="scale" value="noscale" />');
document.write('<param name="wmode" value="transparent" />');
document.write('<param name="bgcolor" value="#ffffff" />');
document.write('<embed src="flash/'+flash+'" quality="high" scale="noscale" wmode="transparent" bgcolor="#ffffff" width="327" height="241" name="anime" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
}

function ie_must_die() {
		tWidth=document.getElementById('merka').clientWidth;
		if (tWidth < 1000) {
			tWidth=1000;
			document.getElementById('topPart').style.width="1000px";
			document.getElementById('centerPart').style.width="1000px";
		} else {
			document.getElementById('topPart').style.width="100%";
		 	document.getElementById('centerPart').style.width="100%";
		}
		if (tWidth==1000) {
			fMargin=80;
			addOn=330;
			if (isMSIE) {
				fMargin=30;
				addOn=360;
			}			
		} else {
			fMargin=(tWidth*100)/1000;
			fMargin=Math.round(fMargin);
			addOn=330;
			if (isMSIE) {
				fMargin=fMargin-75;
				addOn=400;
			}
		}
		//alert(tWidth);
		document.getElementById('tFlash').style.marginRight=fMargin+"px";
		document.getElementById('rBlock').style.marginRight=fMargin+"px";
		document.getElementById('lBlock').style.marginRight=fMargin+addOn+"px";
}	
function ie_must_dieIns() {
		tWidth=document.getElementById('merka').clientWidth;
		if (tWidth < 1000) {
			tWidth=1000;
			document.getElementById('topPartIns').style.width="1000px";
			document.getElementById('centerPartIns').style.width="1000px";
		} else {
			document.getElementById('topPartIns').style.width="100%";
		 	document.getElementById('centerPartIns').style.width="100%";
		}
}

function navig_d (par,type,nIdDiv,source) {
var lay=document.getElementById(par);

if (type==0) {
	if (source) {
		//over(source,nIdDiv);
	}
MenuSH[par]=1;
MenuOn=1;
clearTimeout(TimeId);
lay.style.display="block";
lay.style.visibility="visible";
} //end if type=0

//for current
if (nIdDiv) {
	lay_main=document.getElementById(nIdDiv);
	lay_main.className = source;
}
//end for current


if (type==1) {
MenuSH[par]=0;
if (source=="div") {
	MenuOn=0;
	clearTimeout(TimeId);
	TimeId=setTimeout('HideAllDivs()',0);
} else {
	if (MenuOn) {
		//clearTimeout(TimeId);
		TimeId=setTimeout('MenuOff("'+par+'","'+nIdDiv+'","'+source+'")',0);
	}
}
}//end if type==1

}
function hideChild(arr,current) {
		for (i=0; i < arr.length; i++) {	
			if (arr[i]!=current) {
				document.getElementById(arr[i]).style.display="none";
				document.getElementById(arr[i]).style.visibility="hidden";
			}
			if (document.getElementById(arr[i]).style.visibility=="visible") {
				//over(MainImgs[i],'imgs/greypoint.gif');
			}
		}
}

function hideCurrent(item,item2,style) {
	document.getElementById(item).style.display="none";
	document.getElementById(item).style.visibility="hidden";
	if (item2) {
		lay_main=document.getElementById(item2);
		lay_main.className = style;
	}	
}

function showCurrent(item,item2,style) {
	document.getElementById(item).style.display="block";
	document.getElementById(item).style.visibility="visible";
	if (item2) {
		lay_main=document.getElementById(item2);
		lay_main.className = style;
	}	
}

function HideAllDivs () {
	if (!MenuOn) {
		for (i=0; i < MainDivs.length; i++) {
			document.getElementById(MainDivs[i]).style.display="none";
			document.getElementById(MainDivs[i]).style.visibility="hidden";
		}
	}
}

function MenuOff (lid,img,source) {
	if ( (!MenuSH[lid]) ) {	
		document.getElementById(lid).style.display="none";
		document.getElementById(lid).style.visibility="hidden";
		if (source) {
			//over(source,img);
		}
		//for current
		if (img) {
			lay_main=document.getElementById(img);
			lay_main.className = source;
		}		
		//end for current
	}
}

function HideShow (par,t) {
var lay=document.getElementById(par);
if (t==0) { 
	lay.style.display="block";
	lay.style.visibility="visible"; 
	}
if (t==1) {
	lay.style.display="none"; 
	lay.style.visibility="hidden";
	}
}

function menu(id,bg,colorf)
{
	document.getElementById(id).style.background=bg; 
	document.getElementById(id).style.color=colorf;
}

