<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">if (typeof Effect == "undefined") {
	throw ("lightwindow.js requires including script.aculo.us' effects.js library!")
}
try {
	document.execCommand("BackgroundImageCache", false, true)
} catch (e) {
}
var lightwindow = Class.create();
lightwindow.prototype = {
	element : null,
	contentToFetch : null,
	windowActive : false,
	dataEffects : [],
	dimensions : {
		cruft : null,
		container : null,
		viewport : {
			height : null,
			width : null,
			offsetTop : null,
			offsetLeft : null
		}
	},
	pagePosition : {
		x : 0,
		y : 0
	},
	pageDimensions : {
		width : null,
		height : null
	},
	preloadImage : [],
	preloadedImage : [],
	galleries : [],
	resizeTo : {
		height : null,
		heightPercent : null,
		width : null,
		widthPercent : null,
		fixedTop : null,
		fixedLeft : null
	},
	scrollbarOffset : 18,
	navigationObservers : {
		previous : null,
		next : null
	},
	containerChange : {
		height : 0,
		width : 0
	},
	activeGallery : false,
	galleryLocation : {
		current : 0,
		total : 0
	},
	initialize : function(a) {
		this.options = Object
				.extend(
						{
							resizeSpeed : 8,
							contentOffset : {
								height : 20,
								width : 20
							},
							dimensions : {
								image : {
									height : 250,
									width : 250
								},
								page : {
									height : 250,
									width : 250
								},
								inline : {
									height : 250,
									width : 250
								},
								media : {
									height : 250,
									width : 250
								},
								external : {
									height : 250,
									width : 250
								},
								titleHeight : 25
							},
							classNames : {
								standard : "lightwindow",
								action : "lightwindow_action"
							},
							fileTypes : {
								page : [ "asp", "aspx", "cgi", "cfm", "htm",
										"html", "pl", "php4", "php3", "php",
										"php5", "phtml", "rhtml", "shtml",
										"txt", "vbs", "rb" ],
								media : [ "aif", "aiff", "asf", "avi", "divx",
										"m1v", "m2a", "m2v", "m3u", "mid",
										"midi", "mov", "moov", "movie", "mp2",
										"mp3", "mpa", "mpa", "mpe", "mpeg",
										"mpg", "mpg", "mpga", "pps", "qt",
										"rm", "ram", "swf", "viv", "vivo",
										"wav" ],
								image : [ "bmp", "gif", "jpg", "png", "tiff" ]
							},
							mimeTypes : {
								avi : "video/avi",
								aif : "audio/aiff",
								aiff : "audio/aiff",
								gif : "image/gif",
								bmp : "image/bmp",
								jpeg : "image/jpeg",
								m1v : "video/mpeg",
								m2a : "audio/mpeg",
								m2v : "video/mpeg",
								m3u : "audio/x-mpequrl",
								mid : "audio/x-midi",
								midi : "audio/x-midi",
								mjpg : "video/x-motion-jpeg",
								moov : "video/quicktime",
								mov : "video/quicktime",
								movie : "video/x-sgi-movie",
								mp2 : "audio/mpeg",
								mp3 : "audio/mpeg3",
								mpa : "audio/mpeg",
								mpa : "video/mpeg",
								mpe : "video/mpeg",
								mpeg : "video/mpeg",
								mpg : "audio/mpeg",
								mpg : "video/mpeg",
								mpga : "audio/mpeg",
								pdf : "application/pdf",
								png : "image/png",
								pps : "application/mspowerpoint",
								qt : "video/quicktime",
								ram : "audio/x-pn-realaudio-plugin",
								rm : "application/vnd.rn-realmedia",
								swf : "application/x-shockwave-flash",
								tiff : "image/tiff",
								viv : "video/vivo",
								vivo : "video/vivo",
								wav : "audio/wav",
								wmv : "application/x-mplayer2"
							},
							classids : {
								mov : "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B",
								swf : "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
								wmv : "clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"
							},
							codebases : {
								mov : "http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0",
								swf : "http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0",
								wmv : "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"
							},
							viewportPadding : 10,
							EOLASFix : "swf,wmv,fla,flv",
							overlay : {
								opacity : 0.7,
								image : "images/black.png",
								presetImage : "images/black-70.png"
							},
							skin : {
								main : '&lt;div id="lightwindow_container" &gt;&lt;div id="lightwindow_title_bar" &gt;&lt;div id="lightwindow_title_bar_inner" &gt;&lt;span id="lightwindow_title_bar_title"&gt;&lt;/span&gt;&lt;a id="lightwindow_title_bar_close_link" &gt;close&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div id="lightwindow_stage" &gt;&lt;div id="lightwindow_contents" &gt;&lt;/div&gt;&lt;div id="lightwindow_navigation" &gt;&lt;a href="#" id="lightwindow_previous" &gt;&lt;span id="lightwindow_previous_title"&gt;&lt;/span&gt;&lt;/a&gt;&lt;a href="#" id="lightwindow_next" &gt;&lt;span id="lightwindow_next_title"&gt;&lt;/span&gt;&lt;/a&gt;&lt;iframe name="lightwindow_navigation_shim" id="lightwindow_navigation_shim" src="javascript:false;" frameBorder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div id="lightwindow_galleries"&gt;&lt;div id="lightwindow_galleries_tab_container" &gt;&lt;a href="#" id="lightwindow_galleries_tab" &gt;&lt;span id="lightwindow_galleries_tab_span" class="up" &gt;Galleries&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div id="lightwindow_galleries_list" &gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div id="lightwindow_data_slide" &gt;&lt;div id="lightwindow_data_slide_inner" &gt;&lt;div id="lightwindow_data_details" &gt;&lt;div id="lightwindow_data_gallery_container" &gt;&lt;span id="lightwindow_data_gallery_current"&gt;&lt;/span&gt; of &lt;span id="lightwindow_data_gallery_total"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div id="lightwindow_data_author_container" &gt;by &lt;span id="lightwindow_data_author"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div id="lightwindow_data_caption" &gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;',
								loading : '&lt;div id="lightwindow_loading" &gt;&lt;img src="images/ajax-loading.gif" alt="loading" /&gt;&lt;span&gt;Loading or &lt;a href="javascript: myLightWindow.deactivate();"&gt;Cancel&lt;/a&gt;&lt;/span&gt;&lt;iframe name="lightwindow_loading_shim" id="lightwindow_loading_shim" src="javascript:false;" frameBorder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/div&gt;',
								iframe : '&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;body&gt;{body_replace}&lt;/body&gt;&lt;/html&gt;',
								gallery : {
									top : '&lt;div class="lightwindow_galleries_list"&gt;&lt;h1&gt;{gallery_title_replace}&lt;/h1&gt;&lt;ul&gt;',
									middle : "&lt;li&gt;{gallery_link_replace}&lt;/li&gt;",
									bottom : "&lt;/ul&gt;&lt;/div&gt;"
								}
							},
							formMethod : "get",
							hideFlash : false,
							hideGalleryTab : false,
							showTitleBar : true,
							animationHandler : false,
							navigationHandler : false,
							transitionHandler : false,
							finalAnimationHandler : false,
							formHandler : false,
							galleryAnimationHandler : false,
							showGalleryCount : true
						}, a || {});
		this.duration = ((11 - this.options.resizeSpeed) * 0.15);
		this._setupLinks();
		this._getScroll();
		this._getPageDimensions();
		this._browserDimensions();
		this._addLightWindowMarkup(false);
		this._setupDimensions();
		this.buildGalleryList()
	},
	activate : function(b, a) {
		this._clearWindowContents(true);
		this._addLoadingWindowMarkup();
		this._setupWindowElements(a);
		this._getScroll();
		this._browserDimensions();
		this._setupDimensions();
		this._toggleTroubleElements("hidden", false);
		this._displayLightWindow("block", "hidden");
		this._setStatus(true);
		this._monitorKeyboard(true);
		this._prepareIE(true);
		this._loadWindow()
	},
	deactivate : function() {
		this.windowActive = false;
		this.activeGallery = false;
		if (!this.options.hideGalleryTab) {
			this._handleGalleryAnimation(false)
		}
		this.animating = false;
		this.element = null;
		this._displayLightWindow("none", "visible");
		this._clearWindowContents(false);
		var a = Effect.Queues.get("lightwindowAnimation").each(function(b) {
			b.cancel()
		});
		this._prepareIE(false);
		this._setupDimensions();
		this._toggleTroubleElements("visible", false);
		this._monitorKeyboard(false)
	},
	createWindow : function(b, a) {
		this._processLink($(b))
	},
	activateWindow : function(a) {
		this.element = Object.extend( {
			href : null,
			title : null,
			author : null,
			caption : null,
			rel : null,
			top : null,
			left : null,
			type : null,
			showImages : null,
			height : null,
			width : null,
			loadingAnimation : null,
			iframeEmbed : null,
			form : null
		}, a || {});
		this.contentToFetch = this.element.href;
		this.windowType = this.element.type ? this.element.type : this
				._fileType(this.element.href);
		this._clearWindowContents(true);
		this._addLoadingWindowMarkup();
		this._getScroll();
		this._browserDimensions();
		this._setupDimensions();
		this._toggleTroubleElements("hidden", false);
		this._displayLightWindow("block", "hidden");
		this._setStatus(true);
		this._monitorKeyboard(true);
		this._prepareIE(true);
		this._loadWindow()
	},
	submitForm : function(a) {
		if (this.options.formHandler) {
			this.options.formHandler(a)
		} else {
			this._defaultFormHandler(a)
		}
	},
	openWindow : function(a) {
		var a = $(a);
		this.windowActive = true;
		this._clearWindowContents(true);
		this._addLoadingWindowMarkup();
		this._setupWindowElements(a);
		this._setStatus(true);
		this._handleTransition()
	},
	navigateWindow : function(a) {
		this._handleNavigation(false);
		if (a == "previous") {
			this.openWindow(this.navigationObservers.previous)
		} else {
			if (a == "next") {
				this.openWindow(this.navigationObservers.next)
			}
		}
	},
	buildGalleryList : function() {
		var a = "";
		var b;
		for (i in this.galleries) {
			if (typeof this.galleries[i] == "object") {
				a += (this.options.skin.gallery.top).replace(
						"{gallery_title_replace}", unescape(i));
				for (j in this.galleries[i]) {
					if (typeof this.galleries[i][j] == "object") {
						b = '&lt;a href="#" id="lightwindow_gallery_' + i + "_"
								+ j + '" &gt;' + unescape(j) + "&lt;/a&gt;";
						a += (this.options.skin.gallery.middle).replace(
								"{gallery_link_replace}", b)
					}
				}
				a += this.options.skin.gallery.bottom
			}
		}
		new Insertion.Top("lightwindow_galleries_list", a);
		for (i in this.galleries) {
			if (typeof this.galleries[i] == "object") {
				for (j in this.galleries[i]) {
					if (typeof this.galleries[i][j] == "object") {
						Event.observe($("lightwindow_gallery_" + i + "_" + j),
								"click", this.openWindow.bind(this,
										this.galleries[i][j][0]), false);
						$("lightwindow_gallery_" + i + "_" + j).onclick = function() {
							return false
						}
					}
				}
			}
		}
	},
	_setupLinks : function() {
		var a = $$("." + this.options.classNames.standard);
		a.each(function(b) {
			this._processLink(b)
		}.bind(this))
	},
	_processLink : function(c) {
		if ((this._fileType(c.getAttribute("href")) == "image" || this
				._fileType(c.getAttribute("href")) == "media")) {
			if (gallery = this._getGalleryInfo(c.rel)) {
				if (!this.galleries[gallery[0]]) {
					this.galleries[gallery[0]] = new Array()
				}
				if (!this.galleries[gallery[0]][gallery[1]]) {
					this.galleries[gallery[0]][gallery[1]] = new Array()
				}
				this.galleries[gallery[0]][gallery[1]].push(c)
			}
		}
		var b = c.getAttribute("href");
		if (b.indexOf("?") &gt; -1) {
			b = b.substring(0, b.indexOf("?"))
		}
		var a = b.substring(b.indexOf("#") + 1);
		if ($(a)) {
			$(a).setStyle( {
				display : "none"
			})
		}
		Event.observe(c, "click", this.activate.bindAsEventListener(this, c),
				false);
		c.onclick = function() {
			return false
		}
	},
	_setupActions : function() {
		var a = $$("#lightwindow_container ." + this.options.classNames.action);
		a.each(function(b) {
			Event.observe(b, "click", this[b.getAttribute("rel")]
					.bindAsEventListener(this, b), false);
			b.onclick = function() {
				return false
			}
		}.bind(this))
	},
	_addLightWindowMarkup : function(b) {
		var c = Element.extend(document.createElement("div"));
		c.setAttribute("id", "lightwindow_overlay");
		if (Prototype.Browser.Gecko) {
			c.setStyle( {
				backgroundImage : "url(" + this.options.overlay.presetImage
						+ ")",
				backgroundRepeat : "repeat",
				height : this.pageDimensions.height + "px"
			})
		} else {
			c.setStyle( {
				opacity : this.options.overlay.opacity,
				backgroundImage : "url(" + this.options.overlay.image + ")",
				backgroundRepeat : "repeat",
				height : this.pageDimensions.height + "px"
			})
		}
		var d = document.createElement("div");
		d.setAttribute("id", "lightwindow");
		d.innerHTML = this.options.skin.main;
		var a = document.getElementsByTagName("body")[0];
		a.appendChild(c);
		a.appendChild(d);
		if ($("lightwindow_title_bar_close_link")) {
			Event.observe("lightwindow_title_bar_close_link", "click",
					this.deactivate.bindAsEventListener(this));
			$("lightwindow_title_bar_close_link").onclick = function() {
				return false
			}
		}
		Event.observe($("lightwindow_previous"), "click", this.navigateWindow
				.bind(this, "previous"), false);
		$("lightwindow_previous").onclick = function() {
			return false
		};
		Event.observe($("lightwindow_next"), "click", this.navigateWindow.bind(
				this, "next"), false);
		$("lightwindow_next").onclick = function() {
			return false
		};
		if (!this.options.hideGalleryTab) {
			Event.observe($("lightwindow_galleries_tab"), "click",
					this._handleGalleryAnimation.bind(this, true), false);
			$("lightwindow_galleries_tab").onclick = function() {
				return false
			}
		}
		if (Prototype.Browser.IE) {
			Event.observe(document, "mousewheel", this._stopScrolling
					.bindAsEventListener(this), false)
		} else {
			Event.observe(window, "DOMMouseScroll", this._stopScrolling
					.bindAsEventListener(this), false)
		}
		Event.observe(c, "click", this.deactivate.bindAsEventListener(this),
				false);
		c.onclick = function() {
			return false
		}
	},
	_addLoadingWindowMarkup : function() {
		$("lightwindow_contents").innerHTML += this.options.skin.loading
	},
	_setupWindowElements : function(a) {
		this.element = a;
		this.element.title = null ? "" : a.getAttribute("title");
		this.element.author = null ? "" : a.getAttribute("author");
		this.element.caption = null ? "" : a.getAttribute("caption");
		this.element.rel = null ? "" : a.getAttribute("rel");
		this.element.params = null ? "" : a.getAttribute("params");
		this.contentToFetch = this.element.href;
		this.windowType = this._getParameter("lightwindow_type") ? this
				._getParameter("lightwindow_type") : this
				._fileType(this.contentToFetch)
	},
	_clearWindowContents : function(a) {
		if ($("lightwindow_iframe")) {
			Element.remove($("lightwindow_iframe"))
		}
		if ($("lightwindow_media_primary")) {
			try {
				$("lightwindow_media_primary").Stop()
			} catch (b) {
			}
			Element.remove($("lightwindow_media_primary"))
		}
		if ($("lightwindow_media_secondary")) {
			try {
				$("lightwindow_media_secondary").Stop()
			} catch (b) {
			}
			Element.remove($("lightwindow_media_secondary"))
		}
		this.activeGallery = false;
		this._handleNavigation(this.activeGallery);
		if (a) {
			$("lightwindow_contents").innerHTML = "";
			$("lightwindow_contents").setStyle( {
				overflow : "hidden"
			});
			if (!this.windowActive) {
				$("lightwindow_data_slide_inner").setStyle( {
					display : "none"
				});
				$("lightwindow_title_bar_title").innerHTML = ""
			}
			$("lightwindow_data_slide").setStyle( {
				height : "auto"
			})
		}
		this.resizeTo.height = null;
		this.resizeTo.width = null
	},
	_setStatus : function(a) {
		this.animating = a;
		if (a) {
			Element.show("lightwindow_loading")
		}
		if (!(/MSIE 6./i.test(navigator.userAgent))) {
			this._fixedWindow(a)
		}
	},
	_fixedWindow : function(a) {
		if (a) {
			if (this.windowActive) {
				this._getScroll();
				$("lightwindow")
						.setStyle(
								{
									position : "absolute",
									top : parseFloat($("lightwindow").getStyle(
											"top"))
											+ this.pagePosition.y + "px",
									left : parseFloat($("lightwindow")
											.getStyle("left"))
											+ this.pagePosition.x + "px"
								})
			} else {
				$("lightwindow").setStyle( {
					position : "absolute"
				})
			}
		} else {
			if (this.windowActive) {
				this._getScroll();
				$("lightwindow")
						.setStyle(
								{
									position : "fixed",
									top : parseFloat($("lightwindow").getStyle(
											"top"))
											- this.pagePosition.y + "px",
									left : parseFloat($("lightwindow")
											.getStyle("left"))
											- this.pagePosition.x + "px"
								})
			} else {
				if ($("lightwindow_iframe")) {
					this._browserDimensions()
				}
				$("lightwindow")
						.setStyle(
								{
									position : "fixed",
									top : (parseFloat(this
											._getParameter("lightwindow_top")) ? parseFloat(this
											._getParameter("lightwindow_top"))
											+ "px"
											: this.dimensions.viewport.height
													/ 2 + "px"),
									left : (parseFloat(this
											._getParameter("lightwindow_left")) ? parseFloat(this
											._getParameter("lightwindow_left"))
											+ "px"
											: this.dimensions.viewport.width
													/ 2 + "px")
								})
			}
		}
	},
	_prepareIE : function(c) {
		if (Prototype.Browser.IE) {
			var b, f, d;
			if (c) {
				var b = "100%"
			} else {
				var b = "auto"
			}
			var a = document.getElementsByTagName("body")[0];
			var g = document.getElementsByTagName("html")[0];
			g.style.height = a.style.height = b
		}
	},
	_stopScrolling : function(a) {
		if (this.animating) {
			if (a.preventDefault) {
				a.preventDefault()
			}
			a.returnValue = false
		}
	},
	_getScroll : function() {
		if (typeof (window.pageYOffset) == "number") {
			this.pagePosition.x = window.pageXOffset;
			this.pagePosition.y = window.pageYOffset
		} else {
			if (document.body
					&amp;&amp; (document.body.scrollLeft || document.body.scrollTop)) {
				this.pagePosition.x = document.body.scrollLeft;
				this.pagePosition.y = document.body.scrollTop
			} else {
				if (document.documentElement) {
					this.pagePosition.x = document.documentElement.scrollLeft;
					this.pagePosition.y = document.documentElement.scrollTop
				}
			}
		}
	},
	_setScroll : function(a, b) {
		document.documentElement.scrollLeft = a;
		document.documentElement.scrollTop = b
	},
	_toggleTroubleElements : function(a, d) {
		if (d) {
			var c = $("lightwindow_contents").getElementsByTagName("select")
		} else {
			var c = document.getElementsByTagName("select")
		}
		for ( var b = 0; b &lt; c.length; b++) {
			c[b].style.visibility = a
		}
		if (!d) {
			if (this.options.hideFlash) {
				var g = document.getElementsByTagName("object");
				for (b = 0; b != g.length; b++) {
					g[b].style.visibility = a
				}
				var f = document.getElementsByTagName("embed");
				for (b = 0; b != f.length; b++) {
					f[b].style.visibility = a
				}
			}
			var h = document.getElementsByTagName("iframe");
			for (b = 0; b != h.length; b++) {
				h[b].style.visibility = a
			}
		}
	},
	_getPageDimensions : function() {
		var c, a;
		if (window.innerHeight &amp;&amp; window.scrollMaxY) {
			c = document.body.scrollWidth;
			a = window.innerHeight + window.scrollMaxY
		} else {
			if (document.body.scrollHeight &gt; document.body.offsetHeight) {
				c = document.body.scrollWidth;
				a = document.body.scrollHeight
			} else {
				c = document.body.offsetWidth;
				a = document.body.offsetHeight
			}
		}
		var b, d;
		if (self.innerHeight) {
			b = self.innerWidth;
			d = self.innerHeight
		} else {
			if (document.documentElement
					&amp;&amp; document.documentElement.clientHeight) {
				b = document.documentElement.clientWidth;
				d = document.documentElement.clientHeight
			} else {
				if (document.body) {
					b = document.body.clientWidth;
					d = document.body.clientHeight
				}
			}
		}
		if (a &lt; d) {
			this.pageDimensions.height = d
		} else {
			this.pageDimensions.height = a
		}
		if (c &lt; b) {
			this.pageDimensions.width = b
		} else {
			this.pageDimensions.width = c
		}
	},
	_displayLightWindow : function(b, a) {
		$("lightwindow_overlay").style.display = $("lightwindow").style.display = $("lightwindow_container").style.display = b;
		$("lightwindow_overlay").style.visibility = $("lightwindow").style.visibility = $("lightwindow_container").style.visibility = a
	},
	_setupDimensions : function() {
		var c, d;
		switch (this.windowType) {
		case "page":
			c = this.options.dimensions.page.height;
			d = this.options.dimensions.page.width;
			break;
		case "image":
			c = this.options.dimensions.image.height;
			d = this.options.dimensions.image.width;
			break;
		case "media":
			c = this.options.dimensions.media.height;
			d = this.options.dimensions.media.width;
			break;
		case "external":
			c = this.options.dimensions.external.height;
			d = this.options.dimensions.external.width;
			break;
		case "inline":
			c = this.options.dimensions.inline.height;
			d = this.options.dimensions.inline.width;
			break;
		default:
			c = this.options.dimensions.page.height;
			d = this.options.dimensions.page.width;
			break
		}
		var a = this._getParameter("lightwindow_top") ? parseFloat(this
				._getParameter("lightwindow_top"))
				+ this.pagePosition.y : this.dimensions.viewport.height / 2
				+ this.pagePosition.y;
		var b = this._getParameter("lightwindow_left") ? parseFloat(this
				._getParameter("lightwindow_left"))
				+ this.pagePosition.x : this.dimensions.viewport.width / 2
				+ this.pagePosition.x;
		$("lightwindow").setStyle( {
			top : a + "px",
			left : b + "px"
		});
		$("lightwindow_container").setStyle( {
			height : c + "px",
			width : d + "px",
			left : -(d / 2) + "px",
			top : -(c / 2) + "px"
		});
		$("lightwindow_contents").setStyle( {
			height : c + "px",
			width : d + "px"
		})
	},
	_fileType : function(a) {
		var f = new RegExp("[^.].(" + this.options.fileTypes.image.join("|")
				+ ")s*$", "i");
		if (f.test(a)) {
			return "image"
		}
		if (a.indexOf("#") &gt; -1 &amp;&amp; (document.domain == this._getDomain(a))) {
			return "inline"
		}
		if (a.indexOf("?") &gt; -1) {
			a = a.substring(0, a.indexOf("?"))
		}
		var b = "unknown";
		var c = new RegExp("[^.].(" + this.options.fileTypes.page.join("|")
				+ ")s*$", "i");
		var d = new RegExp("[^.].(" + this.options.fileTypes.media.join("|")
				+ ")s*$", "i");
		if (document.domain != this._getDomain(a)) {
			b = "external"
		}
		if (d.test(a)) {
			b = "media"
		}
		if (b == "external" || b == "media") {
			return b
		}
		if (c.test(a) || a.substr((a.length - 1), a.length) == "/") {
			b = "page"
		}
		return b
	},
	_fileExtension : function(c) {
		if (c.indexOf("?") &gt; -1) {
			c = c.substring(0, c.indexOf("?"))
		}
		var b = "";
		for ( var a = (c.length - 1); a &gt; -1; a--) {
			if (c.charAt(a) == ".") {
				return b
			}
			b = c.charAt(a) + b
		}
	},
	_monitorKeyboard : function(a) {
		if (a) {
			document.onkeydown = this._eventKeypress.bind(this)
		} else {
			document.onkeydown = ""
		}
	},
	_eventKeypress : function(b) {
		if (b == null) {
			var a = event.keyCode
		} else {
			var a = b.which
		}
		switch (a) {
		case 27:
			this.deactivate();
			break;
		case 13:
			return;
		default:
			break
		}
		if (this.animating) {
			return false
		}
		switch (String.fromCharCode(a).toLowerCase()) {
		case "p":
			if (this.navigationObservers.previous) {
				this.navigateWindow("previous")
			}
			break;
		case "n":
			if (this.navigationObservers.next) {
				this.navigateWindow("next")
			}
			break;
		default:
			break
		}
	},
	_getGalleryInfo : function(a) {
		if (!a) {
			return false
		}
		if (a.indexOf("[") &gt; -1) {
			return new Array(escape(a.substring(0, a.indexOf("["))), escape(a
					.substring(a.indexOf("[") + 1, a.indexOf("]"))))
		} else {
			return false
		}
	},
	_getDomain : function(f) {
		var h = f.indexOf("//");
		var b = h + 2;
		var d = f.substring(b, f.length);
		var a = d.indexOf("/");
		var g = d.substring(0, a);
		if (g.indexOf(":") &gt; -1) {
			var c = g.indexOf(":");
			g = g.substring(0, c)
		}
		return g
	},
	_getParameter : function(k, d) {
		if (!this.element) {
			return false
		}
		if (k == "lightwindow_top" &amp;&amp; this.element.top) {
			return unescape(this.element.top)
		} else {
			if (k == "lightwindow_left" &amp;&amp; this.element.left) {
				return unescape(this.element.left)
			} else {
				if (k == "lightwindow_type" &amp;&amp; this.element.type) {
					return unescape(this.element.type)
				} else {
					if (k == "lightwindow_show_images"
							&amp;&amp; this.element.showImages) {
						return unescape(this.element.showImages)
					} else {
						if (k == "lightwindow_height" &amp;&amp; this.element.height) {
							return unescape(this.element.height)
						} else {
							if (k == "lightwindow_width" &amp;&amp; this.element.width) {
								return unescape(this.element.width)
							} else {
								if (k == "lightwindow_loading_animation"
										&amp;&amp; this.element.loadingAnimation) {
									return unescape(this.element.loadingAnimation)
								} else {
									if (k == "lightwindow_iframe_embed"
											&amp;&amp; this.element.iframeEmbed) {
										return unescape(this.element.iframeEmbed)
									} else {
										if (k == "lightwindow_form"
												&amp;&amp; this.element.form) {
											return unescape(this.element.form)
										} else {
											if (!d) {
												if (this.element.params) {
													d = this.element.params
												} else {
													return
												}
											}
											var g;
											var f = d.split(",");
											var c = k + "=";
											var h = c.length;
											for ( var b = 0; b &lt; f.length; b++) {
												if (f[b].substr(0, h) == c) {
													var a = f[b].split("=");
													g = a[1];
													break
												}
											}
											if (!g) {
												return false
											} else {
												return unescape(g)
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	},
	_browserDimensions : function() {
		if (Prototype.Browser.IE) {
			this.dimensions.viewport.height = document.body.clientHeight;
			this.dimensions.viewport.width = document.body.clientWidth
		} else {
			this.dimensions.viewport.height = window.innerHeight;
			this.dimensions.viewport.width = document.width
					|| document.body.offsetWidth
		}
	},
	_getScrollerWidth : function() {
		var f = Element.extend(document.createElement("div"));
		f.setAttribute("id", "lightwindow_scroll_div");
		f.setStyle( {
			position : "absolute",
			top : "-10000px",
			left : "-10000px",
			width : "100px",
			height : "100px",
			overflow : "hidden"
		});
		var c = Element.extend(document.createElement("div"));
		c.setAttribute("id", "lightwindow_content_scroll_div");
		c.setStyle( {
			width : "100%",
			height : "200px"
		});
		f.appendChild(c);
		var b = document.getElementsByTagName("body")[0];
		b.appendChild(f);
		var d = $("lightwindow_content_scroll_div").offsetWidth;
		f.style.overflow = "auto";
		var a = $("lightwindow_content_scroll_div").offsetWidth;
		Element.remove($("lightwindow_scroll_div"));
		this.scrollbarOffset = d - a
	},
	_addParamToObject : function(b, c, a, f) {
		var d = document.createElement("param");
		d.setAttribute("value", c);
		d.setAttribute("name", b);
		if (f) {
			d.setAttribute("id", f)
		}
		a.appendChild(d);
		return a
	},
	_outerHTML : function(a) {
		if (Prototype.Browser.IE) {
			return a.outerHTML
		} else {
			var c = a.cloneNode(true);
			var b = document.createElement("div");
			b.appendChild(c);
			return b.innerHTML
		}
	},
	_convertToMarkup : function(c, b) {
		var a = this._outerHTML(c).replace("&lt;/" + b + "&gt;", "");
		if (Prototype.Browser.IE) {
			for ( var d = 0; d &lt; c.childNodes.length; d++) {
				a += this._outerHTML(c.childNodes[d])
			}
			a += "&lt;/" + b + "&gt;"
		}
		return a
	},
	_appendObject : function(c, b, a) {
		if (Prototype.Browser.IE) {
			a.innerHTML += this._convertToMarkup(c, b);
			if (this.options.EOLASFix
					.indexOf(this._fileType(this.element.href)) &gt; -1) {
				var f = document.getElementsByTagName("object");
				for ( var d = 0; d &lt; f.length; d++) {
					if (f[d].getAttribute("data")) {
						f[d].removeAttribute("data")
					}
					f[d].outerHTML = f[d].outerHTML;
					f[d].style.visibility = "visible"
				}
			}
		} else {
			a.appendChild(c)
		}
	},
	_appendIframe : function(a) {
		var b = document.createElement("iframe");
		b.setAttribute("id", "lightwindow_iframe");
		b.setAttribute("name", "lightwindow_iframe");
		b.setAttribute("src", "about:blank");
		b.setAttribute("height", "100%");
		b.setAttribute("width", "100%");
		b.setAttribute("frameborder", "0");
		b.setAttribute("marginwidth", "0");
		b.setAttribute("marginheight", "0");
		b.setAttribute("scrolling", a);
		this._appendObject(b, "iframe", $("lightwindow_contents"))
	},
	_writeToIframe : function(b) {
		var a = this.options.skin.iframe;
		a = a.replace("{body_replace}", b);
		if ($("lightwindow_iframe").contentWindow) {
			$("lightwindow_iframe").contentWindow.document.open();
			$("lightwindow_iframe").contentWindow.document.write(a);
			$("lightwindow_iframe").contentWindow.document.close()
		} else {
			$("lightwindow_iframe").contentDocument.open();
			$("lightwindow_iframe").contentDocument.write(a);
			$("lightwindow_iframe").contentDocument.close()
		}
	},
	_loadWindow : function() {
		switch (this.windowType) {
		case "image":
			var f = 0;
			var a = [];
			this.checkImage = [];
			this.resizeTo.height = this.resizeTo.width = 0;
			this.imageCount = this._getParameter("lightwindow_show_images") ? parseInt(this
					._getParameter("lightwindow_show_images"))
					: 1;
			if (gallery = this._getGalleryInfo(this.element.rel)) {
				for (f = 0; f &lt; this.galleries[gallery[0]][gallery[1]].length; f++) {
					if (this.contentToFetch
							.indexOf(this.galleries[gallery[0]][gallery[1]][f].href) &gt; -1) {
						break
					}
				}
				if (this.galleries[gallery[0]][gallery[1]][f - this.imageCount]) {
					this.navigationObservers.previous = this.galleries[gallery[0]][gallery[1]][f
							- this.imageCount]
				} else {
					this.navigationObservers.previous = false
				}
				if (this.galleries[gallery[0]][gallery[1]][f + this.imageCount]) {
					this.navigationObservers.next = this.galleries[gallery[0]][gallery[1]][f
							+ this.imageCount]
				} else {
					this.navigationObservers.next = false
				}
				this.activeGallery = true
			} else {
				this.navigationObservers.previous = false;
				this.navigationObservers.next = false;
				this.activeGallery = false
			}
			for ( var c = f; c &lt; (f + this.imageCount); c++) {
				if (gallery &amp;&amp; this.galleries[gallery[0]][gallery[1]][c]) {
					this.contentToFetch = this.galleries[gallery[0]][gallery[1]][c].href;
					this.galleryLocation = {
						current : (c + 1) / this.imageCount,
						total : (this.galleries[gallery[0]][gallery[1]].length)
								/ this.imageCount
					};
					if (!this.galleries[gallery[0]][gallery[1]][c
							+ this.imageCount]) {
						$("lightwindow_next").setStyle( {
							display : "none"
						})
					} else {
						$("lightwindow_next").setStyle( {
							display : "block"
						});
						$("lightwindow_next_title").innerHTML = this.galleries[gallery[0]][gallery[1]][c
								+ this.imageCount].title
					}
					if (!this.galleries[gallery[0]][gallery[1]][c
							- this.imageCount]) {
						$("lightwindow_previous").setStyle( {
							display : "none"
						})
					} else {
						$("lightwindow_previous").setStyle( {
							display : "block"
						});
						$("lightwindow_previous_title").innerHTML = this.galleries[gallery[0]][gallery[1]][c
								- this.imageCount].title
					}
				}
				a[c] = document.createElement("img");
				a[c].setAttribute("id", "lightwindow_image_" + c);
				a[c].setAttribute("border", "0");
				a[c].setAttribute("src", this.contentToFetch);
				$("lightwindow_contents").appendChild(a[c]);
				this.checkImage[c] = new PeriodicalExecuter(
						function(h) {
							if (Prototype.Browser.IE
									&amp;&amp; $("lightwindow_image_" + h).complete != true) {
								return
							} else {
								if ((typeof $("lightwindow_image_" + h).naturalWidth != "undefined" &amp;&amp; $("lightwindow_image_"
										+ h).naturalWidth == 0)) {
									return
								}
							}
							this.checkImage[h].stop();
							var g = $("lightwindow_image_" + h).getHeight();
							if (g &gt; this.resizeTo.height) {
								this.resizeTo.height = g
							}
							this.resizeTo.width += $("lightwindow_image_" + h)
									.getWidth();
							this.imageCount--;
							$("lightwindow_image_" + h).setStyle( {
								height : "100%"
							});
							if (this.imageCount == 0) {
								this._processWindow()
							}
						}.bind(this, c), 1)
			}
			break;
		case "media":
			var f = 0;
			this.resizeTo.height = this.resizeTo.width = 0;
			if (gallery = this._getGalleryInfo(this.element.rel)) {
				for (f = 0; f &lt; this.galleries[gallery[0]][gallery[1]].length; f++) {
					if (this.contentToFetch
							.indexOf(this.galleries[gallery[0]][gallery[1]][f].href) &gt; -1) {
						break
					}
				}
				if (this.galleries[gallery[0]][gallery[1]][f - 1]) {
					this.navigationObservers.previous = this.galleries[gallery[0]][gallery[1]][f - 1]
				} else {
					this.navigationObservers.previous = false
				}
				if (this.galleries[gallery[0]][gallery[1]][f + 1]) {
					this.navigationObservers.next = this.galleries[gallery[0]][gallery[1]][f + 1]
				} else {
					this.navigationObservers.next = false
				}
				this.activeGallery = true
			} else {
				this.navigationObservers.previous = false;
				this.navigationObservers.next = false;
				this.activeGallery = false
			}
			if (gallery &amp;&amp; this.galleries[gallery[0]][gallery[1]][f]) {
				this.contentToFetch = this.galleries[gallery[0]][gallery[1]][f].href;
				this.galleryLocation = {
					current : f + 1,
					total : this.galleries[gallery[0]][gallery[1]].length
				};
				if (!this.galleries[gallery[0]][gallery[1]][f + 1]) {
					$("lightwindow_next").setStyle( {
						display : "none"
					})
				} else {
					$("lightwindow_next").setStyle( {
						display : "block"
					});
					$("lightwindow_next_title").innerHTML = this.galleries[gallery[0]][gallery[1]][f + 1].title
				}
				if (!this.galleries[gallery[0]][gallery[1]][f - 1]) {
					$("lightwindow_previous").setStyle( {
						display : "none"
					})
				} else {
					$("lightwindow_previous").setStyle( {
						display : "block"
					});
					$("lightwindow_previous_title").innerHTML = this.galleries[gallery[0]][gallery[1]][f - 1].title
				}
			}
			if (this._getParameter("lightwindow_iframe_embed")) {
				this.resizeTo.height = this.dimensions.viewport.height;
				this.resizeTo.width = this.dimensions.viewport.width
			} else {
				this.resizeTo.height = this._getParameter("lightwindow_height");
				this.resizeTo.width = this._getParameter("lightwindow_width")
			}
			this._processWindow();
			break;
		case "external":
			this._appendIframe("auto");
			this.resizeTo.height = this.dimensions.viewport.height;
			this.resizeTo.width = this.dimensions.viewport.width;
			this._processWindow();
			break;
		case "page":
			var b = new Ajax.Request(
					this.contentToFetch,
					{
						method : "get",
						parameters : "",
						onComplete : function(g) {
							$("lightwindow_contents").innerHTML += g.responseText;
							$("lightwindow_contents").innerHTML.evalScripts();
							this.resizeTo.height = $("lightwindow_contents").scrollHeight
									+ (this.options.contentOffset.height);
							this.resizeTo.width = $("lightwindow_contents").scrollWidth
									+ (this.options.contentOffset.width);
							this._processWindow()
						}.bind(this)
					});
			break;
		case "inline":
			var d = this.contentToFetch;
			if (d.indexOf("?") &gt; -1) {
				d = d.substring(0, d.indexOf("?"))
			}
			d = d.substring(d.indexOf("#") + 1);
			new Insertion.Top($("lightwindow_contents"), $(d).innerHTML);
			this.resizeTo.height = $("lightwindow_contents").scrollHeight
					+ (this.options.contentOffset.height);
			this.resizeTo.width = $("lightwindow_contents").scrollWidth
					+ (this.options.contentOffset.width);
			this._toggleTroubleElements("hidden", true);
			this._processWindow();
			break;
		default:
			throw ("Page Type could not be determined, please amend this lightwindow URL " + this.contentToFetch);
			break
		}
	},
	_resizeWindowToFit : function() {
		if (this.resizeTo.height + this.dimensions.cruft.height &gt; this.dimensions.viewport.height) {
			var a = this.resizeTo.height / this.resizeTo.width;
			this.resizeTo.height = this.dimensions.viewport.height
					- this.dimensions.cruft.height
					- (2 * this.options.viewportPadding);
			if (this.windowType == "image"
					|| (this.windowType == "media" &amp;&amp; !this
							._getParameter("lightwindow_iframe_embed"))) {
				this.resizeTo.width = this.resizeTo.height / a;
				$("lightwindow_data_slide_inner").setStyle( {
					width : this.resizeTo.width + "px"
				})
			}
		}
		if (this.resizeTo.width + this.dimensions.cruft.width &gt; this.dimensions.viewport.width) {
			var b = this.resizeTo.width / this.resizeTo.height;
			this.resizeTo.width = this.dimensions.viewport.width - 2
					* this.dimensions.cruft.width
					- (2 * this.options.viewportPadding);
			if (this.windowType == "image"
					|| (this.windowType == "media" &amp;&amp; !this
							._getParameter("lightwindow_iframe_embed"))) {
				this.resizeTo.height = this.resizeTo.width / b;
				$("lightwindow_data_slide_inner").setStyle( {
					height : this.resizeTo.height + "px"
				})
			}
		}
	},
	_presetWindowSize : function() {
		if (this._getParameter("lightwindow_height")) {
			this.resizeTo.height = parseFloat(this
					._getParameter("lightwindow_height"))
		}
		if (this._getParameter("lightwindow_width")) {
			this.resizeTo.width = parseFloat(this
					._getParameter("lightwindow_width"))
		}
	},
	_processWindow : function() {
		this.dimensions.dataEffects = [];
		if (this.element.caption || this.element.author
				|| (this.activeGallery &amp;&amp; this.options.showGalleryCount)) {
			if (this.element.caption) {
				$("lightwindow_data_caption").innerHTML = this.element.caption;
				$("lightwindow_data_caption").setStyle( {
					display : "block"
				})
			} else {
				$("lightwindow_data_caption").setStyle( {
					display : "none"
				})
			}
			if (this.element.author) {
				$("lightwindow_data_author").innerHTML = this.element.author;
				$("lightwindow_data_author_container").setStyle( {
					display : "block"
				})
			} else {
				$("lightwindow_data_author_container").setStyle( {
					display : "none"
				})
			}
			if (this.activeGallery &amp;&amp; this.options.showGalleryCount) {
				$("lightwindow_data_gallery_current").innerHTML = this.galleryLocation.current;
				$("lightwindow_data_gallery_total").innerHTML = this.galleryLocation.total;
				$("lightwindow_data_gallery_container").setStyle( {
					display : "block"
				})
			} else {
				$("lightwindow_data_gallery_container").setStyle( {
					display : "none"
				})
			}
			$("lightwindow_data_slide_inner").setStyle( {
				width : this.resizeTo.width + "px",
				height : "auto",
				visibility : "visible",
				display : "block"
			});
			$("lightwindow_data_slide").setStyle( {
				height : $("lightwindow_data_slide").getHeight() + "px",
				width : "1px",
				overflow : "hidden",
				display : "block"
			})
		} else {
			$("lightwindow_data_slide").setStyle( {
				display : "none",
				width : "auto"
			});
			$("lightwindow_data_slide_inner").setStyle( {
				display : "none",
				visibility : "hidden",
				width : this.resizeTo.width + "px",
				height : "0px"
			})
		}
		if (this.element.title != "null") {
			$("lightwindow_title_bar_title").innerHTML = this.element.title
		} else {
			$("lightwindow_title_bar_title").innerHTML = ""
		}
		var b = {
			height : $("lightwindow_container").getHeight(),
			width : $("lightwindow_container").getWidth()
		};
		$("lightwindow_container")
				.setStyle(
						{
							height : "auto",
							width : $("lightwindow_container").getWidth()
									+ this.options.contentOffset.width
									- (this.windowActive ? this.options.contentOffset.width
											: 0) + "px"
						});
		var a = {
			height : $("lightwindow_container").getHeight(),
			width : $("lightwindow_container").getWidth()
		};
		this.containerChange = {
			height : b.height - a.height,
			width : b.width - a.width
		};
		this.dimensions.container = {
			height : $("lightwindow_container").getHeight(),
			width : $("lightwindow_container").getWidth()
		};
		this.dimensions.cruft = {
			height : this.dimensions.container.height
					- $("lightwindow_contents").getHeight()
					+ this.options.contentOffset.height,
			width : this.dimensions.container.width
					- $("lightwindow_contents").getWidth()
					+ this.options.contentOffset.width
		};
		this._presetWindowSize();
		this._resizeWindowToFit();
		if (!this.windowActive) {
			$("lightwindow_container").setStyle( {
				left : -(this.dimensions.container.width / 2) + "px",
				top : -(this.dimensions.container.height / 2) + "px"
			})
		}
		$("lightwindow_container").setStyle( {
			height : this.dimensions.container.height + "px",
			width : this.dimensions.container.width + "px"
		});
		this._displayLightWindow("block", "visible");
		this._animateLightWindow()
	},
	_animateLightWindow : function() {
		if (this.options.animationHandler) {
			this.options.animationHandler().bind(this)
		} else {
			this._defaultAnimationHandler()
		}
	},
	_handleNavigation : function(a) {
		if (this.options.navigationHandler) {
			this.options.navigationHandler().bind(this, a)
		} else {
			this._defaultDisplayNavigation(a)
		}
	},
	_handleTransition : function() {
		if (this.options.transitionHandler) {
			this.options.transitionHandler().bind(this)
		} else {
			this._defaultTransitionHandler()
		}
	},
	_handleFinalWindowAnimation : function(a) {
		if (this.options.finalAnimationHandler) {
			this.options.finalAnimationHandler().bind(this, a)
		} else {
			this._defaultfinalWindowAnimationHandler(a)
		}
	},
	_handleGalleryAnimation : function(a) {
		if (this.options.galleryAnimationHandler) {
			this.options.galleryAnimationHandler().bind(this, a)
		} else {
			this._defaultGalleryAnimationHandler(a)
		}
	},
	_defaultDisplayNavigation : function(a) {
		if (a) {
			$("lightwindow_navigation").setStyle( {
				display : "block",
				height : $("lightwindow_contents").getHeight() + "px",
				width : "100%",
				marginTop : this.options.dimensions.titleHeight + "px"
			})
		} else {
			$("lightwindow_navigation").setStyle( {
				display : "none",
				height : "auto",
				width : "auto"
			})
		}
	},
	_defaultAnimationHandler : function() {
		if (this.element.caption || this.element.author
				|| (this.activeGallery &amp;&amp; this.options.showGalleryCount)) {
			$("lightwindow_data_slide").setStyle( {
				display : "none",
				width : "auto"
			});
			this.dimensions.dataEffects.push(new Effect.SlideDown(
					"lightwindow_data_slide", {
						sync : true
					}), new Effect.Appear("lightwindow_data_slide", {
				sync : true,
				from : 0,
				to : 1
			}))
		}
		$("lightwindow_title_bar_inner").setStyle( {
			height : "0px",
			marginTop : this.options.dimensions.titleHeight + "px"
		});
		this.dimensions.dataEffects.push(new Effect.Morph(
				"lightwindow_title_bar_inner", {
					sync : true,
					style : {
						height : this.options.dimensions.titleHeight + "px",
						marginTop : "0px"
					}
				}), new Effect.Appear("lightwindow_title_bar_inner", {
			sync : true,
			from : 0,
			to : 1
		}));
		if (!this.options.hideGalleryTab) {
			this._handleGalleryAnimation(false);
			if ($("lightwindow_galleries_tab_container").getHeight() == 0) {
				this.dimensions.dataEffects.push(new Effect.Morph(
						"lightwindow_galleries_tab_container", {
							sync : true,
							style : {
								height : "20px",
								marginTop : "0px"
							}
						}));
				$("lightwindow_galleries").setStyle( {
					width : "0px"
				})
			}
		}
		var a = false;
		var b = this.dimensions.container.width
				- $("lightwindow_contents").getWidth() + this.resizeTo.width
				+ this.options.contentOffset.width;
		if (b != $("lightwindow_container").getWidth()) {
			new Effect.Parallel(
					[
							new Effect.Scale(
									"lightwindow_contents",
									100 * (this.resizeTo.width / $(
											"lightwindow_contents").getWidth()),
									{
										scaleFrom : 100 * ($(
												"lightwindow_contents")
												.getWidth() / ($(
												"lightwindow_contents")
												.getWidth() + (this.options.contentOffset.width))),
										sync : true,
										scaleY : false,
										scaleContent : false
									}),
							new Effect.Scale(
									"lightwindow_container",
									100 * (b / (this.dimensions.container.width)),
									{
										sync : true,
										scaleY : false,
										scaleFromCenter : true,
										scaleContent : false
									}) ], {
						duration : this.duration,
						delay : 0.25,
						queue : {
							position : "end",
							scope : "lightwindowAnimation"
						}
					})
		}
		b = this.dimensions.container.height
				- $("lightwindow_contents").getHeight() + this.resizeTo.height
				+ this.options.contentOffset.height;
		if (b != $("lightwindow_container").getHeight()) {
			new Effect.Parallel(
					[
							new Effect.Scale(
									"lightwindow_contents",
									100 * (this.resizeTo.height / $(
											"lightwindow_contents").getHeight()),
									{
										scaleFrom : 100 * ($(
												"lightwindow_contents")
												.getHeight() / ($(
												"lightwindow_contents")
												.getHeight() + (this.options.contentOffset.height))),
										sync : true,
										scaleX : false,
										scaleContent : false
									}),
							new Effect.Scale(
									"lightwindow_container",
									100 * (b / (this.dimensions.container.height)),
									{
										sync : true,
										scaleX : false,
										scaleFromCenter : true,
										scaleContent : false
									}) ], {
						duration : this.duration,
						afterFinish : function() {
							if (this.dimensions.dataEffects.length &gt; 0) {
								if (!this.options.hideGalleryTab) {
									$("lightwindow_galleries").setStyle( {
										width : this.resizeTo.width + "px"
									})
								}
								new Effect.Parallel(
										this.dimensions.dataEffects, {
											duration : this.duration,
											afterFinish : function() {
												this._finishWindow()
											}.bind(this),
											queue : {
												position : "end",
												scope : "lightwindowAnimation"
											}
										})
							}
						}.bind(this),
						queue : {
							position : "end",
							scope : "lightwindowAnimation"
						}
					});
			a = true
		}
		if (!a &amp;&amp; this.dimensions.dataEffects.length &gt; 0) {
			new Effect.Parallel(this.dimensions.dataEffects, {
				duration : this.duration,
				beforeStart : function() {
					if (!this.options.hideGalleryTab) {
						$("lightwindow_galleries").setStyle( {
							width : this.resizeTo.width + "px"
						})
					}
					if (this.containerChange.height != 0
							|| this.containerChange.width != 0) {
						new Effect.MoveBy("lightwindow_container",
								this.containerChange.height,
								this.containerChange.width, {
									transition : Effect.Transitions.sinoidal
								})
					}
				}.bind(this),
				afterFinish : function() {
					this._finishWindow()
				}.bind(this),
				queue : {
					position : "end",
					scope : "lightwindowAnimation"
				}
			})
		}
	},
	_defaultfinalWindowAnimationHandler : function(a) {
		if (this.windowType == "media"
				|| this._getParameter("lightwindow_loading_animation")) {
			Element.hide("lightwindow_loading");
			this._handleNavigation(this.activeGallery);
			this._setStatus(false)
		} else {
			Effect.Fade("lightwindow_loading", {
				duration : 0.75,
				delay : 1,
				afterFinish : function() {
					if (this.windowType != "image"
							&amp;&amp; this.windowType != "media"
							&amp;&amp; this.windowType != "external") {
						$("lightwindow_contents").setStyle( {
							overflow : "auto"
						})
					}
					this._handleNavigation(this.activeGallery);
					this._defaultGalleryAnimationHandler();
					this._setStatus(false)
				}.bind(this),
				queue : {
					position : "end",
					scope : "lightwindowAnimation"
				}
			})
		}
	},
	_defaultGalleryAnimationHandler : function(b) {
		if (this.activeGallery) {
			$("lightwindow_galleries").setStyle(
					{
						display : "block",
						marginBottom : $("lightwindow_data_slide").getHeight()
								+ this.options.contentOffset.height / 2 + "px"
					});
			$("lightwindow_navigation").setStyle( {
				height : $("lightwindow_contents").getHeight() - 20 + "px"
			})
		} else {
			$("lightwindow_galleries").setStyle( {
				display : "none"
			});
			$("lightwindow_galleries_tab_container").setStyle( {
				height : "0px",
				marginTop : "20px"
			});
			$("lightwindow_galleries_list").setStyle( {
				height : "0px"
			});
			return false
		}
		if (b) {
			if ($("lightwindow_galleries_list").getHeight() == 0) {
				var a = $("lightwindow_contents").getHeight() * 0.8;
				$("lightwindow_galleries_tab_span").className = "down"
			} else {
				var a = 0;
				$("lightwindow_galleries_tab_span").className = "up"
			}
			new Effect.Morph("lightwindow_galleries_list", {
				duration : this.duration,
				transition : Effect.Transitions.sinoidal,
				style : {
					height : a + "px"
				},
				beforeStart : function() {
					$("lightwindow_galleries_list").setStyle( {
						overflow : "hidden"
					})
				},
				afterFinish : function() {
					$("lightwindow_galleries_list").setStyle( {
						overflow : "auto"
					})
				},
				queue : {
					position : "end",
					scope : "lightwindowAnimation"
				}
			})
		}
	},
	_defaultTransitionHandler : function() {
		this.dimensions.dataEffects = [];
		if ($("lightwindow_data_slide").getStyle("display") != "none") {
			this.dimensions.dataEffects.push(new Effect.SlideUp(
					"lightwindow_data_slide", {
						sync : true
					}), new Effect.Fade("lightwindow_data_slide", {
				sync : true,
				from : 1,
				to : 0
			}))
		}
		if (!this.options.hideGalleryTab) {
			if ($("lightwindow_galleries").getHeight() != 0
					&amp;&amp; !this.options.hideGalleryTab) {
				this.dimensions.dataEffects.push(new Effect.Morph(
						"lightwindow_galleries_tab_container", {
							sync : true,
							style : {
								height : "0px",
								marginTop : "20px"
							}
						}))
			}
			if ($("lightwindow_galleries_list").getHeight() != 0) {
				$("lightwindow_galleries_tab_span").className = "up";
				this.dimensions.dataEffects.push(new Effect.Morph(
						"lightwindow_galleries_list", {
							sync : true,
							style : {
								height : "0px"
							},
							transition : Effect.Transitions.sinoidal,
							beforeStart : function() {
								$("lightwindow_galleries_list").setStyle( {
									overflow : "hidden"
								})
							},
							afterFinish : function() {
								$("lightwindow_galleries_list").setStyle( {
									overflow : "auto"
								})
							}
						}))
			}
		}
		this.dimensions.dataEffects.push(new Effect.Morph(
				"lightwindow_title_bar_inner", {
					sync : true,
					style : {
						height : "0px",
						marginTop : this.options.dimensions.titleHeight + "px"
					}
				}), new Effect.Fade("lightwindow_title_bar_inner", {
			sync : true,
			from : 1,
			to : 0
		}));
		new Effect.Parallel(this.dimensions.dataEffects, {
			duration : this.duration,
			afterFinish : function() {
				this._loadWindow()
			}.bind(this),
			queue : {
				position : "end",
				scope : "lightwindowAnimation"
			}
		})
	},
	_defaultFormHandler : function(d) {
		var b = Event.element(d).parentNode;
		var c = Form.serialize(this._getParameter("lightwindow_form", b
				.getAttribute("params")));
		if (this.options.formMethod == "post") {
			var a = new Ajax.Request(b.href, {
				method : "post",
				postBody : c,
				onComplete : this.openWindow.bind(this, b)
			})
		} else {
			if (this.options.formMethod == "get") {
				var a = new Ajax.Request(b.href, {
					method : "get",
					parameters : c,
					onComplete : this.openWindow.bind(this, b)
				})
			}
		}
	},
	_finishWindow : function() {
		if (this.windowType == "external") {
			$("lightwindow_iframe").setAttribute("src", this.element.href);
			this._handleFinalWindowAnimation(1)
		} else {
			if (this.windowType == "media") {
				var b = document.createElement("object");
				b.setAttribute("classid", this.options.classids[this
						._fileExtension(this.contentToFetch)]);
				b.setAttribute("codebase", this.options.codebases[this
						._fileExtension(this.contentToFetch)]);
				b.setAttribute("id", "lightwindow_media_primary");
				b.setAttribute("name", "lightwindow_media_primary");
				b.setAttribute("width", this.resizeTo.width);
				b.setAttribute("height", this.resizeTo.height);
				b = this._addParamToObject("movie", this.contentToFetch, b);
				b = this._addParamToObject("src", this.contentToFetch, b);
				b = this._addParamToObject("controller", "true", b);
				b = this._addParamToObject("wmode", "transparent", b);
				b = this._addParamToObject("cache", "false", b);
				b = this._addParamToObject("quality", "high", b);
				if (!Prototype.Browser.IE) {
					var a = document.createElement("object");
					a.setAttribute("type", this.options.mimeTypes[this
							._fileExtension(this.contentToFetch)]);
					a.setAttribute("data", this.contentToFetch);
					a.setAttribute("id", "lightwindow_media_secondary");
					a.setAttribute("name", "lightwindow_media_secondary");
					a.setAttribute("width", this.resizeTo.width);
					a.setAttribute("height", this.resizeTo.height);
					a = this._addParamToObject("controller", "true", a);
					a = this._addParamToObject("wmode", "transparent", a);
					a = this._addParamToObject("cache", "false", a);
					a = this._addParamToObject("quality", "high", a);
					b.appendChild(a)
				}
				if (this._getParameter("lightwindow_iframe_embed")) {
					this._appendIframe("no");
					this._writeToIframe(this._convertToMarkup(b, "object"))
				} else {
					this._appendObject(b, "object", $("lightwindow_contents"))
				}
				this._handleFinalWindowAnimation(0)
			} else {
				this._handleFinalWindowAnimation(0)
			}
		}
		this._setupActions()
	}
};
var lang = $A(document.getElementsByTagName("script")).find(function(a) {
	return (a.src &amp;&amp; a.src.match(/lightwindow\.js.*$/))
}).src.toQueryParams()["lang"] || "en";
var LW_LANG = {};
LW_LANG.ru = {
	close : "Р—Р°РєСЂС‹С‚СЊ",
	galleries : "Р“Р°Р»Р»РµСЂРµРё",
	cancel : "РћС‚РјРµРЅРёС‚СЊ",
	of : "РёР·"
};
LW_LANG.en = {
	close : "Close",
	galleries : "Galleries",
	cancel : "Cancel",
	of : "of"
};
var meLightWindow = null;
function lightwindowInit() {
			meLightWindow = new lightwindow(
					{
						resizeSpeed   : 8,
						contentOffset : {
							height : 20,
							width : 20
						},
						overlay : {
							opacity : 0.7,
							image : "img/lightwindow/black.png",
							presetImage : "img/lightwindow/black-70.png"
						},
						skin : {
							main : '&lt;div id="lightwindow_container" &gt;&lt;div id="lightwindow_title_bar" &gt;&lt;div id="lightwindow_title_bar_inner" &gt;&lt;span id="lightwindow_title_bar_title"&gt;&lt;/span&gt;&lt;a id="lightwindow_title_bar_close_link" &gt;'
									+ LW_LANG[lang]["close"]
									+ '&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div id="lightwindow_stage" &gt;&lt;div id="lightwindow_contents" &gt;&lt;/div&gt;&lt;div id="lightwindow_navigation"  class="'
									+ lang
									+ '"&gt;&lt;a href="#" id="lightwindow_previous" &gt;&lt;span id="lightwindow_previous_title"&gt;&lt;/span&gt;&lt;/a&gt;&lt;a href="#" id="lightwindow_next" &gt;&lt;span id="lightwindow_next_title"&gt;&lt;/span&gt;&lt;/a&gt;&lt;iframe name="lightwindow_navigation_shim" id="lightwindow_navigation_shim" src="javascript:false;" frameBorder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div id="lightwindow_galleries"&gt;&lt;div id="lightwindow_galleries_tab_container" &gt;&lt;a href="#" id="lightwindow_galleries_tab" &gt;&lt;span id="lightwindow_galleries_tab_span" class="up" &gt;'
									+ LW_LANG[lang]["galleries"]
									+ '&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div id="lightwindow_galleries_list" &gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div id="lightwindow_data_slide" &gt;&lt;div id="lightwindow_data_slide_inner" &gt;&lt;div id="lightwindow_data_details" &gt;&lt;div id="lightwindow_data_gallery_container" &gt;&lt;span id="lightwindow_data_gallery_current"&gt;&lt;/span&gt; '
									+ LW_LANG[lang]["of"]
									+ ' &lt;span id="lightwindow_data_gallery_total"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div id="lightwindow_data_author_container" &gt;by &lt;span id="lightwindow_data_author"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div id="lightwindow_data_caption" &gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;',
							loading : '&lt;div id="lightwindow_loading" &gt;&lt;span class="lightwindow_loading_image"&gt;&lt;/span&gt;&lt;span&gt;&lt;a href="javascript: myLightWindow.deactivate();"&gt;' + LW_LANG[lang]["cancel"] + '&lt;/a&gt;&lt;/span&gt;&lt;iframe name="lightwindow_loading_shim" id="lightwindow_loading_shim" src="javascript:false;" frameBorder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/div&gt;',
							iframe : '&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;body&gt;{body_replace}&lt;/body&gt;&lt;/html&gt;',
							gallery : {
								top : '&lt;div class="lightwindow_galleries_list"&gt;&lt;h1&gt;{gallery_title_replace}&lt;/h1&gt;&lt;ul&gt;',
								middle : "&lt;li&gt;{gallery_link_replace}&lt;/li&gt;",
								bottom : "&lt;/ul&gt;&lt;/div&gt;"
							}
						},
						hideGalleryTab : true
					})
}</pre></body></html>