
/*****************************************************
*/ function __P___Language() {}
/******************************************************/
 
lang = 'de';
lang_show_failed_keys = '';

if(typeof INT != 'object') INT = new Object();
/*INT['firstname'] = new Object();
INT['firstname']['de'] = 'Vorname';
INT['firstname']['en'] = 'First Name';*/

function $L(key) {
	
	this.lang = lang;
	this.def_lang = 'en';
	
	if(!INT[key]) {
		return key+lang_show_failed_keys;
	} else if(INT[key]) {
		if(INT[key][this.lang]) return INT[key][this.lang];
		else if(INT[key][this.def_lang]) return INT[key][this.def_lang];
		else return key+lang_show_failed_keys;
	} else return key+lang_show_failed_keys;
}


//---------------------------------------------------------------------------------------
//-- Menu Functions ---------------------------------------------------------------------
//---------------------------------------------------------------------------------------

function Interface () {
	
	this.window = false;
	this.title = '';
	
	this.init = function() {
		//Ext.ux.Lightbox.register('a.obj-imgs', true);
	}
	
	this.quicksearch = function(event) {
		if(event.keyCode != 13) return;
		this.do_search();
	}
	
	this.do_search = function() {
		document.location.href = '/suche/'+this.quicksearchEL.value;
	}
	
	this.donotinterruptsubmits = function() {
		this.coverbackground('visible',0.8);
		// get sid
		PA = new ProgressAnimation();
		PA.viewProgress(this.cover,false,'Bild wird geladen',false,0.5);
	}
	

	//---------------------------------------------------------------------------------------
	this.adjustSize = function(r) {
		sizeUnit = "%";
		defaultSize = 100;
		maxSize = 160;
		minSize = 98;	
	}


	//---------------------------------------------------------------------------------------
	this.setFooter = function() {
		
		// wie kann ich das anders machen?
		// ohne javascript, wird man den footer nicht sehen, keine gute sache
		// damit kommt man nicht zum impressum
		if(!document.getElementById('footer')) return;
		ft = document.getElementById('footer');
		if(!document.getElementById('innerWrapper')) {
			ft.style.visibility = 'visible';
			return;
		}
		
		/*op = 1;
		ft.style.opacity = op; // set opacity for effect : filter:alpha(opacity=50); -moz-opacity:0.5; opacity:0.5; 
		ft.style.filter = "alpha(opacity:"+Math.round(op*100)+")";
		return;
		*/
		
		if(!PAGEdom) return;
		nt = document.getElementById('content'); // contains left subnav and navboxes
		var nt_dp = PAGEdom.toDocumentPosition(nt); // get document position of navteaserarea
		//DebugDump(nt_dp,'nt_dp.y '+nt_dp.y);
		//DebugDump(scrollTop,'scrollTop '+scrollTop);
		var wHeight = PAGEdom.getWindowHeight();
		var pHeight = document.body.offsetHeight; // Safari needs body.offsetHeight //PAGEdom.getPageHeight();
		//DebugDump(pHeight,'pHeight '+pHeight);
		//DebugDump(wHeight,'wHeight '+wHeight);
		if(pHeight
		&& wHeight
		&& pHeight<wHeight) {
			nt.style.height = (wHeight-ft.offsetHeight-nt_dp.y-1)+'px'; // window.height - footer - navteaser position
			this.contentHeight = (wHeight-ft.offsetHeight-nt_dp.y-1);
		} else this.contentHeight = nt.offsetHeight;

		//ft.style.visibility = 'visible';
		op = 1;
		ft.style.opacity = op; // set opacity for effect : filter:alpha(opacity=50); -moz-opacity:0.5; opacity:0.5; 
		ft.style.filter = "alpha(opacity:"+Math.round(op*100)+")";
		//var pHeight = PAGEdom.getPageHeight();
		//DebugDump(pHeight,'pHeight '+pHeight);
		
		
	}

	//---------------------------------------------------------------------------------------
	this.loginOperation = function(operation) {
		//alert();
		document.forms['iflogin'].operation.value = operation;
		document.forms['iflogin'].onsubmit(); // workaround browser bugs.
		document.forms['iflogin'].submit();
	}

	//---------------------------------------------------------------------------------------
	this.logout = function() {
		document.forms['iflogin'].operation.value = '[logout]';
		document.forms['iflogin'].action = '/';
		document.forms['iflogin'].onsubmit(); // workaround browser bugs.
		document.forms['iflogin'].submit();
	}	
	
	//---------------------------------------------------------------------------------------
	this.toggleMode = function() {
		if(mode) mode_value = mode;
		else if (document.getElementById('list_rdbms')) mode_value = "admin";
		else mode_value = "browse";
		//mode_el = document.getElementById("mymode");
		switch (mode_value) {
			case"admin":
				document.getElementById("mymode").value = 'browse';
				//mode_value = document.getElementById("mymode").value;
				break;
			case"browse":
				document.getElementById("mymode").value = 'admin';
				//mode_value = document.getElementById("mymode").value;
				break;			
		}
		//alert(document.getElementById("mymode").value);
		document.forms['iflogin'].submit();
	}
	
	//---------------------------------------------------------------------------------------

	this.linkExternalLinks = function() {
		if(is_phpos_environment) return;
		//return;
		 var links = document.getElementsByTagName('A');
		 for (var i=0; i<links.length; i++) { 
		  // var anchor = anchors[i]; 
		  var v = links[i].getAttribute("href");
		  var c = links[i].getAttribute("onclick");
		  
		   if (!c
		   && v
		   && v.indexOf('http') != -1) {
			 //DebugDump(c,'external link found');
			 //DebugDump(v,'external link found');
			 //this.addEvent(document,'click',function() {return false;}.bind(this));
			 links[i].setAttribute('target',"_blank");
			}
			
			 
		 } 

		/*links = document.getElementsByTagName('A');
		for(i=0;i<links.length;i++) {
			var atts = links[i].attributes;//getAttribute('href');
			DebugDump(atts,'external link found');
			for(p=0;p<atts.length;p++) {
				DebugDump(atts[p],''+p);
			}		
		}*/
	}

	this.jumpToExternalLink = function(myUrl,myName,hitId,hitName) {
	
		var jumpPage = "/link/external";
		var path = myUrl;
		jumpPage = jumpPage+"?path="+path;
		if ((hitName && hitName.length > 0) && (hitName && hitName.length >0)) jumpPage = jumpPage+"&object_id="+hitId+"&object_name="+hitName;
		mywin = window.open(jumpPage,myName);
		mywin.focus();
		
	}

	// browser
	//---------------------------------------------------------------------------------------
	this.browserSubmit = function(v,i,eidb) {
		//alert('huhu'); return;
		document.getElementById(i).value = v;
		document.forms['contentform'].onsubmit(); // workaround browser bugs.
		document.forms['contentform'].submit();
	}

	this.setDirPath = function(id,order_dir,eidb) {
		document.getElementById(eidb+'order').value = id;
		this.browserSubmit(order_dir,eidb+'order_dir');
	} 
		
	this.changeDirPath = function(id,order_dir,eidb) {
		img_path = '/images_admin/embedded_browser/';
		document.getElementById(eidb+'order').value = id;
		switch(order_dir) {
			case"desc":
				document.getElementById(id+'_order_dir_dot').src = img_path+"asc_blue_dot.gif";
				order_change = 'asc';
			break;
			case"asc":
				document.getElementById(id+'_order_dir_dot').src = img_path+"desc_blue_dot.gif";
				order_change = 'desc';
			break;	
		}	
		this.browserSubmit(order_change,eidb+'order_dir');
	} 
	
	// submit
	this.justSubmit = function(formname) {
		document.forms[formname].onsubmit(); // workaround browser bugs.
		document.forms[formname].submit();	
	}

	// submit
	this.setHiddenAndSubmit = function(hidden_value,hidden_id,formname) {
		document.getElementById(hidden_id).value = hidden_value;
		//alert(document.forms[formname]['triggers'].value)
		document.forms[formname].onsubmit(); // workaround browser bugs.
		document.forms[formname].submit();
	}

	//---------------------------------------------------------------------------------------
	//---------------------------------------------------------------------------------------
	
	
	this.magnifier_is_visible = false;
	this.magnify = function(m,e) {
		var mtop, st, ww;
		
		if(this.magnifier_is_visible == true) {
			//this.hideMagnifier(false);
			setTimeout(function(){ this.magnify(m); }.bind(this), 600);
			return;
		}
		
		
/*
.menuitemGNW {
	position: absolute;
	visibility: hidden;
}

.fllGN {
	background-image: url(/images_admin/icons/kr_hl.png);
	background-repeat: no-repeat;
	background-position: left top;
	width: 36px; 
	height:72px; 
	float:left;
}

.fllGNib {
	background-image: url(/images_admin/icons/kr_hr.png);
	background-repeat: no-repeat;
	background-position: right top;	
	height:72px; 
	width: 36px;
	float:left;
}

.fllGNCT {
	float:left;
	background-color: #000;
	margin: 1px 0 0 0;
	he

*/		
		st = PAGEdom.docScrollTop();
		mtop = (st+160)+'px';
		ww = PAGEdom.getWindowWidth();
		this.mag = document.createElement('div');
		this.mag.style.position = 'absolute';
		this.mag.style.zIndex = 10020;
		this.mag.style.left = 60+'px';
		this.mag.style.top = mtop;		
		this.mag.style.width = (ww-120)+'px';	
		this.mag.style.textAlign = 'center';
		//this.mag.style.height = '180px';
		this.mag.style.padding = '3px';
		this.mag.style.fontWeight = 'bold';
		//this.mag.style.fontSize = '400%';
		this.mag.style.fontSize = '60px';
		this.mag.style.lineHeight = '60px';
		this.mag.style.color = '#fff';
		//this.mag.style.border = '1px solid red';
		
		this.mag.innerHTML = m;
		document.getElementsByTagName('body')[0].appendChild(this.mag);
		
		this.mag_bg = document.createElement('div');
		this.mag_bg.style.position = 'absolute';
		this.mag_bg.style.zIndex = 10019;
		this.mag_bg.style.left = 60+'px';
		this.mag_bg.style.top = mtop;		
		this.mag_bg.style.width = (this.mag.offsetWidth)+'px';//(ww-60)+'px';
		this.mag_bg.style.height = this.mag.offsetHeight+'px';//'200px';
		
		op = 0.1;
		this.mag_bg.style.opacity = op; // set opacity for effect : filter:alpha(opacity=50); -moz-opacity:0.5; opacity:0.5; 
		this.mag_bg.style.filter = "alpha(opacity:"+Math.round(op*100)+")";
		
		
		rk = document.createElement('div');
		rk.className = 'fllGN';
		this.mag_bg.appendChild(rk);
		
		ct = document.createElement('div');
		ct.style.width = (this.mag.offsetWidth - 72)+'px';
		ct.className = 'fllGNCT';
		this.mag_bg.appendChild(ct);	
		
		lk = document.createElement('div');
		lk.className = 'fllGNib';
		this.mag_bg.appendChild(lk);		
		
		document.getElementsByTagName('body')[0].appendChild(this.mag_bg);
		if(typeof Effect == 'object') {
			new Effect.Opacity(this.mag_bg, {duration:0.3, from:0.1, to:0.7,afterFinish: function() {IF.magnifier_is_visible = true;}});
		} else if(typeof Ext == 'object') {
			var mag_bg = Ext.get(this.mag_bg);
			IF.magnifier_is_visible = true;
			mag_bg.fadeIn({
				endOpacity:.75, 
				duration:.5,
				easing:'easeOut',
				callback:function() {
					IF.magnifier_is_visible = true;
				}
			});
		} else {
			op = 0.7;
			this.mag_bg.style.opacity = op; // set opacity for effect : filter:alpha(opacity=50); -moz-opacity:0.5; opacity:0.5; 
			this.mag_bg.style.filter = "alpha(opacity:"+Math.round(op*100)+")";
			IF.magnifier_is_visible = true;
		}
		//new Effect.Appear(this.mag_bg,{duration:0.5});
		//new Effect.Appear(this.mag,{duration:0.5});
		//new Effect.SlideDown(menuitems[i],{duration:0.8});
		//new Effect.BlindDown(menuitems[i],{duration:0.8});
		//new Effect.Grow(menuitems[i],{duration:0.8});		

		//this.mag.style.backgroundColor = '#ffffff';
		this.addEvent(document,'mousedown',this.hideme = function(event) {this.hideMagnifier(event);}.bind(this));


		if (e && e.stopPropagation) {
			e.stopPropagation();
		} else if(e) {
			e.cancelBubble = true;
		} 
		
	}
	//---------------------------------------------------------------------------------------
	this.hideMagnifier = function(event) {
	
		var el;
		if(event) {
			el = this.gettarget(event);
			
			// If the active button was clicked on, exit.
			if (el == this.mag) return;
			if (el == this.mag_bg) return;
		
			// If the element is not part of a menu, reset and clear the active
			// button.
		}
		PAGEdom.removeNode(this.mag);
		mag_bg = this.mag_bg;
		if(typeof Effect == 'object') {
			new Effect.Opacity(this.mag_bg, {duration:0.3, from:0.7, to:0,afterFinish: this.sau_Effect_rmNode});
		} else if(typeof Ext == 'object') {
			var mag_bg = Ext.get(this.mag_bg);
			mag_bg.fadeOut({
				endOpacity: 0, 
				duration: .5,
				easing:'easeIn',
				remove:true,
				callback:function() {
					IF.magnifier_is_visible = false;
				}
			});
		} else {
			PAGEdom.removeNode(this.mag_bg);
			IF.magnifier_is_visible = false;
		}
		//new Effect.Puff(this.mag_bg, {duration:0.5,afterFinish: rmNode});
		//PAGEdom.removeNode(this.mag_bg);
	}	
	
	this.sau_Effect_rmNode = function(obj) {
		PAGEdom.removeNode(obj.element);
		IF.magnifier_is_visible = false;
	}
	
	//---------------------------------------------------------------------------------------
	this.coverbackground = function(vs,op) {
		
		if(!op) op = 0;
		
		if(!this.cover) {
			this.cover = document.createElement('div');
			this.cover.style.position = 'absolute';
			this.cover.style.zIndex = 5;
			this.cover.style.left = 0+'px';
			this.cover.style.top = 0+'px';
			this.cover.style.opacity = op; // set opacity for effect : filter:alpha(opacity=50); -moz-opacity:0.5; opacity:0.5; 
			this.cover.style.filter = "alpha(opacity:"+Math.round(op*100)+")";
			this.cover.style.backgroundColor = "#fff";
			document.getElementsByTagName('body')[0].appendChild(this.cover);
		}
		
		if(!vs) {
			this.cover.style.visibility = 'hidden';
		} else {
			ww = PAGEdom.getWindowWidth();
			wh = PAGEdom.getWindowHeight();
			st = PAGEdom.docScrollTop();
			bodyheight = st+wh;
			bodyheight = document.body.offsetHeight;
			this.cover.style.width = (ww-15)+'px';
			this.cover.style.height = ((bodyheight-15))+'px';
			this.cover.style.visibility =  'visible';			
		}
	}
	
	//---------------------------------------------------------------------------------------
	this.setField = function(sourcefield_id,targetfield_id,value,disable) {

		sourcefield = $(sourcefield_id);
		targetfield = $(targetfield_id);
		//DebugDump(sourcefield.value,'sourcefield.value');
		if(targetfield.value != value) {
			targetfield.value = value;
		}
	
	}
	//---------------------------------------------------------------------------------------
	this.printDonation = function(printform) {
		
		
		var firstformEL = false;
	//if (!def_printversion_available) return alert('Es ist keine Druckansicht f\u00FCr diese Seite verf\u00FCgbar...');
		var contentEL = document.getElementById('content');
		var contentforms = contentEL.getElementsByTagName('FORM');
		for (var i=0; i<contentforms.length; i++) { 
			if(contentforms[i]) { firstformEL = contentforms[i]; break; }
		}	
		
		if(firstformEL) {
			//var o_target = firstformEL.target;
			var o_action = firstformEL.action;
			//firstformEL.target = printform;
			firstformEL.action = printform;
		}
		this.printVersion();
		//window.print();
		if(firstformEL) {
			//firstformEL.target = o_target;
			firstformEL.action = o_action;	
		}
	}

	this.printVersion = function() {
		var firstformEL = false;
	//if (!def_printversion_available) return alert('Es ist keine Druckansicht f\u00FCr diese Seite verf\u00FCgbar...');
		var contentEL = document.getElementById('content');
		var contentforms = contentEL.getElementsByTagName('FORM');
		for (var i=0; i<contentforms.length; i++) { 
			if(contentforms[i]) { firstformEL = contentforms[i]; break; }
		}
		//firstformEL.submit();
		//alert(firstformEL.name);
		if(firstformEL) var Ppath = firstformEL.action;//parent.content.myPlainPagePath;
		else var Ppath = parent.content.myPlainPagePath;
		
		var Pname = "PrintVersion";
		var no_w = '/none';
		var no_w = checkUrl(no_w);
		var WHeight = GetWindowHeight()-100;
		mywin = window.open(no_w,Pname,"top=20,left=30,width=540,height="+WHeight+",scroll=yes,scrollbars=yes,titlebar=no,status=no,toolbar=no,location=no,directories=no,menubar=yes,resizable=yes");
		
		Ppath = Ppath+"?print=true";
		var Ppath = checkUrl(Ppath);		
		//spendenformulardrucken
		if(firstformEL) {
			
			var o_target = firstformEL.target;
			var o_action = firstformEL.action;
			//alert(o_target);
			firstformEL.target = Pname;
			firstformEL.action = Ppath;
			firstformEL.onsubmit(); // workaround browser bugs.
			firstformEL.submit();
			firstformEL.target = o_target;
			firstformEL.action = o_action;			
		} else {
			mywin.location.href =createUrl(Ppath);
		}
		
		
		
		/*if (document.forms[formname]) { // this part will be true from now on
			var createdTempHidden = false;
			if (document.createElement) {
				switch (SmartAgent){
					case "Netscape6":
					case "MSIE5.5":
					case "Opera5":
					case "Khtml":
						try {
							var tempFormObj;
							var tempHiddenObj;
							tempFormObj = parent.content.document.forms[0];
							var tempHidden = 	parent.content.document.createElement('input');
							tempHidden.setAttribute('type','hidden');
							tempHidden.setAttribute('name','print');
							tempHidden.setAttribute('value','true');
							tempHiddenObj = tempFormObj.appendChild(tempHidden);
							var createdTempHidden = true;
						} catch(e) {
							Ppath = Ppath+"?print=true";
						}
						break;
				case "Netscape4":
				case "MSIE5":
				default:
					var Ppath = Ppath+"?print=true";
					var Ppath = createUrl(Ppath);
					break;
				}
			} else {
				var Ppath = Ppath+"?print=true";
				var Ppath = createUrl(Ppath);
			}
			setActionAndSubmit(Pname,Ppath,'parent.content.document.forms[0]');
			if (createdTempHidden) tempFormObj.removeChild(tempHidden);
		} else {
			var Ppath = Ppath+"?print=true"; 
			mywin.location.href =createUrl(Ppath);
		}
		*/
		
		if(mywin) mywin.focus();
	}

	//---------------------------------------------------------------------------------------
	this.buildWindow = function() {
		
		// window
		//bodyroot = document.getElementsByTagName('form')[0];
		if(!document.getElementById('content')) return;
		bodyroot = document.getElementById('content');
		this.w_wrapper = document.createElement("div");	
		

		this.w_wrapper.id = 'window';
		this.w_wrapper.className = 'window';
		this.w_wrapper.style.position = 'absolute';
		//this.w_wrapper.style.display = 'none';
		this.w_wrapper.style.visibility = 'hidden';
		this.w_wrapper.width = 300;
		this.w_wrapper.height = 300;
		this.w_wrapper.style.width = this.w_wrapper.width+'px';
		this.w_wrapper.style.height = this.w_wrapper.height+'px';
		this.w_wrapper.style.overflow = 'auto';
		//this.w_wrapper.style.border = '1px solid black';
		//this.w_wrapper.style.backgroundColor = 'white';
		//this.w_wrapper.style.zIndex = 100000;
		WWidth = PAGEdom.getWindowWidth();
		WHeight = PAGEdom.getWindowHeight();
		dst = PAGEdom.docScrollTop();
		var topheight = (((WHeight+dst)/2)-(this.w_wrapper.height/2));
		if(topheight<133) topheight = 133;
		this.w_wrapper.style.top = topheight+'px';
		var leftwidth = ((WWidth/2)-(this.w_wrapper.width/2));
		if(leftwidth<250) leftwidth = 250;
		this.w_wrapper.style.left = leftwidth+'px';
		bodyroot.appendChild(this.w_wrapper);

		this.makeNewWndow();
				
	}
	
	this.makeNewWndow = function() {
		this.window = new ContentWindow(this.title,this.w_wrapper.id);
		this.window.client_area_id = 'windowclientarea';
		this.window.title_id = 'windowtitlearea';
		this.window.init(this.window);	
	}
	
	//---------------------------------------------------------------------------------------
	this.gettarget = function(event) {

		if(window
		&& (window.event)
		&& (window.event.srcElement)) {
			t = window.event.srcElement;
		} else {
			t = (event.target.tagName ? event.target : event.target.parentNode);
		}
		return t;
	}	
	

	//---------------------------------------------------------------------------------------
	this.addEvent = function(el,evname,func) {
	
		if (el.attachEvent) { // IE
			el.attachEvent("on" + evname, func);
		} else if (el.addEventListener) { // Gecko / W3C
			el.addEventListener(evname, func, true);
		} else {
			el["on" + evname] = func;
		}
	
	}
	
	//---------------------------------------------------------------------------------------
	this.removeEvent = function(el,evname,func) {
	
		if (el.detachEvent) { // IE
			el.detachEvent("on" + evname, func);
		} else if (el.removeEventListener) { // Gecko / W3C
			el.removeEventListener(evname, func, true);
		} else {
			el["on" + evname] = null;
		}
	
	}
}
IF = new Interface(); 
OnLoadFunctions[OnLoadFunctions.length] = "IF.init();";

