var ie4 = document.all && navigator.userAgent.indexOf("Opera")==-1;
var ns6 = document.getElementById && !document.all;
var ns4 = document.layers;


//if (document.cookie) alert(document.cookie);
//alert(window.history.length);


//Thomas R. begin
function resetFocus(e) {
	if(lastwin){
		if(!lastwin.closed) {
			lastwin.focus();
		}
	}
	return false;
}

var timevar;
function resetFocus2(e) {
	if(e.which != 1) {
		clearTimeout(timevar);
		timevar = setTimeout("resetFocusNow()",1);
	}
}

var modal_alert_msg;
function resetFocusNow(){
	clearTimeout(timevar);
	alert(modal_alert_msg);
	return false;
}

var divHide = null;
function openDiv() {
	divHide = document.createElement("div");
	divHide.style.position = "absolute";
	divHide.style.top = "0px";
	divHide.style.left = "0px";
	divHide.style.zIndex = "1000";
	divHide.style.width = screen.width;
	if (window.innerHeight && window.scrollMaxY) {
		divHide.style.height=window.innerHeight + window.scrollMaxY;
	}
	else if (document.body.scrollHeight > document.body.offsetHeight) {
		divHide.style.height=document.body.scrollHeight;
	}
	else {
		divHide.style.height=document.body.offsetHeight;
	}
	divHide.style.display = "block";
	divHide.onclick = resetFocus;
	divHide.onmouseup = resetFocus2; //Zur Sicherheit
	document.body.appendChild(divHide);
}

function closeDiv() {
	if(divHide) {
		divHide.style.display = "none";
		document.body.removeChild(divHide);
		divHide = null;
	}
}

function clwname() {
	return (String)(top.window.name) + '$$';
}

function set_clwname_main() {
	var ctitle = top.window.name;
	var mtch = ctitle.match(/^kkCMS_(.*)_.*$/);
	if (mtch) {
		top.window.name = 'kkCMS_'+RegExp.$1;
	}
}

function openMultiup(targ, targ2, targ3, width, height, modal_alert_msg2) {
	modal_alert_msg = modal_alert_msg2;
	var args = null;
	if (screen.width<width) wx = screen.width; else wx = width;
	if (screen.height<height) wy = screen.height; else wy = height;
	px = (screen.width - wx)/2;
	py = (screen.height - wy)/2;
	if (ie4) {
	  wx = wx + 30;
	  arr = showModalDialog('request.php?' + clwname() + targ, args,"font-family:Verdana; font-size:12;  dialogWidth:"+wx+"px; dialogHeight:"+wy+"px");
	  arr2 = showModalDialog('request.php?' + clwname() + '!!' + targ2,args,"font-family:Verdana; font-size:12; scroll:no; dialogWidth:"+200+"px; dialogHeight:"+60+"px; center:yes; help:no; status:no;");
	  window.location.reload();
  } else {
	openDiv();
	wx2 = 200;
	wy2 = 100;
	px2 = (screen.width - wx2)/2;
	py2 = (screen.height - wy2)/2;
	subwnd2 = window.open('request.php?' + clwname() + '!!' + targ3, "Aktion", "dependent=yes,hotkeys=no,fullscreen=yes");
	if (subwnd2 != null) {
		subwnd2.resizeTo(wx2, wy2);
		subwnd2.moveTo(px2, py2);
		subwnd2.blur();
	}
	subwnd = window.open('request.php?' + clwname() + targ, "Auswahl", "dependent=yes,hotkeys=no,fullscreen=yes");
	if (subwnd != null) {
		subwnd.resizeTo(wx, wy);
		subwnd.moveTo(px, py);
		subwnd.focus();
	}
	lastwin = subwnd;
	lastwin2 = subwnd2;
  }
}

//Thomas R. end


var lastwin=null, lastwin2=null, lastcaller=null, lastcaller2=null, lastcombotype=null;

function checkBrowser(fvar,wvar) {
	var AgntUsr=navigator.userAgent.toLowerCase();
	var DomYes=document.getElementById?1:0;
	var NavYes=AgntUsr.indexOf('mozilla')!=-1&&AgntUsr.indexOf('compatible')==-1?1:0;
	var ExpYes=AgntUsr.indexOf('msie')!=-1?1:0;
	var Opr=AgntUsr.indexOf('opera')!=-1?1:0;
	var Opr6orless=window.opera && navigator.userAgent.search(/opera.[1-6]/i)!=-1 //DynamicDrive.com added code
	var DomNav=DomYes&&NavYes?1:0;
 	var DomExp=DomYes&&ExpYes?1:0;
	var Nav4=NavYes&&!DomYes&&document.layers?1:0;
	var Exp4=ExpYes&&!DomYes&&document.all?1:0;
	var IE9 = (navigator.userAgent.indexOf("Trident/5")>-1)?1:0;
	var ChromeYes=(AgntUsr.indexOf('chrome')>-1)?1:0;
	var PosStrt=(NavYes||ExpYes)&&!Opr6orless?1:0;
	if (wvar!=null)
		wvar.value = top.window.name;
	if (fvar==null)
		return DomYes+"|"+NavYes+"|"+ExpYes+"|"+Opr+"|"+Opr6orless+"|"+DomNav+"|"+DomExp+"|"+Nav4+"|"+Exp4+"|"+PosStrt+"|"+IE9+"|"+ChromeYes+"|"+AgntUsr;
	fvar.value = DomYes+"|"+NavYes+"|"+ExpYes+"|"+Opr+"|"+Opr6orless+"|"+DomNav+"|"+DomExp+"|"+Nav4+"|"+Exp4+"|"+PosStrt+"|"+IE9+"|"+ChromeYes+"|"+AgntUsr;
	return true;
}

	function preloadImages(dir) {
	 	var a = new Array();
	 	a[0] = new Image(); a[0].src = dir+"files/file_add.gif";
		a[1] = new Image(); a[1].src = dir+"files/file_clear.gif";
		a[2] = new Image(); a[2].src = dir+"files/file_del.gif";
		a[3] = new Image(); a[3].src = dir+"files/file_edit.gif";
		a[4] = new Image(); a[4].src = dir+"files/file_new.gif";
		a[5] = new Image(); a[5].src = dir+"files/file_del2.gif";
		a[6] = new Image(); a[6].src = dir+"files/file_ren.gif";
	 	var b = new Array();
	 	b[0] = new Image(); b[0].src = dir+"files/sitem/doc.gif";
		b[1] = new Image(); b[1].src = dir+"files/sitem/kreuzung.gif";
		b[2] = new Image(); b[2].src = dir+"files/sitem/leer.gif";
		b[3] = new Image(); b[3].src = dir+"files/sitem/letzter.gif";
		b[4] = new Image(); b[4].src = dir+"files/sitem/linie.gif";
		b[5] = new Image(); b[5].src = dir+"files/sitem/lminus.gif";
		b[6] = new Image(); b[6].src = dir+"files/sitem/lplus.gif";
		b[7] = new Image(); b[7].src = dir+"files/sitem/minus.gif";
		b[8] = new Image(); b[8].src = dir+"files/sitem/oo.gif";
		b[9] = new Image(); b[9].src = dir+"files/sitem/ordner_auf.gif";
		b[10] = new Image(); b[10].src = dir+"files/sitem/ordner_auf_v.gif";
		b[11] = new Image(); b[11].src = dir+"files/sitem/ordner_zu.gif";
		b[12] = new Image(); b[12].src = dir+"files/sitem/ordner_zu_v.gif";
		b[13] = new Image(); b[13].src = dir+"files/sitem/plus.gif";
		b[14] = new Image(); b[14].src = dir+"files/sitem/root.gif";
		b[15] = new Image(); b[15].src = dir+"files/sitem/lkreuzungl.gif";
		b[16] = new Image(); b[16].src = dir+"files/sitem/liste.gif";
		b[17] = new Image(); b[17].src = dir+"files/sitem/kreuzungl.gif";
	 	var c = new Array();
	 	c[0] = new Image(); c[0].src = dir+"files/rec_all.gif";
		c[1] = new Image(); c[1].src = dir+"files/rec_book1.gif";
		c[2] = new Image(); c[2].src = dir+"files/rec_book2.gif";
		c[3] = new Image(); c[3].src = dir+"files/rec_clone.gif";
		c[4] = new Image(); c[4].src = dir+"files/rec_compare.gif";
		c[5] = new Image(); c[5].src = dir+"files/rec_csv.gif";
		c[6] = new Image(); c[6].src = dir+"files/rec_custom.gif";
		c[7] = new Image(); c[7].src = dir+"files/rec_del.gif";
		c[8] = new Image(); c[8].src = dir+"files/rec_edit.gif";
		c[9] = new Image(); c[9].src = dir+"files/rec_list.gif";
	 	c[10] = new Image(); c[10].src = dir+"files/rec_new.gif";
		c[11] = new Image(); c[11].src = dir+"files/rec_none.gif";
		c[12] = new Image(); c[12].src = dir+"files/rec_print.gif";
		c[13] = new Image(); c[13].src = dir+"files/rec_restore.gif";
		c[14] = new Image(); c[14].src = dir+"files/rec_restore_new.gif";
		c[15] = new Image(); c[15].src = dir+"files/rec_select.gif";
		c[16] = new Image(); c[16].src = dir+"files/rec_show.gif";
		c[17] = new Image(); c[17].src = dir+"files/tip1.gif";
		c[18] = new Image(); c[18].src = dir+"files/tip2.gif";
		c[19] = new Image(); c[19].src = dir+"files/lock1.gif";
		c[20] = new Image(); c[20].src = dir+"files/lock2.gif";
		c[21] = new Image(); c[21].src = dir+"files/calendar.gif";
		c[22] = new Image(); c[22].src = dir+"files/exit1.gif";
		c[23] = new Image(); c[23].src = dir+"files/exit2.gif";
		c[24] = new Image(); c[24].src = dir+"files/menu_plus.gif";
	}

