<!--
/*
function countartikel (param) {
	if (document.getElementById ("countartikel")) {
		var countartikel = document.getElementById ("countartikel");
		countartikel.innerHTML = Math.abs (countartikel.innerHTML) + param;
	}
}
*/

function new_win (doc, left, top) {
	var breite = 400;
	var hoehe = 300;
	if (left == null) {
		left = (screen.availWidth - breite) / 2;
	}
	if (top == null) {
		top = (screen.availHeight - hoehe) / 2;
	}
	win = window.open (doc, "_blank", "height=" + hoehe + ",width=" + breite + ",status=no,toolbar=no,menubar=no,location=no,resizable=yes,titlebar=no,scrollbars=yes,fullscreen=no,top=" + top + ",left=" + left);
	win.focus ();
}

function utf8_encode (rohtext) {
	// dient der Normalisierung des Zeilenumbruchs
	rohtext = rohtext.replace(/\r\n/g,"\n");
	var utftext = "";
	for (var n=0; n<rohtext.length; n++) {
		// ermitteln des Unicodes des  aktuellen Zeichens
		var c = rohtext.charCodeAt (n);

		if (c < 128) {
			// alle Zeichen von 0-127 => 1byte
			utftext += String.fromCharCode (c);
		} else if ((c > 127) && (c < 2048)) {
			// alle Zeichen von 127 bis 2047 => 2byte
			utftext += String.fromCharCode((c>>6)|192);
			utftext += String.fromCharCode((c&63)|128);
		} else {
			// alle Zeichen von 2048 bis 66536 => 3byte
			utftext += String.fromCharCode ((c >> 12) | 224);
			utftext += String.fromCharCode (((c >> 6) & 63) | 128);
			utftext += String.fromCharCode ((c & 63) | 128);
		}
	}
	return utftext;
}

function utf8_decode (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;
}
//-->