/* ---

 generated 	25/09/2008	v1.0	Vincenz 
 update			26/09/2008	v1.01	Vincenz		addStdMouseOver: img with rel="mouseover" (Rollover)
 update			05/10/2008	v1.02	Vincenz		getSelect
 update			07/10/2008	v1.03	Vincenz		print_r Bug beseitigt, functions werden nicht ausgegeben
 
--- */

var fkt = {
	hideE: function(s) {
		this.gE(s).style.display = "none";
	},
	showE: function(s) {
		this.gE(s).style.display = "block";
	},
	getSelect: function(o) {
		return o.options[o.options.selectedIndex].value;
	},
	getRadio: function(f,n) {
		var a = f.elements[n];
		for (var i=0;i<a.length;i++)
			if (a[i].checked) return a[i].value;
		return "";
	},
	insertE: function(s, t) {
		this.gE(s).innerHTML = t;
	},
	rO: function(o) {
		o.onmouseover = rollOver;
		o.onmouseout = rollOver;
		o.style.cursor = "pointer";
	},
	gE: function(id) {
		return document.getElementById(id);
	},
	gImg1: function(o) {
		return o.getElementsByTagName("img")[0];
	},
	hideIESelects: function() {
		if (config.isIE6) {
			var s = document.getElementsByTagName("select");
			for (var i=0;i<s.length;i++) s[i].style.visibility = "hidden";
		}
	},
	showIESelects: function() {
			// make select boxes visible
			if (config.isIE6) {
				var s = document.getElementsByTagName("select");
				for (var i=0;i<s.length;i++) s[i].style.visibility = "visible";
			}
	},
	removeFocus: function() {this.blur();},
	printSite: function() {window.print();this.blur();},
	addLink: function(o) {
		x = o.cloneNode(true);
		a = document.createElement("a");
		x.onmouseover = o.onmouseover;
		x.onmouseout = o.onmouseout;
		a.onclick = x.onclick;
		a.setAttribute("href","javascript:;");
		a.onclick = o.onclick;
		a.appendChild(x);
		o.parentNode.replaceChild(a,o);

	},
	openExternal: function () {
		window.open( this.href, "", "" );
		return false;
	},
	addExternalLinks: function() {
		var a = document.getElementsByTagName( "a" );
		for (var i=0; i<a.length; i++) {
			if ( a[i].rel == "external" ) a[i].onclick = fkt.openExternal;
		}
	},
	print_r: function (das_array, ebene) {
		var result = '';
		for (var wert in das_array)
			if (typeof das_array[wert] == "object")
				result = result + ' ' + fkt.padding(ebene) + wert + "\n" + fkt.print_r(das_array[wert], ebene + 1);
			else if ( typeof das_array[wert] != "function" )
				result = result + ' ' + fkt.padding(ebene) + wert + ' = ' + das_array[wert] + "\n";
		return result;
	},
	padding: function (laenge) {
		result = '';
		for (var i = 0; i < laenge; i++)
			result = result + '___';
		return result;
	},
	fixPNG: function () {
		var arVersion = navigator.appVersion.split("MSIE");
		var version = parseFloat(arVersion[1]);
		if ((version >= 5.5 && version < 7) && (document.body.filters)) {
			 imgs = document.getElementsByTagName("img");
			 for(var i=0; i<imgs.length; i++) {
					var imgName = imgs[i].src.toUpperCase();
					if (imgName.substring(imgName.length-3) == "PNG")	{
						imgSrc = imgs[i].src;
						imgWidth = imgs[i].width;	if (imgWidth==0) imgWidth = imgs[i].style.width;
						imgHeight = imgs[i].height; if (imgHeight==0) imgHeight = imgs[i].style.height;
						imgs[i].src = config.blankImg;
						imgs[i].style.width = imgWidth;
						imgs[i].style.height = imgHeight;
						imgs[i].runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+imgSrc+"', sizingMethod='scale')";
					} //if PNG
			 } //for
		} //if IE
	}, //fix PNG
	insertInfobox: function insertInfobox() {
		var o = fkt.gE( config.infoEbene );
		o.innerHTML = config.htmlInfobox;
	},
	setDivText:function(c1, text) {
		if( o = fkt.gE( c1 ) ) {
			o.innerHTML=text;
		} // if
	},
	addStdMouseOver: function()  {
		var img = document.getElementsByTagName( "img" );
		for (var i=0; i<img.length; i++) {
			if ( img[i].getAttribute('rel') == "mouseover" ) { img[i].onmouseover = fkt.rollOver; img[i].onmouseout = fkt.rollOver; }
		}
	},
	rollOver: function(e) {
		if (!e) var e = window.event;
		var src_pre = this.src.substring( 0, this.src.lastIndexOf( "/" ) + 1 );
		var src_suf = this.src.substring( this.src.lastIndexOf( "." ) );
		var src_name = this.src.substring( this.src.lastIndexOf( "/" ) + 1, this.src.lastIndexOf( "." ) );
		if ( e.type == "mouseover" ) {
			this.src = src_pre + config.overPrefix + src_name + config.overSuffix + src_suf;
			this.style.cursor = "pointer";
		} else {
			if ( config.overPrefix != "" ) src_name = src_name.replace( eval('/' + config.overPrefix + '/' ) , "" );
			if ( config.overSuffix != "" ) src_name = src_name.replace( eval('/' + config.overSuffix + '/' ) , "" );
			this.src = src_pre + src_name + src_suf;
		}
	}
	
};