function ignoreevents(e) {
	return false;
}

function modalhandle() {
	var foc = false;
	if (lastwin) {
		if (!lastwin.closed) {
			lastwin.focus();
			foc = true;
		}
	}
	if ((!foc) && (lastwin2)) {
		if (!lastwin2.closed) {
			lastwin2.focus();
			foc = true;
		}
	}
	if (!foc) {
		window.top.releaseEvents(Event.CLICK|Event.FOCUS);
		window.top.onclick = "";
	}
	return false;
}

	function hexencode(s) {
		var v = "";
		var o=0, n=0, m=0, oolen=0;
		var slen = s.length;
		for (n=0;n<slen;n++) {
			o = s.charCodeAt(n);
			oo = s.charAt(n);
			if (o>255) oo = "&#" + o + ";";
			oolen = oo.length;
			for (m=0;m<oolen;m++) {
				switch (oo.charCodeAt(m)) {
					case 0: v += '00'; break;
					case 1: v += '01'; break;
					case 2: v += '02'; break;
					case 3: v += '03'; break;
					case 4: v += '04'; break;
					case 5: v += '05'; break;
					case 6: v += '06'; break;
					case 7: v += '07'; break;
					case 8: v += '08'; break;
					case 9: v += '09'; break;
					case 10: v += '0a'; break;
					case 11: v += '0b'; break;
					case 12: v += '0c'; break;
					case 13: v += '0d'; break;
					case 14: v += '0e'; break;
					case 15: v += '0f'; break;
					case 16: v += '10'; break;
					case 17: v += '11'; break;
					case 18: v += '12'; break;
					case 19: v += '13'; break;
					case 20: v += '14'; break;
					case 21: v += '15'; break;
					case 22: v += '16'; break;
					case 23: v += '17'; break;
					case 24: v += '18'; break;
					case 25: v += '19'; break;
					case 26: v += '1a'; break;
					case 27: v += '1b'; break;
					case 28: v += '1c'; break;
					case 29: v += '1d'; break;
					case 30: v += '1e'; break;
					case 31: v += '1f'; break;
					case 32: v += '20'; break;
					case 33: v += '21'; break;
					case 34: v += '22'; break;
					case 35: v += '23'; break;
					case 36: v += '24'; break;
					case 37: v += '25'; break;
					case 38: v += '26'; break;
					case 39: v += '27'; break;
					case 40: v += '28'; break;
					case 41: v += '29'; break;
					case 42: v += '2a'; break;
					case 43: v += '2b'; break;
					case 44: v += '2c'; break;
					case 45: v += '2d'; break;
					case 46: v += '2e'; break;
					case 47: v += '2f'; break;
					case 48: v += '30'; break;
					case 49: v += '31'; break;
					case 50: v += '32'; break;
					case 51: v += '33'; break;
					case 52: v += '34'; break;
					case 53: v += '35'; break;
					case 54: v += '36'; break;
					case 55: v += '37'; break;
					case 56: v += '38'; break;
					case 57: v += '39'; break;
					case 58: v += '3a'; break;
					case 59: v += '3b'; break;
					case 60: v += '3c'; break;
					case 61: v += '3d'; break;
					case 62: v += '3e'; break;
					case 63: v += '3f'; break;
					case 64: v += '40'; break;
					case 65: v += '41'; break;
					case 66: v += '42'; break;
					case 67: v += '43'; break;
					case 68: v += '44'; break;
					case 69: v += '45'; break;
					case 70: v += '46'; break;
					case 71: v += '47'; break;
					case 72: v += '48'; break;
					case 73: v += '49'; break;
					case 74: v += '4a'; break;
					case 75: v += '4b'; break;
					case 76: v += '4c'; break;
					case 77: v += '4d'; break;
					case 78: v += '4e'; break;
					case 79: v += '4f'; break;
					case 80: v += '50'; break;
					case 81: v += '51'; break;
					case 82: v += '52'; break;
					case 83: v += '53'; break;
					case 84: v += '54'; break;
					case 85: v += '55'; break;
					case 86: v += '56'; break;
					case 87: v += '57'; break;
					case 88: v += '58'; break;
					case 89: v += '59'; break;
					case 90: v += '5a'; break;
					case 91: v += '5b'; break;
					case 92: v += '5c'; break;
					case 93: v += '5d'; break;
					case 94: v += '5e'; break;
					case 95: v += '5f'; break;
					case 96: v += '60'; break;
					case 97: v += '61'; break;
					case 98: v += '62'; break;
					case 99: v += '63'; break;
					case 100: v += '64'; break;
					case 101: v += '65'; break;
					case 102: v += '66'; break;
					case 103: v += '67'; break;
					case 104: v += '68'; break;
					case 105: v += '69'; break;
					case 106: v += '6a'; break;
					case 107: v += '6b'; break;
					case 108: v += '6c'; break;
					case 109: v += '6d'; break;
					case 110: v += '6e'; break;
					case 111: v += '6f'; break;
					case 112: v += '70'; break;
					case 113: v += '71'; break;
					case 114: v += '72'; break;
					case 115: v += '73'; break;
					case 116: v += '74'; break;
					case 117: v += '75'; break;
					case 118: v += '76'; break;
					case 119: v += '77'; break;
					case 120: v += '78'; break;
					case 121: v += '79'; break;
					case 122: v += '7a'; break;
					case 123: v += '7b'; break;
					case 124: v += '7c'; break;
					case 125: v += '7d'; break;
					case 126: v += '7e'; break;
					case 127: v += '7f'; break;
					case 128: v += '80'; break;
					case 129: v += '81'; break;
					case 130: v += '82'; break;
					case 131: v += '83'; break;
					case 132: v += '84'; break;
					case 133: v += '85'; break;
					case 134: v += '86'; break;
					case 135: v += '87'; break;
					case 136: v += '88'; break;
					case 137: v += '89'; break;
					case 138: v += '8a'; break;
					case 139: v += '8b'; break;
					case 140: v += '8c'; break;
					case 141: v += '8d'; break;
					case 142: v += '8e'; break;
					case 143: v += '8f'; break;
					case 144: v += '90'; break;
					case 145: v += '91'; break;
					case 146: v += '92'; break;
					case 147: v += '93'; break;
					case 148: v += '94'; break;
					case 149: v += '95'; break;
					case 150: v += '96'; break;
					case 151: v += '97'; break;
					case 152: v += '98'; break;
					case 153: v += '99'; break;
					case 154: v += '9a'; break;
					case 155: v += '9b'; break;
					case 156: v += '9c'; break;
					case 157: v += '9d'; break;
					case 158: v += '9e'; break;
					case 159: v += '9f'; break;
					case 160: v += 'a0'; break;
					case 161: v += 'a1'; break;
					case 162: v += 'a2'; break;
					case 163: v += 'a3'; break;
					case 164: v += 'a4'; break;
					case 165: v += 'a5'; break;
					case 166: v += 'a6'; break;
					case 167: v += 'a7'; break;
					case 168: v += 'a8'; break;
					case 169: v += 'a9'; break;
					case 170: v += 'aa'; break;
					case 171: v += 'ab'; break;
					case 172: v += 'ac'; break;
					case 173: v += 'ad'; break;
					case 174: v += 'ae'; break;
					case 175: v += 'af'; break;
					case 176: v += 'b0'; break;
					case 177: v += 'b1'; break;
					case 178: v += 'b2'; break;
					case 179: v += 'b3'; break;
					case 180: v += 'b4'; break;
					case 181: v += 'b5'; break;
					case 182: v += 'b6'; break;
					case 183: v += 'b7'; break;
					case 184: v += 'b8'; break;
					case 185: v += 'b9'; break;
					case 186: v += 'ba'; break;
					case 187: v += 'bb'; break;
					case 188: v += 'bc'; break;
					case 189: v += 'bd'; break;
					case 190: v += 'be'; break;
					case 191: v += 'bf'; break;
					case 192: v += 'c0'; break;
					case 193: v += 'c1'; break;
					case 194: v += 'c2'; break;
					case 195: v += 'c3'; break;
					case 196: v += 'c4'; break;
					case 197: v += 'c5'; break;
					case 198: v += 'c6'; break;
					case 199: v += 'c7'; break;
					case 200: v += 'c8'; break;
					case 201: v += 'c9'; break;
					case 202: v += 'ca'; break;
					case 203: v += 'cb'; break;
					case 204: v += 'cc'; break;
					case 205: v += 'cd'; break;
					case 206: v += 'ce'; break;
					case 207: v += 'cf'; break;
					case 208: v += 'd0'; break;
					case 209: v += 'd1'; break;
					case 210: v += 'd2'; break;
					case 211: v += 'd3'; break;
					case 212: v += 'd4'; break;
					case 213: v += 'd5'; break;
					case 214: v += 'd6'; break;
					case 215: v += 'd7'; break;
					case 216: v += 'd8'; break;
					case 217: v += 'd9'; break;
					case 218: v += 'da'; break;
					case 219: v += 'db'; break;
					case 220: v += 'dc'; break;
					case 221: v += 'dd'; break;
					case 222: v += 'de'; break;
					case 223: v += 'df'; break;
					case 224: v += 'e0'; break;
					case 225: v += 'e1'; break;
					case 226: v += 'e2'; break;
					case 227: v += 'e3'; break;
					case 228: v += 'e4'; break;
					case 229: v += 'e5'; break;
					case 230: v += 'e6'; break;
					case 231: v += 'e7'; break;
					case 232: v += 'e8'; break;
					case 233: v += 'e9'; break;
					case 234: v += 'ea'; break;
					case 235: v += 'eb'; break;
					case 236: v += 'ec'; break;
					case 237: v += 'ed'; break;
					case 238: v += 'ee'; break;
					case 239: v += 'ef'; break;
					case 240: v += 'f0'; break;
					case 241: v += 'f1'; break;
					case 242: v += 'f2'; break;
					case 243: v += 'f3'; break;
					case 244: v += 'f4'; break;
					case 245: v += 'f5'; break;
					case 246: v += 'f6'; break;
					case 247: v += 'f7'; break;
					case 248: v += 'f8'; break;
					case 249: v += 'f9'; break;
					case 250: v += 'fa'; break;
					case 251: v += 'fb'; break;
					case 252: v += 'fc'; break;
					case 253: v += 'fd'; break;
					case 254: v += 'fe'; break;
					case 255: v += 'ff'; break;
					default: break;
				}
			}
		}
		return v;
	}
	function hexdecode(s) {
		var ss = "";
		var md = 0;
		var cc = 0;
		var x = '';
		s = s.toUpperCase();
		for (n=0;n<s.length;n++) {
			x = s.charAt(n);
			if (md == 0) {
				switch (x) {
					case '0': cc = 0; break;
					case '1': cc = 1; break;
					case '2': cc = 2; break;
					case '3': cc = 3; break;
					case '4': cc = 4; break;
					case '5': cc = 5; break;
					case '6': cc = 6; break;
					case '7': cc = 7; break;
					case '8': cc = 8; break;
					case '9': cc = 9; break;
					case 'A': cc = 10; break;
					case 'B': cc = 11; break;
					case 'C': cc = 12; break;
					case 'D': cc = 13; break;
					case 'E': cc = 14; break;
					case 'F': cc = 15; break;
				}
			} else {
				switch (x) {
					case '0': cc = cc*16 + 0; break;
					case '1': cc = cc*16 + 1; break;
					case '2': cc = cc*16 + 2; break;
					case '3': cc = cc*16 + 3; break;
					case '4': cc = cc*16 + 4; break;
					case '5': cc = cc*16 + 5; break;
					case '6': cc = cc*16 + 6; break;
					case '7': cc = cc*16 + 7; break;
					case '8': cc = cc*16 + 8; break;
					case '9': cc = cc*16 + 9; break;
					case 'A': cc = cc*16 + 10; break;
					case 'B': cc = cc*16 + 11; break;
					case 'C': cc = cc*16 + 12; break;
					case 'D': cc = cc*16 + 13; break;
					case 'E': cc = cc*16 + 14; break;
					case 'F': cc = cc*16 + 15; break;
				}
				ss += String.fromCharCode(cc);
			}
			md = 1 - md;
		}
		return ss;
	}

