/*	Unobtrusive Flash Objects (UFO) v3.20 <http://www.bobbyvandersluis.com/ufo/>
	Copyright 2005, 2006 Bobby van der Sluis
	This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
*/
var UFO = {
	req: ["movie", "width", "height", "majorversion", "build"],
	opt: ["play", "loop", "menu", "quality", "scale", "salign", "wmode", "bgcolor", "base", "flashvars", "devicefont", "allowscriptaccess", "seamlesstabbing"],
	optAtt: ["id", "name", "align"],
	optExc: ["swliveconnect"],
	ximovie: "ufo.swf",
	xiwidth: "215",
	xiheight: "138",
	ua: navigator.userAgent.toLowerCase(),
	pluginType: "",
	fv: [0,0],
	foList: [],
		
	create: function(FO, id) {
		if (!UFO.uaHas("w3cdom") || UFO.uaHas("ieMac")) return;
		UFO.getFlashVersion();
		UFO.foList[id] = UFO.updateFO(FO);
		UFO.createCSS("#" + id, "visibility:hidden;");
		UFO.domLoad(id);
	},

	updateFO: function(FO) {
		if (typeof FO.xi != "undefined" && FO.xi == "true") {
			if (typeof FO.ximovie == "undefined") FO.ximovie = UFO.ximovie;
			if (typeof FO.xiwidth == "undefined") FO.xiwidth = UFO.xiwidth;
			if (typeof FO.xiheight == "undefined") FO.xiheight = UFO.xiheight;
		}
		FO.mainCalled = false;
		return FO;
	},

	domLoad: function(id) {
		var _t = setInterval(function() {
			if ((document.getElementsByTagName("body")[0] != null || document.body != null) && document.getElementById(id) != null) {
				UFO.main(id);
				clearInterval(_t);
			}
		}, 250);
		if (typeof document.addEventListener != "undefined") {
			document.addEventListener("DOMContentLoaded", function() { UFO.main(id); clearInterval(_t); } , null); // Gecko, Opera 9+
		}
	},

	main: function(id) {
		var _fo = UFO.foList[id];
		if (_fo.mainCalled) return;
		UFO.foList[id].mainCalled = true;
		document.getElementById(id).style.visibility = "hidden";
		if (UFO.hasRequired(id)) {
			if (UFO.hasFlashVersion(parseInt(_fo.majorversion, 10), parseInt(_fo.build, 10))) {
				if (typeof _fo.setcontainercss != "undefined" && _fo.setcontainercss == "true") UFO.setContainerCSS(id);
				UFO.writeSWF(id);
			}
			else if (_fo.xi == "true" && UFO.hasFlashVersion(6, 65)) {
				UFO.createDialog(id);
			}
		}
		document.getElementById(id).style.visibility = "visible";
	},
	
	createCSS: function(selector, declaration) {
		var _h = document.getElementsByTagName("head")[0]; 
		var _s = UFO.createElement("style");
		if (!UFO.uaHas("ieWin")) _s.appendChild(document.createTextNode(selector + " {" + declaration + "}")); // bugs in IE/Win
		_s.setAttribute("type", "text/css");
		_s.setAttribute("media", "screen"); 
		_h.appendChild(_s);
		if (UFO.uaHas("ieWin") && document.styleSheets && document.styleSheets.length > 0) {
			var _ls = document.styleSheets[document.styleSheets.length - 1];
			if (typeof _ls.addRule == "object") _ls.addRule(selector, declaration);
		}
	},
	
	setContainerCSS: function(id) {
		var _fo = UFO.foList[id];
		var _w = /%/.test(_fo.width) ? "" : "px";
		var _h = /%/.test(_fo.height) ? "" : "px";
		UFO.createCSS("#" + id, "width:" + _fo.width + _w +"; height:" + _fo.height + _h +";");
		if (_fo.width == "100%") {
			UFO.createCSS("body", "margin-left:0; margin-right:0; padding-left:0; padding-right:0;");
		}
		if (_fo.height == "100%") {
			UFO.createCSS("html", "height:100%; overflow:hidden;");
			UFO.createCSS("body", "margin-top:0; margin-bottom:0; padding-top:0; padding-bottom:0; height:100%;");
		}
	},

	createElement: function(el) {
		return (UFO.uaHas("xml") && typeof document.createElementNS != "undefined") ?  document.createElementNS("http://www.w3.org/1999/xhtml", el) : document.createElement(el);
	},

	createObjParam: function(el, aName, aValue) {
		var _p = UFO.createElement("param");
		_p.setAttribute("name", aName);	
		_p.setAttribute("value", aValue);
		el.appendChild(_p);
	},

	uaHas: function(ft) {
		var _u = UFO.ua;
		switch(ft) {
			case "w3cdom":
				return (typeof document.getElementById != "undefined" && typeof document.getElementsByTagName != "undefined" && (typeof document.createElement != "undefined" || typeof document.createElementNS != "undefined"));
			case "xml":
				var _m = document.getElementsByTagName("meta");
				var _l = _m.length;
				for (var i = 0; i < _l; i++) {
					if (/content-type/i.test(_m[i].getAttribute("http-equiv")) && /xml/i.test(_m[i].getAttribute("content"))) return true;
				}
				return false;
			case "ieMac":
				return /msie/.test(_u) && !/opera/.test(_u) && /mac/.test(_u);
			case "ieWin":
				return /msie/.test(_u) && !/opera/.test(_u) && /win/.test(_u);
			case "gecko":
				return /gecko/.test(_u) && !/applewebkit/.test(_u);
			case "opera":
				return /opera/.test(_u);
			case "safari":
				return /applewebkit/.test(_u);
			default:
				return false;
		}
	},
	
	getFlashVersion: function() {
		if (UFO.fv[0] != 0) return;  
		if (navigator.plugins && typeof navigator.plugins["Shockwave Flash"] == "object") {
			UFO.pluginType = "npapi";
			var _d = navigator.plugins["Shockwave Flash"].description;
			if (typeof _d != "undefined") {
				_d = _d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
				var _m = parseInt(_d.replace(/^(.*)\..*$/, "$1"), 10);
				var _r = /r/.test(_d) ? parseInt(_d.replace(/^.*r(.*)$/, "$1"), 10) : 0;
				UFO.fv = [_m, _r];
			}
		}
		else if (window.ActiveXObject) {
			UFO.pluginType = "ax";
			try { // avoid fp 6 crashes
				var _a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
			}
			catch(e) {
				try { 
					var _a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
					UFO.fv = [6, 0];
					_a.AllowScriptAccess = "always"; // throws if fp < 6.47 
				}
				catch(e) {
					if (UFO.fv[0] == 6) return;
				}
				try {
					var _a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
				}
				catch(e) {}
			}
			if (typeof _a == "object") {
				var _d = _a.GetVariable("$version"); // bugs in fp 6.21/6.23
				if (typeof _d != "undefined") {
					_d = _d.replace(/^\S+\s+(.*)$/, "$1").split(",");
					UFO.fv = [parseInt(_d[0], 10), parseInt(_d[2], 10)];
				}
			}
		}
	},

	hasRequired: function(id) {
		var _l = UFO.req.length;
		for (var i = 0; i < _l; i++) {
			if (typeof UFO.foList[id][UFO.req[i]] == "undefined") return false;
		}
		return true;
	},
	
	hasFlashVersion: function(major, release) {
		return (UFO.fv[0] > major || (UFO.fv[0] == major && UFO.fv[1] >= release)) ? true : false;
	},

	writeSWF: function(id) {
		var _fo = UFO.foList[id];
		var _e = document.getElementById(id);
		if (UFO.pluginType == "npapi") {
			if (UFO.uaHas("gecko") || UFO.uaHas("xml")) {
				while(_e.hasChildNodes()) {
					_e.removeChild(_e.firstChild);
				}
				var _obj = UFO.createElement("object");
				_obj.setAttribute("type", "application/x-shockwave-flash");
				_obj.setAttribute("data", _fo.movie);
				_obj.setAttribute("width", _fo.width);
				_obj.setAttribute("height", _fo.height);
				var _l = UFO.optAtt.length;
				for (var i = 0; i < _l; i++) {
					if (typeof _fo[UFO.optAtt[i]] != "undefined") _obj.setAttribute(UFO.optAtt[i], _fo[UFO.optAtt[i]]);
				}
				var _o = UFO.opt.concat(UFO.optExc);
				var _l = _o.length;
				for (var i = 0; i < _l; i++) {
					if (typeof _fo[_o[i]] != "undefined") UFO.createObjParam(_obj, _o[i], _fo[_o[i]]);
				}
				_e.appendChild(_obj);
			}
			else {
				var _emb = "";
				var _o = UFO.opt.concat(UFO.optAtt).concat(UFO.optExc);
				var _l = _o.length;
				for (var i = 0; i < _l; i++) {
					if (typeof _fo[_o[i]] != "undefined") _emb += ' ' + _o[i] + '="' + _fo[_o[i]] + '"';
				}
				_e.innerHTML = '<embed type="application/x-shockwave-flash" src="' + _fo.movie + '" width="' + _fo.width + '" height="' + _fo.height + '" pluginspage="http://www.macromedia.com/go/getflashplayer"' + _emb + '></embed>';
			}
		}
		else if (UFO.pluginType == "ax") {
			var _objAtt = "";
			var _l = UFO.optAtt.length;
			for (var i = 0; i < _l; i++) {
				if (typeof _fo[UFO.optAtt[i]] != "undefined") _objAtt += ' ' + UFO.optAtt[i] + '="' + _fo[UFO.optAtt[i]] + '"';
			}
			var _objPar = "";
			var _l = UFO.opt.length;
			for (var i = 0; i < _l; i++) {
				if (typeof _fo[UFO.opt[i]] != "undefined") _objPar += '<param name="' + UFO.opt[i] + '" value="' + _fo[UFO.opt[i]] + '" />';
			}
			var _p = window.location.protocol == "https:" ? "https:" : "http:";
			_e.innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + _objAtt + ' width="' + _fo.width + '" height="' + _fo.height + '" codebase="' + _p + '//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + _fo.majorversion + ',0,' + _fo.build + ',0"><param name="movie" value="' + _fo.movie + '" />' + _objPar + '</object>';
		}
	},
		
	createDialog: function(id) {
		var _fo = UFO.foList[id];
		UFO.createCSS("html", "height:100%; overflow:hidden;");
		UFO.createCSS("body", "height:100%; overflow:hidden;");
		UFO.createCSS("#xi-con", "position:absolute; left:0; top:0; z-index:1000; width:100%; height:100%; background-color:#fff; filter:alpha(opacity:75); opacity:0.75;");
		UFO.createCSS("#xi-dia", "position:absolute; left:50%; top:50%; margin-left: -" + Math.round(parseInt(_fo.xiwidth, 10) / 2) + "px; margin-top: -" + Math.round(parseInt(_fo.xiheight, 10) / 2) + "px; width:" + _fo.xiwidth + "px; height:" + _fo.xiheight + "px;");
		var _b = document.getElementsByTagName("body")[0];
		var _c = UFO.createElement("div");
		_c.setAttribute("id", "xi-con");
		var _d = UFO.createElement("div");
		_d.setAttribute("id", "xi-dia");
		_c.appendChild(_d);
		_b.appendChild(_c);
		var _mmu = window.location;
		if (UFO.uaHas("xml") && UFO.uaHas("safari")) {
			var _mmd = document.getElementsByTagName("title")[0].firstChild.nodeValue = document.getElementsByTagName("title")[0].firstChild.nodeValue.slice(0, 47) + " - Flash Player Installation";
		}
		else {
			var _mmd = document.title = document.title.slice(0, 47) + " - Flash Player Installation";
		}
		var _mmp = UFO.pluginType == "ax" ? "ActiveX" : "PlugIn";
		var _uc = typeof _fo.xiurlcancel != "undefined" ? "&xiUrlCancel=" + _fo.xiurlcancel : "";
		var _uf = typeof _fo.xiurlfailed != "undefined" ? "&xiUrlFailed=" + _fo.xiurlfailed : "";
		UFO.foList["xi-dia"] = { movie:_fo.ximovie, width:_fo.xiwidth, height:_fo.xiheight, majorversion:"6", build:"65", flashvars:"MMredirectURL=" + _mmu + "&MMplayerType=" + _mmp + "&MMdoctitle=" + _mmd + _uc + _uf };
		UFO.writeSWF("xi-dia");
	},

	expressInstallCallback: function() {
		var _b = document.getElementsByTagName("body")[0];
		var _c = document.getElementById("xi-con");
		_b.removeChild(_c);
		UFO.createCSS("body", "height:auto; overflow:auto;");
		UFO.createCSS("html", "height:auto; overflow:auto;");
	},

	cleanupIELeaks: function() {
		var _o = document.getElementsByTagName("object");
		var _l = _o.length
		for (var i = 0; i < _l; i++) {
			_o[i].style.display = "none";
			for (var x in _o[i]) {
				if (typeof _o[i][x] == "function") {
					_o[i][x] = null;
				}
			}
		}
	}
};
if (typeof window.attachEvent != "undefined" && UFO.uaHas("ieWin")) {
	window.attachEvent("onunload", UFO.cleanupIELeaks);
}