var reg = 'phpos'; 
var is_phpos_environment = document.location.href.match(reg);
//OnLoadFunctions[OnLoadFunctions.length] = "DebugDump(found,'found');";
if(!is_phpos_environment) {
	browserSubmit = IF.browserSubmit;
	setDirPath = IF.setDirPath;
	changeDirPath = IF.changeDirPath;
}
//OnLoadFunctions[OnLoadFunctions.length] = "browserSubmit();";
//---------------------------------------------------------------------------------------
function checkSubmit() { // weiss nich, ob ich das brauche... ist der onsubmit gerade
	return true;
}

//---------------------------------------------------------------------------------------
function quicksearch(event) {
	if(event.keyCode != 13) return;
	INTERFACEdo_search();
}
//---------------------------------------------------------------------------------------
function INTERFACEdo_search() {

	setHidden('search','triggers');
	setActionAndSubmit('/suche','_self');
}




//---------------------------------------------------------------------------------------
//-- TinyMCE Settings -------------------------------------------------------------------
//---------------------------------------------------------------------------------------

IF.tinymceSettings = {
	theme : "advanced",
	height: "400", //config.height,
	plugins: "safari,pagebreak,style,advhr,advimage,advlink,emotions,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,noneditable,visualchars,nonbreaking",
	theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",
	theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,code",
	theme_advanced_buttons3 : "hr,removeformat,|,sub,sup,|,charmap,media,advhr,|,ltr,rtl,|,insertdate,inserttime,preview,|,forecolor",
	//theme_advanced_buttons4 : "styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking",
	
	//theme_advanced_buttons4 : "styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_statusbar_location : "bottom",
	theme_advanced_resizing : false,
	//extended_valid_elements : //"a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
	//theme_advanced_blockformats : "p,h1,h2,h3,h4,h5,h6,blockquote,div,address",
	
	
	/* linebreak tests, hier scheint etwas schlimmeres nicht zu stimmen...
	forced_root_block:false,
	remove_linebreaks:false,
	//force_p_newlines:false,
	//force_br_newlines:true,
	apply_source_formatting:true,
	entity_encoding:"",
	cleanup:false,
	cleanup_on_startup:true,
	//convert_newlines_to_brs:true,
	
	force_p_newlines:false,
	force_br_newlines:true,
	convert_newlines_to_brs:false,
	remove_linebreaks:true,					
	cleanup:false,
	
	*/
	cleanup_on_startup:false,
	//cleanup:false,
	verify_html:false,
	//template_external_list_url : "example_template_list.js"
	//file_browser_callback : "FileBrowser"
	file_browser_callback:"ezfilemanager",
	relative_urls:false,
	theme_advanced_enable:"styleselect",
	content_css: "/mcms/wolfundjaeger/_css/wysiwyg.css",
	body_id:'content',
	body_class:'p-normargin',	 
	language:"de"
	//onchange_callback:"myCustomOnChangeHandler"
	//add_form_submit_trigger:true
	//body_id:"content"
};


