var sada = new Object();

function bestaetigen(arg0, arg1){
	d = confirm('Datensatz #'+ arg0 +'\n\nAusgewählten Datensatz endgültig löschen?\n');
	if(d==true)document.location.href = arg1;
}

i = 6;

function goback(arg0){
	document.write('Bitte warten, die Einstellungen werden gespeichert. (<span id="timer">' +i+ '</span>)');
	goback_sub(arg0);
}

function goback_sub(arg0){
	i--;
	timer1 = window.setTimeout('goback_sub('+arg0+')', 1000);
	document.getElementById('timer').innerHTML = i;
	if (i <= 0){
		history.go(arg0);
		clearTimeout(timer1);
	}
}

function bild(id){
	textelement = document.getElementById(id);
	var start = textelement.selectionStart;
	var end = textelement.selectionEnd;
	var theSelection = textelement.value.substring(start, end);

	textelement.value = textelement.value.substr(0, start) + '[bild]' + theSelection + '[/bild]' + textelement.value.substr(end);
}

function spalten(id){
	textelement = document.getElementById(id);
	var start = textelement.selectionStart;
	var end = textelement.selectionEnd;
	var theSelection = textelement.value.substring(start, end);

	textelement.value = textelement.value.substr(0, start) + '[linke_spalte]\n' + theSelection + '\n[/linke_spalte]\n[rechte_spalte]\n\n[/rechte_spalte]\n' + textelement.value.substr(end);
}

function url(id){
	textelement = document.getElementById(id);
	var start = textelement.selectionStart;
	var end = textelement.selectionEnd;
	var theSelection = textelement.value.substring(start, end);

	textelement.value = textelement.value.substr(0, start) + '[url]' + theSelection + '[/url][linkText][/linkText]' + textelement.value.substr(end);
}
function initImagebox(){
	var objBody = document.getElementsByTagName("body").item(0);
	var objImagebox = document.createElement("img");
	objImagebox.setAttribute('id','imagebox');
	objImagebox.onclick = function () {hideImagebox(); return false;}
	objBody.insertBefore(objImagebox, objBody.firstChild);
}

function showImagebox(arg0){
	objImage = new Image();
	objImage.src = arg0.src;

	objImagebox = document.getElementById('imagebox');
	objImagebox.src = objImage.src;

	var arrayPageSize = new Array(document.documentElement.clientWidth, document.documentElement.clientHeight);

	objImagebox.style.top = (((arrayPageSize[1] - objImage.height) / 2) + document.documentElement.scrollTop + 'px');
	objImagebox.style.left = (((arrayPageSize[0] - objImage.width) / 2)  + 'px');

	objImagebox.style.display = 'block';
}

function hideImagebox(){
	objImagebox = document.getElementById('imagebox');
	objImagebox.style.display = 'none';
}
function popup(arg0, arg1, arg2){ //url, width, height
	x = screen.availWidth/2 - arg1/2;
	y = screen.availHeight/2 - arg2/2;
	var popWindow = window.open(arg0, "Popup", "width=" +arg1+ ",height=" +arg2+ ",left=" +x+ ",top=" +y+ ",scrollbars=yes")
}
function Object() {
    this.var0;

	this.mask = function(arg0) {
        	var obj = document.getElementById(arg0);
		var obj3 = document.getElementById(arg0-1);
	        var obj2 = document.getElementById(this.var0);

	        if (typeof this.var0 != 'undefined' && obj != obj2) {
        	    obj2.style.display = 'none';
		    obj3.style.fontWeight = 'normal';
	            this.var0 = void 0;
        	}

	        this.var0 = arg0;

	        if (obj.style.display != 'none'){
       		 	obj.style.display = 'none';			
			obj3.style.fontWeight = 'normal';
		}else{
        		obj.style.display = '';
			obj3.style.fontWeight = 'bold';
		}
	}
}