

/* EMailProtection.js */

if (document.all) {
	window.attachEvent('onload', new Function('var e = new TEditorElementLink(document,null,\'E-Mail-Link mit SPAM-Schutz\');e.unprotectDocument();'));
}
else {
	window.addEventListener('load', new Function('var e = new TEditorElementLink(document,null,\'E-Mail-Link mit SPAM-Schutz\');e.unprotectDocument();'), false);
}



//possible values for protection property of TEditorElementLink
var eelProtectionHref = 1;
var eelProtectionText = 2;
var eelProtectionTitle = 4;

function TEditorElementLink(document, currentObject, textProtected) //todo, mozilla compatibility
{
	//private
	var self = this;
	var _document = document;
	var _textProtected = textProtected; // this could be problematic because detection depends on this text and text is not the same for all languages

	function addEvent(object, eventName, handler, fireImmediatelly) {
		if (document.all) {
			object.attachEvent('on' + eventName, handler);

			if (fireImmediatelly) {
				object.fireEvent('on' + eventName);
			}
		}
		else {
			//mozilla style
			object.addEventListener(eventName, handler, false);

			if (fireImmediatelly) {
				var e = document.createEvent('MouseEvents');
				e.initMouseEvent(eventName, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
				object.dispatchEvent(e);
			}
		}
	}


	//public
	this.protection = 0;
	this.href = '';
	this.subject = '';
	this.address = '';
	this.title = '';
	this.text = '';
	this.target = '';
	this.object = currentObject;
	this.valid = false;
	this.version = '0.2';
	this.enclosingOtherElement = false;

	this.unprotectDocument = function() {
		var c = 0;
		var eList = _document.getElementsByTagName('a');

		while (c <= eList.length - 1) {
			e = eList[c];

			var d = new TEditorElementLink(_document, e, _textProtected);

			if (d.valid && !d.enclosingOtherElement) {
				if (_document.all) { e.innerText = d.text; } else { e.textContent = d.text; }
				e.onmouseout = null;
			}

			c++;
		}
	}

	this.hasProtection = function(eelProtectionValue) {
		return ((this.protection & eelProtectionValue) == eelProtectionValue);
	}

	this.create = function() {
		if (this.object) {
			this.valid = (this.object.tagName ? this.object.tagName.toLowerCase() == 'a' : false);

			if (this.valid) {
				this.enclosingOtherElement = false;

				var c = 0;
				while (c <= this.object.childNodes.length - 1) {
					this.enclosingOtherElement = this.enclosingOtherElement || (this.object.childNodes[c].tagName ? true : false);
					c++;
				}

				this.text = (document.all ? this.object.innerText : this.object.textContent);
				this.href = this.object.href;
				this.title = this.object.title;
				this.target = this.object.target;

				this.protection += (this.href.toLowerCase().indexOf('javascript://sendmail') >= 0 ? eelProtectionHref : 0);
				this.protection += (this.text == _textProtected ? eelProtectionText : 0);
				this.protection += (this.object.onmouseover ? (('' + this.object.onmouseover).toLowerCase().indexOf('this.title ') >= 0 ? eelProtectionTitle : 0) : 0);

				editorElement_temporaryLink = _document.createElement('a'); //we dont use "var" here because it should be a global variable so that event handler can access it
				editorElement_temporaryLink.href = this.object.href;
				editorElement_temporaryLink.title = this.object.title;
				editorElement_temporaryLink.innerText = this.object.innerText;

				if (this.hasProtection(eelProtectionHref) || this.hasProtection(eelProtectionText) || this.hasProtection(eelProtectionTitle)) {
					var onmouseoverHandler = this.object.attributes.getNamedItem('onmouseover');
					if (onmouseoverHandler) {
						addEvent(editorElement_temporaryLink, 'mouseover', new Function(onmouseoverHandler.value.replace(/this./gi, 'editorElement_temporaryLink.')), true);

						this.title = editorElement_temporaryLink.title;
						this.text = (document.all ? editorElement_temporaryLink.innerText : editorElement_temporaryLink.textContent);
						this.href = editorElement_temporaryLink.href;
					}
				}

				i = this.href.toLowerCase().indexOf('mailto:');
				if (i >= 0) {
					s = this.href.substr(i + 7, this.href.length);

					i = s.toLowerCase().indexOf('?subject=');
					if (i >= 0) {
						this.address = s.substr(0, i);
						this.subject = s.substr(i + 9, s.length);
					}
					else {
						this.address = s;
						this.subject = '';
					}
				}
			}
		}
	}

	this.assignTo = function(object, surrounding) {
		object.target = this.target;

		if (this.hasProtection(eelProtectionTitle)) {
			object.attributes.removeNamedItem('title');
		}
		else {
			object.title = this.title;
		}

		var text_initialvalue = (this.hasProtection(eelProtectionText) ? _textProtected : this.text);

		if (!surrounding) {
			object.innerText = text_initialvalue;
			//.innerText = ...replace(/#/g,String.fromCharCode(38)+'#'); //this dont work because ie converts & always to &amp; due to html standard, http://www.astro.washington.edu/owen/ROFM_CGI/Documentation/SpecialChars.html
		}

		if (this.hasProtection(eelProtectionHref) || this.hasProtection(eelProtectionText) || this.hasProtection(eelProtectionTitle)) {
			var onmouseover = _document.createAttribute('onmouseover');
			onmouseover.value = "function c(a) { return String.fromCharCode(a) }; ";

			if (this.hasProtection(eelProtectionHref)) {
				if (!this.hasProtection(eelProtectionText)) {
					onmouseover.value += "s = (document.all?this.innerText:this.textContent); ";
				}

				var href_encoded = "";

				for (var i = 0; i < this.href.length; i++) {
					href_encoded = href_encoded + '#' + this.href.charCodeAt(i) + ';';
				}

				onmouseover.value += "this.href=''" + href_encoded.replace(/#/g, '+c(').replace(/;/g, ')') + "; ";

				if (!this.hasProtection(eelProtectionText) && !surrounding) {
					onmouseover.value += "if (document.all) { this.innerText = s } else { this.textContent = s }; ";
				}

				object.href = "javascript://sendmail;";
			}

			if (this.hasProtection(eelProtectionText) && !surrounding) {
				var text_encoded = "";

				for (var i = 0; i < this.text.length; i++) {
					text_encoded = text_encoded + '#' + this.text.charCodeAt(i) + ';';
				}

				onmouseover.value += "s = ''" + text_encoded.replace(/#/g, '+c(').replace(/;/g, ')') + "; if (document.all) { this.innerText = s; } else { this.textContent = s; };";
			}

			if (this.hasProtection(eelProtectionTitle)) {
				var title_encoded = "";

				for (var i = 0; i < this.title.length; i++) {
					title_encoded = title_encoded + '#' + this.title.charCodeAt(i) + ';';
				}

				onmouseover.value += "this.title = ''" + title_encoded.replace(/#/g, '+c(').replace(/;/g, ')') + ";";
			}

			object.attributes.setNamedItem(onmouseover);

			if (this.hasProtection(eelProtectionText) && !surrounding) {
				var onmouseout = _document.createAttribute('onmouseout');
				onmouseout.value = "s = '" + text_initialvalue + "'; if (document.all) { this.innerText = s; } else { this.textContent = s; }";
				object.attributes.setNamedItem(onmouseout);
			}
			else {
				object.attributes.removeNamedItem('onmouseout');
			}
		}
		else {
			object.attributes.removeNamedItem('onmouseover');
			object.attributes.removeNamedItem('onmouseout');
		}
	}

	self.create();
}

/* Functions.js */



function swapLayers(id) {
	var cur_lyr; // holds id of currently visible layer
	if (cur_lyr) hideLayer(cur_lyr);
	showLayer(id);
	cur_lyr = id;
} 

function showLayer(id) {
	var lyr = getElemRefs(id);
	if (lyr && lyr.css) lyr.css.visibility = "visible";
}

function hideLayer(id) {
	var lyr = getElemRefs(id);
	if (lyr && lyr.css) lyr.css.visibility = "hidden";
}

function getElemRefs(id) {
	var el = (document.getElementById) ? document.getElementById(id) : (document.all) ? document.all[id] : (document.layers) ? document.layers[id] : null;
	if (el) el.css = (el.style) ? el.style : el;
	return el;
}

function changeimg(bildname, dateiname) {
	document.images[bildname].src = dateiname;
}

function showpic(id, picture, width, height, extension) {
	var left = (screen.width) / 2;
	var top = (screen.height) / 2;
	//alert(left);
	//alert(top);

	left = parseInt(left - (width));
	top = parseInt(top - (height));

	
	if (parseInt(width) > 2) {
		width = parseInt(width) + 50;
		height = parseInt(height) + 50;
	}
	else {
		width = 980
		height = 680
	}
	window.open('/file/' + id + '_' + picture + '.' + extension, 'cmspicture' + id, 'left=' + left + ',top=' + top + ',width=' + (width) + ',height=' + (height) + ',scrollbars=yes');

}


function showpicJquery(id, picture, width, height, extension) {
	var left = (screen.width) / 2;
	var top = (screen.height) / 2;
	//alert(left);
	//alert(top);

	left = parseInt(left - (width));
	top = parseInt(top - (height));


	if (parseInt(width) > 2) {
		width = parseInt(width) + 50;
		height = parseInt(height) + 50;
	}
	else {
		width = 980
		height = 680
	}
	window.open('/thumb/' + picture + '.' + extension, 'cmspicture' + id, 'left=' + left + ',top=' + top + ',width=' + (width) + ',height=' + (height) + ',scrollbars=yes');

}
	



/* swfobject.js */

/**
* SWFObject v1.4.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
*
* SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
* **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
*   legal reasons.
*/
if (typeof deconcept == "undefined") { var deconcept = new Object(); }
if (typeof deconcept.util == "undefined") { deconcept.util = new Object(); }
if (typeof deconcept.SWFObjectUtil == "undefined") { deconcept.SWFObjectUtil = new Object(); }
deconcept.SWFObject = function (_1, id, w, h, _5, c, _7, _8, _9, _a, _b) {
	if (!document.getElementById) { return; }
	this.DETECT_KEY = _b ? _b : "detectflash";
	this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	if (_1) { this.setAttribute("swf", _1); }
	if (id) { this.setAttribute("id", id); }
	if (w) { this.setAttribute("width", w); }
	if (h) { this.setAttribute("height", h); }
	if (_5) { this.setAttribute("version", new deconcept.PlayerVersion(_5.toString().split("."))); }
	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
	if (c) { this.addParam("bgcolor", c); }
	var q = _8 ? _8 : "high";
	this.addParam("quality", q);
	this.setAttribute("useExpressInstall", _7);
	this.setAttribute("doExpressInstall", false);
	var _d = (_9) ? _9 : window.location;
	this.setAttribute("xiRedirectUrl", _d);
	this.setAttribute("redirectUrl", "");
	if (_a) { this.setAttribute("redirectUrl", _a); } 
};
deconcept.SWFObject.prototype = { setAttribute: function (_e, _f) {
	this.attributes[_e] = _f;
}, getAttribute: function (_10) {
	return this.attributes[_10];
}, addParam: function (_11, _12) {
	this.params[_11] = _12;
}, getParams: function () {
	return this.params;
}, addVariable: function (_13, _14) {
	this.variables[_13] = _14;
}, getVariable: function (_15) {
	return this.variables[_15];
}, getVariables: function () {
	return this.variables;
}, getVariablePairs: function () {
	var _16 = new Array();
	var key;
	var _18 = this.getVariables();
	for (key in _18) { _16.push(key + "=" + _18[key]); }
	return _16;
}, getSWFHTML: function () {
	var _19 = "";
	if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) {
		if (this.getAttribute("doExpressInstall")) {
			this.addVariable("MMplayerType", "PlugIn");
		}
		_19 = "<embed type=\"application/x-shockwave-flash\" src=\"" + this.getAttribute("swf") + "\" width=\"" + this.getAttribute("width") + "\" height=\"" + this.getAttribute("height") + "\"";
		_19 += " id=\"" + this.getAttribute("id") + "\" name=\"" + this.getAttribute("id") + "\" ";
		var _1a = this.getParams();
		for (var key in _1a) { _19 += [key] + "=\"" + _1a[key] + "\" "; }
		var _1c = this.getVariablePairs().join("&");
		if (_1c.length > 0) { _19 += "flashvars=\"" + _1c + "\""; } _19 += "/>";
	} else {
		if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "ActiveX"); }
		_19 = "<object id=\"" + this.getAttribute("id") + "\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"" + this.getAttribute("width") + "\" height=\"" + this.getAttribute("height") + "\">";
		_19 += "<param name=\"movie\" value=\"" + this.getAttribute("swf") + "\" />";
		var _1d = this.getParams();
		for (var key in _1d) { _19 += "<param name=\"" + key + "\" value=\"" + _1d[key] + "\" />"; }
		var _1f = this.getVariablePairs().join("&");
		if (_1f.length > 0) { _19 += "<param name=\"flashvars\" value=\"" + _1f + "\" />"; } _19 += "</object>";
	}
	return _19;
}, write: function (_20) {
	if (this.getAttribute("useExpressInstall")) {
		var _21 = new deconcept.PlayerVersion([6, 0, 65]);
		if (this.installedVer.versionIsValid(_21) && !this.installedVer.versionIsValid(this.getAttribute("version"))) {
			this.setAttribute("doExpressInstall", true);
			this.addVariable("MMredirectURL", escape(this.getAttribute("xiRedirectUrl")));
			document.title = document.title.slice(0, 47) + " - Flash Player Installation";
			this.addVariable("MMdoctitle", document.title);
		} 
	}
	if (this.skipDetect || this.getAttribute("doExpressInstall") || this.installedVer.versionIsValid(this.getAttribute("version"))) {
		var n = (typeof _20 == "string") ? document.getElementById(_20) : _20;
		n.innerHTML = this.getSWFHTML(); return true;
	} else { if (this.getAttribute("redirectUrl") != "") { document.location.replace(this.getAttribute("redirectUrl")); } }
	return false;
} 
};
deconcept.SWFObjectUtil.getPlayerVersion = function () {
	var _23 = new deconcept.PlayerVersion([0, 0, 0]);
	if (navigator.plugins && navigator.mimeTypes.length) {
		var x = navigator.plugins["Shockwave Flash"];
		if (x && x.description) { _23 = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".")); }
	} else {
		try { var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); }
		catch (e) {
			try {
				var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				_23 = new deconcept.PlayerVersion([6, 0, 21]); axo.AllowScriptAccess = "always";
			}
			catch (e) { if (_23.major == 6) { return _23; } } try { axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); }
			catch (e) { } 
		} if (axo != null) { _23 = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(",")); } 
	}
	return _23;
};
deconcept.PlayerVersion = function (_27) {
	this.major = _27[0] != null ? parseInt(_27[0]) : 0;
	this.minor = _27[1] != null ? parseInt(_27[1]) : 0;
	this.rev = _27[2] != null ? parseInt(_27[2]) : 0;
};
deconcept.PlayerVersion.prototype.versionIsValid = function (fv) {
	if (this.major < fv.major) { return false; }
	if (this.major > fv.major) { return true; }
	if (this.minor < fv.minor) { return false; }
	if (this.minor > fv.minor) { return true; }
	if (this.rev < fv.rev) {
		return false;
	} return true;
};
deconcept.util = { getRequestParameter: function (_29) {
	var q = document.location.search || document.location.hash;
	if (q) {
		var _2b = q.substring(1).split("&");
		for (var i = 0; i < _2b.length; i++) {
			if (_2b[i].substring(0, _2b[i].indexOf("=")) == _29) {
				return _2b[i].substring((_2b[i].indexOf("=") + 1));
			} 
		} 
	}
	return "";
} 
};
deconcept.SWFObjectUtil.cleanupSWFs = function () {
	if (window.opera || !document.all) { return; }
	var _2d = document.getElementsByTagName("OBJECT");
	for (var i = 0; i < _2d.length; i++) {
		_2d[i].style.display = "none"; for (var x in _2d[i]) {
			if (typeof _2d[i][x] == "function") { _2d[i][x] = function () { }; } 
		} 
	} 
};
deconcept.SWFObjectUtil.prepUnload = function () {
	__flash_unloadHandler = function () { };
	__flash_savedUnloadHandler = function () { };
	if (typeof window.onunload == "function") {
		var _30 = window.onunload;
		window.onunload = function () {
			deconcept.SWFObjectUtil.cleanupSWFs(); _30();
		};
	} else { window.onunload = deconcept.SWFObjectUtil.cleanupSWFs; } 
};
if (typeof window.onbeforeunload == "function") {
	var oldBeforeUnload = window.onbeforeunload;
	window.onbeforeunload = function () {
		deconcept.SWFObjectUtil.prepUnload();
		oldBeforeUnload();
	};
} else { window.onbeforeunload = deconcept.SWFObjectUtil.prepUnload; }
if (Array.prototype.push == null) {
	Array.prototype.push = function (_31) {
		this[this.length] = _31;
		return this.length;
	};
}
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject;
var SWFObject = deconcept.SWFObject;

