var isIE=document.all?true:false;
var isDOM=document.getElementById?true:false;
var isNS4=document.layers?true:false;

/* _w : which ID (1) or (2) */
/* _h : (h)ide or (s)how */


window.addEvent('domready', function(){
	var hilfe = new Tips($$('.hilfe'), {
		initialize:function(){
			this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 500, wait: false}).set(0);
		},
			onShow: function(toolTip) {
			this.fx.start(1);
		},
			onHide: function(toolTip) {
			this.fx.start(0);
		}
	});
			
});


// Ende: ToolTips (MooTools)


var tn_on_id=-1;
function tn_lo(id) {if (tn_on_id!=id) {tn_set(id,"lo");}}
function tn_hi(id) {if (tn_on_id!=id) {tn_set(id,"hi");}}
function tn_on(id) {tn_set(tn_on_id,"lo"); tn_on_id=id; tn_set(tn_on_id,"on");}
function tn_set(id,mode)
{
	var className="tn";
	var obj=null;
	if (mode=="hi") {className+="_hi";} else if (mode=="on") {className+="_on";}
	if (id>=0) {obj=document.getElementById('tn_'+id);}
	if (obj) {obj.className=className;}
}


// functions for window handling
var isopen=false;

function winClose(winname)
{ winname.close(); }

function lexilaunch(newURL, newName, newFeatures, orgName)
{ if( (isopen) && (!remote.closed) ){ winClose(remote); }
  var remote = window.open(newURL, newName, newFeatures);
  remote.window.opener.name = orgName;
}

// PopUp-Fenster

function popupWindow(url,titel,zusatz) {
		  newWindow = window.open(url,"titel",zusatz);
		  newWindow.focus();
		}
		
// PopUp-Fenster: ENDE

// Schriftgroessen anpassen

function FontSize(_size, _targets, _exceptions) {
	this.size = _size || 11;
	this.min = 9;
	this.max = 16;
	this.targets = _targets || ['fsTextbody','fsInfoBox','fsHeadnormal'];
	this.exceptions = _exceptions || 'haferbrei#hirsebrei#';
	this.lucky = this.checkBrowser();
}
FontSize.prototype = {
larger : function() {
	(this.size < this.max) ? ++this.size : this.size;
	if (this.lucky) this.scale();
},
smaller : function() {
	(this.size > this.min) ? --this.size : this.size + 'px';	 
	if (this.lucky) this.scale();
},
scale : function() {
	var oTarget = null;
	for (var k = 0; k < this.targets.length; k++) {
		oTarget = document.getElementById(this.targets[k]);
		if (oTarget) this.changeSize(oTarget);  
	}
},
changeSize : function(oo) {
	if (oo.style) {
		oo.style.fontSize = this.size + 'px';
		oo.style.lineHeight = '1.3em';
	}
	for (var k = 0; k < oo.childNodes.length; k++) if (this.exceptions.indexOf((oo.childNodes[k].id || '#') + '#') == -1) this.changeSize(oo.childNodes[k]);
},
checkBrowser : function() {
	if (document.all && document.getElementById) return true;
	if (navigator.userAgent.indexOf('Netscape6/') >= 0 || navigator.userAgent.indexOf('Gecko') >= 0) return true;
	return false;
},
inc : function(oo) {
	this.larger();
	if (oo) oo.blur();
	return false;	
},
dec : function(oo) {
	this.smaller();
	if (oo) oo.blur();
	return false;	
}
}
font_size = new FontSize();

// Schriftgroessen anpassen: ENDE


