
	/**
	 * ProjectGames Main Javascript File
	 * V5.0
	 * (C) 2005 - 2012
	 */
	var PG = [ ];
	PG.$ = function(id)
	{
		var e = null;
		this.each(function(item)
		{
			if(e == null && item.id == id)
			{
				if(item.getElement() != null && item.getElement() != undefined)
					e = item;
				else
					item.destroy();
			}
		});
		return e;
	};
	PG.$$ = function(id)
	{
		var list = new Array();
		this.each(function(item)
		{
			if((item.id != undefined && item.id != null) && item.id == id)
			{
				if(item.getElement() != null && item.getElement() != undefined)
					list.push(item)
				else
					item.destroy();
			}
		});
		return list;
	};
	PG.$E = function(object)
	{
		var list = [ ];
		
		["pg:button", "pg:image", "pg:youtube"].each(function(tag)
		{
			$$(object.getElementsByTagName(tag)).each(function(item)
			{
				PG.each(function(e)
				{
					if(e.getElement() == undefined || e.getElement == null)
						e.destroy();
					else if(e.getElement() == item)
						list.push(e);
				});
			});
		});
		
		return list;
	};
	PG.Initialize = function(object)
	{
		var list = [ ];
		
		["pg:button", "pg:image", "pg:youtube"].each(function(tag)
		{
			$$(object.getElementsByTagName(tag)).each(function(item)
			{
				switch(tag)
				{
					/* PG:Button */
					case "pg:button":
						list.push(new PGButton(item));
						break;
						
					/* PG:Image */
					case "pg:image":
						list.push(new PGImage(item));
						break;
						
					/* PG:YouTube */
					case "pg:youtube":
						list.push(new PGYouTube(item));
						break;
				}
			});
		});
		return list;
	};
	PG.Add = function(item)
	{
		this.push(item);
	};
	PG.Remove = function(item)
	{
		for(var i = 0; i < this.length; i++)
			if(this[i] == item)
			{
				this.splice(i, 1);
				break;
			}
	};

	window.addEvent('domready', function()
	{	
		PG.Initialize(document.body);
	});
	String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); }
	String.prototype.toBase64 = function() { return Base64.Encode(this); }
	String.prototype.fromBase64 = function() { return Base64.Decode(this); }

	var Template =
	{
		'Load':function(path, callback)
		{		
			var remote = new Request(
			{
				url:'/Templates/' + path,
				onSuccess:function(html, xml)
				{
					callback(html);
				}
			});
			remote.urlEncoded = false;
			remote.setHeader("Content-Type", "text/html");
			remote.send();
		},
		'LoadInObject':function(path, obj, name)
		{
			Template.Load(path, function(html)
			{
				obj[name] = html;
			});
		}
	};
	
	/* Ajax */
	var Ajax =
	{
		'Request':function(json, callback)
		{
			var remote = new Request.JSON(
			{
				url:'/?app=ajax',
				onError:function(text, error)
				{
					if(callback != null)
						callback(null, text);
				},
				onSuccess:function(json, text)
				{
					if(callback != null)
						callback(json, text);
				}
			});
			remote.post({'json':json});
		},
		
		'RequestPost':function(post, callback)
		{
			var remote = new Request.JSON(
			{
				url:'/?app=ajax',
				onError:function(text, error)
				{
					if(callback != null)
						callback(null, text);
				},
				onSuccess:function(json, text)
				{
					if(callback != null)
						callback(json, text);
				}
			}).post(post);
		},
		
		'Address':function(url)
		{
			if(window.history != null && (typeof window.history.pushState == "function"))
			{
				window.history.pushState({}, "", url);
				return true;
			}

			window.location.href = url;
			return false;
		}
	};
	
	/**
	 * PG:Like
	 */
	var Like = 
	{
		'Yes':function(gameid, videoid)
		{
			var id = (gameid != null ? gameid : videoid);
			if(id == null) return;
		
			PG.$("button_like_" + id).disable();
			
			this.Process(gameid, videoid, 1);
			
			var count = $("likecount_" + id);
			count.set("html", parseInt(count.get("html")) + 1);
		},
		
		'No':function(gameid, videoid)
		{
			var id = (gameid != null ? gameid : videoid);
			if(id == null) return;
			
			PG.$("button_dislike_" + id).disable();
			
			this.Process(gameid, videoid, 0);
			
			var count = $("dislikecount_" + id);
			count.set("html", parseInt(count.get("html")) + 1);
		},
		
		'Process':function(gameid, videoid, state)
		{
			var id = (gameid != null ? gameid : (videoid != null ? videoid : null));
			Ajax.Request
			(
				{
					'module':'like',
					'cmd':(state == 1 ? "like" : "dislike"),
					
					'params':
					{
						'gameid':(gameid != null ? gameid : ''),
						'videoid':(videoid != null ? videoid : '')
					}
				},
				function(data, plaintext)
				{
				}
			);
		}
	};
	
	/**
	 * PG:Tooltip
	 */
	var Tooltip =
	{
		'Show':function(element, text)
		{
			if($$(".tooltip")[0] != null)
			{
				$$(".tooltip_text")[0].set("html", text);
				$$(".tooltip")[0].position
				(
					{
						relativeTo:element,
						offset:
						{
							x:0,
							y:30,
						}
					}
				);
				$$(".tooltip")[0].show();
				$$(".tooltip")[0].fade('hide');
				$$(".tooltip")[0].fade('in');
			}
		},
		
		'Hide':function(instant)
		{
			if($$(".tooltip")[0] != null)
				$$(".tooltip")[0].fade((instant ? 'hide' : 'out'));
		}
	};
	
	/**
	 * PG:Alert
	 */
	var Alert =
	{
		'Show':function(message)
		{
			alert(message);
		},
		
		'Confirm':function(message)
		{
			return confirm(message);
		},
		
		'Hide':function()
		{
		}
	};
	
	/**
	 * PG:Image
	 */
	var PGImage = new Class(
	{
		id: null,
		image: null,
		width: null,
		rel: null,
		url: null,
		imageurl: null,
		title: null,
		href:null,
		tooltip:null,
		
		initialize:function(image)
		{
			PG.Add(this);
		
			this.image = image;
			this.id = ((typeof image.get("id")) == "string" && image.get("id").length > 0 ? image.get("id") : null);
			this.href = ((typeof image.get("href")) == "string" && image.get("href").length > 0 ? image.get("href") : null);
			this.tooltip = ((typeof image.get("tooltip")) == "string" && image.get("tooltip").length > 0 ? image.get("tooltip") : null);
			this.title = ((typeof image.get("title")) == "string" && image.get("title").length > 0 ? image.get("title") : null);
			this.width = ((typeof image.get("width")) == "string" && image.get("width").length > 0 && image.get("width") != "0" ? image.get("width") : null);
			this.rel = ((typeof image.get("rel")) == "string" && image.get("rel").length > 0 ? image.get("rel") : null);
			this.align = ((typeof image.get("align")) == "string" && (image.get("align") == "left" || image.get("align") == "right") ? image.get("align") : null);
			
			if((typeof image.get("src")) != "string" || image.get("src").length == 0)
				return;
			
			var link = (new Element("a", { 'href':image.get("src") }));
			var path = link.pathname;
			path = path.replace("%3C", "<");
			path = path.replace("%3E", ">");
			path = (path.substr(0, 1) != "/" ? "/" + path : path);			
			
			var regex = new RegExp(/^\/\i\/([A-z0-9]+)(\/([<>0-9]+))?\/?$/);
			var matches = regex.exec(path);
			
			if(matches == null || matches.length == 0)
				return;		
			
			this.url = "http://" + link.hostname + "/i/" + matches[1] + "/" + (matches.length >= 4 && matches[3] != undefined ? matches[3] : "");
			this.imageurl = "http://" + link.hostname + "/i/" + matches[1] + "/";
			
			this.draw();
			this.tooltipEvent();
		},
		
		draw:function()
		{
			var link = (this.href == null ? (new Element("a", 
			{
				'href':this.url,
				'rel':'lightbox' + (this.rel != null ? '-' + this.rel : ''),
				'onclick':'return false;'
			})) : 
				(new Element("a", 
				{
					'href':this.href
				})));
			
			var img = new Element("img",
			{
				'src': (this.imageurl + '/' + (this.width != null ? this.width + '/' : '')),
				'border':'0'
			});
			
			if(this.align != null)
			{
				link.setStyle("float", this.align);
				link.setStyle("padding-" + (this.align == "left" ? "right" : "left"), "10px");
			}
			
			if(this.title != null)
				link.set("title", this.title);
			
			img.inject(link);
			link.inject(this.image);
			
			if(this.href == null)
				link.slimbox();
		},
		
		tooltipEvent:function()
		{
			if(this.tooltip == null)
				return;
			
			var tooltip = this.tooltip;
			this.image.addEvent("mouseover", function()
			{
				Tooltip.Show(this, tooltip);
			});
			this.image.addEvent("mouseout", function()
			{
				Tooltip.Hide();
			});
		},
		
		addEvent:function(name, event)
		{
			this.image.addEvent(name, event);
		},
		removeEvents:function(name)
		{
			this.image.removeEvents(name);
		},
		removeEvent:function(name, event)
		{
			this.image.removeEvent(name, event)
		},
		
		destroy:function()
		{
			PG.Remove(this);
			this.image.destroy();
			this.image = null;
		},
		
		getElement:function()
		{
			return this.image;
		}
	});
	
	/**
	 * PG:Button
	 */
	var PGButton = new Class(
	{
		id: null,
		button: null,
		enabled: false,
		visible: false,
		data: null,
		image: null,
		url: null,
		amount: 0,
		tooltip: null,
		color: null,
		href: null,
		
		initialize:function(button)
		{		
			PG.Add(this);
		
			this.button = button;
			this.id = ((typeof button.get("id")) == "string" && button.get("id").length > 0 ? button.get("id") : null);
			this.enabled = (button.get("enabled") == "false" ? false : true);
			this.visible = (button.get("visible") == "false" ? false : true);
			this.tooltip = ((typeof button.get("tooltip")) == "string" && button.get("tooltip").length > 0 ? button.get("tooltip") : null);
			this.data = ((typeof button.get("data")) == "string" && button.get("data").length > 0 ? button.get("data") : null);
			this.image = ((typeof button.get("image")) == "string" && button.get("image").length > 0 ? button.get("image") : null);
			this.color = ((typeof button.get("color")) == "string" && button.get("color").length > 0 ? button.get("color") : null);
			this.href = ((typeof button.get("href")) == "string" && button.get("href").length > 0 ? button.get("href") : null);
			this.data = 
			{
				text: this.data
			}
			if(this.color != null)
				this.data.color = this.color;
			this.url = (this.image != null ? this.image : ("/control/button/" + JSON.encode(this.data).toBase64()));
			
			var image = new Image();
			image.e = this;
			if((typeof image.addEvent) == "function")
				image.addEvent("load", function()
				{
					this.e.draw(this.width, (this.height / 3));
				});
			else
				image.onload = function()
				{
					this.e.draw(this.width, (this.height / 3));
				};
			image.src = this.url;
		},
		
		draw:function(width, height)
		{
			this.amount = height;
			
			var link = new Element("a", 
			{
				'styles':
				{
					'display':(this.visible ? 'inline' : 'none')
				}
			});
			var img = new Element("img",
			{
				'border':'0',
				'src':'/Graphics/Misc/transparent.png',
				'styles':
				{
					'width': width + "px",
					'height': height + "px",
					'background-image':"url('" + this.url + "')",
					'background-position': "0px -" + (!this.enabled ? (this.amount * 2) : 0) + "px",
					'background-repeat': "no-repeat"
				}
			});
			img.inject(link);
			link.inject(this.button);
			
			if(this.enabled)
				this.makeEvents();
			
			this.updateTooltipEvent();
		},
		
		makeEvents:function()
		{			
			var amount = this.amount;
			var atag = this.button.getElement("a");
			var imgtag = this.button.getElement("img");
			var href = (this.href != null ? this.href : "");
			
			if(href.substr(0, 11) == "javascript:")
				atag.set("href", "javascript:;");
			else
				atag.set("href", href);
			
			atag.addEvent("mouseover", function()
			{
				imgtag.setStyle("background-position", "0px -" + amount + "px");
			});
			atag.addEvent("mouseout", function()
			{
				imgtag.setStyle("background-position", "0px 0px");
			});
			
			if(href.substr(0, 11) == "javascript:")
				atag.addEvent("click", function()
				{
					eval(href);
				});
		},
		
		destroyEvents:function()
		{
			var atag = this.button.getElement("a");

			atag.removeProperty("href");
			atag.removeEvents("mouseover");
			atag.removeEvents("mouseout");
			atag.removeEvents("click");
		},
		
		show:function()
		{
			if(this.visible || !(this.visible = true))
				return;
			
			this.button.set("visible", "true");
			this.button.getElement("a").setStyle("display", "inline");
		},
		hide:function()
		{
			if(!this.visible || (this.visible = false))
				return;
			
			this.button.set("visible", "false");
			this.button.getElement("a").setStyle("display", "none");
			Tooltip.Hide();
		},
		
		enable:function()
		{
			if(this.enabled || !(this.enabled = true))
				return;
			
			this.button.set("enabled", "true");
			this.makeEvents();
			
			var imgtag = this.button.getElements("img")[0];
			imgtag.setStyle("background-position", "0px 0px");
		},
		disable:function()
		{
			if(!this.enabled || (this.enabled = false))
				return;
			
			this.button.set("enabled", "false");
			this.destroyEvents();
			
			Tooltip.Hide();
			
			var imgtag = this.button.getElements("img")[0];
			imgtag.setStyle("background-position", "0px -" + (this.amount * 2) + "px");
		},
		
		updateTooltipEvent:function()
		{
			if((typeof this.tooltip) == "string" && this.tooltip.length > 0)
			{
				var tooltip = this.tooltip;
				this.button.addEvent("mouseover", function()
				{
					Tooltip.Show(this, tooltip);
				});
				this.button.addEvent("mouseout", function()
				{
					Tooltip.Hide();
				});
			}
			else
			{
				this.button.removeEvents("mouseover");
				this.button.removeEvents("mouseout");
			}
		},
		
		setTooltip:function(text)
		{
			this.tooltip = text;
			this.button.set("tooltip", this.tooltip);
			this.updateTooltipEvent();
		},
		
		/*
		 * Events
		 */
		addEvent:function(name, event)
		{
			
		},
		removeEvent:function(name, event)
		{
		},
		
		destroy:function()
		{
			PG.Remove(this);
			this.button.destroy();
			this.button = null;
		},
		
		getElement:function()
		{
			return this.button;
		}
	});
	
	/**
	 * PG:YouTube
	 */
	var PGYouTube = new Class(
	{
		id: null,
		youtube: null,
		url: null,
		prefix: 'https://www.youtube.com/v/',
		suffix: '?version=3&feature=player_embedded',
		
		size: [560, 340],
		params:
		{
			movie: null,
			allowFullScreen: 'true',
			allowScriptAccess: 'always'
		},
		
		initialize:function(youtube)
		{
			PG.Add(this);
			
			this.youtube = youtube;
			this.id = this.youtube.get("id");
			
			this.parseUrl();
			this.params['movie'] = this.url;
			
			this.draw();
		},
		
		parseUrl:function()
		{
			// <pg:youtube url="http://youtu.be/craMd_kXjto"></pg:youtube>
			var videoid = null;
			var url = this.youtube.get("url");
			
			([
				new RegExp(/watch\?v\=([A-z0-9\-\_]+)/i),
				new RegExp(/\/v\/([A-z0-9\-\_]+)/i),
				new RegExp(/\/embed\/([A-z0-9\-\_]+)/i),
				new RegExp(/youtu\.be\/([A-z0-9\-\_]+)/i)
			]).each(function(rx)
			{
				var matches = null;
				if(videoid == null && (matches = rx.exec(url)) != null && matches.length > 1)
				{
					videoid = matches[1];
				}
			});
			this.url = this.prefix + videoid + this.suffix;
		},

		draw:function()
		{
			if(this.url == null)
				return;
			
			/* Object */
			var object = new Element("object",
			{
				styles:
				{
					width: this.size[0] + "px",
					height: this.size[1] + "px"
				}
			});
			
			/* Params */
			Object.each(this.params, function(pvalue, pname)
			{
				var param = new Element("param",
				{
					name: pname,
					value: pvalue
				});
				param.inject(object);
			});
			
			/* Embed */
			(new Element("embed",
			{
				src: this.url,
				type: 'application/x-shockwave-flash',
				allowfullscreen: 'true',
				allowScriptAccess: 'always',
				width: this.size[0],
				height: this.size[1]
			})).inject(object);
			
			/* add Object */
			object.inject(this.youtube);
		},
		
		destroy:function()
		{
			PG.Remove(this);
			this.youtube.destroy();
			this.youtube = null;
		},
		
		getElement:function()
		{
			return this.youtube;
		}
	});
	
	var Field = 
	{
		'SetActive':function(elements)
		{
			if(elements instanceof Array)
			{
				elements.each(function(item)
				{
					item.disabled = false;
				});
			}
			else
				elements.disabled = false;
		},
		'SetInactive':function(elements)
		{
			if(elements instanceof Array)
			{
				elements.each(function(item)
				{
					item.disabled = true;
				});
			}
			else
				elements.disabled = true;
		},
		
		'SetOkay':function(elements)
		{
			if(elements instanceof Array)
			{
				elements.each(function(item)
				{
					Field.SetInactive(item);
					item.setStyle("border", "solid 1px green");
				});
			}
			else
			{
				Field.SetInactive(elements);
				elements.setStyle("border", "solid 1px green");
			}
		},
		'SetError':function(elements)
		{
			if(elements instanceof Array)
			{
				elements.each(function(item)
				{
					Field.SetActive(item);
					item.setStyle("border", "solid 1px red");
				});
			}
			else
			{
				Field.SetActive(elements);
				elements.setStyle("border", "solid 1px red");
			}
		}
	}
	
	/**
	 * PGImageApi
	 */
	var PGImageApi = new Class(
	{
		background:null,
		callback:null,
		loaderSize:[220, 19],
		windowSize:[600, 180],
		
		initialize:function(callback)
		{
			this.callback = callback;
		},
		
		open:function()
		{
			var e = this;
			/* Background */
			this.background = new Element("div",
			{
				'styles':
				{
					'position': 'fixed',
					'background-color': 'rgba(0, 0, 0, 0.5)',
					'top': '0px',
					'left': '0px',
					'width': '100%',
					'height': '100%',
					'z-index': '9000',
					
					'opacity':'0.0'
				},
				
				'events':
				{
					'click':function()
					{
						e.close();
					}
				}
			});
			
			/* Window */
			var window = new Element("div",
			{
				'styles':
				{
					'position':'fixed',
					'width': this.windowSize[0] + 'px',
					'height': this.windowSize[1] + 'px',
					'top':'50%',
					'left':'50%',
					
					'margin-left': '-' + (this.windowSize[0] / 2) + 'px',
					'margin-top': '-' + (this.windowSize[1] / 2) + 'px',
					
					'border':'solid 1px #333',
					'background-color':'#e6e6e6'
				}
			});
			window.inject(this.background);
			
			/* Loader */
			(new Element("img",
			{
				'src':'/Graphics/Misc/loader_balken.gif',
				'styles':
				{
					'position':'absolute',
					'width': this.loaderSize[0] + 'px',
					'height': this.loaderSize[1] + 'px',
					'top':'50%',
					'left':'50%',
					
					'margin-left': '-' + (this.loaderSize[0] / 2) + 'px',
					'margin-top': '-' + (this.loaderSize[1] / 2) + 'px',
				}
			})).inject(window);
			
			/* iFrame */
			(new Element("iframe",
			{
				'src':'/i/api/',
				'scrolling':'no',
				'frameborder':0,
				'name':'imageapi_frame',
				
				'styles':
				{
					'width':'100%',
					'height':'100%',
					'display':'none',
				},
				
				'events':
				{
					'load':function()
					{
						this.setStyle("display", "block");
						window.getElement("img").destroy();
						
						var content = (this.contentWindow || this.contentDocument);
						
						content.ImageShortApi.Register(function(url)
						{
							e.close();
							
							if(e.callback != null)
								e.callback(url);
						});
					}
				}
			})).inject(window);
			
			/* Body */
			this.background.inject($$("body")[0]);
			
			/* Effect */
			(new Fx.Tween(this.background,
            {
				duration: 400,
            })).start("opacity", "0.0", "1.0");
		},
		
		close:function()
		{
			var window = this.background;
			(new Fx.Tween(window,
            {
				duration: 400,
				onComplete:function(event)
				{
					window.destroy();
				}
            })).start("opacity", "1.0", "0.0");
		}
	});
	
