
Loading={showLoading:function(element,loadingImageSrc){$(element)._waiting=true;if(!$(element)._loading){var loading=new Element('div');$$('body')[0].appendChild(loading);loading.setStyle({display:'none',zIndex:$(element).getStyle('zIndex')+1,position:'absolute',left:$(element).cumulativeOffset()[0]+'px',top:$(element).cumulativeOffset()[1]+'px',height:$(element).getHeight()+'px',width:$(element).getWidth()+'px',lineHeight:$(element).getHeight()+'px',textAlign:'center',margin:'auto',verticalAlign:'middle',backgroundColor:'#ffffff',backgroundImage:'url('+loadingImageSrc+')',backgroundPosition:'center center',backgroundRepeat:'no-repeat'});$(element)._loading=loading.identify();if(typeof Effect=='undefined'){loading.setOpacity(0.6);loading.show();}
else{loading.appear({duration:0.4,to:0.6});}}},hideLoading:function(element){if($(element)._waiting){if(typeof Effect=='undefined'){$($(element)._loading).hide();}
else{$($(element)._loading).fade({duration:0.4,afterFinish:function(){$(element).waiting=false;$($(element)._loading).remove();$(element)._loading=null;}});}}}};if(Prototype){Element.addMethods(Loading);Object.extend(Element,Loading);}
Tips=Class.create({initialize:function(element,className){this.element=element;if(this.element.tagName.toLowerCase()=='a'){this._title=element.title;this._tip=element.rel;this.element.title='';this.element.rel='';}
else if(this.element.tagName.toLowerCase()=='img'){this._tip=element.alt;this.element.alt='';}
this._tipID='';this._tipClass=className;this._tipOffsetX=20;this._tipOffsetY=25;element.observe('mouseover',this.onMouseOver.bind(this));element.observe('mousemove',this.onMouseMove.bind(this));element.observe('mouseout',this.onMouseOut.bind(this));},onMouseOver:function(event){if(this._tipID==''){var tip=document.body.appendChild(this.getTipBody(this._title,this._tip));this._tipID=tip.identify();this.setTipPosition(event);if(typeof Effect=='undefined'){tip.show().delay(0.2);}
else{tip.appear({delay:0.2,duration:0.2});}}},onMouseMove:function(event){if(this._tipID!=''){this.setTipPosition(event);}},onMouseOut:function(event){if(this._tipID!=''){var tip=$(this._tipID);var tipID=this._tipID;this._tipID='';if(typeof Effect=='undefined'){tip.hide();}
else{tip.fade({duration:0.2,afterFinish:function(tipID){$(tipID.element).remove();}});}}},getTipBody:function(title,tip){var container=new Element('div',{style:'display: none;'}).addClassName(this._tipClass);var title=new Element('div').update(title);var tip=new Element('span').update(tip);container.appendChild(title);container.appendChild(tip);return container;},setTipPosition:function(event){$(this._tipID).setStyle({position:'absolute',left:(event.pointerX()+this._tipOffsetX)+'px',top:(event.pointerY()+this._tipOffsetY)+'px'});}});Watermark=Class.create({initialize:function(element,className){this.element=element;this._watermarkText=(element.title.strip()||'Enter your text');this._watermarkClass=className;if(this.element.value.strip().length==0||this.element.value=='undefined'||this.element.value==this._watermarkText){this.element.value=this._watermarkText;this.element.addClassName(this._watermarkClass);}
if(this.element.value.strip().length>0&&this.element.value!=this._watermarkText){this.element.removeClassName(this._watermarkClass);}
element.observe('click',this.onClick.bind(this));element.observe('blur',this.onBlur.bind(this));},onFocus:function(event){if(this.element.value==this._watermarkText){this.element.value='';this.element.removeClassName(this._watermarkClass);}},onClick:function(event){if(this.element.value==this._watermarkText){this.element.value='';this.element.removeClassName(this._watermarkClass);}},onBlur:function(event){if((this.element.value.strip().length<=0)||(this.element.value==this._watermarkText)){this.element.value=this._watermarkText;this.element.addClassName(this._watermarkClass);}}});Fader=Class.create({initialize:function(container,fadeDuration,staticDuration){this.container=$(container);this.currentIndex=0;this.childElements=this.container.childElements();this.fadeDuration=fadeDuration;this.staticDuration=staticDuration;this.mouseOver=false;this.container.setStyle({position:'relative'});if(this.container.tagName.toLowerCase()=='ul')this.container.setStyle({listStyleType:'none',margin:'0px',padding:'0px'});this.container.observe('mouseover',this.onMouseOver.bind(this));this.container.observe('mouseout',this.onMouseOut.bind(this));this.childElements.each(function(e){e.setStyle({position:'absolute'});if(this.currentIndex++>0){e.hide();}}.bind(this));this.currentIndex=0;new PeriodicalExecuter(function(){if(!this.mouseover){this.childElements[this.currentIndex].fade({duration:this.fadeDuration});if(this.currentIndex==this.childElements.length-1){this.currentIndex=0;}
else{this.currentIndex++;}
this.childElements[this.currentIndex].appear({duration:this.fadeDuration});}}.bind(this),this.staticDuration);},onMouseOver:function(event){this.mouseover=true;},onMouseOut:function(event){this.mouseover=false;}});if(typeof Prototype==='undefined'){throw("SkyByte.js requires Prototype.js library");}
var SkyByte={Version:'1.2'};var Browser={cursor:function(cur){document.body.style.cursor=cur;}};function debug(o){s='';for(var n in o){s+=n+':'+o[n]+'\n';}alert(s);}
var Mouse={callbacks:[],x:0,y:0,event:null,start:function(obj){obj=obj||'global';if(this.callbacks.length===0){this.eventMouseMove=this._mouseMove.bindAsEventListener(this);Event.observe(document,"mousemove",this.eventMouseMove);}
var found=this.callbacks.detect(function(d){return d==obj;});if(!found){this.callbacks.push(obj);}},stop:function(obj){obj=obj||'global';this.callbacks=this.callbacks.reject(function(d){return d==obj;});if(this.callbacks.length===0){Event.stopObserving(document,"mousemove",this.eventMouseMove);}},_mouseMove:function(e){var o,i;this.x=Event.pointerX(e);this.y=Event.pointerY(e);this.event=e;if(Mouse.callbacks){for(i=0,len=Mouse.callbacks.length;i<len;++i){o=Mouse.callbacks[i];if(typeof o=='object'){o._mouseMove(e);}}}}};Object.extend(Element,{add:function(el,attr,style,opt){var d;for(var n in opt){val=opt[n];if(n=='clone'){d=val.cloneNode(true);}}
if(!d){d=document.createElement(el);}
for(n in attr){d.setAttribute(n,attr[n]);}
for(n in style){d.style[n.camelize()]=style[n];}
for(n in opt){val=opt[n];switch(n){case'a':if(typeof val=='string'){val=$(val);}d=val.appendChild(d);break;case'c':d.className=val;break;case'id':d.id=val;break;case'txt':if(d.tagName=="TABLE"||d.tagName=="TFOOT"||d.tagName=="THEAD"||d.tagName=="TR"){}else if(d.innerHTML){d.innerHTML=val;}
break;}}return d;},rem:function(el){if(el.parentNode){d=el.parentNode.removeChild(el);return d;}},putAt:function(target,c){if(target){target.style.left=c.x+'px';target.style.top=c.y+'px';}},showAt:function(target,c){if(target){target.style.left=c.x+'px';target.style.top=c.y+'px';target.style.width=c.w+'px';target.style.height=c.h+'px';}},xywh:function(el){var d=Element.getDimensions(el);var c=Position.cumulativeOffset(el);return{x:c[0],y:c[1],w:d.width,h:d.height};},wh:function(el){var d=Element.getDimensions(el);return{w:d.width,h:d.height};}});if(typeof Prototype=='undefined'){throw("SkyByteDD.js requires Prototype.js library");}
else if(typeof SkyByte=='undefined'){throw("SkyByteDD.js requires SkyByte.js library");}
var SkyByteDD={Version:'1.2'};var Drags={drag:null,drags:[],hide:{x:-100,y:-100,w:0,h:0},register:function(obj){if(this.drags.length===0){Mouse.start(this);this.eventMouseUp=this._mouseUp.bindAsEventListener(this);Event.observe(document,"mouseup",this.eventMouseUp);if(navigator.appVersion.match(/\bMSIE\b/)){this.eventMouseOver=this._mouseOver.bindAsEventListener(this);this.eventMouseOut=this._mouseOut.bindAsEventListener(this);}
this.div=Element.add('div',{},{},{a:document.body,c:'dragmove'});document.body.onselectstart=function(){return false;};}
this.drags.push(obj);},unregister:function(el){this.drags=this.drags.reject(function(d){return d.element==el;});},is_drag:function(el){return this.drags.detect(function(d){return d.element==el;});},destroy:function(){var i,o,len;if(this.drags.length>0){this.drag=null;$A(this.drags).each(function(o){if(typeof o.destroy==='function'){o.destroy();}});}
if(this.drags.length===0&&this.div){Element.rem(this.div);Mouse.stop(this);Event.stopObserving(document,"mouseup",this.eventMouseUp);}},activate:function(drag,e){this.drag=drag;this.drag.IE=false;if(this.drag.element.tagName==='IMG'&&navigator.appVersion.match(/\bMSIE\b/)){this.drag.IE=true;Event.observe(document,"mouseover",this.eventMouseOver);Event.observe(document,"mouseout",this.eventMouseOut);}},deactivate:function(){if(this.drag.IE){Event.stopObserving(document,"mouseover",this.eventMouseOver);Event.stopObserving(document,"mouseout",this.eventMouseOut);}
this.drag=null;},_mouseOver:function(e){var d=Drops.is_drop(Event.element(e));if(d){Drops.drop=d;Drops.show_frame();}},_mouseOut:function(e){if(Drops&&Drops.lastActive&&typeof Drops.lastActive.options.mouseOut==='function'){Drops.lastActive.options.mouseOut(Drops.lastActive.element);Drops.lastActive=null;}
Drops.hide_frame();Drops.drop=null;},_mouseMove:function(e){if(!this.drag){return;}
this.drag._mouseMove(e);Event.stop(e);},_mouseUp:function(e){if(!this.drag){return;}
this.drag._mouseUp(e);this.drag=null;Event.stop(e);}};var Drag=Class.create();Drag.prototype={initialize:function(el){this.element=$(el);this.options=Object.extend({self:false,classname:'drag',caption:'',affect:false},arguments[1]||{});if(this.options.self){this.options.self=this.element.parentNode;Element.makePositioned(this.options.self);}
this.eventMouseDown=this._mouseDown.bindAsEventListener(this);Event.observe(this.element,"mousedown",this.eventMouseDown);Drags.register(this);},destroy:function(){Event.stopObserving(this.element,"mousedown",this.eventMouseDown);Drags.unregister(this.element);},currentDelta:function(){return([parseInt(Element.getStyle(this.options.self,'left')||'0'),parseInt(Element.getStyle(this.options.self,'top')||'0')]);},_mouseDown:function(e){var el,pointer,pos;if(this.options.self){el=this.options.self;pointer=[Mouse.x,Mouse.y];pos=Position.cumulativeOffset(el);this.offset=[0,1].map(function(i){return(pointer[i]-pos[i]);});}
Browser.cursor('default');Drops.affect=this.options.affect;Drags.activate(this);Event.stop(e);},_mouseUp:function(e){var ok;Element.putAt(Drags.div,Drags.hide);if(this.element&&Drops.drop&&(this.element!=Drops.drop.element)){if(Drops.drop.options.accept===this.element.tagName){ok=true;}
if(Drops.drop.options.accept===''){ok=true;}
if(Drops.affect){ok=true;}
if(ok){if(typeof Drops.drop.options.mouseUp==='function'){Drops.drop.options.mouseUp(Drops.drop.element,this.element);}}}
Drops.affect=false;Drags.deactivate();Drops.hide_frame();},_mouseMove:function(e){var ok,d,pos,point,p,style,el,div,caption;if(this.options.self){el=this.options.self;pos=Position.cumulativeOffset(el);d=this.currentDelta();pos[0]-=d[0];pos[1]-=d[1];point=[];point.push(Mouse.x);point.push(Mouse.y);p=[0,1].map(function(i){return(point[i]-pos[i]-this.offset[i])}.bind(this));style=el.style;style.left=p[0]+"px";style.top=p[1]+"px";}else{div=Drags.div;div.className='dragmove';caption=this.options.caption;if(this.element&&Drops.drop&&(this.element!=Drops.drop.element)){if(Drops.drop.options.accept&&Drops.drop.options.accept===this.element.tagName){ok=true;}
if(Drops.drop.options.accept===''){ok=true;}
if(Drops.affect){ok=true;}
if(ok){cap=Drops.drop.options.caption;if(cap){caption=cap;}
div.className=this.options.classname;if(typeof Drops.drop.options.mouseOver==='function'){Drops.lastActive=Drops.drop;Drops.drop.options.mouseOver(Drops.drop.element,this.element);}}}
div.innerHTML=caption;Mouse.x+=15;Mouse.y+=10;Element.putAt(div,Mouse);}}};var Drops={lastActive:null,frameactive:null,drop:null,affect:null,drops:[],hide:{x:-10,y:-10,w:0,h:0},register:function(obj){if(this.drops.length===0){this.L=Element.add('div',{},{},{a:document.body,c:'drop'});this.R=Element.add('div',{},{},{a:document.body,c:'drop'});this.T=Element.add('div',{},{},{a:document.body,c:'drop'});this.B=Element.add('div',{},{},{a:document.body,c:'drop'});}
this.drops.push(obj);},unregister:function(el){this.hide_frame();this.drops=this.drops.reject(function(d){return d.element==el;});},destroy:function(){var i,o,len;if(this.drops.length>0){Element.rem(this.L);Element.rem(this.R);Element.rem(this.T);Element.rem(this.B);$A(this.drops).each(function(o){if(typeof o.destroy==='function'){o.destroy();}});this.drop=null;this.hide_frame();}},is_drop:function(el){return this.drops.detect(function(d){return d.element==el;});},show_frame:function(){this.frameactive=true;var pointer=Element.xywh(this.drop.element);this.L.className=this.drop.options.classname;this.R.className=this.drop.options.classname;this.T.className=this.drop.options.classname;this.B.className=this.drop.options.classname;Element.showAt(this.L,{x:pointer.x,y:pointer.y,w:1,h:pointer.h});Element.showAt(this.R,{x:(pointer.x+pointer.w),y:pointer.y,w:1,h:pointer.h});Element.showAt(this.T,{x:pointer.x,y:pointer.y,w:pointer.w,h:1});Element.showAt(this.B,{x:pointer.x,y:(pointer.y+pointer.h),w:pointer.w,h:1});},hide_frame:function(){if(this.drops.length>0&&this.frameactive){this.frameactive=false;Element.showAt(this.L,this.hide);Element.showAt(this.R,this.hide);Element.showAt(this.T,this.hide);Element.showAt(this.B,this.hide);}}};var Drop=Class.create();Drop.prototype={initialize:function(el){this.element=$(el);this.options=Object.extend({caption:'',classname:'drop',accept:this.element.tagName,mouseUp:null,mouseOver:null,mouseOut:null},arguments[1]||{});this.eventMouseOver=this._mouseOver.bindAsEventListener(this);Event.observe(this.element,"mouseover",this.eventMouseOver);this.eventMouseOut=this._mouseOut.bindAsEventListener(this);Event.observe(this.element,"mouseout",this.eventMouseOut);Drops.register(this);},destroy:function(){Event.stopObserving(this.element,"mouseover",this.eventMouseOver);Event.stopObserving(this.element,"mouseout",this.eventMouseOut);Drops.unregister(this.element);},_mouseOver:function(e){var d=Drops.is_drop(Event.element(e));if(!d){d=Drops.is_drop(this.element);}
if(d){Drops.drop=d;Drops.show_frame();}
Event.stop(e);},_mouseOut:function(e){if(Drops.lastActive&&typeof Drops.lastActive.options.mouseOut==='function'){Drops.lastActive.options.mouseOut(Drops.lastActive.element);Drops.lastActive=null;}
Drops.drop=null;Drops.hide_frame();Event.stop(e);}};if(!Prototype){throw("SkyByteRS.js requires Prototype.js library");}
else if(!SkyByte){throw("SkyByteRS.js requires SkyByte.js library");}
else if(!SkyByteDD){throw("SkyByteRS.js requires SkyByteDD.js library");}
var SkyByteRS={Version:'1.2.3'};var Resizes={resizes:[],resize:{},resizing:null,frameactive:false,register:function(obj){if(this.resizes.length===0){this.L=Element.add('div',{},{position:'absolute',top:'-50px',left:'-50px'},{c:'resizel',a:document.body});this.R=Element.add('div',{},{position:'absolute',top:'-50px',left:'-50px'},{c:'resizer',a:document.body});this.T=Element.add('div',{},{position:'absolute',top:'-50px',left:'-50px'},{c:'resizet',a:document.body});this.B=Element.add('div',{},{position:'absolute',top:'-50px',left:'-50px'},{c:'resizeb',a:document.body});this.box=Element.add('div',{},{position:'absolute',top:'-50px',left:'-50px'},{c:'resizebox',a:document.body});this.TM=Element.add('div',{},{cursor:'s-resize',overflow:'hidden',position:'absolute',top:'-50px',left:'-50px'},{c:'resizeknob',a:document.body});Drags.register(this.TM);this.BM=Element.add('div',{},{cursor:'s-resize',overflow:'hidden',position:'absolute',top:'-50px',left:'-50px'},{c:'resizeknob',a:document.body});Drags.register(this.BM);this.LT=Element.add('div',{},{cursor:'se-resize',overflow:'hidden',position:'absolute',top:'-50px',left:'-50px'},{c:'resizeknob',a:document.body});Drags.register(this.LT);this.LM=Element.add('div',{},{cursor:'e-resize',overflow:'hidden',position:'absolute',top:'-50px',left:'-50px'},{c:'resizeknob',a:document.body});Drags.register(this.LM);this.LB=Element.add('div',{},{cursor:'ne-resize',overflow:'hidden',position:'absolute',top:'-50px',left:'-50px'},{c:'resizeknob',a:document.body});Drags.register(this.LB);this.RT=Element.add('div',{},{cursor:'sw-resize',overflow:'hidden',position:'absolute',top:'-50px',left:'-50px'},{c:'resizeknob',a:document.body});Drags.register(this.RT);this.RM=Element.add('div',{},{cursor:'e-resize',overflow:'hidden',position:'absolute',top:'-50px',left:'-50px'},{c:'resizeknob',a:document.body});Drags.register(this.RM);this.RB=Element.add('div',{},{cursor:'nw-resize',overflow:'hidden',position:'absolute',top:'-50px',left:'-50px'},{c:'resizeknob',a:document.body});Drags.register(this.RB);this.eventMouseDown=this._mouseDown.bindAsEventListener(this);this.eventMouseOver=this._mouseOver.bindAsEventListener(this);this.eventMouseOut=this._mouseOut.bindAsEventListener(this);this.eventClick=this._observeClick.bindAsEventListener(this);Event.observe(document,"mousedown",this.eventClick);Event.observe(this.TM,"mousedown",this.eventMouseDown);Event.observe(this.TM,"mouseover",this.eventMouseOver);Event.observe(this.TM,"mouseout",this.eventMouseOut);Event.observe(this.BM,"mousedown",this.eventMouseDown);Event.observe(this.BM,"mouseover",this.eventMouseOver);Event.observe(this.BM,"mouseout",this.eventMouseOut);Event.observe(this.LT,"mousedown",this.eventMouseDown);Event.observe(this.LT,"mouseover",this.eventMouseOver);Event.observe(this.LT,"mouseout",this.eventMouseOut);Event.observe(this.LM,"mousedown",this.eventMouseDown);Event.observe(this.LM,"mouseover",this.eventMouseOver);Event.observe(this.LM,"mouseout",this.eventMouseOut);Event.observe(this.LB,"mousedown",this.eventMouseDown);Event.observe(this.LB,"mouseover",this.eventMouseOver);Event.observe(this.LB,"mouseout",this.eventMouseOut);Event.observe(this.RT,"mousedown",this.eventMouseDown);Event.observe(this.RT,"mouseover",this.eventMouseOver);Event.observe(this.RT,"mouseout",this.eventMouseOut);Event.observe(this.RM,"mousedown",this.eventMouseDown);Event.observe(this.RM,"mouseover",this.eventMouseOver);Event.observe(this.RM,"mouseout",this.eventMouseOut);Event.observe(this.RB,"mousedown",this.eventMouseDown);Event.observe(this.RB,"mouseover",this.eventMouseOver);Event.observe(this.RB,"mouseout",this.eventMouseOut);}
this.resizes.push(obj);},unregister:function(el){this.hide_frame();this.resizes=this.resizes.reject(function(d){return d.element==el;});},destroy:function(){var i,o;if(this.resizes.length>0){$A(this.resizes).each(function(o){if(o.destroy){o.destroy();}});}
if(this.resizes.length===0&&this.TM){this.resize={};Element.rem(this.T);Element.rem(this.B);Element.rem(this.L);Element.rem(this.R);Drags.unregister(this.TM);Element.rem(this.TM);Drags.unregister(this.TB);Element.rem(this.BM);Drags.unregister(this.LT);Element.rem(this.LT);Drags.unregister(this.LM);Element.rem(this.LM);Drags.unregister(this.LB);Element.rem(this.LB);Drags.unregister(this.RT);Element.rem(this.RT);Drags.unregister(this.RM);Element.rem(this.RM);Drags.unregister(this.RB);Element.rem(this.RB);Event.stopObserving(this,"mousedown",this.eventMouseDown);Event.stopObserving(this,"mouseover",this.eventMouseOver);Event.stopObserving(this,"mouseout",this.eventMouseOut);Event.stopObserving(document,"mousedown",this.eventClick);}
this.hide_frame();},is_resize:function(el){return this.resizes.detect(function(d){return d.element==el;});},activate:function(el){var r=Resizes.is_resize(el);if(!r){return;}
Resizes.resize=r;this.element=el;this.show_frame(Element.xywh(this.element));},deactivate:function(){this.hide_frame();},show_frame:function(c){var opt=this.resize.options;if(this.resizes.length==0){return;}
this.frameactive=true;if(opt.indicator==true){this.box.innerHTML=c.w+'x'+c.h;var bb=Element.wh(this.box);Element.putAt(this.box,{x:c.x+(c.w/2)-(bb.w/2),y:c.y+(c.h/2)-(bb.h/2)});}
Element.showAt(this.L,{x:c.x,y:c.y,w:1,h:c.h});Element.showAt(this.R,{x:(c.x+c.w),y:c.y,w:1,h:c.h});Element.showAt(this.T,{x:c.x,y:c.y,w:c.w,h:1});Element.showAt(this.B,{x:c.x,y:(c.y+c.h),w:c.w,h:1});Element.putAt(this.TM,{x:c.x+((c.w/2)-4),y:(c.y-2)});Element.putAt(this.BM,{x:c.x+((c.w/2)-4),y:c.y+(c.h-4)});Element.putAt(this.LT,{x:(c.x-3),y:(c.y-2)});Element.putAt(this.LM,{x:(c.x-3),y:c.y+((c.h/2)-3)});Element.putAt(this.LB,{x:(c.x-3),y:c.y+(c.h-4)});Element.putAt(this.RT,{x:c.x+(c.w-4),y:(c.y-2)});Element.putAt(this.RM,{x:c.x+(c.w-4),y:c.y+((c.h/2)-3)});Element.putAt(this.RB,{x:c.x+(c.w-4),y:c.y+(c.h-4)});},hide_frame:function(){if(this.frameactive){this.show_frame({x:-50,y:-50,w:10,h:10});this.frameactive=false;}},border:function(el){var cl=Element.add('div',{},{background:'red',border:'0',margin:0,padding:0,visibility:'hidden'},{clone:el,a:el.parentNode});var cwh=Element.wh(cl);var ewh=Element.wh(el);Element.rem(cl);return{w:(ewh.w-cwh.w),h:(ewh.h-cwh.h)};},minmax:function(src){var i,o,xy;var minW=0;var minH=0;var maxW=0;var maxH=0;var div0=Element.add('div',{},{},{a:src.parentNode});var parXY=Element.wh(div0);Element.rem(div0);var div1=Element.add('div',{},{position:'absolute',top:'0px',left:'0px'},{a:document.body});var div2=Element.add('div',{},{width:'auto',height:'auto',float:'left'},{clone:src,txt:'',a:div1});var outXY=Element.xywh(div1);var innXY=Element.xywh(div2);Element.rem(div1);var ml=innXY.x;var mt=innXY.y;var mr=outXY.w-(innXY.x+innXY.w);var mb=outXY.h-(innXY.y+innXY.h);var ownXY=Element.xywh(src);var els=src.getElementsByTagName('*');for(i=0,len=els.length;i<len;++i){o=els[i];xy=Element.xywh(o);mW=xy.x+xy.w;mH=xy.y+xy.h;if(mW>minW){minW=mW;}if(mH>minH){minH=mH;}}
var a={};a.minW=minW-ownXY.x;if(a.minW<0){a.minW=0;}
a.minH=minH-ownXY.y;if(a.minH<0){a.minH=0;}
a.maxW=(parXY.w-mr-ml);a.maxH=(parXY.h-mt-mb);a.w=ownXY.w;a.h=ownXY.h;if(a.maxW<=0||a.maxW<ownXY.w){a.maxW=parXY.w;}
if(a.maxH<=0||a.maxH<ownXY.h){a.maxH=0;}
return a;},_mouseMove:function(e){var rA;if(!this.init){return;}
var opt=this.resize.options;var m0=this.init.mouse;var mm=this.init.wh;var mb=this.init.border;var mx=this.init.minmax;var pr=opt.proportional;var dX=(m0.x-Mouse.x);var dY=(m0.y-Mouse.y);if(mm.h>0){rA=(mm.w/mm.h);}else{rA=1;}
var newX=(mm.w-dX);var newY=(mm.h-dY);switch(this.init.knob){case this.RM:newX=(mm.w-dX);newY=mm.h;break;case this.LM:newX=(mm.w+dX);newY=mm.h;break;case this.TM:newX=mm.w;newY=(mm.h+dY);break;case this.BM:newX=mm.w;newY=(mm.h-dY);break;case this.RT:if(pr){newX=Math.round((mm.w-(dX*rA)));newY=(mm.h-dX);}break;case this.LT:if(pr){dX=-dX;newX=Math.round((mm.w-(dX*rA)));newY=(mm.h-dX);}break;case this.RB:if(pr){newX=Math.round((mm.w-(dX*rA)));newY=(mm.h-dX);}break;case this.LB:if(pr){dX=-dX;newX=Math.round((mm.w-(dX*rA)));newY=(mm.h-dX);}break;}
if(mx.minW){if(newX<=mx.minW){newX=mx.minW;}}
if(mx.minH){if(newY<=mx.minH){newY=mx.minH;}}
if(mx.maxW){if(newX>=mx.maxW){newX=mx.maxW;}}
if(mx.maxH){if(newY>=mx.maxH){newY=mx.maxH;}}
newX=newX-mb.w;if(newX<0){newX=0;}
newY=newY-mb.h;if(newY<0){newY=0;}
this.element.style.width=newX+'px';this.element.style.height=newY+'px';var p=Element.xywh(this.element);this.show_frame(p);if(typeof opt.mouseMove==='function'){opt.mouseMove(this.element);}
return p;},_mouseDown:function(e){var src=Event.element(e);Event.stop(e);if(src.className!='resizeknob'){return;}
switch(src){case this.TM:Drags.activate(this);break;case this.BM:Drags.activate(this);break;case this.LT:Drags.activate(this);break;case this.LM:Drags.activate(this);break;case this.LB:Drags.activate(this);break;case this.RT:Drags.activate(this);break;case this.RM:Drags.activate(this);break;case this.RB:Drags.activate(this);break;}
var mx=this.minmax(this.element);var opt=this.resize.options;if(opt.min.w){mx.minW=opt.min.w;}
if(opt.min.h){mx.minH=opt.min.h;}
if(opt.max.w){mx.maxW=opt.max.w;}
if(opt.max.h){mx.maxH=opt.max.h;}
this.init={knob:src,mouse:{x:Mouse.x,y:Mouse.y},wh:{w:mx.w,h:mx.h},border:this.border(this.element),minmax:mx};if(typeof opt.startResize==='function'){opt.startResize(this.element);}},_observeClick:function(e){var el,click;if(!this.frameactive){return;}
var src=Event.element(e);var r=Resizes.is_resize(this.element);if(r){click=r.options.click;if(click==true){if(src!=this.element){this.deactivate();}}else if(click==false){}else{el=$(click);if(el==src){this.deactivate();}}}},_mouseUp:function(e){var opt=this.resize.options;if(typeof opt.endResize==='function'){opt.endResize(this.element);}
this.init=false;Browser.cursor('default');},_mouseOver:function(e){var src=Event.element(e);if(src.className==='resizeknob'){src.style.background='black';}},_mouseOut:function(e){var src=Event.element(e);if(src.className==='resizeknob'){src.style.background='white';}}};var Resize=Class.create();Resize.prototype={initialize:function(el){this.element=$(el);this.options=Object.extend({event:'mousedown',startResize:null,mouseMove:null,endResize:null,indicator:true,click:true,proportional:true,min:{w:0,h:0},max:{w:0,h:0}},arguments[1]||{});if(typeof this.options.min==='function'){this.options.min=this.options.min(this);if(!this.options.min){this.options.min={w:0,h:0};}}
if(typeof this.options.max==='function'){this.options.max=this.options.max(this);if(!this.options.max){this.options.max={w:0,h:0};}}
this.eventActivate=this.activate.bindAsEventListener(this);Event.observe(this.element,this.options.event,this.eventActivate);Resizes.register(this);},activate:function(e){var el=Event.element(e);Resizes.activate(el);},destroy:function(){Event.stopObserving(this.element,this.options.event,this.eventActivate);Resizes.unregister(this.element);}};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={_usesLightwindowParams:false,_usesMoodalboxParams:false,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(options){this.options=Object.extend({resizeSpeed:10,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/lightwindow/black.png',presetImage:'/images/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="/images/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},options||{});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,link){this._clearWindowContents(true);this._addLoadingWindowMarkup();this._setupWindowElements(link);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 queue=Effect.Queues.get('lightwindowAnimation').each(function(e){e.cancel();});this._prepareIE(false);this._setupDimensions();this._toggleTroubleElements('visible',false);this._monitorKeyboard(false);},createWindow:function(element,attributes){this._processLink($(element));},activateWindow:function(options){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},options||{});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(element){var element=$(element);this.windowActive=true;this._clearWindowContents(true);this._addLoadingWindowMarkup();this._setupWindowElements(element);this._setStatus(true);this._handleTransition();},navigateWindow:function(direction){this._handleNavigation(false);if(direction=='previous'){this.openWindow(this.navigationObservers.previous);}else if(direction=='next'){this.openWindow(this.navigationObservers.next);}},buildGalleryList:function(){var output='';var galleryLink;for(i in this.galleries){if(typeof this.galleries[i]=='object'){output+=(this.options.skin.gallery.top).replace('{gallery_title_replace}',unescape(i));for(j in this.galleries[i]){if(typeof this.galleries[i][j]=='object'){galleryLink='<a href="#" id="lightwindow_gallery_'+i+'_'+j+'" >'+unescape(j)+'</a>';output+=(this.options.skin.gallery.middle).replace('{gallery_link_replace}',galleryLink);}}
output+=this.options.skin.gallery.bottom;}}
new Insertion.Top('lightwindow_galleries_list',output);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 links=$$('.'+this.options.classNames.standard,'[rel~="moodalbox"]');links.each(function(link){this._processLink(link);}.bind(this));},_processLink:function(link){if(link.hasClassName(this.options.classNames.standard))this._usesLightwindowParams=true;if(link.getAttribute('rel')!=null&&link.getAttribute('rel').indexOf('moodalbox')>=0)this._usesMoodalboxParams=true;if((this._fileType(link.getAttribute('href'))=='image'||this._fileType(link.getAttribute('href'))=='media')){if(gallery=this._getGalleryInfo(link.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(link);}}
var url=link.getAttribute('href');if(url.indexOf('?')>-1){url=url.substring(0,url.indexOf('?'));}
var container=url.substring(url.indexOf('#')+1);if($(container)){$(container).setStyle({display:'none'});}
Event.observe(link,'click',this.activate.bindAsEventListener(this,link),false);link.onclick=function(){return false;};},_setupActions:function(){var links=$$('#lightwindow_container .'+this.options.classNames.action);links.each(function(link){Event.observe(link,'click',this[link.getAttribute('rel')].bindAsEventListener(this,link),false);link.onclick=function(){return false;};}.bind(this));},_addLightWindowMarkup:function(rebuild){var overlay=Element.extend(document.createElement('div'));overlay.setAttribute('id','lightwindow_overlay');if(Prototype.Browser.Gecko){overlay.setStyle({backgroundImage:'url('+this.options.overlay.presetImage+')',backgroundRepeat:'repeat',height:this.pageDimensions.height+'px'});}else{overlay.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 body=document.getElementsByTagName('body')[0];body.appendChild(overlay);body.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(overlay,'click',this.deactivate.bindAsEventListener(this),false);overlay.onclick=function(){return false;};},_addLoadingWindowMarkup:function(){$('lightwindow_contents').innerHTML+=this.options.skin.loading;},_setupWindowElements:function(link){this.element=link;this.element.title=null?'':link.getAttribute('title');this.element.author=null?'':link.getAttribute('author');this.element.caption=null?'':link.getAttribute('caption');this.element.rel=null?'':link.getAttribute('rel');this.element.params=null?'':link.getAttribute('params');this.contentToFetch=this.element.href;this.windowType=this._getParameter('lightwindow_type')?this._getParameter('lightwindow_type'):this._fileType(this.contentToFetch);},_clearWindowContents:function(contents){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(contents){$('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(status){this.animating=status;if(status){Element.show('lightwindow_loading');}
if(!(/MSIE 6./i.test(navigator.userAgent))){this._fixedWindow(status);}},_fixedWindow:function(status){if(status){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(setup){if(Prototype.Browser.IE){var height,overflowX,overflowY;if(setup){var height='100%';}else{var height='auto';}
var body=document.getElementsByTagName('body')[0];var html=document.getElementsByTagName('html')[0];html.style.height=body.style.height=height;}},_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(visibility,content){if(content){var selects=$('lightwindow_contents').getElementsByTagName('select');}else{var selects=document.getElementsByTagName('select');}
for(var i=0;i<selects.length;i++){selects[i].style.visibility=visibility;}
if(!content){if(this.options.hideFlash){var objects=document.getElementsByTagName('object');for(i=0;i!=objects.length;i++){objects[i].style.visibility=visibility;}
var embeds=document.getElementsByTagName('embed');for(i=0;i!=embeds.length;i++){embeds[i].style.visibility=visibility;}}
var iframes=document.getElementsByTagName('iframe');for(i=0;i!=iframes.length;i++){iframes[i].style.visibility=visibility;}}},_getPageDimensions:function(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=document.body.scrollWidth;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){windowWidth=self.innerWidth;windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){this.pageDimensions.height=windowHeight;}else{this.pageDimensions.height=yScroll;}
if(xScroll<windowWidth){this.pageDimensions.width=windowWidth;}else{this.pageDimensions.width=xScroll;}},_displayLightWindow:function(display,visibility){$('lightwindow_overlay').style.display=$('lightwindow').style.display=$('lightwindow_container').style.display=display;$('lightwindow_overlay').style.visibility=$('lightwindow').style.visibility=$('lightwindow_container').style.visibility=visibility;},_setupDimensions:function(){var originalHeight,originalWidth;switch(this.windowType){case'page':originalHeight=this.options.dimensions.page.height;originalWidth=this.options.dimensions.page.width;break;case'image':originalHeight=this.options.dimensions.image.height;originalWidth=this.options.dimensions.image.width;break;case'media':originalHeight=this.options.dimensions.media.height;originalWidth=this.options.dimensions.media.width;break;case'external':originalHeight=this.options.dimensions.external.height;originalWidth=this.options.dimensions.external.width;break;case'inline':originalHeight=this.options.dimensions.inline.height;originalWidth=this.options.dimensions.inline.width;break;default:originalHeight=this.options.dimensions.page.height;originalWidth=this.options.dimensions.page.width;break;}
var offsetHeight=this._getParameter('lightwindow_top')?parseFloat(this._getParameter('lightwindow_top'))+this.pagePosition.y:this.dimensions.viewport.height/2+this.pagePosition.y;var offsetWidth=this._getParameter('lightwindow_left')?parseFloat(this._getParameter('lightwindow_left'))+this.pagePosition.x:this.dimensions.viewport.width/2+this.pagePosition.x;$('lightwindow').setStyle({top:offsetHeight+'px',left:offsetWidth+'px'});$('lightwindow_container').setStyle({height:originalHeight+'px',width:originalWidth+'px',left:-(originalWidth/2)+'px',top:-(originalHeight/2)+'px'});$('lightwindow_contents').setStyle({height:originalHeight+'px',width:originalWidth+'px'});},_fileType:function(url){var image=new RegExp("[^\.]\.("+this.options.fileTypes.image.join('|')+")\s*$","i");if(image.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 type='unknown';var page=new RegExp("[^\.]\.("+this.options.fileTypes.page.join('|')+")\s*$","i");var media=new RegExp("[^\.]\.("+this.options.fileTypes.media.join('|')+")\s*$","i");if(document.domain!=this._getDomain(url))type='external';if(media.test(url))type='media';if(type=='external'||type=='media')return type;if(page.test(url)||url.substr((url.length-1),url.length)=='/')type='page';return type;},_fileExtension:function(url){if(url.indexOf('?')>-1){url=url.substring(0,url.indexOf('?'));}
var extenstion='';for(var x=(url.length-1);x>-1;x--){if(url.charAt(x)=='.'){return extenstion;}
extenstion=url.charAt(x)+extenstion;}},_monitorKeyboard:function(status){if(status)document.onkeydown=this._eventKeypress.bind(this);else document.onkeydown='';},_eventKeypress:function(e){if(e==null){var keycode=event.keyCode;}else{var keycode=e.which;}
switch(keycode){case 27:this.deactivate();break;case 13:return;default:break;}
if(this.animating){return false;}
switch(String.fromCharCode(keycode).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 leadSlashes=url.indexOf('//');var domainStart=leadSlashes+2;var withoutResource=url.substring(domainStart,url.length);var nextSlash=withoutResource.indexOf('/');var domain=withoutResource.substring(0,nextSlash);if(domain.indexOf(':')>-1){var portColon=domain.indexOf(':');domain=domain.substring(0,portColon);}
return domain;},_getParameter:function(parameter,parameters){if(!this.element)return false;if(parameter=='lightwindow_top'&&this.element.top){return unescape(this.element.top);}else if(parameter=='lightwindow_left'&&this.element.left){return unescape(this.element.left);}else if(parameter=='lightwindow_type'&&this.element.type){return unescape(this.element.type);}else if(parameter=='lightwindow_show_images'&&this.element.showImages){return unescape(this.element.showImages);}else if(parameter=='lightwindow_height'&&this.element.height){return unescape(this.element.height);}else if(parameter=='lightwindow_width'&&this.element.width){return unescape(this.element.width);}else if(parameter=='lightwindow_loading_animation'&&this.element.loadingAnimation){return unescape(this.element.loadingAnimation);}else if(parameter=='lightwindow_iframe_embed'&&this.element.iframeEmbed){return unescape(this.element.iframeEmbed);}else if(parameter=='lightwindow_form'&&this.element.form){return unescape(this.element.form);}else{if(!parameters){if(this.element.params)parameters=this.element.params;else return;}
var value;var parameterArray=parameters.split(',');var compareString=parameter+'=';var compareLength=compareString.length;for(var i=0;i<parameterArray.length;i++){if(parameterArray[i].substr(0,compareLength)==compareString){var currentParameter=parameterArray[i].split('=');value=currentParameter[1];break;}}
if(!value)return false;else return unescape(value);}},_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 scrollDiv=Element.extend(document.createElement('div'));scrollDiv.setAttribute('id','lightwindow_scroll_div');scrollDiv.setStyle({position:'absolute',top:'-10000px',left:'-10000px',width:'100px',height:'100px',overflow:'hidden'});var contentDiv=Element.extend(document.createElement('div'));contentDiv.setAttribute('id','lightwindow_content_scroll_div');contentDiv.setStyle({width:'100%',height:'200px'});scrollDiv.appendChild(contentDiv);var body=document.getElementsByTagName('body')[0];body.appendChild(scrollDiv);var noScroll=$('lightwindow_content_scroll_div').offsetWidth;scrollDiv.style.overflow='auto';var withScroll=$('lightwindow_content_scroll_div').offsetWidth;Element.remove($('lightwindow_scroll_div'));this.scrollbarOffset=noScroll-withScroll;},_addParamToObject:function(name,value,object,id){var param=document.createElement('param');param.setAttribute('value',value);param.setAttribute('name',name);if(id){param.setAttribute('id',id);}
object.appendChild(param);return object;},_outerHTML:function(object){if(Prototype.Browser.IE){return object.outerHTML;}else{var clone=object.cloneNode(true);var cloneDiv=document.createElement('div');cloneDiv.appendChild(clone);return cloneDiv.innerHTML;}},_convertToMarkup:function(object,closeTag){var markup=this._outerHTML(object).replace('</'+closeTag+'>','');if(Prototype.Browser.IE){for(var i=0;i<object.childNodes.length;i++){markup+=this._outerHTML(object.childNodes[i]);}
markup+='</'+closeTag+'>';}
return markup;},_appendObject:function(object,closeTag,appendTo){if(Prototype.Browser.IE){appendTo.innerHTML+=this._convertToMarkup(object,closeTag);if(this.options.EOLASFix.indexOf(this._fileType(this.element.href))>-1){var objectElements=document.getElementsByTagName('object');for(var i=0;i<objectElements.length;i++){if(objectElements[i].getAttribute("data"))objectElements[i].removeAttribute('data');objectElements[i].outerHTML=objectElements[i].outerHTML;objectElements[i].style.visibility="visible";}}}else{appendTo.appendChild(object);}},_appendIframe:function(scroll){var iframe=document.createElement('iframe');iframe.setAttribute('id','lightwindow_iframe');iframe.setAttribute('name','lightwindow_iframe');iframe.setAttribute('src','about:blank');iframe.setAttribute('height','100%');iframe.setAttribute('width','100%');iframe.setAttribute('frameborder','0');iframe.setAttribute('marginwidth','0');iframe.setAttribute('marginheight','0');iframe.setAttribute('scrolling',scroll);this._appendObject(iframe,'iframe',$('lightwindow_contents'));},_writeToIframe:function(content){var template=this.options.skin.iframe;template=template.replace('{body_replace}',content);if($('lightwindow_iframe').contentWindow){$('lightwindow_iframe').contentWindow.document.open();$('lightwindow_iframe').contentWindow.document.write(template);$('lightwindow_iframe').contentWindow.document.close();}else{$('lightwindow_iframe').contentDocument.open();$('lightwindow_iframe').contentDocument.write(template);$('lightwindow_iframe').contentDocument.close();}},_loadWindow:function(){switch(this.windowType){case'image':var current=0;var images=[];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(current=0;current<this.galleries[gallery[0]][gallery[1]].length;current++){if(this.contentToFetch.indexOf(this.galleries[gallery[0]][gallery[1]][current].href)>-1){break;}}
if(this.galleries[gallery[0]][gallery[1]][current-this.imageCount]){this.navigationObservers.previous=this.galleries[gallery[0]][gallery[1]][current-this.imageCount];}else{this.navigationObservers.previous=false;}
if(this.galleries[gallery[0]][gallery[1]][current+this.imageCount]){this.navigationObservers.next=this.galleries[gallery[0]][gallery[1]][current+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=current;i<(current+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;}}
images[i]=document.createElement('img');images[i].setAttribute('id','lightwindow_image_'+i);images[i].setAttribute('border','0');images[i].setAttribute('src',this.contentToFetch);$('lightwindow_contents').appendChild(images[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 imageHeight=$('lightwindow_image_'+i).getHeight();if(imageHeight>this.resizeTo.height){this.resizeTo.height=imageHeight;}
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 current=0;this.resizeTo.height=this.resizeTo.width=0;if(gallery=this._getGalleryInfo(this.element.rel)){for(current=0;current<this.galleries[gallery[0]][gallery[1]].length;current++){if(this.contentToFetch.indexOf(this.galleries[gallery[0]][gallery[1]][current].href)>-1){break;}}
if(this.galleries[gallery[0]][gallery[1]][current-1]){this.navigationObservers.previous=this.galleries[gallery[0]][gallery[1]][current-1];}else{this.navigationObservers.previous=false;}
if(this.galleries[gallery[0]][gallery[1]][current+1]){this.navigationObservers.next=this.galleries[gallery[0]][gallery[1]][current+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]][current]){this.contentToFetch=this.galleries[gallery[0]][gallery[1]][current].href;this.galleryLocation={current:current+1,total:this.galleries[gallery[0]][gallery[1]].length};if(!this.galleries[gallery[0]][gallery[1]][current+1]){$('lightwindow_next').setStyle({display:'none'});}else{$('lightwindow_next').setStyle({display:'block'});$('lightwindow_next_title').innerHTML=this.galleries[gallery[0]][gallery[1]][current+1].title;}
if(!this.galleries[gallery[0]][gallery[1]][current-1]){$('lightwindow_previous').setStyle({display:'none'});}else{$('lightwindow_previous').setStyle({display:'block'});$('lightwindow_previous_title').innerHTML=this.galleries[gallery[0]][gallery[1]][current-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 newAJAX=new Ajax.Request(this.contentToFetch,{method:'get',parameters:'',onComplete:function(response){$('lightwindow_contents').innerHTML+=response.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 content=this.contentToFetch;if(content.indexOf('?')>-1){content=content.substring(0,content.indexOf('?'));}
content=content.substring(content.indexOf('#')+1);new Insertion.Top($('lightwindow_contents'),$(content).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 heightRatio=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/heightRatio;$('lightwindow_data_slide_inner').setStyle({width:this.resizeTo.width+'px'});}}
if(this.resizeTo.width+this.dimensions.cruft.width>this.dimensions.viewport.width){var widthRatio=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/widthRatio;$('lightwindow_data_slide_inner').setStyle({height:this.resizeTo.height+'px'});}}},_presetWindowSize:function(){if(this._usesLightwindowParams){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'));}}
else if(this._usesMoodalboxParams){var moodalboxParams=this.element.rel.split(' ');this.resizeTo.width=parseFloat(moodalboxParams[1]);this.resizeTo.height=parseFloat(moodalboxParams[2]);this.windowType='page';}},_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 originalContainerDimensions={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 newContainerDimensions={height:$('lightwindow_container').getHeight(),width:$('lightwindow_container').getWidth()};this.containerChange={height:originalContainerDimensions.height-newContainerDimensions.height,width:originalContainerDimensions.width-newContainerDimensions.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(display){if(this.options.navigationHandler){this.options.navigationHandler().bind(this,display);}else{this._defaultDisplayNavigation(display);}},_handleTransition:function(){if(this.options.transitionHandler){this.options.transitionHandler().bind(this);}else{this._defaultTransitionHandler();}},_handleFinalWindowAnimation:function(delay){if(this.options.finalAnimationHandler){this.options.finalAnimationHandler().bind(this,delay);}else{this._defaultfinalWindowAnimationHandler(delay);}},_handleGalleryAnimation:function(list){if(this.options.galleryAnimationHandler){this.options.galleryAnimationHandler().bind(this,list);}else{this._defaultGalleryAnimationHandler(list);}},_defaultDisplayNavigation:function(display){if(display){$('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.0,to:1.0}));}
$('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.0,to:1.0}));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 resized=false;var ratio=this.dimensions.container.width-$('lightwindow_contents').getWidth()+this.resizeTo.width+this.options.contentOffset.width;if(ratio!=$('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*(ratio/(this.dimensions.container.width)),{sync:true,scaleY:false,scaleFromCenter:true,scaleContent:false})],{duration:this.duration,delay:0.25,queue:{position:'end',scope:'lightwindowAnimation'}});}
ratio=this.dimensions.container.height-$('lightwindow_contents').getHeight()+this.resizeTo.height+this.options.contentOffset.height;if(ratio!=$('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*(ratio/(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'}});resized=true;}
if(!resized&&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(delay){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.0,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(list){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(list){if($('lightwindow_galleries_list').getHeight()==0){var height=$('lightwindow_contents').getHeight()*0.80;$('lightwindow_galleries_tab_span').className='down';}else{var height=0;$('lightwindow_galleries_tab_span').className='up';}
new Effect.Morph('lightwindow_galleries_list',{duration:this.duration,transition:Effect.Transitions.sinoidal,style:{height:height+'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.0,to:0.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.0,to:0.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 element=Event.element(e).parentNode;var parameterString=Form.serialize(this._getParameter('lightwindow_form',element.getAttribute('params')));if(this.options.formMethod=='post'){var newAJAX=new Ajax.Request(element.href,{method:'post',postBody:parameterString,onComplete:this.openWindow.bind(this,element)});}else if(this.options.formMethod=='get'){var newAJAX=new Ajax.Request(element.href,{method:'get',parameters:parameterString,onComplete:this.openWindow.bind(this,element)});}},_finishWindow:function(){if(this.windowType=='external'){$('lightwindow_iframe').setAttribute('src',this.element.href);this._handleFinalWindowAnimation(1);}else if(this.windowType=='media'){var outerObject=document.createElement('object');outerObject.setAttribute('classid',this.options.classids[this._fileExtension(this.contentToFetch)]);outerObject.setAttribute('codebase',this.options.codebases[this._fileExtension(this.contentToFetch)]);outerObject.setAttribute('id','lightwindow_media_primary');outerObject.setAttribute('name','lightwindow_media_primary');outerObject.setAttribute('width',this.resizeTo.width);outerObject.setAttribute('height',this.resizeTo.height);outerObject=this._addParamToObject('movie',this.contentToFetch,outerObject);outerObject=this._addParamToObject('src',this.contentToFetch,outerObject);outerObject=this._addParamToObject('controller','true',outerObject);outerObject=this._addParamToObject('wmode','transparent',outerObject);outerObject=this._addParamToObject('cache','false',outerObject);outerObject=this._addParamToObject('quality','high',outerObject);if(!Prototype.Browser.IE){var innerObject=document.createElement('object');innerObject.setAttribute('type',this.options.mimeTypes[this._fileExtension(this.contentToFetch)]);innerObject.setAttribute('data',this.contentToFetch);innerObject.setAttribute('id','lightwindow_media_secondary');innerObject.setAttribute('name','lightwindow_media_secondary');innerObject.setAttribute('width',this.resizeTo.width);innerObject.setAttribute('height',this.resizeTo.height);innerObject=this._addParamToObject('controller','true',innerObject);innerObject=this._addParamToObject('wmode','transparent',innerObject);innerObject=this._addParamToObject('cache','false',innerObject);innerObject=this._addParamToObject('quality','high',innerObject);outerObject.appendChild(innerObject);}
if(this._getParameter('lightwindow_iframe_embed')){this._appendIframe('no');this._writeToIframe(this._convertToMarkup(outerObject,'object'));}else{this._appendObject(outerObject,'object',$('lightwindow_contents'));}
this._handleFinalWindowAnimation(0);}else{this._handleFinalWindowAnimation(0);}
this._setupActions();}}
var myLightWindow=null;function lightwindowInit(){myLightWindow=new lightwindow();}
Showcase=Class.create(Abstract,{initialize:function(sections,controls,options){this.allSections=this.sections=sections;this.controls=controls;this.options=Object.extend({ratio:0.5,initialDelay:1,duration:0.5,size:this.sections.size()},options||{});this.running=false;this.queue=new Array;this.computeMetrics();this.sections=this.allSections.slice(this.currentIndex-this.half,this.currentIndex+this.half+1);this.allSections.each((function(section,index){section.setStyle({position:'absolute',zIndex:Math.abs(index-this.sections.size()),left:'50%',top:'50%',marginLeft:-Math.round(section.getWidth()/2)+'px',marginTop:-Math.round(section.getHeight()/2)+'px'}).initialIndex=index;section.observe('click',this.jump.bind(this)).observe('mouseover',function(event){section.setOpacity(1);}).observe('mouseout',function(){section.setOpacity(section.opacity);}).opacity=1;if(!this.sections.member(section)){this.queue.push(section.hide());}}).bind(this));for(i=0;i<=this.half;i++){this.sections.push(this.sections.shift());}
this.controls.invoke('observe','click',this.click.bind(this));(this.animate.bind(this)).delay(this.options.initialDelay);},computeMetrics:function(){this.half=this.currentIndex=(this.options.size-1)/2;this.ratioStep=Math.round(((1-this.options.ratio)/this.currentIndex)*100)/100;this.positionStep=Math.round(50/this.half*100)/100;this.maxDimensions=this.sections.first().getDimensions();},click:function(event){event.stop();var element=event.findElement('a');if(!this.running){eval("this."+element.rel+"()");}
this.animate(element.rel);},previous:function(){if(this.options.size<this.allSections.size()){var sectionIn=this.queue.shift();var sectionOut=this.sections.pop();this.sections.unshift(sectionIn);this.queue.push(sectionOut.fade({duration:this.options.duration}));}else{this.sections.unshift(this.sections.pop());}},next:function(){if(this.options.size<this.allSections.size()){var sectionIn=this.queue.shift();var sectionOut=this.sections.shift();this.sections.push(sectionIn);this.queue.push(sectionOut.fade({duration:this.options.duration}));}else{this.sections.push(this.sections.shift());}},jump:function(event){event.stop();if(!this.running){var section=this.sections[this.sections.indexOf(event.findElement('li'))];var direction='';if(section.index<this.half){(this.half-section.index).times((function(){this.previous();}).bind(this));direction='previous';}else if(section.index==this.half){}else{(section.index-this.half).times((function(){this.next();}).bind(this));direction='next';}}
this.animate(direction);},runEffects:function(){this.stackSections.bind(this).delay(this.options.duration/2);this.running=new Effect.Parallel(this.effects.map(function(effect){return new Effect.Parallel([new Effect.Morph(effect.section,{style:effect.style,sync:true,delay:1,transition:Effect.Transitions.linear}),new Effect.Appear(effect.section,{to:Math.min(effect.section.ratio,1),sync:true})],{sync:true,beforeStart:function(){}});}),{duration:this.options.duration,afterFinish:(function(){this.running=false;}).bind(this)});},stackSections:function(){this.sections.each(function(section){section.setStyle({zIndex:section.stackIndex});});},indexSections:function(){this.sections.each((function(section,index){section.index=index;section.modifier=Math.abs(Math.abs((section.index-(this.sections.size()-1)/2))-this.half);section.ratio=Math.round(((section.modifier*this.ratioStep)+this.options.ratio)*100)/100;section.width=Math.min(Math.round(this.maxDimensions.width*section.ratio),this.maxDimensions.width);section.height=Math.min(Math.round(this.maxDimensions.height*section.ratio),this.maxDimensions.height);section.positionIndex=(section.index-(this.sections.size()-1)/2);section.stackIndex=Math.abs(Math.abs((section.index-(this.sections.size()-1)/2))-this.half)+1;section.left=section.top=Math.round((this.half+section.positionIndex)*this.positionStep);section.opacity=Math.min(section.ratio,1);}).bind(this));}});Showcase.Horizontal=Class.create(Showcase,{animate:function(direction){this.indexSections();this.effects=new Array();this.sections.each((function(section){var style={left:section.left+'%',top:'50%',marginTop:-Math.abs(section.height/2)+'px',width:section.width+'px',height:section.height+'px'};if(section.left==0){style.marginLeft='0px';}else if(section.left==50){style.marginLeft=-Math.round(section.width/2)+'px';}else if(section.left==100){style.marginLeft=-section.width+'px';}else{style.marginLeft=-Math.round(section.width/2)+'px';}
this.effects.push({section:section,style:style});}).bind(this));this.currentIndex=this.sections[this.half].initialIndex;this.runEffects();}});Showcase.Vertical=Class.create(Showcase,{animate:function(direction){this.indexSections();this.effects=new Array();this.sections.each((function(section){var style={top:section.top+'%',left:'50%',marginLeft:-Math.abs(section.width/2)+'px',width:section.width+'px',height:section.height+'px'};if(section.top==0){style.marginTop='0px';}else if(section.top==50){style.marginTop=-Math.round(section.height/2)+'px';}else if(section.top==100){style.marginTop=-section.height+'px';}else{style.marginTop=-Math.round(section.height/2)+'px';}
this.effects.push({section:section,style:style});}).bind(this));this.currentIndex=this.sections[this.half].initialIndex;this.runEffects();}});Showcase.Diagonal=Class.create(Showcase,{animate:function(direction){this.indexSections();this.effects=new Array();this.sections.each((function(section){var style={left:section.left+'%',top:section.top+'%',width:section.width+'px',height:section.height+'px'};if(section.left==0){style.marginLeft='0px';}else if(section.left==50){style.marginLeft=-Math.round(section.width/2)+'px';}else if(section.left==100){style.marginLeft=-section.width+'px';}else{style.marginLeft=-Math.round(section.width/2)+'px';}
if(section.top==0){style.marginTop='0px';}else if(section.top==50){style.marginTop=-Math.round(section.height/2)+'px';}else if(section.top==100){style.marginTop=-section.height+'px';}else{style.marginTop=-Math.round(section.height/2)+'px';}
this.effects.push({section:section,style:style});}).bind(this));this.currentIndex=this.sections[this.half].initialIndex;this.runEffects();}});Carousel=Class.create(Abstract,{initialize:function(scroller,slides,controls,options){this.scrolling=false;this.scroller=scroller;this.slides=slides;this.controls=controls;this.options=Object.extend({duration:1.0,frequency:3,controlClassName:'carousel-control',jumperClassName:'carousel-jumper'},options||{});this.slides.each(function(slide,index){slide._index=index;});if(this.controls){this.controls.invoke('observe','click',this.click.bind(this));}
if(this.options.auto){this.start();this.slides.invoke('observe','mouseover',this.pause.bind(this));this.slides.invoke('observe','mouseout',this.resume.bind(this));}},click:function(event){this.stop();var element=event.findElement('a');if(!element.hasClassName('disabled')){this.deactivateControls();if(element.hasClassName(this.options.controlClassName)){eval("this."+element.rel+"()");}else if(element.hasClassName(this.options.jumperClassName)){this.moveTo(element,element.rel);}}
event.stop();},moveTo:function(trigger,element){if(this.options.beforeMove&&(typeof this.options.beforeMove=='function')){this.options.beforeMove();}
if(this.controls&&this.options.selectedClassName){this.controls.each((function(elm){elm.removeClassName(this.options.selectedClassName);}).bind(this));trigger.addClassName(this.options.selectedClassName);}
this.previous=this.current?this.current:this.slides[0];this.current=$(element);var scrollerOffset=this.scroller.cumulativeOffset();var elementOffset=this.current.cumulativeOffset();if(this.scrolling){this.scrolling.cancel();}
this.scrolling=new Effect.SmoothScroll(this.scroller,{duration:this.options.duration,x:(elementOffset[0]-scrollerOffset[0]),y:(elementOffset[1]-scrollerOffset[1]),queue:{position:'end',limit:1,scope:this.scroller.id},afterFinish:(function(){if(this.controls){this.activateControls();}}).bind(this)});if(this.options.afterMove&&(typeof this.options.afterMove=='function')){this.options.afterMove();}
return false;},prev:function(){if(this.current){var currentIndex=this.current._index;var prevIndex=(currentIndex==0)?this.slides.length-1:currentIndex-1;}else{var prevIndex=this.slides.length-1;}
this.moveTo(this.controls?this.controls[prevIndex]:false,this.slides[prevIndex]);},next:function(){if(this.current){var currentIndex=this.current._index;var nextIndex=(this.slides.length-1==currentIndex)?0:currentIndex+1;}else{var nextIndex=1;}
this.moveTo(this.controls?this.controls[nextIndex]:false,this.slides[nextIndex]);},first:function(){var firstIndex=0;if(this.current){var currentIndex=this.current._index;}
this.moveTo(this.controls[firstIndex],this.slides[firstIndex]);},last:function(){var lastIndex=(this.slides.length-1);if(this.current){var currentIndex=this.current._index;}
this.moveTo(this.controls[lastIndex],this.slides[lastIndex]);},toggle:function(){if(this.previous){this.moveTo(this.controls[this.previous._index],this.slides[this.previous._index]);}else{return false;}},stop:function(){clearTimeout(this.timer);},start:function(){this.periodicallyUpdate();},pause:function(event){this.stop();this.activateControls();},resume:function(event){if(event){var related=event.relatedTarget||event.toElement;if(!related||(!this.slides.include(related)&&!this.slides.any(function(slide){return related.descendantOf(slide);}))){this.start();}}else{this.start();}},periodicallyUpdate:function(){if(this.timer!=null){clearTimeout(this.timer);this.next();}
this.timer=setTimeout(this.periodicallyUpdate.bind(this),this.options.frequency*1000);},deactivateControls:function(){this.controls.invoke('addClassName','disabled');},activateControls:function(){this.controls.invoke('removeClassName','disabled');}});Effect.SmoothScroll=Class.create();Object.extend(Object.extend(Effect.SmoothScroll.prototype,Effect.Base.prototype),{initialize:function(element){this.element=$(element);var options=Object.extend({x:0,y:0,mode:'absolute'},arguments[1]||{});this.start(options);},setup:function(){if(this.options.continuous&&!this.element._ext){this.element.cleanWhitespace();this.element._ext=true;this.element.appendChild(this.element.firstChild);}
this.originalLeft=this.element.scrollLeft;this.originalTop=this.element.scrollTop;if(this.options.mode=='absolute'){this.options.x-=this.originalLeft;this.options.y-=this.originalTop;}},update:function(position){this.element.scrollLeft=this.options.x*position+this.originalLeft;this.element.scrollTop=this.options.y*position+this.originalTop;}});Event.observe(window,'load',function(){if(lightwindowInit)lightwindowInit();$$('.watermark').each(function(element){new Watermark(element,'watermark');});$$('.tip').each(function(element){new Tips(element,'tip');});if($('tSearch')&&$('tSearchUpdate')){var searchAutocompleter=new Ajax.Autocompleter('tSearch','tSearchUpdate','/User-Search-Parameters.aspx',{paramName:'tSearch',minChars:2,parameters:'max=6',afterUpdateElement:function(e){document.location='/SearchResults.aspx?tSearch='+$('tSearch').value;}});}
var loadingSmall=new Image();loadingSmall.src='/images/design/loadingSmall.gif';var loadingMedium=new Image();loadingMedium.src='/images/design/loadingMedium.gif';var loadingLarge=new Image();loadingLarge.src='/images/design/loadingLarge.gif';});