//---------------------------------------------------------------------------------------
//-- Size Functions -------------------------------------------------------------------
//---------------------------------------------------------------------------------------

function AdjustFontSize() {

	this.sizeUnit = "%";
	this.defaultSize = 100;
	this.maxSize = 125; // Windows 125! / Mac 145
	this.minSize = 90;

	this.init = function() {
		CFS = new CookieManager('fontSize');
		if ( !document.body || !document.getElementById ) return;
		var size = window.location.search? window.location.search.slice(1): CFS.getValue("fontSize");
		size = !isNaN( parseFloat(size) )? parseFloat(size): this.defaultSize;
		// in case default unit changed or size passed in url out of range
		if ( size > this.maxSize || size < this.minSize ) size = this.defaultSize;
		document.body.style.fontSize = size + this.sizeUnit;
	}
  
	this.adjust = function(inc) {
		var size = parseFloat( document.body.style.fontSize );
		/* !!!!! Änderung  Anfang !!!! */
		size = !isNaN( parseFloat(size) )? parseFloat(size): this.defaultSize;
		/* !!!!! Änderung Ende  !!!! */
		size += inc;
		// Test against max and min sizes 
		if (inc > 0) size = Math.min(size, this.maxSize);
		else size = Math.max(size, this.minSize);
		CFS.save( "fontSize", size, 180, "/" );
		document.body.style.fontSize = size + this.sizeUnit;
	}

	this.reset = function() {
		document.body.style.fontSize = this.defaultSize + this.sizeUnit;
		CFS.del("fontSize", "/");
	}
}


function Browser() {

  var ua, s, i;

  this.isIE    = false;  // Internet Explorer
  this.isOP    = false;  // Opera
  this.isNS    = false;  // Netscape
  this.version = null;

  ua = navigator.userAgent;

  s = "Opera";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isOP = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  // Treat any other "Gecko" browser as Netscape 6.1.

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }

  s = "MSIE";
  if ((i = ua.indexOf(s))) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }
}

var browser = new Browser();


//--------------------------------------------------------------------------------------- //
function KSPL () {
	
	this.init = function() {

	}
	
}

var FNK = new KSPL();

//--------------------------------------------------------------------------------------- //
if(typeof Ext == 'object') {
	Ext.BLANK_IMAGE_URL = '/images/spacer.gif';
	// application main entry point
	Ext.onReady(function() {
		//IF.setFooter();
		/*ft = document.getElementById('footer');
		op = 1;
		ft.style.opacity = op; // set opacity for effect : filter:alpha(opacity=50); -moz-opacity:0.5; opacity:0.5; 
		ft.style.filter = "alpha(opacity:"+Math.round(op*100)+")";		*/
	});

}