/* File: Slimbox.js */
var Slimbox=(function(){var F=window,n=Browser.ie6,u,g,G=-1,o,w,E,v,y,M,s,m={},t=new Image(),K=new Image(),I,a,h,q,J,e,H,c,A,L,x,i,d,C;F.addEvent("domready",function(){$(document.body).adopt($$(I=new Element("div#lbOverlay",{events:{click:D}}),a=new Element("div#lbCenter"),H=new Element("div#lbBottomContainer")).setStyle("display","none"));h=new Element("div#lbImage").inject(a).adopt(q=new Element("div",{styles:{position:"relative"}}).adopt(J=new Element("a#lbPrevLink[href=#]",{events:{click:B}}),e=new Element("a#lbNextLink[href=#]",{events:{click:f}})));c=new Element("div#lbBottom").inject(H).adopt(new Element("a#lbCloseLink[href=#]",{events:{click:D}}),A=new Element("div#lbCaption"),L=new Element("div#lbNumber"),new Element("div",{styles:{clear:"both"}}))});function z(){var N=F.getScroll(),O=F.getSize();$$(a,H).setStyle("left",N.x+(O.x/2));if(v){I.setStyles({left:N.x,top:N.y,width:O.x,height:O.y})}}function l(N){["object",n?"select":"embed"].forEach(function(P){Array.forEach(document.getElementsByTagName(P),function(Q){if(N){Q._slimbox=Q.style.visibility}Q.style.visibility=N?"hidden":Q._slimbox})});I.style.display=N?"":"none";var O=N?"addEvent":"removeEvent";F[O]("scroll",z)[O]("resize",z);document[O]("keydown",p)}function p(O){var N=O.code;return u.closeKeys.contains(N)?D():u.nextKeys.contains(N)?f():u.previousKeys.contains(N)?B():false}function B(){return b(w)}function f(){return b(E)}function b(N){if(N>=0){G=N;o=g[N][0];w=(G||(u.loop?g.length:0))-1;E=((G+1)%g.length)||(u.loop?0:-1);r();a.className="lbLoading";m=new Image();m.onload=k;m.src=o}return false}function k(){a.className="";d.set(0);h.setStyles({backgroundImage:"url("+o+")",display:""});q.setStyle("width",m.width);$$(q,J,e).setStyle("height",m.height);A.set("html",g[G][1]||"");L.set("html",(((g.length>1)&&u.counterText)||"").replace(/{x}/,G+1).replace(/{y}/,g.length));if(w>=0){t.src=g[w][0]}if(E>=0){K.src=g[E][0]}M=h.offsetWidth;s=h.offsetHeight;var P=Math.max(0,y-(s/2)),N=0,O;if(a.offsetHeight!=s){N=i.start({height:s,top:P})}if(a.offsetWidth!=M){N=i.start({width:M,marginLeft:-M/2})}O=function(){H.setStyles({width:M,top:P+s,marginLeft:-M/2,visibility:"hidden",display:""});d.start(1)};if(N){i.chain(O)}else{O()}}function j(){if(w>=0){J.style.display=""}if(E>=0){e.style.display=""}C.set(-c.offsetHeight).start(0);H.style.visibility=""}function r(){m.onload=null;m.src=t.src=K.src=o;i.cancel();d.cancel();C.cancel();$$(J,e,h,H).setStyle("display","none")}function D(){if(G>=0){r();G=w=E=-1;a.style.display="none";x.cancel().chain(l).start(0)}return false}Element.implement({slimbox:function(N,O){$$(this).slimbox(N,O);return this}});Elements.implement({slimbox:function(N,Q,P){Q=Q||function(R){return[R.href,R.title]};P=P||function(){return true};var O=this;O.removeEvents("click").addEvent("click",function(){var R=O.filter(P,this);return Slimbox.open(R.map(Q),R.indexOf(this),N)});return O}});return{open:function(P,O,N){u=Object.append({loop:false,overlayOpacity:0.8,overlayFadeDuration:400,resizeDuration:400,resizeTransition:false,initialWidth:250,initialHeight:250,imageFadeDuration:400,captionAnimationDuration:400,counterText:"Image {x} of {y}",closeKeys:[27,88,67],previousKeys:[37,80],nextKeys:[39,78]},N||{});x=new Fx.Tween(I,{property:"opacity",duration:u.overlayFadeDuration});i=new Fx.Morph(a,Object.append({duration:u.resizeDuration,link:"chain"},u.resizeTransition?{transition:u.resizeTransition}:{}));d=new Fx.Tween(h,{property:"opacity",duration:u.imageFadeDuration,onComplete:j});C=new Fx.Tween(c,{property:"margin-top",duration:u.captionAnimationDuration});if(typeof P=="string"){P=[[P,O]];O=0}y=F.getScrollTop()+(F.getHeight()/2);M=u.initialWidth;s=u.initialHeight;a.setStyles({top:Math.max(0,y-(s/2)),width:M,height:s,marginLeft:-M/2,display:""});v=n||(I.currentStyle&&(I.currentStyle.position!="fixed"));if(v){I.style.position="absolute"}x.set(0).start(u.overlayOpacity);z();l(1);g=P;u.loop=u.loop&&(g.length>1);return b(O)}}})();Slimbox.scanPage = function() {$$("a[rel^=lightbox]").slimbox({ }, null, function(el) {return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));});};if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) {window.addEvent("domready", Slimbox.scanPage);}

