// FG Forrest, a.s. (c) 1996-2003

window.defaultStatus="www.eon-is.cz";

function stripHTML(str) {
	return str.replace(/<[^>]*>/g," ");
}
function ws(txt) {
	txt = stripHTML(txt);
	window.status = txt;
	return true;
}

function getCenterW(width) {
	return parseInt( eval( (screen.width-parseInt(width))/2 ) );
}

function getCenterH(height) {
	return parseInt( eval( (screen.height-parseInt(height))/2 ) );
}


// open new win func
function openWin( path, width, height ) {
		var zcewin = window.open(path,'_eon','scrollbars=yes,resizable=yes,resize=no,width='+width+',height='+height+',screenX='+getCenterW(width)+',screenY='+getCenterH(height)+',top='+getCenterH(height)+',left='+getCenterW(width) );
		zcewin.focus();
}
function openHardWin( name, path, width, height, scroll ) {
		if (!scroll || scroll != 'yes') { scroll = 'no' };
		var eonwin = window.open(path,name,'scrollbars=' + scroll + ',resizable=no,resize=no,width='+width+',height='+height+',screenX='+getCenterW(width)+',screenY='+getCenterH(height)+',top='+getCenterH(height)+',left='+getCenterW(width)+',locationbar=no,directories=no,dependent=yes' );
		eonwin.focus();
		return eonwin;
}
function openSiteMap(path) {
	openHardWin('_sitemap',path,780,580);
}

function printFrame(id) {
	var oW = window.parent.top.frames[id].window;
	oW.focus();
	oW.print();
}

function wClose() {
	parent.window.close();
}

// rollover object
function rollOver ( path, name, first, last )	{
	// properties
	this.path = path;
	this.name = name;
	this.extension = "gif";
	this.first = first;
	this.last = last;
	this.active = first-1;
	// methods
	this.preloadImages = preloadImages;
	this.preload = preload;
	this.roll = roll;
	this.set = set;
	this.dis = dis;
}
// rollover public method
function preloadImages( ext ) {
	var nameOver = (null!=ext)?'_'+ext:'';
	for (num=this.first; num<=this.last; num++) {
		this.preload( this.name + '_' + num + nameOver );
	}
}

function preload(imgSrc) {
	if (document.images) {
		eval(imgSrc+' = new Image()');
		eval(imgSrc+'.src = "' +this.path + '/' + imgSrc + '.' + this.extension + '"');
	}
}
// rollover public method - set active item
function set(num,over,pic) {
	this.prev = this.active;
	this.active = num+1;
	this.roll(num,over,pic);
	this.active = num;
	if (this.prev != 0) 
		this.roll(this.prev);
}
// rollover public method - disable item
function dis(num,over,pic) {
	this.active = num;
}
// rollover public method - roll item
function roll(num,over,pic) {
	pic = (null != pic)?pic:num;
	over = (null != over)?over:'';
	if (num == this.active)	{
		return false;
	}
	
	if (document.images) {
		var imgObj;
		if (over != '') {
			imgObj = this.name + '_' + num + '_' + over;
		}
		else {
			imgObj = this.name + '_' + num;
		}
		var imgName = this.name + '_' + pic;
		if (document.images[imgName])	{
			document.images[imgName].src = eval(imgObj+".src");
		}
	}
//	alert (imgObj.src);
}

function hiLiteMenuItem(index, tryNo) {
	if ( typeof(tryNo) == "undefined" ) tryNo = 1; if ( tryNo > 100 ) return;
	if ( top.frames[0].mn.set ) { top.frames[0].mn.set(index,'ovr'); 	return; }
	else { window.setTimeout("hiLiteMenuItem(" + index + ", " + tryNo + 1 + ")", 1000); return; }
}

function showSiteMap()
{
	openHardWin( "eonsitemap", "/cz/sitemap/sitemap.shtml", 780, 460 );
}

function SwitchMenu(obj) {
	var mi;
	if ( document.getElementById ) {
	var el = document.getElementById(obj);
	var ar;
	for ( mi=0;mi<3;mi++ ) {
		ar = document.getElementById("masterdiv" + mi).getElementsByTagName("span"); 
			if(el.style.display != "block"){ 
				for (var i=0; i<ar.length; i++){
					if (ar[i].className=="subm") 
					ar[i].style.display = "none";
				}
				el.style.display = "block";
			}else{
				el.style.display = "none";
			}
		}
	}
}	
