ie5=(document.getElementById&&document.all&&document.styleSheets)?1:0;
nn6=(document.getElementById&&!document.all)?1:0;

var PrivateStrWindowText = ""
var PrivateStrButtonOk = ""
var PrivateStrActionOk = ""
var PrivateStrButtonCancel = ""
var PrivateStrActionCancel = ""

var confirmTitle = "";
var confirmText="<p align='center'>&nbsp;</p>";

if(ie5||nn6) {

	if(ie5) cs=2,th=30;
	else cs=0,th=20;
	//wg. Layout

	document.write("<div style='position:absolute;top:210px;left:8px;z-index:100;visibility:hidden' id='confirm'>"+
		"<div id='ContentConfirmationBody'>" +
			"<table border='0' style='width:728px;height:100px' cellpadding='4' cellspacing='0'>" +
				"<tr><th colspan='2' style='text-align: center' id='ConfirmTitle'>" + confirmTitle + "</th></tr>" +
				"<tr><td style='vertical-align: middle;text-align:center;'><img src='pics/Sprechblase.gif'></td><td style='vertical-align: middle' height='95px' id='ConfirmText'>" + confirmText + "</td></tr>"+
				"<tr><td colspan='2' id='buttons' align='center'>&nbsp;</td></tr>" +
			"</table>" +
		"</div>" +
		"</div>"
	);
}

//Box verstecken
function unshowConfirm() {
	document.getElementById("confirm").style.visibility="hidden";
}

//Box anzeigen
function showConfirm(strWindowTitle, strWindowText, strButtonOk, strActionOk , strButtonCancel, strActionCancel) {
	PrivateStrWindowText = strWindowText;
	PrivateStrButtonOk = strButtonOk;
	PrivateStrActionOk = strActionOk;
	PrivateStrButtonCancel = strButtonCancel;
	PrivateStrActionCancel = strActionCancel;

	document.getElementById("ConfirmTitle").innerHTML= strWindowTitle;
	document.getElementById("ConfirmText").innerHTML= strWindowText;

	button =
	"<button style='width:50%' id='ConfirmOk' type='button' value='Ok' onClick='ButtonConfirmOk()'>" + strButtonOk + "</button>" +
	"<button style='width:50%' id='ConfirmCancel' type='button' value='Cancel' onClick='ButtonConfirmCancel()'>" + strButtonCancel + "</button>";
	buttonOld =
	"<a id='ConfirmOk' href='javascript:ButtonConfirmOk()'>" + strButtonOk + "</a>&nbsp;&nbsp;" +
	"<a id='ConfirmCancel' href='javascript:ButtonConfirmCancel()'>" + strButtonCancel + "</a>";

	document.getElementById("buttons").innerHTML=button;

	if (!strButtonOk) document.getElementById("ConfirmOk").style.display = "none";
	if (!strButtonCancel) document.getElementById("ConfirmCancel").style.display = "none";

	moveStatus=0;

	document.getElementById("confirm").style.visibility="visible";

	if(ie5) {
		document.getElementById("confirm").style.left=60 + document.body.scrollLeft;
		document.getElementById("confirm").style.top=200 + document.body.scrollTop;
	}
	else if(nn6) {
		document.getElementById("confirm").style.left=60 + window.pageXOffset;
		document.getElementById("confirm").style.top=200 + window.pageYOffset;
	}
	// Wenn Browser zu alt herkömliche Abfrage
	else {
		if (confirmBrowser()) {
					if (PrivateStrButtonOk!="" && PrivateStrActionOk!="") {document.location.href = PrivateStrActionOk;}
			} else {
					if (PrivateStrButtonCancel!="" && PrivateStrActionCancel!="") {document.location.href = PrivateStrActionCancel;}
			}
	}
}

function confirmBrowser() {
 	var chk = window.confirm(PrivateStrWindowText);
 	return(chk);
}

function ButtonConfirmOk() {
	document.getElementById("confirm").style.visibility="hidden";
	if (PrivateStrButtonOk!="" && PrivateStrActionOk!="") {document.location.href = PrivateStrActionOk ;}
}

function ButtonConfirmCancel() {
	document.getElementById("confirm").style.visibility="hidden";
	if (PrivateStrButtonCancel!="" && PrivateStrActionCancel!="") {document.location.href = PrivateStrActionCancel;}
}

//Relative Mausposition auf der Box ermitteln
function getxyRelativ() {
	moveStatus=1;
	if(ie5) {
		xRelativ=event.clientX-xConfirm;
		yRelativ=event.clientY-yConfirm;
	}
}