// lightwindow.js v2.0
//
// Copyright (c) 2007 stickmanlabs
// Author: Kevin P Miller | http://www.stickmanlabs.com
// 
// LightWindow is freely distributable under the terms of an MIT-style license.
//
// I don't care what you think about the file size...
//   Be a pro: 
//	    http://www.thinkvitamin.com/features/webapps/serving-javascript-fast
//      http://rakaz.nl/item/make_your_pages_load_faster_by_combining_and_compressing_javascript_and_css_files
//

/*-----------------------------------------------------------------------------------------------*/
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(_1){
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:"/pics/lightwindow/black.png",presetImage:"/pics/lightwindow/black-70.png"},skin:{main:"<div id=\"lightwindow_container\" >"+"<div id=\"lightwindow_title_bar\" >"+"<div id=\"lightwindow_title_bar_inner\" >"+"<span id=\"lightwindow_title_bar_title\"></span>"+"<a id=\"lightwindow_title_bar_close_link\" >close</a>"+"</div>"+"</div>"+"<div id=\"lightwindow_stage\" >"+"<div id=\"lightwindow_contents\" >"+"</div>"+"<div id=\"lightwindow_navigation\" >"+"<a href=\"#\" id=\"lightwindow_previous\" >"+"<span id=\"lightwindow_previous_title\"></span>"+"</a>"+"<a href=\"#\" id=\"lightwindow_next\" >"+"<span id=\"lightwindow_next_title\"></span>"+"</a>"+"<iframe name=\"lightwindow_navigation_shim\" id=\"lightwindow_navigation_shim\" src=\"javascript:false;\" frameBorder=\"0\" scrolling=\"no\"></iframe>"+"</div>"+"<div id=\"lightwindow_galleries\">"+"<div id=\"lightwindow_galleries_tab_container\" >"+"<a href=\"#\" id=\"lightwindow_galleries_tab\" >"+"<span id=\"lightwindow_galleries_tab_span\" class=\"up\" >Galleries</span>"+"</a>"+"</div>"+"<div id=\"lightwindow_galleries_list\" >"+"</div>"+"</div>"+"</div>"+"<div id=\"lightwindow_data_slide\" >"+"<div id=\"lightwindow_data_slide_inner\" >"+"<div id=\"lightwindow_data_details\" >"+"<div id=\"lightwindow_data_gallery_container\" >"+"<span id=\"lightwindow_data_gallery_current\"></span>"+" of "+"<span id=\"lightwindow_data_gallery_total\"></span>"+"</div>"+"<div id=\"lightwindow_data_author_container\" >"+"by <span id=\"lightwindow_data_author\"></span>"+"</div>"+"</div>"+"<div id=\"lightwindow_data_caption\" >"+"</div>"+"</div>"+"</div>"+"</div>",loading:"<div id=\"lightwindow_loading\" >"+"<img src=\"pics/lightwindow/ajax-loading.gif\" alt=\"loading\" />"+"<span>Loading or <a href=\"javascript: myLightWindow.deactivate();\">Cancel</a></span>"+"<iframe name=\"lightwindow_loading_shim\" id=\"lightwindow_loading_shim\" src=\"javascript:false;\" frameBorder=\"0\" scrolling=\"no\"></iframe>"+"</div>",iframe:"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"+"<html xmlns=\"http://www.w3.org/1999/xhtml\">"+"<body>"+"{body_replace}"+"</body>"+"</html>",gallery:{top:"<div class=\"lightwindow_galleries_list\">"+"<h1>{gallery_title_replace}</h1>"+"<ul>",middle:"<li>"+"{gallery_link_replace}"+"</li>",bottom:"</ul>"+"</div>"}},formMethod:"get",hideFlash:false,hideGalleryTab:false,showTitleBar:true,animationHandler:false,navigationHandler:false,transitionHandler:false,finalAnimationHandler:false,formHandler:false,galleryAnimationHandler:false,showGalleryCount:true},_1||{});
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(e,_3){
this._clearWindowContents(true);
this._addLoadingWindowMarkup();
this._setupWindowElements(_3);
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 _4=Effect.Queues.get("lightwindowAnimation").each(function(e){
e.cancel();
});
this._prepareIE(false);
this._setupDimensions();
this._toggleTroubleElements("visible",false);
this._monitorKeyboard(false);
},createWindow:function(_6,_7){
this._processLink($(_6));
},activateWindow:function(_8){
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},_8||{});
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(e){
if(this.options.formHandler){
this.options.formHandler(e);
}else{
this._defaultFormHandler(e);
}
},openWindow:function(_a){
var _a=$(_a);
this.windowActive=true;
this._clearWindowContents(true);
this._addLoadingWindowMarkup();
this._setupWindowElements(_a);
this._setStatus(true);
this._handleTransition();
},navigateWindow:function(_b){
this._handleNavigation(false);
if(_b=="previous"){
this.openWindow(this.navigationObservers.previous);
}else{
if(_b=="next"){
this.openWindow(this.navigationObservers.next);
}
}
},buildGalleryList:function(){
var _c="";
var _d;
for(i in this.galleries){
if(typeof this.galleries[i]=="object"){
_c+=(this.options.skin.gallery.top).replace("{gallery_title_replace}",unescape(i));
for(j in this.galleries[i]){
if(typeof this.galleries[i][j]=="object"){
_d="<a href=\"#\" id=\"lightwindow_gallery_"+i+"_"+j+"\" >"+unescape(j)+"</a>";
_c+=(this.options.skin.gallery.middle).replace("{gallery_link_replace}",_d);
}
}
_c+=this.options.skin.gallery.bottom;
}
}
new Insertion.Top("lightwindow_galleries_list",_c);
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 _e=$$("."+this.options.classNames.standard);
_e.each(function(_f){
this._processLink(_f);
}.bind(this));
},_processLink:function(_10){
if((this._fileType(_10.getAttribute("href"))=="image"||this._fileType(_10.getAttribute("href"))=="media")){
if(gallery=this._getGalleryInfo(_10.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(_10);
}
}
var url=_10.getAttribute("href");
if(url.indexOf("?")>-1){
url=url.substring(0,url.indexOf("?"));
}
var _12=url.substring(url.indexOf("#")+1);
if($(_12)){
$(_12).setStyle({display:"none"});
}
Event.observe(_10,"click",this.activate.bindAsEventListener(this,_10),false);
_10.onclick=function(){
return false;
};
},_setupActions:function(){
var _13=$$("#lightwindow_container ."+this.options.classNames.action);
_13.each(function(_14){
Event.observe(_14,"click",this[_14.getAttribute("rel")].bindAsEventListener(this,_14),false);
_14.onclick=function(){
return false;
};
}.bind(this));
},_addLightWindowMarkup:function(_15){
var _16=Element.extend(document.createElement("div"));
_16.setAttribute("id","lightwindow_overlay");
if(Prototype.Browser.Gecko){
_16.setStyle({backgroundImage:"url("+this.options.overlay.presetImage+")",backgroundRepeat:"repeat",height:this.pageDimensions.height+"px"});
}else{
_16.setStyle({opacity:this.options.overlay.opacity,backgroundImage:"url("+this.options.overlay.image+")",backgroundRepeat:"repeat",height:this.pageDimensions.height+"px"});
}
var lw=document.createElement("div");
lw.setAttribute("id","lightwindow");
lw.innerHTML=this.options.skin.main;
var _18=document.getElementsByTagName("body")[0];
_18.appendChild(_16);
_18.appendChild(lw);
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(_16,"click",this.deactivate.bindAsEventListener(this),false);
_16.onclick=function(){
return false;
};
},_addLoadingWindowMarkup:function(){
$("lightwindow_contents").innerHTML+=this.options.skin.loading;
},_setupWindowElements:function(_19){
this.element=_19;
this.element.title=null?"":_19.getAttribute("title");
this.element.author=null?"":_19.getAttribute("author");
this.element.caption=null?"":_19.getAttribute("caption");
this.element.rel=null?"":_19.getAttribute("rel");
this.element.params=null?"":_19.getAttribute("params");
this.contentToFetch=this.element.href;
this.windowType=this._getParameter("lightwindow_type")?this._getParameter("lightwindow_type"):this._fileType(this.contentToFetch);
},_clearWindowContents:function(_1a){
if($("lightwindow_iframe")){
Element.remove($("lightwindow_iframe"));
}
if($("lightwindow_media_primary")){
try{
$("lightwindow_media_primary").Stop();
}
catch(e){
}
Element.remove($("lightwindow_media_primary"));
}
if($("lightwindow_media_secondary")){
try{
$("lightwindow_media_secondary").Stop();
}
catch(e){
}
Element.remove($("lightwindow_media_secondary"));
}
this.activeGallery=false;
this._handleNavigation(this.activeGallery);
if(_1a){
$("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(_1b){
this.animating=_1b;
if(_1b){
Element.show("lightwindow_loading");
}
if(!(/MSIE 6./i.test(navigator.userAgent))){
this._fixedWindow(_1b);
}
},_fixedWindow:function(_1c){
if(_1c){
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(_1d){
if(Prototype.Browser.IE){
var _1e,_1f,_20;
if(_1d){
var _1e="100%";
}else{
var _1e="auto";
}
var _21=document.getElementsByTagName("body")[0];
var _22=document.getElementsByTagName("html")[0];
_22.style.height=_21.style.height=_1e;
}
},_stopScrolling:function(e){
if(this.animating){
if(e.preventDefault){
e.preventDefault();
}
e.returnValue=false;
}
},_getScroll:function(){
if(typeof (window.pageYOffset)=="number"){
this.pagePosition.x=window.pageXOffset;
this.pagePosition.y=window.pageYOffset;
}else{
if(document.body&&(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(x,y){
document.documentElement.scrollLeft=x;
document.documentElement.scrollTop=y;
},_toggleTroubleElements:function(_26,_27){
if(_27){
var _28=$("lightwindow_contents").getElementsByTagName("select");
}else{
var _28=document.getElementsByTagName("select");
}
for(var i=0;i<_28.length;i++){
_28[i].style.visibility=_26;
}
if(!_27){
if(this.options.hideFlash){
var _2a=document.getElementsByTagName("object");
for(i=0;i!=_2a.length;i++){
_2a[i].style.visibility=_26;
}
var _2b=document.getElementsByTagName("embed");
for(i=0;i!=_2b.length;i++){
_2b[i].style.visibility=_26;
}
}
var _2c=document.getElementsByTagName("iframe");
for(i=0;i!=_2c.length;i++){
_2c[i].style.visibility=_26;
}
}
},_getPageDimensions:function(){
var _2d,_2e;
if(window.innerHeight&&window.scrollMaxY){
_2d=document.body.scrollWidth;
_2e=window.innerHeight+window.scrollMaxY;
}else{
if(document.body.scrollHeight>document.body.offsetHeight){
_2d=document.body.scrollWidth;
_2e=document.body.scrollHeight;
}else{
_2d=document.body.offsetWidth;
_2e=document.body.offsetHeight;
}
}
var _2f,_30;
if(self.innerHeight){
_2f=self.innerWidth;
_30=self.innerHeight;
}else{
if(document.documentElement&&document.documentElement.clientHeight){
_2f=document.documentElement.clientWidth;
_30=document.documentElement.clientHeight;
}else{
if(document.body){
_2f=document.body.clientWidth;
_30=document.body.clientHeight;
}
}
}
if(_2e<_30){
this.pageDimensions.height=_30;
}else{
this.pageDimensions.height=_2e;
}
if(_2d<_2f){
this.pageDimensions.width=_2f;
}else{
this.pageDimensions.width=_2d;
}
},_displayLightWindow:function(_31,_32){
$("lightwindow_overlay").style.display=$("lightwindow").style.display=$("lightwindow_container").style.display=_31;
$("lightwindow_overlay").style.visibility=$("lightwindow").style.visibility=$("lightwindow_container").style.visibility=_32;
},_setupDimensions:function(){
var _33,_34;
switch(this.windowType){
case "page":
_33=this.options.dimensions.page.height;
_34=this.options.dimensions.page.width;
break;
case "image":
_33=this.options.dimensions.image.height;
_34=this.options.dimensions.image.width;
break;
case "media":
_33=this.options.dimensions.media.height;
_34=this.options.dimensions.media.width;
break;
case "external":
_33=this.options.dimensions.external.height;
_34=this.options.dimensions.external.width;
break;
case "inline":
_33=this.options.dimensions.inline.height;
_34=this.options.dimensions.inline.width;
break;
default:
_33=this.options.dimensions.page.height;
_34=this.options.dimensions.page.width;
break;
}
var _35=this._getParameter("lightwindow_top")?parseFloat(this._getParameter("lightwindow_top"))+this.pagePosition.y:this.dimensions.viewport.height/2+this.pagePosition.y;
var _36=this._getParameter("lightwindow_left")?parseFloat(this._getParameter("lightwindow_left"))+this.pagePosition.x:this.dimensions.viewport.width/2+this.pagePosition.x;
$("lightwindow").setStyle({top:_35+"px",left:_36+"px"});
$("lightwindow_container").setStyle({height:_33+"px",width:_34+"px",left:-(_34/2)+"px",top:-(_33/2)+"px"});
$("lightwindow_contents").setStyle({height:_33+"px",width:_34+"px"});
},_fileType:function(url){
var _38=new RegExp("[^.].("+this.options.fileTypes.image.join("|")+")s*$","i");
if(_38.test(url)){
return "image";
}
if(url.indexOf("#")>-1&&(document.domain==this._getDomain(url))){
return "inline";
}
if(url.indexOf("?")>-1){
url=url.substring(0,url.indexOf("?"));
}
var _39="unknown";
var _3a=new RegExp("[^.].("+this.options.fileTypes.page.join("|")+")s*$","i");
var _3b=new RegExp("[^.].("+this.options.fileTypes.media.join("|")+")s*$","i");
if(document.domain!=this._getDomain(url)){
_39="external";
}
if(_3b.test(url)){
_39="media";
}
if(_39=="external"||_39=="media"){
return _39;
}
if(_3a.test(url)||url.substr((url.length-1),url.length)=="/"){
_39="page";
}
return _39;
},_fileExtension:function(url){
if(url.indexOf("?")>-1){
url=url.substring(0,url.indexOf("?"));
}
var _3d="";
for(var x=(url.length-1);x>-1;x--){
if(url.charAt(x)=="."){
return _3d;
}
_3d=url.charAt(x)+_3d;
}
},_monitorKeyboard:function(_3f){
if(_3f){
document.onkeydown=this._eventKeypress.bind(this);
}else{
document.onkeydown="";
}
},_eventKeypress:function(e){
if(e==null){
var _41=event.keyCode;
}else{
var _41=e.which;
}
switch(_41){
case 27:
this.deactivate();
break;
case 13:
return;
default:
break;
}
if(this.animating){
return false;
}
switch(String.fromCharCode(_41).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(rel){
if(!rel){
return false;
}
if(rel.indexOf("[")>-1){
return new Array(escape(rel.substring(0,rel.indexOf("["))),escape(rel.substring(rel.indexOf("[")+1,rel.indexOf("]"))));
}else{
return false;
}
},_getDomain:function(url){
var _44=url.indexOf("//");
var _45=_44+2;
var _46=url.substring(_45,url.length);
var _47=_46.indexOf("/");
var _48=_46.substring(0,_47);
if(_48.indexOf(":")>-1){
var _49=_48.indexOf(":");
_48=_48.substring(0,_49);
}
return _48;
},_getParameter:function(_4a,_4b){
if(!this.element){
return false;
}
if(_4a=="lightwindow_top"&&this.element.top){
return unescape(this.element.top);
}else{
if(_4a=="lightwindow_left"&&this.element.left){
return unescape(this.element.left);
}else{
if(_4a=="lightwindow_type"&&this.element.type){
return unescape(this.element.type);
}else{
if(_4a=="lightwindow_show_images"&&this.element.showImages){
return unescape(this.element.showImages);
}else{
if(_4a=="lightwindow_height"&&this.element.height){
return unescape(this.element.height);
}else{
if(_4a=="lightwindow_width"&&this.element.width){
return unescape(this.element.width);
}else{
if(_4a=="lightwindow_loading_animation"&&this.element.loadingAnimation){
return unescape(this.element.loadingAnimation);
}else{
if(_4a=="lightwindow_iframe_embed"&&this.element.iframeEmbed){
return unescape(this.element.iframeEmbed);
}else{
if(_4a=="lightwindow_form"&&this.element.form){
return unescape(this.element.form);
}else{
if(!_4b){
if(this.element.params){
_4b=this.element.params;
}else{
return;
}
}
var _4c;
var _4d=_4b.split(",");
var _4e=_4a+"=";
var _4f=_4e.length;
for(var i=0;i<_4d.length;i++){
if(_4d[i].substr(0,_4f)==_4e){
var _51=_4d[i].split("=");
_4c=_51[1];
break;
}
}
if(!_4c){
return false;
}else{
return unescape(_4c);
}
}
}
}
}
}
}
}
}
}
},_browserDimensions:function(){
if(Prototype.Browser.IE){
this.dimensions.viewport.height=document.documentElement.clientHeight;
this.dimensions.viewport.width=document.documentElement.clientWidth;
}else{
this.dimensions.viewport.height=window.innerHeight;
this.dimensions.viewport.width=document.width||document.body.offsetWidth;
}
},_getScrollerWidth:function(){
var _52=Element.extend(document.createElement("div"));
_52.setAttribute("id","lightwindow_scroll_div");
_52.setStyle({position:"absolute",top:"-10000px",left:"-10000px",width:"100px",height:"100px",overflow:"hidden"});
var _53=Element.extend(document.createElement("div"));
_53.setAttribute("id","lightwindow_content_scroll_div");
_53.setStyle({width:"100%",height:"200px"});
_52.appendChild(_53);
var _54=document.getElementsByTagName("body")[0];
_54.appendChild(_52);
var _55=$("lightwindow_content_scroll_div").offsetWidth;
_52.style.overflow="auto";
var _56=$("lightwindow_content_scroll_div").offsetWidth;
Element.remove($("lightwindow_scroll_div"));
this.scrollbarOffset=_55-_56;
},_addParamToObject:function(_57,_58,_59,id){
var _5b=document.createElement("param");
_5b.setAttribute("value",_58);
_5b.setAttribute("name",_57);
if(id){
_5b.setAttribute("id",id);
}
_59.appendChild(_5b);
return _59;
},_outerHTML:function(_5c){
if(Prototype.Browser.IE){
return _5c.outerHTML;
}else{
var _5d=_5c.cloneNode(true);
var _5e=document.createElement("div");
_5e.appendChild(_5d);
return _5e.innerHTML;
}
},_convertToMarkup:function(_5f,_60){
var _61=this._outerHTML(_5f).replace("</"+_60+">","");
if(Prototype.Browser.IE){
for(var i=0;i<_5f.childNodes.length;i++){
_61+=this._outerHTML(_5f.childNodes[i]);
}
_61+="</"+_60+">";
}
return _61;
},_appendObject:function(_63,_64,_65){
if(Prototype.Browser.IE){
_65.innerHTML+=this._convertToMarkup(_63,_64);
if(this.options.EOLASFix.indexOf(this._fileType(this.element.href))>-1){
var _66=document.getElementsByTagName("object");
for(var i=0;i<_66.length;i++){
if(_66[i].getAttribute("data")){
_66[i].removeAttribute("data");
}
_66[i].outerHTML=_66[i].outerHTML;
_66[i].style.visibility="visible";
}
}
}else{
_65.appendChild(_63);
}
},_appendIframe:function(_68){
var _69=document.createElement("iframe");
_69.setAttribute("id","lightwindow_iframe");
_69.setAttribute("name","lightwindow_iframe");
_69.setAttribute("src","about:blank");
_69.setAttribute("height","100%");
_69.setAttribute("width","100%");
_69.setAttribute("frameborder","0");
_69.setAttribute("marginwidth","0");
_69.setAttribute("marginheight","0");
_69.setAttribute("scrolling",_68);
this._appendObject(_69,"iframe",$("lightwindow_contents"));
},_writeToIframe:function(_6a){
var _6b=this.options.skin.iframe;
_6b=_6b.replace("{body_replace}",_6a);
if($("lightwindow_iframe").contentWindow){
$("lightwindow_iframe").contentWindow.document.open();
$("lightwindow_iframe").contentWindow.document.write(_6b);
$("lightwindow_iframe").contentWindow.document.close();
}else{
$("lightwindow_iframe").contentDocument.open();
$("lightwindow_iframe").contentDocument.write(_6b);
$("lightwindow_iframe").contentDocument.close();
}
},_loadWindow:function(){
switch(this.windowType){
case "image":
var _6c=0;
var _6d=[];
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(_6c=0;_6c<this.galleries[gallery[0]][gallery[1]].length;_6c++){
if(this.contentToFetch.indexOf(this.galleries[gallery[0]][gallery[1]][_6c].href)>-1){
break;
}
}
if(this.galleries[gallery[0]][gallery[1]][_6c-this.imageCount]){
this.navigationObservers.previous=this.galleries[gallery[0]][gallery[1]][_6c-this.imageCount];
}else{
this.navigationObservers.previous=false;
}
if(this.galleries[gallery[0]][gallery[1]][_6c+this.imageCount]){
this.navigationObservers.next=this.galleries[gallery[0]][gallery[1]][_6c+this.imageCount];
}else{
this.navigationObservers.next=false;
}
this.activeGallery=true;
}else{
this.navigationObservers.previous=false;
this.navigationObservers.next=false;
this.activeGallery=false;
}
for(var i=_6c;i<(_6c+this.imageCount);i++){
if(gallery&&this.galleries[gallery[0]][gallery[1]][i]){
this.contentToFetch=this.galleries[gallery[0]][gallery[1]][i].href;
this.galleryLocation={current:(i+1)/this.imageCount,total:(this.galleries[gallery[0]][gallery[1]].length)/this.imageCount};
if(!this.galleries[gallery[0]][gallery[1]][i+this.imageCount]){
$("lightwindow_next").setStyle({display:"none"});
}else{
$("lightwindow_next").setStyle({display:"block"});
$("lightwindow_next_title").innerHTML=this.galleries[gallery[0]][gallery[1]][i+this.imageCount].title;
}
if(!this.galleries[gallery[0]][gallery[1]][i-this.imageCount]){
$("lightwindow_previous").setStyle({display:"none"});
}else{
$("lightwindow_previous").setStyle({display:"block"});
$("lightwindow_previous_title").innerHTML=this.galleries[gallery[0]][gallery[1]][i-this.imageCount].title;
}
}
_6d[i]=document.createElement("img");
_6d[i].setAttribute("id","lightwindow_image_"+i);
_6d[i].setAttribute("border","0");
_6d[i].setAttribute("src",this.contentToFetch);
$("lightwindow_contents").appendChild(_6d[i]);
this.checkImage[i]=new PeriodicalExecuter(function(i){
if(!(typeof $("lightwindow_image_"+i).naturalWidth!="undefined"&&$("lightwindow_image_"+i).naturalWidth==0)){
this.checkImage[i].stop();
var _70=$("lightwindow_image_"+i).getHeight();
if(_70>this.resizeTo.height){
this.resizeTo.height=_70;
}
this.resizeTo.width+=$("lightwindow_image_"+i).getWidth();
this.imageCount--;
$("lightwindow_image_"+i).setStyle({height:"100%"});
if(this.imageCount==0){
this._processWindow();
}
}
}.bind(this,i),1);
}
break;
case "media":
var _6c=0;
this.resizeTo.height=this.resizeTo.width=0;
if(gallery=this._getGalleryInfo(this.element.rel)){
for(_6c=0;_6c<this.galleries[gallery[0]][gallery[1]].length;_6c++){
if(this.contentToFetch.indexOf(this.galleries[gallery[0]][gallery[1]][_6c].href)>-1){
break;
}
}
if(this.galleries[gallery[0]][gallery[1]][_6c-1]){
this.navigationObservers.previous=this.galleries[gallery[0]][gallery[1]][_6c-1];
}else{
this.navigationObservers.previous=false;
}
if(this.galleries[gallery[0]][gallery[1]][_6c+1]){
this.navigationObservers.next=this.galleries[gallery[0]][gallery[1]][_6c+1];
}else{
this.navigationObservers.next=false;
}
this.activeGallery=true;
}else{
this.navigationObservers.previous=false;
this.navigationObservers.next=false;
this.activeGallery=false;
}
if(gallery&&this.galleries[gallery[0]][gallery[1]][_6c]){
this.contentToFetch=this.galleries[gallery[0]][gallery[1]][_6c].href;
this.galleryLocation={current:_6c+1,total:this.galleries[gallery[0]][gallery[1]].length};
if(!this.galleries[gallery[0]][gallery[1]][_6c+1]){
$("lightwindow_next").setStyle({display:"none"});
}else{
$("lightwindow_next").setStyle({display:"block"});
$("lightwindow_next_title").innerHTML=this.galleries[gallery[0]][gallery[1]][_6c+1].title;
}
if(!this.galleries[gallery[0]][gallery[1]][_6c-1]){
$("lightwindow_previous").setStyle({display:"none"});
}else{
$("lightwindow_previous").setStyle({display:"block"});
$("lightwindow_previous_title").innerHTML=this.galleries[gallery[0]][gallery[1]][_6c-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 _71=new Ajax.Request(this.contentToFetch,{method:"get",parameters:"",onComplete:function(_72){
$("lightwindow_contents").innerHTML+=_72.responseText;
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 _73=this.contentToFetch;
if(_73.indexOf("?")>-1){
_73=_73.substring(0,_73.indexOf("?"));
}
_73=_73.substring(_73.indexOf("#")+1);
new Insertion.Top($("lightwindow_contents"),$(_73).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>this.dimensions.viewport.height){
var _74=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"&&!this._getParameter("lightwindow_iframe_embed"))){
this.resizeTo.width=this.resizeTo.height/_74;
$("lightwindow_data_slide_inner").setStyle({width:this.resizeTo.width+"px"});
}
}
if(this.resizeTo.width+this.dimensions.cruft.width>this.dimensions.viewport.width){
var _75=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"&&!this._getParameter("lightwindow_iframe_embed"))){
this.resizeTo.height=this.resizeTo.width/_75;
$("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&&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&&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 _76={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 _77={height:$("lightwindow_container").getHeight(),width:$("lightwindow_container").getWidth()};
this.containerChange={height:_76.height-_77.height,width:_76.width-_77.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(_78){
if(this.options.navigationHandler){
this.options.navigationHandler().bind(this,_78);
}else{
this._defaultDisplayNavigation(_78);
}
},_handleTransition:function(){
if(this.options.transitionHandler){
this.options.transitionHandler().bind(this);
}else{
this._defaultTransitionHandler();
}
},_handleFinalWindowAnimation:function(_79){
if(this.options.finalAnimationHandler){
this.options.finalAnimationHandler().bind(this,_79);
}else{
this._defaultfinalWindowAnimationHandler(_79);
}
},_handleGalleryAnimation:function(_7a){
if(this.options.galleryAnimationHandler){
this.options.galleryAnimationHandler().bind(this,_7a);
}else{
this._defaultGalleryAnimationHandler(_7a);
}
},_defaultDisplayNavigation:function(_7b){
if(_7b){
$("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&&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 _7c=false;
var _7d=this.dimensions.container.width-$("lightwindow_contents").getWidth()+this.resizeTo.width+this.options.contentOffset.width;
if(_7d!=$("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*(_7d/(this.dimensions.container.width)),{sync:true,scaleY:false,scaleFromCenter:true,scaleContent:false})],{duration:this.duration,delay:0.25,queue:{position:"end",scope:"lightwindowAnimation"}});
}
_7d=this.dimensions.container.height-$("lightwindow_contents").getHeight()+this.resizeTo.height+this.options.contentOffset.height;
if(_7d!=$("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*(_7d/(this.dimensions.container.height)),{sync:true,scaleX:false,scaleFromCenter:true,scaleContent:false})],{duration:this.duration,afterFinish:function(){
if(this.dimensions.dataEffects.length>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"}});
_7c=true;
}
if(!_7c&&this.dimensions.dataEffects.length>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(_7e){
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"&&this.windowType!="media"&&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(_7f){
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(_7f){
if($("lightwindow_galleries_list").getHeight()==0){
var _80=$("lightwindow_contents").getHeight()*0.8;
$("lightwindow_galleries_tab_span").className="down";
}else{
var _80=0;
$("lightwindow_galleries_tab_span").className="up";
}
new Effect.Morph("lightwindow_galleries_list",{duration:this.duration,transition:Effect.Transitions.sinoidal,style:{height:_80+"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&&!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(e){
var _82=Event.element(e).parentNode;
var _83=Form.serialize(this._getParameter("lightwindow_form",_82.getAttribute("params")));
if(this.options.formMethod=="post"){
var _84=new Ajax.Request(_82.href,{method:"post",postBody:_83,onComplete:this.openWindow.bind(this,_82)});
}else{
if(this.options.formMethod=="get"){
var _84=new Ajax.Request(_82.href,{method:"get",parameters:_83,onComplete:this.openWindow.bind(this,_82)});
}
}
},_finishWindow:function(){
if(this.windowType=="external"){
$("lightwindow_iframe").setAttribute("src",this.element.href);
this._handleFinalWindowAnimation(1);
}else{
if(this.windowType=="media"){
var _85=document.createElement("object");
_85.setAttribute("classid",this.options.classids[this._fileExtension(this.contentToFetch)]);
_85.setAttribute("codebase",this.options.codebases[this._fileExtension(this.contentToFetch)]);
_85.setAttribute("id","lightwindow_media_primary");
_85.setAttribute("name","lightwindow_media_primary");
_85.setAttribute("width",this.resizeTo.width);
_85.setAttribute("height",this.resizeTo.height);
_85=this._addParamToObject("movie",this.contentToFetch,_85);
_85=this._addParamToObject("src",this.contentToFetch,_85);
_85=this._addParamToObject("controller","true",_85);
_85=this._addParamToObject("wmode","transparent",_85);
_85=this._addParamToObject("cache","false",_85);
_85=this._addParamToObject("quality","high",_85);
if(!Prototype.Browser.IE){
var _86=document.createElement("object");
_86.setAttribute("type",this.options.mimeTypes[this._fileExtension(this.contentToFetch)]);
_86.setAttribute("data",this.contentToFetch);
_86.setAttribute("id","lightwindow_media_secondary");
_86.setAttribute("name","lightwindow_media_secondary");
_86.setAttribute("width",this.resizeTo.width);
_86.setAttribute("height",this.resizeTo.height);
_86=this._addParamToObject("controller","true",_86);
_86=this._addParamToObject("wmode","transparent",_86);
_86=this._addParamToObject("cache","false",_86);
_86=this._addParamToObject("quality","high",_86);
_85.appendChild(_86);
}
if(this._getParameter("lightwindow_iframe_embed")){
this._appendIframe("no");
this._writeToIframe(this._convertToMarkup(_85,"object"));
}else{
this._appendObject(_85,"object",$("lightwindow_contents"));
}
this._handleFinalWindowAnimation(0);
}else{
this._handleFinalWindowAnimation(0);
}
}
this._setupActions();
}};
Event.observe(window,"load",lightwindowInit,false);
var myLightWindow=null;
function lightwindowInit(){
myLightWindow=new lightwindow();
};

