

function reloadPageOnResize ( init ) {
	( init == true ) ? onresize = reloadPageOnResize : location.reload() ;
}

if ( (navigator.appName=="Netscape") && (parseInt(navigator.appVersion)==4) ) reloadPageOnResize ( true ) ;

	
// für Counter-Pixel
function replace(text,from,to)  // replace strings in strings
 {
    while (( ti=text.indexOf(from) ) >= 0)
    {
        text = text.substr(0,ti)+to+text.substr(ti+1);
    }    
    return text;
 } 

function x_escape(text)  // extended escape function
 {
    var x_chars = "*2A+2B-2D.2E/2F_5F";
    
    text = escape(text);
    for (ci=0; ci < x_chars.length; ci+=3)
    {
        text = replace(text,x_chars.substr(ci,1),"%"+x_chars.substr(ci+1,2));
    }
    return text;
 }   
 
function getCounterPixel (myurl, params) {
        var CGI="http://count.eon.com/cgi-bin/count/eon-polska/"+myurl;
        if ((params.substring(0,1) != "&") && (params != "")) params = "&" + params;
		
		if (myurl.indexOf('?') > -1) { 
			CGI += "&ref=";
		} else {
			CGI += "?ref=";
		}
			
		if (parent.location == document.referrer) {
            document.write("<IMG SRC=\""+CGI+x_escape(parent.document.referrer)+params+"\" WIDTH=\"1\" HEIGHT=\"1\">");
			
        } else {
            document.write("<IMG SRC=\""+CGI+x_escape(document.referrer)+params+"\" WIDTH=\"1\" HEIGHT=\"1\">");
			
        }
}

//Druckfunktion
function toPrint ( file, lang) {
	
	// Url decoden um doppeltes encoden zu vermeiden
	file = unescape( file);
	
	// zusätzliche Parameter definiert im Javascript-Block der auszudruckenden Seite
	// zur Übergabe an die Printversion	
	if ( typeof( params) != 'undefined') {
		pos = file.indexOf('?')
		if ( pos<0) {
			params = params.replace( /^&/, "?");
		}
		file = file + params;
	}
	
	// file ist als Paremeter zu encoden
	file = escape( file);
	
	if(lang == "en"){
		var url = "http://mmserver3/vip/produktion/EONKRAFTWERKE/WebSite/frameset_english/print_version.php?page=" + file;
	}else{
		var url = "http://mmserver3/vip/produktion/EONKRAFTWERKE/WebSite/frameset_german/print_version.php?page=" + file;
	}
	fenster = window.open( url, "printversion", "height=580,width=700,scrollbars=yes,toolbar=yes" ) ;
}

//Popup Funktionen
/*allgemein*/
function openNamedPopup(url,name,width,height) {
	namedWin = window.open(url,name,"width="+width+",height="+height+",resizable=no,status=no,toolbar=no,scrollbars=no,menubar=no,location=no");
	namedWin.focus();
}

/*zentriert*/
function openNamedCPopup(url,name,iPopupWidth,iPopupHeight) {
	var iScreenX;
	var iScreenY;
	var iPosX;
	var iPosY;
	
	if( !isNaN( iPopupWidth) && !isNaN( iPopupHeight)) {
		var iScreenX = (screen.width/2)-(iPopupWidth/2);
		var iScreenY = (screen.height/2)-(iPopupHeight/2);

		iPosX = Math.floor( iScreenX);
		iPosY = Math.floor( iScreenY);
	}

	if( !isNaN( iPosX) && !isNaN( iPosY)) {
		namedWin = window.open(url,name,"width="+iPopupWidth+",height="+iPopupHeight+",top="+iPosY+",left="+iPosX+",resizable=no,status=no,toolbar=no,scrollbars=no,menubar=no,location=no");
		namedWin.focus();
	}
	else {
		namedWin = window.open(url,name,"width="+iPopupWidth+",height="+iPopupHeight+",resizable=no,status=no,toolbar=no,scrollbars=no,menubar=no,location=no");
		namedWin.focus();
	}
}