function isIE()
{
	return document.all != undefined;
}


function popup(sURL, iWidth, iHeight)
{
    var iXPos = (screen.width - iWidth) / 2;
    var iYPos = (screen.height - iHeight) / 2;
	
	win = window.open(sURL, "", "scrollbars=yes,status=no,toolbar=yes,location=no,directories=no,menubar=no,width="+iWidth+",height="+iHeight+",screenX="+iXPos+",screenY="+iYPos+",top="+iYPos+",left="+iXPos);
}


function decode_utf8(utftext)
{
    var plaintext = ""; var i=0; var c=c1=c2=0;
    // while-Schleife, weil einige Zeichen uebersprungen werden
    while(i<utftext.length)
    {
		c = utftext.charCodeAt(i);
		if (c<128) {
        	plaintext += String.fromCharCode(c);
        	i++;}
        else if((c>191) && (c<224)) {
        	c2 = utftext.charCodeAt(i+1);
        	plaintext += String.fromCharCode(((c&31)<<6) | (c2&63));
        	i+=2;}
       	else {
        	c2 = utftext.charCodeAt(i+1); c3 = utftext.charCodeAt(i+2);
        	plaintext += String.fromCharCode(((c&15)<<12) | ((c2&63)<<6) | (c3&63));
        	i+=3;}
	}
	return plaintext;
}


function getDocHeight(doc)
{
	return Math.max
	(
		Math.max(doc.body.scrollHeight, doc.documentElement.scrollHeight),
		Math.max(doc.body.offsetHeight, doc.documentElement.offsetHeight),
		Math.max(doc.body.clientHeight, doc.documentElement.clientHeight)
	);
}


function getDocWidth(doc)
{
	return Math.max
	(
		Math.max(doc.body.scrollWidth, doc.documentElement.scrollWidth),
		Math.max(doc.body.offsetWidth, doc.documentElement.offsetWidth),
		Math.max(doc.body.clientWidth, doc.documentElement.clientWidth)
	);
}