/* File: Base64.js */
var Base64 = { _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", 'Encode' : function (input) {var output = "";var chr1, chr2, chr3, enc1, enc2, enc3, enc4;var i = 0; input = Base64._utf8_encode(input); while (i < input.length) { chr1 = input.charCodeAt(i++);chr2 = input.charCodeAt(i++);chr3 = input.charCodeAt(i++); enc1 = chr1 >> 2;enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);enc4 = chr3 & 63; if (isNaN(chr2)) {enc3 = enc4 = 64;} else if (isNaN(chr3)) {enc4 = 64;} output = output +this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4); } output = output.replace(/\//g, "_");output = output.replace(/\+/g, "-");output = output.replace(/\=/g, "");return output;}, 'Decode' : function (input) {var output = "";var chr1, chr2, chr3;var enc1, enc2, enc3, enc4;var i = 0; input = input.replace(/\_/g, "/");input = input.replace(/\-/g, "+");input = Base64._strpad(input, '=', (4 - input.length % 4) % 4);input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); while (i < input.length) { enc1 = this._keyStr.indexOf(input.charAt(i++));enc2 = this._keyStr.indexOf(input.charAt(i++));enc3 = this._keyStr.indexOf(input.charAt(i++));enc4 = this._keyStr.indexOf(input.charAt(i++)); chr1 = (enc1 << 2) | (enc2 >> 4);chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);chr3 = ((enc3 & 3) << 6) | enc4; output = output + String.fromCharCode(chr1); if (enc3 != 64) {output = output + String.fromCharCode(chr2);}if (enc4 != 64) {output = output + String.fromCharCode(chr3);} } output = Base64._utf8_decode(output); return output; },_strpad : function(p, char, count){var pad = "";for(var i = 0; i < count; i++)pad += char;return p + pad;}, _utf8_encode : function (string) {string = string.replace(/\r\n/g,"\n");var utftext = ""; for (var n = 0; n < string.length; n++) { var c = string.charCodeAt(n); if (c < 128) {utftext += String.fromCharCode(c);}else if((c > 127) && (c < 2048)) {utftext += String.fromCharCode((c >> 6) | 192);utftext += String.fromCharCode((c & 63) | 128);}else {utftext += String.fromCharCode((c >> 12) | 224);utftext += String.fromCharCode(((c >> 6) & 63) | 128);utftext += String.fromCharCode((c & 63) | 128);} } return utftext;}, _utf8_decode : function (utftext) {var string = "";var i = 0;var c = c1 = c2 = 0; while ( i < utftext.length ) { c = utftext.charCodeAt(i); if (c < 128) {string += String.fromCharCode(c);i++;}else if((c > 191) && (c < 224)) {c2 = utftext.charCodeAt(i+1);string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));i += 2;}else {c2 = utftext.charCodeAt(i+1);c3 = utftext.charCodeAt(i+2);string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));i += 3;} } return string;} }


	
	