function rebuild_unicode(str) {
	return str.replace(/&#([0-9]+);/gm,function(s, x) { return String.fromCharCode(x); });
}

function bin2hex(s) {
	return hexencode(s);
}

function check(val, obj) {
	for (var i=0; i<obj.length; i++) {
		if (obj[i].value==val) obj[i].checked = "true";
	}
}

function getCheckVal(obj) {
	var ret;
	if (!obj.length) {
		if (obj.checked) ret = obj.value;
	} else {
		for (var i=0; i<obj.length; i++) {
			if (obj[i].checked) ret = obj[i].value;
		}
	}
	return ret;
}

function getBits(targ, caller, val, width, height) {
	var args = new Array();
	var arr = null;
	args["bits"] = val;
	if (screen.width<width) wx = screen.width; else wx = width;
	if (screen.height<height) wy = screen.height; else wy = height;
	px = (screen.width - wx)/2;
	py = (screen.height - wy)/2;
	if (ie4) {
	  arr = showModalDialog(targ,args,"font-family:Verdana; font-size:12;  dialogWidth:"+wx+"px; dialogHeight:"+wy+"px");
	  if (arr != null) {
    	for ( elem in arr ) {
	      if ("bits" == elem && arr["bits"] != null) {
    	    val = arr["bits"];
	      }
    	}
		caller.value = val;
	  }
  } else {
  	window.top.captureEvents(Event.CLICK|Event.FOCUS);
	window.top.onclick = ignoreevents;
	window.top.onfocus = modalhandle;
	subwnd = window.open(targ+"+NS4", "Auswahl", "dependent=yes,hotkeys=no,fullscreen=yes");
	if (subwnd != null) {
		subwnd.resizeTo(wx, wy);
		subwnd.moveTo(px, py);
		subwnd.focus();
	}
	lastwin = subwnd;
  }
}

function getColor(caller,butt,val,pref,rootpath) {
	var width=480, height=520;
	if (!ie4) height+=60;
	if (screen.width<width) wx = screen.width; else wx = width;
	if (screen.height<height) wy = screen.height; else wy = height;
	px = (screen.width - wx)/2;
	py = (screen.height - wy)/2;
  if (ie4) {
	  var arr = showModalDialog( rootpath+"files/toolbars/selcolor2.htm",
                             "",
                             "font-family:Verdana; font-size:12; dialogWidth:"+wx+"px; dialogHeight:"+wy+"px" );

	  if (arr != null) {
	  	if (arr.substring(0,1)=="#") arr = arr.substr(1,arr.length-1);
		eval(caller).value = pref+arr;
		eval(butt).style.background = "#"+arr;
	  }
  } else {
  	window.top.captureEvents(Event.CLICK|Event.FOCUS);
	window.top.onclick = ignoreevents;
	window.top.onfocus = modalhandle;
	subwnd = window.open("selcolor.php?"+caller+"+"+butt+"+"+pref, "Auswahl", "dependent=yes,hotkeys=no,fullscreen=yes");
	if (subwnd != null) {
		subwnd.resizeTo(wx, wy);
		subwnd.moveTo(px, py);
		subwnd.focus();
	}
	lastwin = subwnd;
  }
}

function editHTML(caller, param) {
	var args = new Array();
	var arr = null;
	// Sonderbehandlung für Gleichheitszeichen
	//args["htmltext"] = eval(caller).value.replace(/=/g,"&#0061;");
	args["htmltext"] = eval(caller).value;
	var width = 800;
	var height = 600;
	if (screen.width<width) wx = screen.width; else wx = width;
	if (screen.height<height) wy = screen.height; else wy = height;
	px = (screen.width - wx)/2;
	py = (screen.height - wy)/2;
	if (ie4) {
    arr = showModalDialog('request.php?' + clwname() + param,args,"font-family:Verdana; font-size:12;  dialogWidth:"+wx+"px; dialogHeight:"+wy+"px");
	if (arr != null) {
	    for ( elem in arr ) {
	      if ("htmltext" == elem && arr["htmltext"] != null) {
	        eval(caller).value = arr["htmltext"];
	      }
	    }
	}
	} else {
	  	window.top.captureEvents(Event.CLICK|Event.FOCUS);
		window.top.onclick = ignoreevents;
		window.top.onfocus = modalhandle;
		subwnd = window.open('request.php?' + clwname() + caller + '!!' + param, "Auswahl", "dependent=yes,hotkeys=no,fullscreen=yes");
		if (subwnd != null) {
			subwnd.resizeTo(wx, wy);
			subwnd.moveTo(px, py);
			subwnd.focus();
		}
		lastwin = subwnd;
	}
}

function newFile(caller, param) {
	var args = new Array();
	var arr = null;
	var nffile="", nfsfile="";
	args["field"] = param;
	args["filename"] = "";
	var width = 570;
	var height = 150;
	if (!ie4) height+=60;
	if (screen.width<width) wx = screen.width; else wx = width;
	if (screen.height<height) wy = screen.height; else wy = height;
	px = (screen.width - wx)/2;
	py = (screen.height - wy)/2;
	if (ie4) {
  arr = showModalDialog('dbv_newfile.php?'+param+"+"+caller,args,"font-family:Verdana; font-size:12;  dialogWidth:"+wx+"px; dialogHeight:"+wy+"px");
  if (arr != null) {
    for ( elem in arr ) {
      if ("filename" == elem && arr["filename"] != null) {
        nffile = arr["filename"];
      }
      if ("sfilename" == elem && arr["sfilename"] != null) {
        nfsfile = arr["sfilename"];
      }
    }
	if ((nffile!="") && (nfsfile!="")) {
		eval(caller).options[eval(caller).length] = new Option(nfsfile, nffile);
		eval(caller).value = nffile;
	}
  }
  } else {
  	window.top.captureEvents(Event.CLICK|Event.FOCUS);
	window.top.onclick = ignoreevents;
	window.top.onfocus = modalhandle;
	subwnd = window.open('dbv_newfile.php?'+param+"+"+caller, "Auswahl", "dependent=yes,hotkeys=no,fullscreen=yes");
	if (subwnd != null) {
		subwnd.resizeTo(wx, wy);
		subwnd.moveTo(px, py);
		subwnd.focus();
	}
	lastwin = subwnd;
  }
}

function editFile(caller, param1, param2) {
	if (param2 != "") {
	var args = new Array();
	var arr = null;
	var width = 800;
	var height = 640;
	if (screen.width<width) wx = screen.width; else wx = width;
	if (screen.height<height) wy = screen.height; else wy = height;
	px = (screen.width - wx)/2;
	py = (screen.height - wy)/2;
	if (ie4) {
    arr = showModalDialog('request.php?' + clwname() + param2 + '!!' + param1,args,"font-family:Verdana; font-size:12;  dialogWidth:"+wx+"px; dialogHeight:"+wy+"px");
	} else {
  	window.top.captureEvents(Event.CLICK|Event.FOCUS);
	window.top.onclick = ignoreevents;
	window.top.onfocus = modalhandle;
	subwnd = window.open('request.php?' + clwname() + param2 + '!!' + param1, "Auswahl", "dependent=yes,hotkeys=no,fullscreen=yes");
	if (subwnd != null) {
		subwnd.resizeTo(wx, wy);
		subwnd.moveTo(px, py);
		subwnd.focus();
	}
	lastwin = subwnd;
	}
	}
}

function cfdel(text, link) {
	check = confirm(text);
	if (check) {
		window.location.href=link;
	}
}

function cfdelw(text, link) {
	check = confirm(text);
	if (check) {
		window.open(link);
	}
}

function cfcont(text, link1, link2) {
	check = confirm(text);
	if (check) window.location.href=link1;
	else window.location.href=link2;
}

function cfmarked(cform,txt,ukat,act) {
	var check = true;
	if (txt.length>0) check = confirm(txt);
	if (check) {
		cform.ukat.value = ukat;
		cform.action.value = act;
		cform.submit();
	} return false;
}

function selectmarked(cform,cfield,ukat) {
	vals = "";
	for (var n=0;n<cform.elements.length;n++) {
		if (cform.elements[n].name==cfield) {
			if (cform.elements[n].checked) vals += cform.elements[n].value + ";";
		}
	}
	if (vals.length>0) vals = vals.substring(0,vals.length-1);
	cform.ukat.value = ukat;
	cform.action.value = vals;
	cform.cmsclick.value = top.window.name;
	cform.submit();
}

function selectmarked_jquery(cform,cfield,ukat) {
	vals = "";
	for (var n=0;n<cform.elements.length;n++) {
		if (cform.elements[n].name==cfield) {
			if (cform.elements[n].checked) vals += cform.elements[n].value + ";";
		}
	}
	if (vals.length>0) vals = vals.substring(0,vals.length-1);
	cform.ukat.value = ukat;
	cform.action.value = vals;
	cform.cmsclick.value = top.window.name;
	cform.submit();
}

function cffiledel(caller, text, param1, param2) {
	if (param2 != "") {
	check = confirm(text);
	if (check) {
		var arr = null;
		var args = new Array();
		var width = 550;
		var height = 220;
		var val = "";
		if (screen.width<width) wx = screen.width; else wx = width;
		if (screen.height<height) wy = screen.height; else wy = height;
		px = (screen.width - wx)/2;
		py = (screen.height - wy)/2;
		if (ie4) {
		arr = showModalDialog('request.php?' + clwname() + param2 + '!!' + param1,args,"font-family:Verdana; font-size:12;  dialogWidth:"+wx+"px; dialogHeight:"+wy+"px");
  if (arr != null) {
    for ( elem in arr ) {
      if ("filename" == elem && arr["filename"] != null) {
        val = arr["filename"];
      }
    }
	if (val != "") {
		for (n=0; n<eval(caller).length; n++) {
			if (eval(caller).options[n].selected) eval(caller).options[n] = null;
		}
		eval(caller).value = "";
	}
  }
  } else {
  	window.top.captureEvents(Event.CLICK|Event.FOCUS);
	window.top.onclick = ignoreevents;
	window.top.onfocus = modalhandle;
	subwnd = window.open('request.php?' + clwname() + param2 + '!!' + param1, "Auswahl", "dependent=yes,hotkeys=no,fullscreen=yes");
	if (subwnd != null) {
		subwnd.resizeTo(wx, wy);
		subwnd.moveTo(px, py);
		subwnd.focus();
	}
	lastwin = subwnd;
  }
	}
	}
}

function openRequest(width, height, param1, param2, cparam) {
	if (param2 != "") {
	var args = new Array();
	var arr = null;
	if (screen.width<width) wx = screen.width; else wx = width;
	if (screen.height<height) wy = screen.height; else wy = height;
	px = (screen.width - wx)/2;
	py = (screen.height - wy)/2;
	if (ie4) {
    arr = showModalDialog('request.php?' + clwname() + param2 + '!!' + param1,args,"font-family:Verdana; font-size:12; scroll:no; dialogWidth:"+wx+"px; dialogHeight:"+wy+"px; center:yes; help:no; status:no;");
	window.location.href = cparam;
	} else {
  	window.top.captureEvents(Event.CLICK|Event.FOCUS);
	window.top.onclick = ignoreevents;
	window.top.onfocus = modalhandle;
	subwnd = window.open('request.php?' + clwname() + bin2hex(cparam) + '!' + param2 + '!!' + param1, "Auswahl", "dependent=yes,hotkeys=no,fullscreen=yes");
	if (subwnd != null) {
		subwnd.resizeTo(wx, wy);
		subwnd.moveTo(px, py);
		subwnd.focus();
	}
	lastwin = subwnd;
	lastwin2 = window;
	}
	}
}

function openSubform(caller, caller2, width, height, param1, param2, param3, param4, combotype) {
	if (param2 != "") {
	var args = new Array();
	var fvalue = "";
	var fdisplay = "";
	args["fvalue"] = "";
	args["fdisplay"] = "";
	var arr = null;
	if (screen.width<width) wx = screen.width; else wx = width;
	if (screen.height<height) wy = screen.height; else wy = height;
	px = (screen.width - wx)/2;
	py = (screen.height - wy)/2;
	if (ie4) {
    arr = showModalDialog('request.php?' + clwname() + param2 + '!!' + param1,args,"font-family:Verdana; font-size:12; scroll:no; dialogWidth:"+wx+"px; dialogHeight:"+wy+"px; center:yes; help:no; status:no;");
    if (arr != null) {
      for ( elem in arr ) {
        if ("fvalue" == elem && arr["fvalue"] != null) {
        	fvalue = arr["fvalue"];
        }
        if ("fdisplay" == elem && arr["fdisplay"] != null) {
        	fdisplay = arr["fdisplay"];
        }
      }
    }
	arr2 = showModalDialog('request.php?' + clwname() + '!!' + param3,args,"font-family:Verdana; font-size:12; scroll:no; dialogWidth:"+200+"px; dialogHeight:"+60+"px; center:yes; help:no; status:no;");
	} else {
	wx2 = 200;
	wy2 = 100;
	px2 = (screen.width - wx2)/2;
	py2 = (screen.height - wy2)/2;
  	window.top.captureEvents(Event.CLICK|Event.FOCUS);
	window.top.onclick = ignoreevents;
	window.top.onfocus = modalhandle;
	subwnd2 = window.open('request.php?' + clwname() + '!!' + param4, "Aktion", "dependent=yes,hotkeys=no,fullscreen=yes");
	if (subwnd2 != null) {
		subwnd2.resizeTo(wx2, wy2);
		subwnd2.moveTo(px2, py2);
		subwnd2.blur();
	}
	subwnd = window.open('request.php?' + clwname() + param3 + '!' + param2 + '!!' + param1, "Auswahl", "dependent=yes,hotkeys=no,fullscreen=yes");
	if (subwnd != null) {
		subwnd.resizeTo(wx, wy);
		subwnd.moveTo(px, py);
		subwnd.focus();
	}
	lastwin = subwnd;
	lastwin2 = subwnd2;
	}
	}
}

function openSubform2(caller, caller2, width, height, param1, param3, param4, combotype) {
	var args = new Array();
	var fvalue = "";
	var fdisplay = "";
	args["fvalue"] = "";
	args["fdisplay"] = "";
	var arr = null;
	if (screen.width<width) wx = screen.width; else wx = width;
	if (screen.height<height) wy = screen.height; else wy = height;
	px = (screen.width - wx)/2;
	py = (screen.height - wy)/2;
	if (ie4) {
    arr = showModalDialog('request.php?' + clwname() + '!!' + param1,args,"font-family:Verdana; font-size:12; scroll:no; dialogWidth:"+wx+"px; dialogHeight:"+wy+"px; center:yes; help:no; status:no;");
    if (arr != null) {
      for ( elem in arr ) {
        if ("fvalue" == elem && arr["fvalue"] != null) {
        	fvalue = arr["fvalue"];
        }
        if ("fdisplay" == elem && arr["fdisplay"] != null) {
        	fdisplay = arr["fdisplay"];
        }
      }
  	  if (fvalue != "") {
	  	switch (combotype) {
			case 1:
				caller.value = fvalue;
				caller2.value = fdisplay;
				break;
			case 2:
		   		caller.options[caller.length] = new Option(fdisplay, fvalue);
			    caller.value = fvalue;
				break;
		}
	  }
    }
	arr2 = showModalDialog('request.php?' + clwname() + '!!' + param3,args,"font-family:Verdana; font-size:12; scroll:no; dialogWidth:"+200+"px; dialogHeight:"+60+"px; center:yes; help:no; status:no;");
	} else {
	wx2 = 200;
	wy2 = 100;
	px2 = (screen.width - wx2)/2;
	py2 = (screen.height - wy2)/2;
  	window.top.captureEvents(Event.CLICK|Event.FOCUS);
	window.top.onclick = ignoreevents;
	window.top.onfocus = modalhandle;
	subwnd2 = window.open('request.php?' + clwname() + '!!' + param4, "Aktion", "dependent=yes,hotkeys=no,fullscreen=yes");
	if (subwnd2 != null) {
		subwnd2.resizeTo(wx2, wy2);
		subwnd2.moveTo(px2, py2);
		subwnd2.blur();
	}
	subwnd = window.open('request.php?' + clwname() + param3 + '!!' + param1, "Auswahl", "dependent=yes,hotkeys=no,fullscreen=yes");
	if (subwnd != null) {
		subwnd.resizeTo(wx, wy);
		subwnd.moveTo(px, py);
		subwnd.focus();
	}
	lastwin = subwnd;
	lastwin2 = subwnd2;
	lastcaller = caller;
	lastcaller2 = caller2;
	lastcombotype = combotype;
	}
}

function openSubform3(caller, caller2, width, height, param1, param3, param4, combotype) {
	var args = new Array();
	var fvalue = "";
	var fdisplay = "";
	args["fvalue"] = "";
	args["fdisplay"] = "";
	var arr = null;
	if (screen.width<width) wx = screen.width; else wx = width;
	if (screen.height<height) wy = screen.height; else wy = height;
	px = (screen.width - wx)/2;
	py = (screen.height - wy)/2;
	if (ie4) {
    arr = showModalDialog('request.php?' + clwname() + '!!' + param1,args,"font-family:Verdana; font-size:12; scroll:no; dialogWidth:"+wx+"px; dialogHeight:"+wy+"px; center:yes; help:no; status:no;");
    if (arr != null) {
      for ( elem in arr ) {
        if ("fvalue" == elem && arr["fvalue"] != null) {
        	fvalue = arr["fvalue"];
        }
        if ("fdisplay" == elem && arr["fdisplay"] != null) {
        	fdisplay = arr["fdisplay"];
        }
      }
  	  if (fvalue != "") {
	  	switch (combotype) {
			case 1:
				caller.value = fvalue;
				caller2.value = fdisplay;
				break;
			case 2:
				for (n=0; n<caller.length; n++) {
					if (caller.options[n].selected) caller.options[n].selected = false;
				}
				caller.value = fvalue;
				break;
		}
	  }
    }
	arr2 = showModalDialog('request.php?' + clwname() + '!!' + param3,args,"font-family:Verdana; font-size:12; scroll:no; dialogWidth:"+200+"px; dialogHeight:"+60+"px; center:yes; help:no; status:no;");
	} else {
	wx2 = 200;
	wy2 = 100;
	px2 = (screen.width - wx2)/2;
	py2 = (screen.height - wy2)/2;
  	window.top.captureEvents(Event.CLICK|Event.FOCUS);
	window.top.onclick = ignoreevents;
	window.top.onfocus = modalhandle;
	subwnd2 = window.open('request.php?' + clwname() + '!!' + param4, "Aktion", "dependent=yes,hotkeys=no,fullscreen=yes");
	if (subwnd2 != null) {
		subwnd2.resizeTo(wx2, wy2);
		subwnd2.moveTo(px2, py2);
		subwnd2.blur();
	}
	subwnd = window.open('request.php?' + clwname() + param3 + '!!' + param1, "Auswahl", "dependent=yes,hotkeys=no,fullscreen=yes");
	if (subwnd != null) {
		subwnd.resizeTo(wx, wy);
		subwnd.moveTo(px, py);
		subwnd.focus();
	}
	lastwin = subwnd;
	lastwin2 = subwnd2;
	lastcaller = caller;
	lastcaller2 = caller2;
	lastcombotype = combotype;
	}
}

function openSubform4(width, height, param1, param2, param3, param4) {
	if (param2 != "") {
	var args = new Array();
	var fvalue = "";
	var fdisplay = "";
	args["fvalue"] = "";
	args["fdisplay"] = "";
	var arr = null;
	if (screen.width<width) wx = screen.width; else wx = width;
	if (screen.height<height) wy = screen.height; else wy = height;
	px = (screen.width - wx)/2;
	py = (screen.height - wy)/2;
	if (ie4) {
    arr = showModalDialog('request.php?' + clwname() + param2 + '!!' + param1,args,"font-family:Verdana; font-size:12; scroll:no; dialogWidth:"+wx+"px; dialogHeight:"+wy+"px; center:yes; help:no; status:no;");
    if (arr != null) {
      for ( elem in arr ) {
        if ("fvalue" == elem && arr["fvalue"] != null) {
        	fvalue = arr["fvalue"];
        }
        if ("fdisplay" == elem && arr["fdisplay"] != null) {
        	fdisplay = arr["fdisplay"];
        }
      }
    }
	arr2 = showModalDialog('request.php?' + clwname() + '!!' + param3,args,"font-family:Verdana; font-size:12; scroll:no; dialogWidth:"+200+"px; dialogHeight:"+60+"px; center:yes; help:no; status:no;");
	} else {
	wx2 = 200;
	wy2 = 100;
	px2 = (screen.width - wx2)/2;
	py2 = (screen.height - wy2)/2;
  	window.top.captureEvents(Event.CLICK|Event.FOCUS);
	window.top.onclick = ignoreevents;
	window.top.onfocus = modalhandle;
	subwnd2 = window.open('request.php?' + clwname() + '!!' + param4, "Aktion", "dependent=yes,hotkeys=no,fullscreen=yes");
	if (subwnd2 != null) {
		subwnd2.resizeTo(wx2, wy2);
		subwnd2.moveTo(px2, py2);
		subwnd2.blur();
	}
	subwnd = window.open('request.php?' + clwname() + param3 + '!' + param2 + '!!' + param1, "Auswahl", "dependent=yes,hotkeys=no,fullscreen=yes");
	if (subwnd != null) {
		subwnd.resizeTo(wx, wy);
		subwnd.moveTo(px, py);
		subwnd.focus();
	}
	lastwin = subwnd;
	lastwin2 = subwnd2;
	}
	}
}

function cfcombodel(caller, caller2, text, param1, param2, param3, param4, combotype) {
	if (param2 != "") {
	check = confirm(text);
	if (check) {
		var arr = null;
		var args = new Array();
		var width = 400;
		var height = 200;
		var fvalue = "";
		if (screen.width<width) wx = screen.width; else wx = width;
		if (screen.height<height) wy = screen.height; else wy = height;
		px = (screen.width - wx)/2;
		py = (screen.height - wy)/2;
		if (ie4) {
		arr = showModalDialog('request.php?' + clwname() + param2 + '!!' + param1,args,"font-family:Verdana; font-size:12; scroll:no;  dialogWidth:"+wx+"px; dialogHeight:"+wy+"px; center:yes; help:no; status:no;");
		  if (arr != null) {
		    for ( elem in arr ) {
		      if ("fvalue" == elem && arr["fvalue"] != null) {
		        fvalue = arr["fvalue"];
		      }
		    }
			if (fvalue != "") {
			  	switch (combotype) {
					case 1:
						caller.value = "";
						caller2.value = "";
						break;
					case 2:
						for (n=0; n<caller.length; n++) {
							if (caller.options[n].selected) caller.options[n] = null;
						}
						caller.value = "";
						break;
				}
			}
		  }
		arr2 = showModalDialog('request.php?' + clwname() + '!!' + param3,args,"font-family:Verdana; font-size:12; scroll:no; dialogWidth:"+200+"px; dialogHeight:"+60+"px; center:yes; help:no; status:no;");
		} else {
		wx2 = 200;
		wy2 = 100;
		px2 = (screen.width - wx2)/2;
		py2 = (screen.height - wy2)/2;
	  	window.top.captureEvents(Event.CLICK|Event.FOCUS);
		window.top.onclick = ignoreevents;
		window.top.onfocus = modalhandle;
		subwnd2 = window.open('request.php?' + clwname() + '!!' + param4, "Aktion", "dependent=yes,hotkeys=no,fullscreen=yes");
		if (subwnd2 != null) {
			subwnd2.resizeTo(wx2, wy2);
			subwnd2.moveTo(px2, py2);
			subwnd2.blur();
		}
		subwnd = window.open('request.php?' + clwname() + param3 + '!' + param2 + '!!' + param1, "Auswahl", "dependent=yes,hotkeys=no,fullscreen=yes");
		if (subwnd != null) {
			subwnd.resizeTo(wx, wy);
			subwnd.moveTo(px, py);
			subwnd.focus();
		}
		lastwin = subwnd;
		lastwin2 = subwnd2;
		lastcaller = caller;
		lastcaller2 = caller2;
		lastcombotype = combotype;
		}
	}
  }
}

function cfcomboclear(caller, caller2, text, combotype) {
	check = confirm(text);
	if (check) {
	  	switch (combotype) {
			case 1:
				caller.value = "";
				caller2.value = "";
				break;
			case 2:
				for (n=0; n<caller.length; n++) {
					if (caller.options[n].selected) caller.options[n] = null;
				}
				caller.value = "";
				break;
		}
	}
}

function markCheckboxes(cform,cfield,mark) {
	for (var n=0;n<cform.elements.length;n++) {
		if (cform.elements[n].name==cfield) cform.elements[n].checked=mark;
	}
}

function updChkSel(cform,cfield,curval) {
	var noval=null, curfld=null;
	var sels = 0;
	for (var n=0;n<cform.elements.length;n++) {
		if (cform.elements[n].name==cfield) {
			if ((String)(cform.elements[n].value).length==0) noval = cform.elements[n];
			if (cform.elements[n].checked) sels++;
			if (cform.elements[n].value==curval) curfld = cform.elements[n];
		}
	}
	if (sels==0) {
		if (noval) noval.checked = true;
		else {
			if (curfld) curfld.checked = true;
		}
	}
	if ((sels>1) && (noval)) {
		if (noval.checked) {
			if (curfld==noval) {
				for (var n=0;n<cform.elements.length;n++) {
					if (cform.elements[n].name==cfield) {
						if (cform.elements[n]!=noval) cform.elements[n].checked = false;
					}
				}
			} else {
				noval.checked = false;
			}
		}
	}
}

function markRow(rref,act,colnorm,colhigh)
{
    var tds = null;
    if ((colhigh == '') || typeof(rref.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        tds = rref.getElementsByTagName('td');
    }
    else if (typeof(rref.cells) != 'undefined') {
        tds = rref.cells;
    }
    else {
        return false;
    }
    var numtd = tds.length;
    var isdom = null;
    var ccol = null;
    var ncol = null;
    if (typeof(window.opera) == 'undefined' && typeof(tds[0].getAttribute) != 'undefined') {
        ccol = tds[0].getAttribute('bgcolor');
        isdom = true;
    }
    else {
        ccol = tds[0].style.backgroundColor;
        isdom = false;
    }
    if (ccol.indexOf("rgb") >= 0)
    {
        var rgbStr = ccol.slice(ccol.indexOf('(') + 1, ccol.indexOf(')'));
        var rgbValues = rgbStr.split(",");
        ccol = "#";
        var hexChars = "0123456789ABCDEF";
        for (var i = 0; i < 3; i++)
        {
            var v = rgbValues[i].valueOf();
            ccol += hexChars.charAt(v/16) + hexChars.charAt(v%16);
        }
    }
    if (ccol == '' || ccol.toLowerCase() == colnorm.toLowerCase()) {
        if (act == 'over' && colhigh != '') {
            ncol = colhigh;
        }
    }
    else if (ccol.toLowerCase() == colhigh.toLowerCase()) {
        if (act == 'out') {
            ncol = colnorm;
        }
    }
    if (ncol) {
        var c = null;
        if (isdom) {
            for (c = 0; c < numtd; c++) {
                tds[c].setAttribute('bgcolor', ncol, 0);
            }
        }
        else {
            for (c = 0; c < numtd; c++) {
                tds[c].style.backgroundColor = ncol;
            }
        }
    }
    return true;
}

function markRowClass(rref,act,colnorm,colhigh)
{

  if(act == 'over'){
    rref.className=colhigh; 
  }
  
   if(act == 'out'){
    rref.className=colnorm; 
  }
    return true;
}

var TTDiv = null;
var TTmmact = null;
var TTExpYes=ie4;
var TTwidth, TTcolor;
function ShowTT(msg,width,color) {
	var padding = 5;
	if (TTDiv != null) HideTT();
	if ((width) && (width>50)) TTwidth = width;
	else TTwidth = 200;
	if (color) TTcolor = color;
	else TTcolor = "#FFFFFF";
	TTmmact = document.onmousemove;
	document.onmousemove = TTCursor;
	TTDiv = document.createElement("div");
	TTDiv.id = "ttdiv";
	TTDiv.className = "dbvtooltip";
	TTDiv.innerHTML = msg;
	TTDiv.style.position = "absolute";
	TTDiv.style.width = TTwidth + 'px';
	TTDiv.style.background = TTcolor;
	TTDiv.style.padding = padding + 'px';
	TTDiv.style.border = "1px solid #000000";
	TTDiv.style.visibility = "visible";
	document.body.appendChild(TTDiv);
}

function TTCursor(e) {
	var x, y, rw, rh, px, py;
	var margin = 10;
	var rheight = 50;
	if (TTDiv != null) {
		if (TTExpYes) {
			x = event.x + document.body.scrollLeft;
			y = event.y + document.body.scrollTop;
			rw = document.body.clientWidth + document.body.scrollLeft;
			rh = document.body.clientHeight + document.body.scrollTop;
		} else {
			x = e.pageX;
			y = e.pageY;
			rw = window.innerWidth + window.pageXOffset;
			rh = window.innerHeight + window.pageYOffset;
		}
		if (rw < x + TTwidth + margin) px = x - TTwidth - margin;
		else px = x + margin;
		if (rh < y + rheight + margin) py = y - rheight - margin;
		else py = y + margin;
		if (TTExpYes) {
			TTDiv.style.pixelLeft = px;
			TTDiv.style.pixelTop = py;
		} else {
			TTDiv.style.left = px + 'px';
			TTDiv.style.top = py + 'px';
		}
	}
}

function HideTT() {
	document.onmousemove = TTmmact;
	if (TTDiv != null) {
		TTDiv.style.visibility = "hidden";
		document.body.removeChild(TTDiv);
		TTDiv = null;
	}
}

function AsyncHttpReq(url,func,param) {
	var req = null;
	try {
	    req = new XMLHttpRequest();
	} catch(e) {
	    try {
	        // IE6+
	        req  = new ActiveXObject("Microsoft.XMLHTTP");
	    } catch(e) {
	        try {
	            // IE5
	            req  = new ActiveXObject("Msxml2.XMLHTTP");
	        } catch(e) {
	            req  = null;
	        }
	    }
	}
	if (req) {
	    req.open('POST', url, true);
	    req.onreadystatechange = function() {
			if (req.readyState == 4) {
				if (req.status == 200) {
					func(param,req.responseText);
				}
			}
		};
	    req.send(null);
	}
}

function ComboReload(f,s) {
	var oldval = f.value;
	var omatch = /<option value=\"(.*)\">(.*)<\/option>/;
	var n;
	for (n=f.length-1;n>=0;n--) {
		f.options[n] = null;
	}
	var opts = s.match(/<option value=\"(.*)\">(.*)<\/option>/g)
	if (opts) {
		for (n=0;n<opts.length;n++) {
			omatch.exec(opts[n]);
			f.options[f.length] = new Option(RegExp.$2, RegExp.$1);
			if (RegExp.$1==oldval) f.options[f.length-1].selected = true;
		}
	}
	/* Update jQuery/chosen */
	if (f.className!="dbvcombobox") {
	    var updFld = '$("#'+f.id.toString()+'").trigger("liszt:updated");';
		eval(updFld);
	}
}

/* Sylvia Moschner Menu-Funktionen Begin */
	function init_menu(dir){
		var tables = new Array;
		var pruefer = -1;
		var submenus = new Array;
		var submenu_entry = "";
		var text = "";
		var zaehler = 1;
		var alltables = document.getElementsByTagName('table');
		for (var i = 0; i < alltables.length; i++) {
			var onetable = alltables[i];
			if (onetable.className && onetable.className == 'menu1_table_ext') {
				onetable.id = "menu_table_" + zaehler;
				var menu_td = onetable.getElementsByTagName('td');
				if(menu_td.length>1){//mache nur was wenn Submenu da
					hauptmenu = menu_td[0];
					submenu = menu_td[1];
					var submenu_td = submenu.getElementsByTagName('td');
					//alert(submenu_td.length);
					if(submenu_td.length>0){//sind auch Menuepunkte im Submenu
						//symbol in hauptmenu setzen
						text = '<div id="menu_table_div_' + zaehler + '" style="float:right; width:12px; margin:2px 0px 0px 5px; cursor:pointer;" onclick="switch_menu(' + zaehler + ',true)"><img src="' + dir + 'files/menu_plus.gif" alt="" class="menu_plus"></div>';
						hauptmenu.getElementsByTagName('div')[0].innerHTML = text + '<a href="#" onclick= "switch_menu(' + zaehler + ',false)">' + hauptmenu.getElementsByTagName('div')[0].innerHTML + '</a>';	
						//submenu schliessen, wenn aktuelles wieder oeffnen
						submenu.style.display = "none";
						submenus = submenu.getElementsByTagName('td');
						for (var j = 0; j < submenus.length; j++) {
							submenu_entry = submenus[j];
							if (submenu_entry.className && submenu_entry.className == 'menu2_ext_high') {
								switch_menu(zaehler,false);

								pruefer = zaehler;
							}
						}
					}else{
						//Submenue loeschen, damit es huebsch ausschaut
						submenu.parentNode.removeChild(submenu);
					}
				}
				zaehler += 1;
			}
		}
		/*
		//Verwendung evtl. spaeter geplant
		//wenn kein aktiver Punkt folgendes Menu 
		if(pruefer<0){
			switch_menu(default_open,false);
		}*/
	}
	
	function switch_menu(menu_id, allow_close){
		menutable = document.getElementById("menu_table_" + menu_id);
		var display = "table-cell";
		if(navigator.userAgent.indexOf("MSIE 7")<0 && navigator.userAgent.indexOf("MSIE 6")<0 && navigator.userAgent.indexOf("MSIE 5")<0 || navigator.userAgent.indexOf("MSIE 4")<0){
			display = "block";
		}
		var menu_td = menutable.getElementsByTagName('td');
		if(menu_td.length>1){//mache nur was wenn Submenu da
			hauptmenu = menu_td[0];
			submenu = menu_td[1];
			if(submenu.style.display=="none"){
				submenu.style.display = display;
				submenu.style.paddingTop = "0px";
				if(single_active==true){
					var alltables = document.getElementsByTagName('table');
					for (var i = 0; i < alltables.length; i++) {
						var onetable = alltables[i];
						if (onetable.className && onetable.className == 'menu1_table_ext' && onetable.id!= "menu_table_" + menu_id) {
							var menu_td = onetable.getElementsByTagName('td');
							if(menu_td.length>1){
								onetable.getElementsByTagName('td')[1].style.display ="none";
							}
						}
					}
				}
			}else{
				if(allow_close==true){
					submenu.style.display = "none";
				}
			}
		}
	}
	
	function btn_change(mode, button_group){
		if (mode==1) {
			document.getElementById(button_group + "_1").className = "btn_left_mo";
			if (document.getElementById(button_group + "_2").className == "btn_center") {
				document.getElementById(button_group + "_2").className = "btn_center_mo";
			} else {
				document.getElementById(button_group + "_2").className = "btn_center2_mo";
			}
			document.getElementById(button_group + "_3").className = "btn_right_mo";
		} else {
			document.getElementById(button_group + "_1").className = "btn_left";
			if (document.getElementById(button_group + "_2").className == "btn_center_mo") {
				document.getElementById(button_group + "_2").className = "btn_center";
			} else {
				document.getElementById(button_group + "_2").className = "btn_center2";
			}
			document.getElementById(button_group + "_3").className = "btn_right";
		}
	}
	
/* Sylvia Moschner Menu-Funktionen End */
