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

window.defaultStatus="E.ON IT Slovakia";

// window status function
/*function ws(txt) {
	window.status = txt;
	return true;
}*/
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");
		}
	}
}

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 );
}

var cWindow = null;
function showDetail(cType, anch, lng, hTop) {
	this.hCode = "";
	this.writeHCode = writeHCode;

	var strTop, srcMain, srcFooter, heightTop;

	if ( typeof(lng) == "undefined" ) lng = "cz";
	heightTop =  ( !hTop ) ? heightTop = 50 : hTop;
	
	srcTop = "/" + lng + "/contact/summary_" + cType + "_top.shtml";
	srcMain = "/cms/" + lng + "/contact/summary_" + cType + "_main.shtml#" + anch;
	srcFooter = "/" + lng + "/footer_close_print.shtml";
	
	this.hCode += '<!--#include virtual="/cms/inc/u/_doctype_frame.shtml"-->\n';
	this.hCode += '<head>\n';
	this.	hCode += '	<title>E.ON</title>\n';
	this.	hCode += '</head>\n';
	this.	hCode += '<frameset rows="' + heightTop + ',*,25" border="0" frameborder="0" framespacing="0">\n';
	this.	hCode += '<frame name="cont_top" src="' + srcTop + '" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" noresize>\n';
	this.	hCode += '<frame name="cont_main" src="' + srcMain + '" marginwidth="0" marginheight="0" scrolling="auto" frameborder="0" noresize>\n';
	this.	hCode += '<frame name="cont_footer" src="' + srcFooter + '" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" noresize>\n';
	this.	hCode += '<noframes>\n';
	this.	hCode += '	Váš prohlížeč nepodporuje rámce.\n';
	this.	hCode += '</noframes>\n';
	this.	hCode += '</frameset>\n';
	this.	hCode += '</html>\n';
	
	if ( xIE && cWindow ) cWindow.close();
	cWindow = openHardWin("_contact", "/u/blank.html", 460, 460 );

	this.writeHCode();
	return;
	
	function writeHCode() {
		if ( cWindow.loaded ) {
			cWindow.document.write(hCode);
			cWindow.focus();
		}
		else {
			window.setTimeout(this.writeHCode, 200);
			return;
		}
	}
}

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";
			}
		}
	}
}	
// funkce vypise button BACK v dane lang verzi
function btnBack (lang)	{
	var lng	= lang ? lang : 'cs';
	if (lng == 'cs')	document.write('<a href="javascript:history.back()" onMouseOver="return ws(\'zpět\')"><img src="/img/u/back.gif" width="10" height="19" alt="Zpět" border="0">Zpět</a>'); 
	else	document.write('<a href="javascript:history.back()" onMouseOver="return ws(\'Back\')"><img src="/img/u/back.gif" width="10" height="19" alt="Back" border="0">Back</a>'); 	
}