// Mootools with DOM + Window:
//MooTools, My Object Oriented Javascript Tools. Copyright (c) 2006 Valerio Proietti, <http://mad4milk.net>, MIT Style License.
eval(function(A,G){return A.replace(/(\w+)/g,function(a,b){return G[parseInt(b,36)]})}("0 1=2(3){0 4=2(){5 (0 6 7 8){9 (8[6]) 8[6].a=8;}\n9 (b[c] !=\n\'d\'\n&&8.e) f 8.e.g(8,b);};4.h=8.h;4.i=8.i;4.j=3;f 4;};1.k=2(){};1.l=2(3){f m 1(3);};1.j={h:2(3){0 n=m 8(\n\'d\'\n);5 (0 o 7 3){0 p=n[o];0 q=3[o];9 (p&&p !=q) q=p.r(q)||q;n[o]=q;}\nf m 1(n);},i:2(3){5 (0 o 7 3) 8.j[o]=3[o];}};s.h=2(){0 t=b;9 (t[u]) t=[t[c],t[u]];v t=[8,t[c]];5 (0 o 7 t[u]) t[c][o]=t[u][o];f t[c];};s.w=2(){5 (0 x=c;x<b.y;x++) b[x].h=1.j.i;};m s.w(z,10,11,12);z.h({r:2(q){0 p=8;f 2(){8.13=p;f q.g(8,b);};}});;z.h({14:2(t,15){0 16=8;9 ($17(t) !=\n\'18\'\n) t=[t];f 2(){f 16.g(15||16.a||16,t);};},15:2(15){0 16=8;f 2(){f 16.g(15,b);};},19:2(15){0 16=8;f 2(1a){16.1b(15,1a||1c.1a);f 1d;};},1e:2(1f,15){f 1g(8.15(15||8.a||8),1f);},1h:2(1f,15){f 1i(8.15(15||8.a||8),1f);}});2 $1j(1k){1l(1k);1m(1k);f 1n;};2 $17(1o){9 (!1o) f 1d;0 17=1d;9 (1o 1p z) 17=\n\'2\'\n;v 9 (1o.1q){9 (1o.1r==1s&&!\n/\\1t/.1u(1o.1v)) 17=\n\'1w\'\n;v 9 (1o.1r==u) 17=\n\'1x\'\n;}\nv 9 (1o 1p 10) 17=\n\'18\'\n;v 9 (1y 1o==\n\'1z\'\n) 17=\n\'1z\'\n;v 9 (1y 1o==\n\'20\'\n) 17=\n\'20\'\n;v 9 (1y 1o==\n\'21\'\n&&22(1o)) 17=\n\'21\'\n;f 17;};0 23=m 1({24:2(16){8.25=8.25||[];8.25.26(16);f 8;},27:2(){9 (8.25&&8.25.y) 8.25.28(c,u)[c].1e(29,8);},2a:2(){8.25=[];}});;9 (!10.j.2b){10.j.2b=2(16,15){5(0 x=c;x<8.y;x++) 16.1b(15,8[x],x);};}\n10.h({2c:10.j.2b,2d:2(){0 2e=[];5 (0 x=c;x<8.y;x++) 2e.26(8[x]);f 2e;},2f:2(2g){5 (0 x=c;x<8.y;x++){9 (8[x]==2g) 8.28(x,u);}\nf 8;},1u:2(2g){5 (0 x=c;x<8.y;x++){9 (8[x]==2g) f 2h;};f 1d;},h:2(2e){5 (0 x=c;x<2e.y;x++) 8.26(2e[x]);f 8;},2i:2(2j){0 2e=[];5 (0 x=c;x<8.y;x++) 2e[2j[x]]=8[x];f 2e;}});2 $2k(18){f 10.j.2d.1b(18);};;11.h({1u:2(2l,2m){f 8.2n(m 2o(2l,2m));},2p:2(){f 2q(8);},2r:2(){f 8.2s(\n/-\\2t/2u,2(2n){f 2n.2v(2n.y-u).2w();});},2x:2(){f 8.2y().2s(\n/\\2z[30-31]/32,2(2n){f 2n.2w();});},33:2(){f 8.2s(\n/^\\34*|\\34*$/32,\n\'\'\n);},35:2(){f 8.2s(\n/\\34\\34/32,\n\' \'\n).33();},36:2(18){0 37=8.1u(\n\'([\\\\38]{u,1s})\'\n,\n\'32\'\n);9 (37[1s]==c) f\n\'39\'\n;0 3a=[];5 (0 x=c;x<1s;x++){0 3b=(37[x]-c).3c(3d);3a.26(3b.y==u?\n\'c\'\n+3b:3b);}\n0 3e=\n\'#\'\n+3a.3f(\n\'\'\n);9 (18) f 3a;v f 3e;},3g:2(18){0 3a=8.1u(\n\'^[#]{c,u}([\\\\3h]{u,3i})([\\\\3h]{u,3i})([\\\\3h]{u,3i})$\'\n);0 37=[];5 (0 x=u;x<3a.y;x++){9 (3a[x].y==u) 3a[x]+=3a[x];37.26(2q(3a[x],3d));}\n0 3j=\n\'37(\'\n+37.3f(\n\',\'\n)+\n\')\'\n;9 (18) f 37;v f 3j;}});12.h({2p:2(){f 8;}});;0 3k=m 1({e:2(3l){9 ($17(3l)==\n\'20\'\n) 3l=3m.3n(3l);f $(3l);},3o:2(3l,3p){3l=$(3l)||m 3k(3l);3q(3p){3r\n\"3s\"\n:$(3l.3t).3u(8,3l);3v;3r\n\"3w\"\n:{9 (!3l.3x()) $(3l.3t).3y(8);v $(3l.3t).3u(8,3l.3x());} 3v;3r\n\"3z\"\n:3l.3y(8);3v;}\nf 8;},40:2(3l){f 8.3o(3l,\n\'3s\'\n);},41:2(3l){f 8.3o(3l,\n\'3w\'\n);},42:2(3l){f 8.3o(3l,\n\'3z\'\n);},43:2(3l){8.3y($(3l)||m 3k(3l));f 8;},2f:2(){8.3t.44(8);},45:2(46){f $(8.47(46||2h));},48:2(3l){0 3l=$(3l)||m 3k(3l);8.3t.49(3l,8);f 3l;},4a:2(4b){9 (8.4c()==\n\'4d\'\n&&1c.4e) 8.4f.4g=4b;v 8.3y(3m.4h(4b));f 8;},4i:2(4j){f !!8.4j.1u(\n\"\\\\2z\"\n+4j+\n\"\\\\2z\"\n);},4k:2(4j){9 (!8.4i(4j)) 8.4j=(8.4j+\n\' \'\n+4j.33()).35();f 8;},4l:2(4j){9 (8.4i(4j)) 8.4j=8.4j.2s(4j.33(),\n\'\'\n).35();f 8;},4m:2(4j){9 (8.4i(4j)) f 8.4l(4j);v f 8.4k(4j);},4n:2(o,4o){9 (o==\n\'4p\'\n) 8.4q(4r(4o));v 8.4d[o.2r()]=4o;f 8;},4s:2(4t){9 ($17(4t)==\n\'1z\'\n){5 (0 o 7 4t) 8.4n(o,4t[o]);} v 9 ($17(4t)==\n\'20\'\n){9 (1c.4e) 8.4g=4t;v 8.4u(\n\'4d\'\n,4t);}\nf 8;},4q:2(4p){9 (4p==c){9(8.4d.4v !=\n\"4w\"\n) 8.4d.4v=\n\"4w\"\n;} v {9(8.4d.4v !=\n\"4x\"\n) 8.4d.4v=\n\"4x\"\n;}\n9 (1c.4e) 8.4d.4y=\n\"4z(4p=\"\n+4p*50+\n\")\"\n;8.4d.4p=4p;f 8;},51:2(o){0 52=o.2r();0 4d=8.4d[52]||1d;9 (!4d){9 (3m.53) 4d=3m.53.54(8,1n).55(o);v 9 (8.56) 4d=8.56[52];}\n9 (4d&&[\n\'57\'\n,\n\'58\'\n,\n\'59\'\n].1u(52)&&4d.1u(\n\'37\'\n)) 4d=4d.36();f 4d;},5a:2(5b,16){8[5b+16]=16.15(8);9 (8.5c) 8.5c(5b,16,1d);v 8.5d(\n\'5e\'\n+5b,8[5b+16]);0 3l=8;9 (8 !=1c) 5f.5g.26(2(){3l.5h(5b,16);3l[5b+16]=1n;});f 8;},5h:2(5b,16){9 (8.5i) 8.5i(5b,16,1d);v 8.5j(\n\'5e\'\n+5b,8[5b+16]);f 8;},5k:2(5l){0 3l=8[5l+\n\'5m\'\n];5n ($17(3l)==\n\'1w\'\n) 3l=3l[5l+\n\'5m\'\n];f $(3l);},5o:2(){f 8.5k(\n\'p\'\n);},3x:2(){f 8.5k(\n\'5p\'\n);},5q:2(){0 3l=8.5r;5n ($17(3l)==\n\'1w\'\n) 3l=3l.5s;f $(3l);},5t:2(){0 3l=8.5u;5n ($17(3l)==\n\'1w\'\n)\n3l=3l.5v;f $(3l);},5w:2(o,4o){0 3l=1d;3q(o){3r\n\'5x\'\n:8.4j=4o;3v;3r\n\'4d\'\n:8.4s(4o);3v;3r\n\'5y\'\n:9 (1c.4e&&8.4c()==\n\'5z\'\n){3l=$(3m.3n(\n\'<5z 5y=\"\'\n+4o+\n\'\" />\'\n));$2k(8.60).2c(2(61){9 (61.5y !=\n\'5y\'\n) 3l.5w(61.5y,61.4o);});9 (8.3t) 8.48(3l);};62:8.4u(o,4o);}\nf 3l||8;},63:2(4t){5 (0 o 7 4t) 8.5w(o,4t[o]);f 8;},64:2(65){8.66=65;f 8;},67:2(o){f 8.68(o);},4c:2(){f 8.69.2y();},6a:2(5l){5l=5l.2x();0 3l=8;0 6b=c;6c {6b+=3l[\n\'6b\'\n+5l]||c;3l=3l.6d;} 5n (3l);f 6b;},6e:2(){f 8.6a(\n\'6f\'\n);},6g:2(){f 8.6a(\n\'6h\'\n);},6i:2(){0 4o=1d;3q(8.4c()){3r\n\'6j\'\n:4o=8.6k(\n\'6l\'\n)[8.6m].4o;3v;3r\n\'5z\'\n:9 ((8.6n&&[\n\'6o\'\n,\n\'6p\'\n].1u(8.17))||([\n\'4w\'\n,\n\'4b\'\n,\n\'6q\'\n].1u(8.17)))\n4o=8.4o;3v;3r\n\'6r\'\n:4o=8.4o;}\nf 4o;}});m s.w(3k);3k.h({6s:3k.j.4i,6t:3k.j.4k,6u:3k.j.4l,6v:3k.j.4m});2 $3k(3l,6w,t){9 ($17(t) !=\n\'18\'\n) t=[t];f 3k.j[6w].g(3l,t);};2 $(3l){9 ($17(3l)==\n\'20\'\n) 3l=3m.6x(3l);9 ($17(3l)==\n\'1x\'\n){9 (!3l.h){5f.6y.26(3l);3l.h=s.h;3l.h(3k.j);}\nf 3l;} v f 1d;};1c.5a=3m.5a=3k.j.5a;1c.5h=3m.5h=3k.j.5h;0 5f={6y:[],5g:[],6z:[],70:2(){5f.5g.2c(2(16){16();});1c.5h(\n\'70\'\n,1c.71);5f.6y.2c(2(3l){5(0 6 7 3k.j){1c[6]=1n;3m[6]=1n;3l[6]=1n;}\n3l.h=1n;});}};1c.71=5f.70;1c.5a(\n\'70\'\n,1c.71);;2 $1t(){0 72=[];$2k(b).2c(2(73){9 ($17(73)==\n\'20\'\n) 72.h(3m.74(73));v 9 ($17(73)==\n\'1x\'\n) 72.26($(73));});f $75(72);};0 $$=$1t;2 $76(77,4y){f ($(4y)||3m).78(77);};2 $79(77,4y){f ($(4y)||3m).74(77);};2 $75(6y){f s.h(6y,m 75);};3k.h({7a:2(77){0 7b=[];77.35().7c(\n\' \'\n).2c(2(73,x){0 7d=73.1u(\n\'^(\\\\3h*|\\\\*)(?:#(\\\\3h+)|\\\\.(\\\\3h+))?(?:\\\\[[\"\\\']?(\\\\3h+)[\"\\\']?([\\\\*\\\\^\\\\$]?=)[\"\\\']?(\\\\3h*)[\"\\\']?\\\\])?$\'\n);9 (!7d) f;9 (!7d[u]) 7d[u]=\n\'*\'\n;0 7e=7d.2f(7d[c]).2i([\n\'7f\'\n,\n\'7g\'\n,\n\'5x\'\n,\n\'61\'\n,\n\'7h\'\n,\n\'4o\'\n]);9 (x==c){9 (7e[\n\'7g\'\n]){0 3l=8.6x(7e[\n\'7g\'\n]);9 (!3l||(7e[\n\'7f\'\n] !=\n\'*\'\n&&$(3l).4c() !=7e[\n\'7f\'\n])) f 1d;7b=[3l];} v {7b=$2k(8.6k(7e[\n\'7f\'\n]));}} v {9 (7e[\n\'7g\'\n]) 7b=$75(7b).7i(7e[\n\'7g\'\n]);7b=$75(7b).7j(7e[\n\'7f\'\n]);}\n9 (7e[\n\'5x\'\n]) 7b=$75(7b).7k(7e[\n\'5x\'\n]);9 (7e[\n\'61\'\n]) 7b=$75(7b).7l(7e[\n\'61\'\n],7e[\n\'4o\'\n],7e[\n\'7h\'\n]);},8);7b.2c(2(3l){$(3l);});f $75(7b);},78:2(77){f 8.74(77)[c];},74:2(77){0 72=[];77.7c(\n\',\'\n).2c(2(73){72.h(8.7a(73));},8);f $75(72);}});3m.h=s.h;3m.h({7m:2(4j){f 3m.7a(\n\'.\'\n+4j);},78:3k.j.78,7a:3k.j.7a,74:3k.j.74});0 75=m 1({5b:2(7n){8.2c(2(3l){3l=$(3l);9 (7n.e) 7n.e.g(3l);5(0 5b 7 7n){0 7o=1d;9 (5b.1u(\n\'^5e[\\\\3h]{u,}\'\n)) 3l[5b]=7n[5b];v 9 (7o=5b.1u(\n\'([\\\\3h-]{u,})1a$\'\n)) 3l.5a(7o[u],7n[5b]);}});},7i:2(7g){0 7p=[];8.2c(2(3l){9 (3l.7g==7g) 7p.26(3l);});f 7p;},7k:2(4j){0 7p=[];8.2c(2(3l){9 ($3k(3l,\n\'4i\'\n,4j)) 7p.26(3l);});f 7p;},7j:2(69){0 7p=[];8.2c(2(3l){7p.h($2k(3l.6k(69)));});f 7p;},7l:2(5y,4o,7h){0 7p=[];8.2c(2(3l){0 7q=3l.68(5y);9(!7q) f;9 (!7h) f 7p.26(3l);3q(7h){3r\n\'*=\'\n:9 (7q.1u(4o)) 7p.26(3l);3v;3r\n\'=\'\n:9 (7q==4o) 7p.26(3l);3v;3r\n\'^=\'\n:9 (7q.1u(\n\'^\'\n+4o)) 7p.26(3l);3v;3r\n\'$=\'\n:9 (7q.1u(4o+\n\'$\'\n)) 7p.26(3l);}});f 7p;}});m s.w(75);;0 7r={7s:2(){9 (1c.4e) 3m.7t(\n\"7u\"\n,1d,2h);},h:s.h,7v:2(){f 1c.7w||3m.7x.7y||c;},7z:2(){f 1c.80||3m.7x.81||c;},82:2(){f 3m.7x.83;},84:2(){f 3m.7x.85;},86:2(){f 3m.7x.87||1c.88||c;},89:2(){f 3m.7x.8a||1c.8b||c;},8c:2(8d){0 8e=3m.8f;9 (8e&&3m.8g&&!3m.8h&&!8i.8j){9 (8e.1u(\n/8k|8l/)) f 8d();v f 7r.8c.14(8d).1e(50);} v 9 (8e&&1c.4e){0 8m=$(\n\'8n\'\n);9 (!8m) 3m.8o(\n\"<8m 7g=\'8n\' 8p=\'2h\' 8q=\'://\'></8m>\"\n);$(\n\'8n\'\n).5a(\n\'8r\'\n,2(){9 (8.8f==\n\'8l\'\n) 8d();});f;} v {0 8s=2(){9 (b.8t.8u) f;b.8t.8u=2h;8d();};1c.5a(\n\"8v\"\n,8s);3m.5a(\n\"8w\"\n,8s);}}};","var,Class,function,properties,klass,for,p,in,this,if,_proto_,arguments,0,noinit,initialize,return,apply,extend,implement,prototype,empty,create,new,pr0t0typ3,property,previous,current,parentize,Object,args,1,else,Native,i,length,Function,Array,String,Number,parent,pass,bind,fn,type,array,bindAsEventListener,event,call,window,false,delay,ms,setTimeout,periodical,setInterval,clear,timer,clearTimeout,clearInterval,null,obj,instanceof,nodeName,nodeType,3,S,test,nodeValue,textnode,element,typeof,object,string,number,isFinite,Chain,chain,chains,push,callChain,splice,10,clearChain,forEach,each,copy,newArray,remove,item,true,associate,keys,A,regex,params,match,RegExp,toInt,parseInt,camelCase,replace,D,gi,charAt,toUpperCase,capitalize,toLowerCase,b,a,z,g,trim,s,clean,rgbToHex,rgb,d,transparent,hex,bit,toString,16,hexText,join,hexToRgb,w,2,rgbText,Element,el,document,createElement,inject,where,switch,case,before,parentNode,insertBefore,break,after,getNext,appendChild,inside,injectBefore,injectAfter,injectInside,adopt,removeChild,clone,contents,cloneNode,replaceWith,replaceChild,appendText,text,getTag,style,ActiveXObject,styleSheet,cssText,createTextNode,hasClass,className,addClass,removeClass,toggleClass,setStyle,value,opacity,setOpacity,parseFloat,setStyles,source,setAttribute,visibility,hidden,visible,filter,alpha,100,getStyle,proPerty,defaultView,getComputedStyle,getPropertyValue,currentStyle,color,backgroundColor,borderColor,addEvent,action,addEventListener,attachEvent,on,Unload,functions,removeEvent,removeEventListener,detachEvent,getBrother,what,Sibling,while,getPrevious,next,getFirst,firstChild,nextSibling,getLast,lastChild,previousSibling,setProperty,class,name,input,attributes,attribute,default,setProperties,setHTML,html,innerHTML,getProperty,getAttribute,tagName,getOffset,offset,do,offsetParent,getTop,top,getLeft,left,getValue,select,getElementsByTagName,option,selectedIndex,checked,checkbox,radio,password,textarea,hasClassName,addClassName,removeClassName,toggleClassName,method,getElementById,elements,vars,unload,removeFunction,els,sel,getElementsBySelector,Elements,E,selector,getElement,ES,getElements,filters,split,bits,param,tag,id,operator,filterById,filterByTagName,filterByClassName,filterByAttribute,getElementsByClassName,actions,evt,found,att,Window,disableImageCache,execCommand,BackgroundImageCache,getWidth,innerWidth,documentElement,clientWidth,getHeight,innerHeight,clientHeight,getScrollHeight,scrollHeight,getScrollWidth,scrollWidth,getScrollTop,scrollTop,pageYOffset,getScrollLeft,scrollLeft,pageXOffset,onDomReady,init,state,readyState,childNodes,all,navigator,taintEnabled,loaded,complete,script,_ie_ready_,write,defer,src,readystatechange,myInit,callee,done,load,DOMContentLoaded".split(",")));

//*** THE ACTUAL CODE **//
function applyBackground(template, $shape, $color){
	var wrap = $("wrapper");
	new FlashBackground(wrap,template, $shape, $color);
}
var FlashBackground = new Class({
	initialize:function(wrap,template, $shape, $color){
		if(this.cancelReplacement(wrap)) return;
		var bg = this.createBgAfter(wrap);
		this.convertToOverlay(wrap);
		this.applyFlashTo(bg,template, $shape, $color);
		this.fixFlashInIE();
		//this.clearOtherStuffUp();
	},
	convertToOverlay:function(wrap){
		wrap.setStyles({
			position: "absolute",
			background:"none"
		});
	},
	createBgAfter:function(wrap){
		var bg = new Element("DIV");
		bg.id="flash_bg";
		bg.injectBefore(wrap);
		var h = wrap.scrollHeight + 40;
		bg.setStyles({
			position:"absolute",
			width:"100%",
			height:h +  "px"
		});
		return bg;
	},
	applyFlashTo:function(bg,template, $shape, $color){
		var content_xml = "";
		if( $("heading") && FlashBackground.isInArray(template, replacing_heading_arr) ) content_xml = this.innerHTML( $("heading") );
		var $height = Math.min(1500, Window.getScrollHeight());
		var FO = { 
					movie:"/flash/background.swf", 
					width:"100%", 
					height:$height, 
					majorversion:"8",
					build:"22",
					flashvars:"&template="+template+"&content_xml=" + encodeURIComponent(content_xml) + "&shape=" + $shape + "&emcolor=" + $color,
					wmode:"transparent"
				};
		UFO.create(FO,bg.id);
	},
	fixFlashInIE:function(){
		objects = document.getElementsByTagName("object");
		for (var i = 0; i < objects.length; i++)
		{
			var o = objects[i];
			o.outerHTML = o.outerHTML;
		}
	},
	cancelReplacement:function(wrap){
		if(!FlashBackground.isSupportedBrowser(["Safari,Mac"])) return true;
		//if(wrap.innerHTML.match(/swf/)) return true;
		if(!UFO.hasFlashVersion(8,0)) return false;
		return false;
	},
	innerHTML:function (src_obj){
		var str_out='';
		var children=src_obj.childNodes;
		
		for (var i=children.length-1; i>=0; i--)
		{
			var c_node=children[i];
			
			if(c_node.nodeType==1) // element
			{
				attr_str = this.getNodeAttributes(c_node);
				str_out = 	'<' + c_node.tagName + attr_str + '>' + this.innerHTML(c_node) +  '</' + c_node.tagName + '>' + str_out;
			}else{ // 3 = text
				str_out = c_node.nodeValue + str_out;			
			}
		}
		return str_out;
	},
	getNodeAttributes:function($node){
		var allowed_tags = ["id", "src", "href", "class"];
		var res = "";
		var arr = $node.attributes ? $node.attributes : $node.getAttributes();
		for(var j=0; j<arr.length; j++){
			var attr_node = arr[j];
			if(FlashBackground.isInArray (attr_node.nodeName, allowed_tags)){
				res += " " + attr_node.nodeName + "='" + attr_node.nodeValue + "'";
			}
		}
		return res;
	}
});
FlashBackground.getUserAgent = function(){
	return navigator.userAgent;
}
FlashBackground.isSupportedBrowser = function( not_supported ){
	var ua = FlashBackground.getUserAgent(); 
	var r = true;
	for(var i=0; i<not_supported.length; i++){
		var s = not_supported[i];
		var a = s.split(",");
		var b = a[0];
		var os = a[1];
		if(ua.indexOf(b)>-1 && ua.indexOf(os)>-1) r = false;
	}
	return r;
}
FlashBackground.isInArray = function ($element, $array){
	for(var i=0; i<$array.length; i++){
		if($array[i] == $element) return true;
	}
	return false;
}

UFO.getFlashVersion();

var willBeReplaced = (FlashBackground.isSupportedBrowser(["Safari,Mac"]) && UFO.hasFlashVersion(8,0));
var replacing_heading_arr = ["t2", "t3", "t4", "t5"];

//alert("will be replaced? " + willBeReplaced);
function replaceBackground(){
	if(willBeReplaced) {
		UFO.createCSS("body", "background : url('/images/tile_flash.gif') transparent repeat-y;");
		UFO.createCSS("body", "background-color : #EBE6E8");
	}
	//$("page").setStyle("background", "url('/images/temp_flash_background.png') left top repeat-x");
}
function replacePageBackground(){
	if(willBeReplaced && $("page")) $("page").setStyle("background","none");
}
function replaceHeading($t){
	if(! FlashBackground.isInArray($t, replacing_heading_arr) ) return;
	if(willBeReplaced && $("heading") )  $("heading").setStyle("visibility","hidden");
}

function isFirefoxWin ()
{
	return (navigator.userAgent.indexOf("Firefox")>-1 && navigator.userAgent.indexOf("Windows")>-1);
}

function addOverlayButton($url, $x, $y, $w, $h) {
	if(!isFirefoxWin()) return;
	//alert("addOverlayButton: url:" + $url + " x:" + $x + " y:" + $y + " w:" + $w + " h:" + $h);
	
	var e = new Element("DIV");
	e.id="overlay_button";
	$("headerArea").appendChild(e);
	
	e.setStyles({
		//border:"1px solid blue",
		cursor:"pointer",
		position:"absolute",
		width:$w + "px",
		height:$h + "px",
		top:$y +"px",
		left:$x + "px"
	});

	e.onclick = function(){
		location = $url;
	}
}

function getStyle ( $e )
{
	return $e.style;
}