/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

/*  Prototype JavaScript framework, version 1.6.0.2
 *  (c) 2005-2008 Sam Stephenson
 *
 *  Prototype is freely distributable under the terms of an MIT-style license.
 *  For details, see the Prototype web site: http://www.prototypejs.org/
 *
 *--------------------------------------------------------------------------*/

eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('G Y={6Q:\'1.6.0.2\',1w:{2N:!!(1i.5J&&!1i.6R),3J:!!1i.6R,3j:3K.3L.2O(\'bp/\')>-1,5K:3K.3L.2O(\'5K\')>-1&&3K.3L.2O(\'8A\')==-1,8B:!!3K.3L.1k(/bq.*br.*8C/)},2P:{5L:!!V.2b,4R:!!1i.4S,5M:V.2Q(\'2k\').3M&&V.2Q(\'2k\').3M!==V.2Q(\'6S\').3M},5N:\'<4T[^>]*>([\\\\S\\\\s]*?)<\\/4T>\',8D:/^\\/\\*-bs-([\\s\\S]*)\\*\\/\\s*$/,2q:q(){},K:q(x){o x}};E(Y.1w.8B)Y.2P.5M=1d;G 1E={1L:q(){G a=17,4U=$A(1c);E(J.1M(4U[0]))a=4U.3N();q 2r(){C.22.2B(C,1c)}J.U(2r,1E.W);2r.6T=a;2r.8E=[];E(a){G b=q(){};b.18=a.18;2r.18=1e b;a.8E.14(2r)}N(G i=0;i<4U.M;i++)2r.4V(4U[i]);E(!2r.18.22)2r.18.22=Y.2q;2r.18.bt=2r;o 2r}};1E.W={4V:q(a){G b=C.6T&&C.6T.18;G c=J.4g(a);E(!J.4g({24:1f}).M)c.14("24","8F");N(G i=0,M=c.M;i<M;i++){G d=c[i],1g=a[d];E(b&&J.1M(1g)&&1g.8G().2C()=="$2Y"){G e=1g,1g=J.U((q(m){o q(){o b[m].2B(C,1c)}})(d).3O(e),{8F:q(){o e},24:q(){o e.24()}})}C.18[d]=1g}o C}};G 3P={};J.U=q(a,b){N(G c 1s b)a[c]=b[c];o a};J.U(J,{1W:q(a){1N{E(J.1X(a))o\'3k\';E(a===17)o\'17\';o a.1W?a.1W():1B(a)}1Y(e){E(e 8H bu)o\'...\';3l e;}},2s:q(a){G b=2R a;4h(b){1O\'3k\':1O\'q\':1O\'bv\':o;1O\'bw\':o a.24()}E(a===17)o\'17\';E(a.2s)o a.2s();E(J.2Z(a))o;G c=[];N(G d 1s a){G e=J.2s(a[d]);E(!J.1X(e))c.14(d.2s()+\': \'+e)}o\'{\'+c.1P(\', \')+\'}\'},3m:q(a){o $H(a).3m()},31:q(a){o a&&a.31?a.31():1B.4i(a)},4g:q(a){G b=[];N(G c 1s a)b.14(c);o b},25:q(a){G b=[];N(G c 1s a)b.14(a[c]);o b},1Z:q(a){o J.U({},a)},2Z:q(a){o a&&a.2t==1},3n:q(a){o a!=17&&2R a=="2D"&&\'bx\'1s a&&\'1P\'1s a},6U:q(a){o a 8H 2S},1M:q(a){o 2R a=="q"},2l:q(a){o 2R a=="5O"},3Q:q(a){o 2R a=="by"},1X:q(a){o 2R a=="3k"}});J.U(6V.18,{8G:q(){G a=C.24().1k(/^[\\s\\(]*q[^(]*\\((.*?)\\)/)[1].32(",").5P("2T");o a.M==1&&!a[0]?[]:a},1o:q(){E(1c.M<2&&J.1X(1c[0]))o C;G a=C,2c=$A(1c),2D=2c.3N();o q(){o a.2B(2D,2c.1z($A(1c)))}},bz:q(){G b=C,2c=$A(1c),2D=2c.3N();o q(a){o b.2B(2D,[a||1i.bA].1z(2c))}},5Q:q(){E(!1c.M)o C;G a=C,2c=$A(1c);o q(){o a.2B(C,2c.1z($A(1c)))}},6W:q(){G a=C,2c=$A(1c),8I=2c.3N()*8J;o 1i.bB(q(){o a.2B(a,2c)},8I)},3O:q(a){G b=C;o q(){o a.2B(C,[b.1o(C)].1z($A(1c)))}},3o:q(){E(C.6X)o C.6X;G a=C;o C.6X=q(){o a.2B(17,[C].1z($A(1c)))}}});6V.18.3p=6V.18.6W.5Q(0.bC);bD.18.2s=q(){o\'"\'+C.bE()+\'-\'+(C.bF()+1).3q(2)+\'-\'+C.bG().3q(2)+\'T\'+C.bH().3q(2)+\':\'+C.bI().3q(2)+\':\'+C.bJ().3q(2)+\'Z"\'};G 8K={8L:q(){G a;N(G i=0,M=1c.M;i<M;i++){G b=1c[i];1N{a=b();1F}1Y(e){}}o a}};3a.18.1k=3a.18.2d;3a.8M=q(a){o 1B(a).1x(/([.*+?^=!:${}()|[\\]\\/\\\\])/g,\'\\\\$1\')};G 8N=1E.1L({22:q(a,b){C.4W=a;C.4X=b;C.5R=1d;C.4Y()},4Y:q(){C.4j=8O(C.4Z.1o(C),C.4X*8J)},6Y:q(){C.4W(C)},6Z:q(){E(!C.4j)o;8P(C.4j);C.4j=17},4Z:q(){E(!C.5R){1N{C.5R=1f;C.6Y()}bK{C.5R=1d}}}});J.U(1B,{4i:q(a){o a==17?\'\':1B(a)},8Q:{\'\\b\':\'\\\\b\',\'\\t\':\'\\\\t\',\'\\n\':\'\\\\n\',\'\\f\':\'\\\\f\',\'\\r\':\'\\\\r\',\'\\\\\':\'\\\\\\\\\'}});J.U(1B.18,{2m:q(a,b){G c=\'\',3r=C,1k;b=1c.4k.70(b);1q(3r.M>0){E(1k=3r.1k(a)){c+=3r.3s(0,1k.50);c+=1B.4i(b(1k));3r=3r.3s(1k.50+1k[0].M)}19{c+=3r,3r=\'\'}}o c},8R:q(b,c,d){c=C.2m.70(c);d=J.1X(d)?1:d;o C.2m(b,q(a){E(--d<0)o a[0];o c(a)})},8S:q(a,b){C.2m(a,b);o 1B(C)},bL:q(a,b){a=a||30;b=J.1X(b)?\'...\':b;o C.M>a?C.3s(0,a-b.M)+b:1B(C)},2T:q(){o C.1x(/^\\s+/,\'\').1x(/\\s+$/,\'\')},8T:q(){o C.1x(/<\\/?[^>]+>/8U,\'\')},3b:q(){o C.1x(1e 3a(Y.5N,\'8V\'),\'\')},8W:q(){G b=1e 3a(Y.5N,\'8V\');G c=1e 3a(Y.5N,\'bM\');o(C.1k(b)||[]).2e(q(a){o(a.1k(c)||[\'\',\'\'])[1]})},3R:q(){o C.8W().2e(q(a){o 5S(a)})},5T:q(){G a=1c.4k;a.2U.bN=C;o a.2k.3t},8X:q(){G c=1e I(\'2k\');c.3t=C.8T();o c.2o[0]?(c.2o.M>1?$A(c.2o).2E(\'\',q(a,b){o a+b.71}):c.2o[0].71):\'\'},5U:q(e){G f=C.2T().1k(/([^?#]*)(#.*)?$/);E(!f)o{};o f[1].32(e||\'&\').2E({},q(a,b){E((b=b.32(\'=\'))[0]){G c=72(b.3N());G d=b.M>1?b.1P(\'=\'):b[0];E(d!=3k)d=72(d);E(c 1s a){E(!J.3n(a[c]))a[c]=[a[c]];a[c].14(d)}19 a[c]=d}o a})},2u:q(){o C.32(\'\')},73:q(){o C.3s(0,C.M-1)+1B.bO(C.8Y(C.M-1)+1)},5V:q(a){o a<1?\'\':1e 1I(a+1).1P(C)},74:q(){G a=C.32(\'-\'),75=a.M;E(75==1)o a[0];G b=C.5W(0)==\'-\'?a[0].5W(0).2f()+a[0].4l(1):a[0];N(G i=1;i<75;i++)b+=a[i].5W(0).2f()+a[i].4l(1);o b},51:q(){o C.5W(0).2f()+C.4l(1).1G()},bP:q(){o C.2m(/::/,\'/\').2m(/([A-Z]+)([A-Z][a-z])/,\'#{1}52#{2}\').2m(/([a-z\\d])([A-Z])/,\'#{1}52#{2}\').2m(/-/,\'52\').1G()},bQ:q(){o C.2m(/52/,\'-\')},1W:q(c){G d=C.2m(/[\\bR-\\bS\\\\]/,q(a){G b=1B.8Q[a[0]];o b?b:\'\\\\bT\'+a[0].8Y().3q(2,16)});E(c)o\'"\'+d.1x(/"/g,\'\\\\"\')+\'"\';o"\'"+d.1x(/\'/g,\'\\\\\\\'\')+"\'"},2s:q(){o C.1W(1f)},76:q(a){o C.8R(a||Y.8D,\'#{1}\')},8Z:q(){G a=C;E(a.3S())o 1d;a=C.1x(/\\\\./g,\'@\').1x(/"[^"\\\\\\n\\r]*"/g,\'\');o(/^[,:{}\\[\\]0-9.\\-+bU-u \\n\\r\\t]*$/).2d(a)},4m:q(a){G b=C.76();1N{E(!a||b.8Z())o 5S(\'(\'+b+\')\')}1Y(e){}3l 1e bV(\'bW bX 90 5O: \'+C.1W());},1p:q(a){o C.2O(a)>-1},77:q(a){o C.2O(a)===0},91:q(a){G d=C.M-a.M;o d>=0&&C.78(a)===d},4n:q(){o C==\'\'},3S:q(){o/^\\s*$/.2d(C)},92:q(a,b){o 1e 2g(C,b).2b(a)}});E(Y.1w.3j||Y.1w.2N)J.U(1B.18,{5T:q(){o C.1x(/&/g,\'&93;\').1x(/</g,\'&94;\').1x(/>/g,\'&95;\')},8X:q(){o C.1x(/&93;/g,\'&\').1x(/&94;/g,\'<\').1x(/&95;/g,\'>\')}});1B.18.2m.70=q(b){E(J.1M(b))o b;G c=1e 2g(b);o q(a){o c.2b(a)}};1B.18.bY=1B.18.5U;J.U(1B.18.5T,{2k:V.2Q(\'2k\'),2U:V.96(\'\')});97(1B.18.5T)2k.4o(2U);G 2g=1E.1L({22:q(a,b){C.98=a.24();C.99=b||2g.9a},2b:q(f){E(J.1M(f.79))f=f.79();o C.98.2m(C.99,q(a){E(f==17)o\'\';G b=a[1]||\'\';E(b==\'\\\\\')o a[2];G c=f,53=a[3];G d=/^([^.[]+|\\[((?:.*?[^\\\\])?)\\])(\\.|\\[|$)/;a=d.9b(53);E(a==17)o b;1q(a!=17){G e=a[1].77(\'[\')?a[2].2m(\'\\\\\\\\]\',\']\'):a[1];c=c[e];E(17==c||\'\'==a[3])1F;53=53.4l(\'[\'==a[3]?a[1].M:a[0].M);a=d.9b(53)}o b+1B.4i(c)})}});2g.9a=/(^|.|\\r|\\n)(#\\{(.*?)\\})/;G $1F={};G 26={1l:q(b,c){G d=0;b=b.1o(c);1N{C.3c(q(a){b(a,d++)})}1Y(e){E(e!=$1F)3l e;}o C},9c:q(a,b,c){b=b?b.1o(c):Y.K;G d=-a,7a=[],7b=C.2u();1q((d+=a)<7b.M)7a.14(7b.3s(d,d+a));o 7a.7c(b,c)},7d:q(c,d){c=c?c.1o(d):Y.K;G e=1f;C.1l(q(a,b){e=e&&!!c(a,b);E(!e)3l $1F;});o e},9d:q(c,d){c=c?c.1o(d):Y.K;G e=1d;C.1l(q(a,b){E(e=!!c(a,b))3l $1F;});o e},7c:q(c,d){c=c?c.1o(d):Y.K;G e=[];C.1l(q(a,b){e.14(c(a,b))});o e},5X:q(c,d){c=c.1o(d);G e;C.1l(q(a,b){E(c(a,b)){e=a;3l $1F;}});o e},4p:q(c,d){c=c.1o(d);G e=[];C.1l(q(a,b){E(c(a,b))e.14(a)});o e},bZ:q(c,d,e){d=d?d.1o(e):Y.K;G f=[];E(J.2l(c))c=1e 3a(c);C.1l(q(a,b){E(c.1k(a))f.14(d(a,b))});o f},1p:q(b){E(J.1M(C.2O))E(C.2O(b)!=-1)o 1f;G c=1d;C.1l(q(a){E(a==b){c=1f;3l $1F;}});o c},c0:q(b,c){c=J.1X(c)?17:c;o C.9c(b,q(a){1q(a.M<b)a.14(c);o a})},2E:q(c,d,e){d=d.1o(e);C.1l(q(a,b){c=d(c,a,b)});o c},5P:q(b){G c=$A(1c).3s(1);o C.2e(q(a){o a[b].2B(a,c)})},c1:q(c,d){c=c?c.1o(d):Y.K;G e;C.1l(q(a,b){a=c(a,b);E(e==17||a>=e)e=a});o e},c2:q(c,d){c=c?c.1o(d):Y.K;G e;C.1l(q(a,b){a=c(a,b);E(e==17||a<e)e=a});o e},c3:q(c,d){c=c?c.1o(d):Y.K;G e=[],7e=[];C.1l(q(a,b){(c(a,b)?e:7e).14(a)});o[e,7e]},4q:q(b){G c=[];C.1l(q(a){c.14(a[b])});o c},c4:q(c,d){c=c.1o(d);G e=[];C.1l(q(a,b){E(!c(a,b))e.14(a)});o e},9e:q(e,f){e=e.1o(f);o C.2e(q(a,b){o{1g:a,54:e(a,b)}}).c5(q(c,d){G a=c.54,b=d.54;o a<b?-1:a>b?1:0}).4q(\'1g\')},2u:q(){o C.2e()},c6:q(){G c=Y.K,2c=$A(1c);E(J.1M(2c.1Q()))c=2c.c7();G d=[C].1z(2c).2e($A);o C.2e(q(a,b){o c(d.4q(b))})},9f:q(){o C.2u().M},1W:q(){o\'#<26:\'+C.2u().1W()+\'>\'}};J.U(26,{2e:26.7c,7f:26.5X,20:26.4p,4r:26.4p,c8:26.1p,c9:26.2u,ca:26.7d,cb:26.9d});q $A(a){E(!a)o[];E(a.2u)o a.2u();G b=a.M||0,15=1e 1I(b);1q(b--)15[b]=a[b];o 15}E(Y.1w.3j){$A=q(a){E(!a)o[];E(!(J.1M(a)&&a==\'[2D cc]\')&&a.2u)o a.2u();G b=a.M||0,15=1e 1I(b);1q(b--)15[b]=a[b];o 15}}1I.9g=$A;J.U(1I.18,26);E(!1I.18.7g)1I.18.7g=1I.18.55;J.U(1I.18,{3c:q(a){N(G i=0,M=C.M;i<M;i++)a(C[i])},9h:q(){C.M=0;o C},2C:q(){o C[0]},1Q:q(){o C[C.M-1]},cd:q(){o C.20(q(a){o a!=17})},9i:q(){o C.2E([],q(a,b){o a.1z(J.3n(b)?b.9i():[b])})},56:q(){G b=$A(1c);o C.20(q(a){o!b.1p(a)})},55:q(a){o(a!==1d?C:C.2u()).7g()},ce:q(){o C.M>1?C:C[0]},9j:q(d){o C.2E([],q(a,b,c){E(0==c||(d?a.1Q()!=b:!a.1p(b)))a.14(b);o a})},cf:q(c){o C.9j().4p(q(b){o c.5X(q(a){o b===a})})},1Z:q(){o[].1z(C)},9f:q(){o C.M},1W:q(){o\'[\'+C.2e(J.1W).1P(\', \')+\']\'},2s:q(){G c=[];C.1l(q(a){G b=J.2s(a);E(!J.1X(b))c.14(b)});o\'[\'+c.1P(\', \')+\']\'}});E(J.1M(1I.18.9k))1I.18.3c=1I.18.9k;E(!1I.18.2O)1I.18.2O=q(a,i){i||(i=0);G b=C.M;E(i<0)i=b+i;N(;i<b;i++)E(C[i]===a)o i;o-1};E(!1I.18.78)1I.18.78=q(a,i){i=cg(i)?C.M:(i<0?C.M+i:i)+1;G n=C.3s(0,i).55().2O(a);o(n<0)?n:i-n-1};1I.18.2u=1I.18.1Z;q $w(a){E(!J.2l(a))o[];a=a.2T();o a?a.32(/\\s+/):[]}E(Y.1w.3J){1I.18.1z=q(){G a=[];N(G i=0,M=C.M;i<M;i++)a.14(C[i]);N(G i=0,M=1c.M;i<M;i++){E(J.3n(1c[i])){N(G j=0,9l=1c[i].M;j<9l;j++)a.14(1c[i][j])}19{a.14(1c[i])}}o a}}J.U(3T.18,{ch:q(){o C.3q(2,16)},73:q(){o C+1},5V:q(a){$R(0,C,1f).1l(a);o C},3q:q(a,b){G c=C.24(b||10);o\'0\'.5V(a-c.M)+c},2s:q(){o ci(C)?C.24():\'17\'}});$w(\'cj ck cl cm\').1l(q(a){3T.18[a]=co[a].3o()});q $H(a){o 1e 2S(a)};G 2S=1E.1L(26,(q(){q 7h(a,b){E(J.1X(b))o a;o a+\'=\'+9m(1B.4i(b))}o{22:q(a){C.3u=J.6U(a)?a.57():J.1Z(a)},3c:q(a){N(G b 1s C.3u){G c=C.3u[b],5Y=[b,c];5Y.4s=b;5Y.1g=c;a(5Y)}},58:q(a,b){o C.3u[a]=b},7i:q(a){o C.3u[a]},cp:q(a){G b=C.3u[a];7j C.3u[a];o b},57:q(){o J.1Z(C.3u)},4g:q(){o C.4q(\'4s\')},25:q(){o C.4q(\'1g\')},50:q(b){G c=C.5X(q(a){o a.1g===b});o c&&c.4s},cq:q(a){o C.1Z().3U(a)},3U:q(c){o 1e 2S(c).2E(C,q(a,b){a.58(b.4s,b.1g);o a})},3m:q(){o C.2e(q(a){G b=9m(a.4s),25=a.1g;E(25&&2R 25==\'2D\'){E(J.3n(25))o 25.2e(7h.5Q(b)).1P(\'&\')}o 7h(b,25)}).1P(\'&\')},1W:q(){o\'#<2S:{\'+C.2e(q(a){o a.2e(J.1W).1P(\': \')}).1P(\', \')+\'}>\'},2s:q(){o J.2s(C.57())},1Z:q(){o 1e 2S(C)}}})());2S.18.79=2S.18.57;2S.9g=$H;G 9n=1E.1L(26,{22:q(a,b,c){C.59=a;C.7k=b;C.9o=c},3c:q(a){G b=C.59;1q(C.1p(b)){a(b);b=b.73()}},1p:q(a){E(a<C.59)o 1d;E(C.9o)o a<C.7k;o a<=C.7k}});G $R=q(a,b,c){o 1e 9n(a,b,c)};G 1t={9p:q(){o 8K.8L(q(){o 1e 9q()},q(){o 1e 9r(\'cr.9s\')},q(){o 1e 9r(\'cs.9s\')})||1d},7l:0};1t.4t={5a:[],3c:q(a){C.5a.3c(a)},9t:q(a){E(!C.1p(a))C.5a.14(a)},ct:q(a){C.5a=C.5a.56(a)},5Z:q(b,c,d,f){C.1l(q(a){E(J.1M(a[b])){1N{a[b].2B(a,[c,d,f])}1Y(e){}}})}};J.U(1t.4t,26);1t.4t.9t({60:q(){1t.7l++},3v:q(){1t.7l--}});1t.7m=1E.1L({22:q(a){C.1b={28:\'5b\',61:1f,9u:\'62/x-cu-6S-cv\',7n:\'cw-8\',2v:\'\',4m:1f,7o:1f};J.U(C.1b,a||{});C.1b.28=C.1b.28.1G();E(J.2l(C.1b.2v))C.1b.2v=C.1b.2v.5U();19 E(J.6U(C.1b.2v))C.1b.2v=C.1b.2v.57()}});1t.3V=1E.1L(1t.7m,{7p:1d,22:q($2Y,b,c){$2Y(c);C.1R=1t.9p();C.2V(b)},2V:q(a){C.3W=a;C.28=C.1b.28;G b=J.1Z(C.1b.2v);E(![\'7i\',\'5b\'].1p(C.28)){b[\'cx\']=C.28;C.28=\'5b\'}C.2v=b;E(b=J.3m(b)){E(C.28==\'7i\')C.3W+=(C.3W.1p(\'?\')?\'&\':\'?\')+b;19 E(/cy|8C|8A/.2d(3K.3L))b+=\'&52=\'}1N{G c=1e 1t.7q(C);E(C.1b.60)C.1b.60(c);1t.4t.5Z(\'60\',C,c);C.1R.cz(C.28.2f(),C.3W,C.1b.61);E(C.1b.61)C.7r.1o(C).3p(1);C.1R.63=C.7s.1o(C);C.9v();C.1S=C.28==\'5b\'?(C.1b.cA||b):17;C.1R.cB(C.1S);E(!C.1b.61&&C.1R.9w)C.7s()}1Y(e){C.3X(e)}},7s:q(){G a=C.1R.2W;E(a>1&&!((a==4)&&C.7p))C.7r(C.1R.2W)},9v:q(){G b={\'X-cC-cD\':\'9q\',\'X-Y-6Q\':Y.6Q,\'cE\':\'2U/cF, 2U/cG, 62/9x, 2U/9x, */*\'};E(C.28==\'5b\'){b[\'7t-1n\']=C.1b.9u+(C.1b.7n?\'; cH=\'+C.1b.7n:\'\');E(C.1R.9w&&(3K.3L.1k(/5K\\/(\\d{4})/)||[0,9y])[1]<9y)b[\'cI\']=\'cJ\'}E(2R C.1b.9z==\'2D\'){G c=C.1b.9z;E(J.1M(c.14))N(G i=0,M=c.M;i<M;i+=2)b[c[i]]=c[i+1];19 $H(c).1l(q(a){b[a.4s]=a.1g})}N(G d 1s b)C.1R.cK(d,b[d])},3Y:q(){G a=C.5c();o!a||(a>=cL&&a<cM)},5c:q(){1N{o C.1R.64||0}1Y(e){o 0}},7r:q(a){G b=1t.3V.9A[a],3d=1e 1t.7q(C);E(b==\'7u\'){1N{C.7p=1f;(C.1b[\'4u\'+3d.64]||C.1b[\'4u\'+(C.3Y()?\'cN\':\'cO\')]||Y.2q)(3d,3d.65)}1Y(e){C.3X(e)}G c=3d.4v(\'7t-1n\');E(C.1b.7o==\'9B\'||(C.1b.7o&&C.66()&&c&&c.1k(/^\\s*(2U|62)\\/(x-)?(cP|cQ)4T(;.*)?\\s*$/i)))C.9C()}1N{(C.1b[\'4u\'+b]||Y.2q)(3d,3d.65);1t.4t.5Z(\'4u\'+b,C,3d,3d.65)}1Y(e){C.3X(e)}E(b==\'7u\'){C.1R.63=Y.2q}},66:q(){G m=C.3W.1k(/^\\s*cR?:\\/\\/[^\\/]*/);o!m||(m[0]==\'#{7v}//#{7w}#{67}\'.92({7v:68.7v,7w:V.7w,67:68.67?\':\'+68.67:\'\'}))},4v:q(a){1N{o C.1R.7x(a)||17}1Y(e){o 17}},9C:q(){1N{o 5S((C.1R.3w||\'\').76())}1Y(e){C.3X(e)}},3X:q(a){(C.1b.9D||Y.2q)(C,a);1t.4t.5Z(\'9D\',C,a)}});1t.3V.9A=[\'cS\',\'cT\',\'cU\',\'cV\',\'7u\'];1t.7q=1E.1L({22:q(a){C.2V=a;G b=C.1R=a.1R,2W=C.2W=b.2W;E((2W>2&&!Y.1w.2N)||2W==4){C.64=C.5c();C.7y=C.9E();C.3w=1B.4i(b.3w);C.65=C.9F()}E(2W==4){G c=b.9G;C.9G=J.1X(c)?17:c;C.cW=C.9H()}},64:0,7y:\'\',5c:1t.3V.18.5c,9E:q(){1N{o C.1R.7y||\'\'}1Y(e){o\'\'}},4v:1t.3V.18.4v,cX:q(){1N{o C.7z()}1Y(e){o 17}},7x:q(a){o C.1R.7x(a)},7z:q(){o C.1R.7z()},9F:q(){G a=C.4v(\'X-90\');E(!a)o 17;a=72(8M(a));1N{o a.4m(C.2V.1b.9I||!C.2V.66())}1Y(e){C.2V.3X(e)}},9H:q(){G a=C.2V.1b;E(!a.4m||(a.4m!=\'9B\'&&!(C.4v(\'7t-1n\')||\'\').1p(\'62/cY\'))||C.3w.3S())o 17;1N{o C.3w.4m(a.9I||!C.2V.66())}1Y(e){C.2V.3X(e)}}});1t.9J=1E.1L(1t.3V,{22:q($2Y,d,e,f){C.69={3Y:(d.3Y||d),7A:(d.7A||(d.3Y?17:d))};f=J.1Z(f);G g=f.3v;f.3v=(q(a,b){C.9K(a.3w);E(J.1M(g))g(a,b)}).1o(C);$2Y(e,f)},9K:q(a){G b=C.69[C.3Y()?\'3Y\':\'7A\'],1b=C.1b;E(!1b.3R)a=a.3b();E(b=$(b)){E(1b.6a){E(J.2l(1b.6a)){G c={};c[1b.6a]=a;b.2w(c)}19 1b.6a(b,a)}19 b.3U(a)}}});1t.cZ=1E.1L(1t.7m,{22:q($2Y,b,c,d){$2Y(d);C.3v=C.1b.3v;C.4X=(C.1b.4X||2);C.3Z=(C.1b.3Z||1);C.7B={};C.69=b;C.3W=c;C.59()},59:q(){C.1b.3v=C.9L.1o(C);C.4Z()},6Z:q(){C.7B.1b.3v=3k;d0(C.4j);(C.3v||Y.2q).2B(C,1c)},9L:q(a){E(C.1b.3Z){C.3Z=(a.3w==C.9M?C.3Z*C.1b.3Z:1);C.9M=a.3w}C.4j=C.4Z.1o(C).6W(C.3Z*C.4X)},4Z:q(){C.7B=1e 1t.9J(C.69,C.3W,C.1b)}});q $(a){E(1c.M>1){N(G i=0,7C=[],M=1c.M;i<M;i++)7C.14($(1c[i]));o 7C}E(J.2l(a))a=V.d1(a);o I.U(a)}E(Y.2P.5L){V.7D=q(a,b){G c=[];G d=V.2b(a,$(b)||V,17,d2.d3,17);N(G i=0,M=d.d4;i<M;i++)c.14(I.U(d.d5(i)));o c}}E(!1i.5d)G 5d={};E(!5d.9N){J.U(5d,{9N:1,d6:2,9O:3,d7:4,d8:5,d9:6,da:7,db:8,dc:9,dd:10,de:11,df:12})}(q(){G d=C.I;C.I=q(a,b){b=b||{};a=a.1G();G c=I.5e;E(Y.1w.2N&&b.21){a=\'<\'+a+\' 21="\'+b.21+\'">\';7j b.21;o I.5f(V.2Q(a),b)}E(!c[a])c[a]=I.U(V.2Q(a));o I.5f(c[a].dg(1d),b)};J.U(C.I,d||{})}).7E(1i);I.5e={};I.W={7F:q(a){o $(a).1a.3e!=\'6b\'},9P:q(a){a=$(a);I[I.7F(a)?\'9Q\':\'9R\'](a);o a},9Q:q(a){$(a).1a.3e=\'6b\';o a},9R:q(a){$(a).1a.3e=\'\';o a},9S:q(a){a=$(a);a.1A.5g(a);o a},3U:q(a,b){a=$(a);E(b&&b.2x)b=b.2x();E(J.2Z(b))o a.3U().2w(b);b=J.31(b);a.3t=b.3b();b.3R.1o(b).3p();o a},1x:q(a,b){a=$(a);E(b&&b.2x)b=b.2x();19 E(!J.2Z(b)){b=J.31(b);G c=a.dh.di();c.dj(a);b.3R.1o(b).3p();b=c.dk(b.3b())}a.1A.7G(b,a);o a},2w:q(a,b){a=$(a);E(J.2l(b)||J.3Q(b)||J.2Z(b)||(b&&(b.2x||b.31)))b={41:b};G c,2w,1h,2o;N(G d 1s b){c=b[d];d=d.1G();2w=I.4w[d];E(c&&c.2x)c=c.2x();E(J.2Z(c)){2w(a,c);2F}c=J.31(c);1h=((d==\'7H\'||d==\'6c\')?a.1A:a).1h.2f();2o=I.6d(1h,c.3b());E(d==\'2h\'||d==\'6c\')2o.55();2o.1l(2w.5Q(a));c.3R.1o(c).3p()}o a},3O:q(a,b,c){a=$(a);E(J.2Z(b))$(b).5f(c||{});19 E(J.2l(b))b=1e I(b,c);19 b=1e I(\'2k\',b);E(a.1A)a.1A.7G(b,a);b.4o(a);o b},1W:q(d){d=$(d);G e=\'<\'+d.1h.1G();$H({\'29\':\'29\',\'1J\':\'5h\'}).1l(q(a){G b=a.2C(),9T=a.1Q();G c=(d[b]||\'\').24();E(c)e+=\' \'+9T+\'=\'+c.1W(1f)});o e+\'>\'},6e:q(a,b){a=$(a);G c=[];1q(a=a[b])E(a.2t==1)c.14(I.U(a));o c},7I:q(a){o $(a).6e(\'1A\')},9U:q(a){o $(a).20("*")},9V:q(a){a=$(a).4x;1q(a&&a.2t!=1)a=a.3x;o $(a)},9W:q(a){E(!(a=$(a).4x))o[];1q(a&&a.2t!=1)a=a.3x;E(a)o[a].1z($(a).5i());o[]},7J:q(a){o $(a).6e(\'9X\')},5i:q(a){o $(a).6e(\'3x\')},dl:q(a){a=$(a);o a.7J().55().1z(a.5i())},1k:q(a,b){E(J.2l(b))b=1e O(b);o b.1k($(a))},dm:q(a,b,c){a=$(a);E(1c.M==1)o $(a.1A);G d=a.7I();o J.3Q(b)?d[b]:O.4y(d,b,c)},dn:q(a,b,c){a=$(a);E(1c.M==1)o a.9V();o J.3Q(b)?a.9U()[b]:a.20(b)[c||0]},dp:q(a,b,c){a=$(a);E(1c.M==1)o $(O.1C.5j(a));G d=a.7J();o J.3Q(b)?d[b]:O.4y(d,b,c)},9Y:q(a,b,c){a=$(a);E(1c.M==1)o $(O.1C.5k(a));G d=a.5i();o J.3Q(b)?d[b]:O.4y(d,b,c)},20:q(){G a=$A(1c),1u=$(a.3N());o O.6f(1u,a)},42:q(){G a=$A(1c),1u=$(a.3N());o O.6f(1u.1A,a).56(1u)},9Z:q(a){a=$(a);G b=a.43(\'29\'),7K=1c.4k;E(b)o b;do{b=\'dq\'+7K.a0++}1q($(b));a.5f(\'29\',b);o b},43:q(a,b){a=$(a);E(Y.1w.2N){G t=I.2G.6g;E(t.25[b])o t.25[b](a,b);E(t.3y[b])b=t.3y[b];E(b.1p(\':\')){o(!a.7L||!a.7L[b])?17:a.7L[b].1g}}o a.7M(b)},5f:q(a,b,c){a=$(a);G d={},t=I.2G.5l;E(2R b==\'2D\')d=b;19 d[b]=J.1X(c)?1f:c;N(G e 1s d){b=t.3y[e]||e;c=d[e];E(t.25[e])b=t.25[e](a,c);E(c===1d||c===17)a.7N(b);19 E(c===1f)a.a1(b,b);19 a.a1(b,c)}o a},a2:q(a){o $(a).4z().2y},a3:q(a){o $(a).4z().1T},5m:q(a){o 1e I.6h(a)},6i:q(a,b){E(!(a=$(a)))o;G c=a.1J;o(c.M>0&&(c==b||1e 3a("(^|\\\\s)"+b+"(\\\\s|$)").2d(c)))},a4:q(a,b){E(!(a=$(a)))o;E(!a.6i(b))a.1J+=(a.1J?\' \':\'\')+b;o a},a5:q(a,b){E(!(a=$(a)))o;a.1J=a.1J.1x(1e 3a("(^|\\\\s+)"+b+"(\\\\s+|$)"),\' \').2T();o a},dr:q(a,b){E(!(a=$(a)))o;o a[a.6i(b)?\'a5\':\'a4\'](b)},ds:q(a){a=$(a);G b=a.4x;1q(b){G c=b.3x;E(b.2t==3&&!/\\S/.2d(b.71))a.5g(b);b=c}o a},4n:q(a){o $(a).3t.3S()},6j:q(b,c){b=$(b),c=$(c);G d=c;E(b.a6)o(b.a6(c)&8)===8;E(b.5n&&!Y.1w.3J){G e=b.5n,a=c.5n,4A=c.3x;E(!4A){do{c=c.1A}1q(!(4A=c.3x)&&c.1A)}E(4A&&4A.5n)o(e>a&&e<4A.5n)}1q(b=b.1A)E(b==d)o 1f;o 1d},a7:q(a){a=$(a);G b=a.44();1i.a7(b[0],b[1]);o a},1D:q(a,b){a=$(a);b=b==\'7O\'?\'6k\':b.74();G c=a.1a[b];E(!c){G d=V.dt.du(a,17);c=d?d[b]:17}E(b==\'2H\')o c?4B(c):1.0;o c==\'6l\'?17:c},dv:q(a){o $(a).1D(\'2H\')},4C:q(a,b){a=$(a);G c=a.1a,1k;E(J.2l(b)){a.1a.7P+=\';\'+b;o b.1p(\'2H\')?a.4D(b.1k(/2H:\\s*(\\d?\\.?\\d*)/)[1]):a}N(G d 1s b)E(d==\'2H\')a.4D(b[d]);19 c[(d==\'7O\'||d==\'6k\')?(J.1X(c.7Q)?\'6k\':\'7Q\'):d]=b[d];o a},4D:q(a,b){a=$(a);a.1a.2H=(b==1||b===\'\')?\'\':(b<0.6m)?0:b;o a},4z:q(a){a=$(a);G b=$(a).1D(\'3e\');E(b!=\'6b\'&&b!=17)o{1T:a.4E,2y:a.4F};G c=a.1a;G d=c.7R;G e=c.1v;G f=c.3e;c.7R=\'6n\';c.1v=\'4G\';c.3e=\'dw\';G g=a.a8;G h=a.a9;c.3e=f;c.1v=e;c.7R=d;o{1T:g,2y:h}},dx:q(a){a=$(a);G b=I.1D(a,\'1v\');E(b==\'4H\'||!b){a.7S=1f;a.1a.1v=\'5o\';E(1i.6R){a.1a.2h=0;a.1a.2I=0}}o a},dy:q(a){a=$(a);E(a.7S){a.7S=3k;a.1a.1v=a.1a.2h=a.1a.2I=a.1a.41=a.1a.6o=\'\'}o a},dz:q(a){a=$(a);E(a.47)o a;a.47=I.1D(a,\'7T\')||\'6l\';E(a.47!==\'6n\')a.1a.7T=\'6n\';o a},dA:q(a){a=$(a);E(!a.47)o a;a.1a.7T=a.47==\'6l\'?\'\':a.47;a.47=17;o a},44:q(a){G b=0,2a=0;do{b+=a.48||0;2a+=a.49||0;a=a.3f}1q(a);o I.4a(2a,b)},5p:q(a){G b=0,2a=0;do{b+=a.48||0;2a+=a.49||0;a=a.3f;E(a){E(a.1h==\'aa\')1F;G p=I.1D(a,\'1v\');E(p!==\'4H\')1F}}1q(a);o I.4a(2a,b)},7U:q(a){a=$(a);E(a.1D(\'1v\')==\'4G\')o;G b=a.5p();G c=b[1];G d=b[0];G e=a.a8;G f=a.a9;a.ab=d-4B(a.1a.2I||0);a.ac=c-4B(a.1a.2h||0);a.ad=a.1a.1T;a.ae=a.1a.2y;a.1a.1v=\'4G\';a.1a.2h=c+\'2p\';a.1a.2I=d+\'2p\';a.1a.1T=e+\'2p\';a.1a.2y=f+\'2p\';o a},7V:q(a){a=$(a);E(a.1D(\'1v\')==\'5o\')o;a.1a.1v=\'5o\';G b=4B(a.1a.2h||0)-(a.ac||0);G c=4B(a.1a.2I||0)-(a.ab||0);a.1a.2h=b+\'2p\';a.1a.2I=c+\'2p\';a.1a.2y=a.ae;a.1a.1T=a.ad;o a},7W:q(a){G b=0,2a=0;do{b+=a.3z||0;2a+=a.3A||0;a=a.1A}1q(a);o I.4a(2a,b)},4I:q(a){E(a.3f)o $(a.3f);E(a==V.1S)o $(a);1q((a=a.1A)&&a!=V.1S)E(I.1D(a,\'1v\')!=\'4H\')o $(a);o $(V.1S)},5q:q(a){G b=0,2a=0;G c=a;do{b+=c.48||0;2a+=c.49||0;E(c.3f==V.1S&&I.1D(c,\'1v\')==\'4G\')1F}1q(c=c.3f);c=a;do{E(!Y.1w.3J||c.1h==\'aa\'){b-=c.3z||0;2a-=c.3A||0}}1q(c=c.1A);o I.4a(2a,b)},af:q(a,b){G c=J.U({ag:1f,ah:1f,ai:1f,aj:1f,48:0,49:0},1c[2]||{});b=$(b);G p=b.5q();a=$(a);G d=[0,0];G e=17;E(I.1D(a,\'1v\')==\'4G\'){e=a.4I();d=e.5q()}E(e==V.1S){d[0]-=V.1S.49;d[1]-=V.1S.48}E(c.ag)a.1a.2I=(p[0]-d[0]+c.49)+\'2p\';E(c.ah)a.1a.2h=(p[1]-d[1]+c.48)+\'2p\';E(c.ai)a.1a.1T=b.4E+\'2p\';E(c.aj)a.1a.2y=b.4F+\'2p\';o a}};I.W.9Z.a0=1;J.U(I.W,{dB:I.W.20,dC:I.W.9W});I.2G={5l:{3y:{1J:\'5h\',ak:\'N\'},25:{}}};E(Y.1w.3J){I.W.1D=I.W.1D.3O(q(d,e,f){4h(f){1O\'2I\':1O\'2h\':1O\'6o\':1O\'41\':E(d(e,\'1v\')===\'4H\')o 17;1O\'2y\':1O\'1T\':E(!I.7F(e))o 17;G g=al(d(e,f),10);E(g!==e[\'2i\'+f.51()])o g+\'2p\';G h;E(f===\'2y\'){h=[\'6p-2h-1T\',\'6q-2h\',\'6q-41\',\'6p-41-1T\']}19{h=[\'6p-2I-1T\',\'6q-2I\',\'6q-6o\',\'6p-6o-1T\']}o h.2E(g,q(a,b){G c=d(e,b);o c===17?a:a-al(c,10)})+\'2p\';5r:o d(e,f)}});I.W.43=I.W.43.3O(q(a,b,c){E(c===\'6r\')o b.6r;o a(b,c)})}19 E(Y.1w.2N){I.W.4I=I.W.4I.3O(q(a,b){b=$(b);G c=b.1D(\'1v\');E(c!==\'4H\')o a(b);b.4C({1v:\'5o\'});G d=a(b);b.4C({1v:c});o d});$w(\'5p 5q\').1l(q(f){I.W[f]=I.W[f].3O(q(a,b){b=$(b);G c=b.1D(\'1v\');E(c!==\'4H\')o a(b);G d=b.4I();E(d&&d.1D(\'1v\')===\'dD\')d.4C({7X:1});b.4C({1v:\'5o\'});G e=a(b);b.4C({1v:c});o e})});I.W.1D=q(a,b){a=$(a);b=(b==\'7O\'||b==\'6k\')?\'7Q\':b.74();G c=a.1a[b];E(!c&&a.7Y)c=a.7Y[b];E(b==\'2H\'){E(c=(a.1D(\'4r\')||\'\').1k(/7Z\\(2H=(.*)\\)/))E(c[1])o 4B(c[1])/am;o 1.0}E(c==\'6l\'){E((b==\'1T\'||b==\'2y\')&&(a.1D(\'3e\')!=\'6b\'))o a[\'2i\'+b.51()]+\'2p\';o 17}o c};I.W.4D=q(b,c){q 80(a){o a.1x(/7Z\\([^\\)]*\\)/8U,\'\')}b=$(b);G d=b.7Y;E((d&&!d.dE)||(!d&&b.1a.7X==\'dF\'))b.1a.7X=1;G e=b.1D(\'4r\'),1a=b.1a;E(c==1||c===\'\'){(e=80(e))?1a.4r=e:1a.7N(\'4r\');o b}19 E(c<0.6m)c=0;1a.4r=80(e)+\'7Z(2H=\'+(c*am)+\')\';o b};I.2G={6g:{3y:{\'5h\':\'1J\',\'N\':\'ak\'},25:{6s:q(a,b){o a.7M(b,2)},an:q(a,b){G c=a.ao(b);o c?c.1g:""},1K:q(a,b){b=a.7M(b);o b?b.24().3s(23,-2):17},5s:q(a,b){o $(a).2J(b)?b:17},1a:q(a){o a.1a.7P.1G()},6r:q(a){o a.6r}}}};I.2G.5l={3y:J.U({dG:\'dH\',dI:\'dJ\'},I.2G.6g.3y),25:{2K:q(a,b){a.2K=!!b},1a:q(a,b){a.1a.7P=b?b:\'\'}}};I.2G.81={};$w(\'dK dL dM dN dO 6t \'+\'dP dQ dR dS\').1l(q(a){I.2G.5l.3y[a.1G()]=a;I.2G.81[a.1G()]=a});(q(v){J.U(v,{ap:v.6s,aq:v.6s,1n:v.6s,4J:v.an,2z:v.5s,2K:v.5s,dT:v.5s,dU:v.5s,dV:v.1K,ar:v.1K,dW:v.1K,dX:v.1K,dY:v.1K,dZ:v.1K,e0:v.1K,e1:v.1K,e2:v.1K,e3:v.1K,e4:v.1K,e5:v.1K,e6:v.1K,e7:v.1K,e8:v.1K,e9:v.1K,ea:v.1K,eb:v.1K})})(I.2G.6g.25)}19 E(Y.1w.5K&&/ec:1\\.8\\.0/.2d(3K.3L)){I.W.4D=q(a,b){a=$(a);a.1a.2H=(b==1)?0.ed:(b===\'\')?\'\':(b<0.6m)?0:b;o a}}19 E(Y.1w.3j){I.W.4D=q(a,b){a=$(a);a.1a.2H=(b==1||b===\'\')?\'\':(b<0.6m)?0:b;E(b==1)E(a.1h==\'at\'&&a.1T){a.1T++;a.1T--}19 1N{G n=V.96(\' \');a.4o(n);a.5g(n)}1Y(e){}o a};I.W.44=q(a){G b=0,2a=0;do{b+=a.48||0;2a+=a.49||0;E(a.3f==V.1S)E(I.1D(a,\'1v\')==\'4G\')1F;a=a.3f}1q(a);o I.4a(2a,b)}}E(Y.1w.2N||Y.1w.3J){I.W.3U=q(b,c){b=$(b);E(c&&c.2x)c=c.2x();E(J.2Z(c))o b.3U().2w(c);c=J.31(c);G d=b.1h.2f();E(d 1s I.4w.3B){$A(b.2o).1l(q(a){b.5g(a)});I.6d(d,c.3b()).1l(q(a){b.4o(a)})}19 b.3t=c.3b();c.3R.1o(c).3p();o b}}E(\'au\'1s V.2Q(\'2k\')){I.W.1x=q(b,c){b=$(b);E(c&&c.2x)c=c.2x();E(J.2Z(c)){b.1A.7G(c,b);o b}c=J.31(c);G d=b.1A,1h=d.1h.2f();E(I.4w.3B[1h]){G e=b.9Y();G f=I.6d(1h,c.3b());d.5g(b);E(e)f.1l(q(a){d.6u(a,e)});19 f.1l(q(a){d.4o(a)})}19 b.au=c.3b();c.3R.1o(c).3p();o b}}I.4a=q(l,t){G a=[l,t];a.2I=l;a.2h=t;o a};I.6d=q(a,b){G c=1e I(\'2k\'),t=I.4w.3B[a];E(t){c.3t=t[0]+b+t[1];t[2].5V(q(){c=c.4x})}19 c.3t=b;o $A(c.2o)};I.4w={7H:q(a,b){a.1A.6u(b,a)},2h:q(a,b){a.6u(b,a.4x)},41:q(a,b){a.4o(b)},6c:q(a,b){a.1A.6u(b,a.3x)},3B:{ee:[\'<3C>\',\'</3C>\',1],6v:[\'<3C><4K>\',\'</4K></3C>\',2],av:[\'<3C><4K><6w>\',\'</6w></4K></3C>\',3],82:[\'<3C><4K><6w><aw>\',\'</aw></6w></4K></3C>\',4],ax:[\'<20>\',\'</20>\',1]}};(q(){J.U(C.3B,{ay:C.3B.6v,az:C.3B.6v,aA:C.3B.82})}).7E(I.4w);I.W.6x={2J:q(a,b){b=I.2G.81[b]||b;G c=$(a).ao(b);o c&&c.ef}};I.W.2A={};J.U(I,I.W);E(!Y.2P.4R&&V.2Q(\'2k\').3M){1i.4S={};1i.4S.18=V.2Q(\'2k\').3M;Y.2P.4R=1f}I.U=(q(){E(Y.2P.5M)o Y.K;G c={},2A=I.W.2A;G d=J.U(q(a){E(!a||a.6y||a.2t!=1||a==1i)o a;G b=J.1Z(c),1h=a.1h,5t,1g;E(2A[1h])J.U(b,2A[1h]);N(5t 1s b){1g=b[5t];E(J.1M(1g)&&!(5t 1s a))a[5t]=1g.3o()}a.6y=Y.2q;o a},{6z:q(){E(!Y.2P.4R){J.U(c,I.W);J.U(c,I.W.6x)}}});d.6z();o d})();I.2J=q(a,b){E(a.2J)o a.2J(b);o I.W.6x.2J(a,b)};I.4V=q(f){G F=Y.2P,T=I.W.2A;E(!f){J.U(1j,1j.W);J.U(1j.I,1j.I.W);J.U(I.W.2A,{"eg":J.1Z(1j.W),"eh":J.1Z(1j.I.W),"ax":J.1Z(1j.I.W),"aB":J.1Z(1j.I.W)})}E(1c.M==2){G g=f;f=1c[1]}E(!g)J.U(I.W,f||{});19{E(J.3n(g))g.1l(U);19 U(g)}q U(a){a=a.2f();E(!I.W.2A[a])I.W.2A[a]={};J.U(I.W.2A[a],f)}q 6A(a,b,c){c=c||1d;N(G d 1s a){G e=a[d];E(!J.1M(e))2F;E(!c||!(d 1s b))b[d]=e.3o()}}q aC(a){G b;G c={"ei":"ej","aB":"ek","P":"el","em":"eo","ep":"eq","er":"es","et":"eu","ev":"ew","ex":"4L","ey":"4L","ez":"4L","eA":"4L","eB":"4L","eC":"4L","Q":"eD","eE":"aD","eF":"aD","A":"eG","at":"eH","eI":"eJ","eK":"aE","eL":"aE","ay":"83","az":"83","6v":"83","av":"eM","aA":"aF","82":"aF","eN":"eO","eP":"eQ"};E(c[a])b=\'84\'+c[a]+\'I\';E(1i[b])o 1i[b];b=\'84\'+a+\'I\';E(1i[b])o 1i[b];b=\'84\'+a.51()+\'I\';E(1i[b])o 1i[b];1i[b]={};1i[b].18=V.2Q(a).3M;o 1i[b]}E(F.4R){6A(I.W,4S.18);6A(I.W.6x,4S.18,1f)}E(F.5M){N(G h 1s I.W.2A){G i=aC(h);E(J.1X(i))2F;6A(T[h],i.18)}}J.U(I,I.W);7j I.2A;E(I.U.6z)I.U.6z();I.5e={}};V.eR={4z:q(){G a={};G B=Y.1w;$w(\'1T 2y\').1l(q(d){G D=d.51();a[d]=(B.3j&&!V.2b)?7K[\'eS\'+D]:(B.3J)?V.1S[\'aG\'+D]:V.3D[\'aG\'+D]});o a},a3:q(){o C.4z().1T},a2:q(){o C.4z().2y},eT:q(){o I.4a(1i.aH||V.3D.3A||V.1S.3A,1i.aI||V.3D.3z||V.1S.3z)}};G O=1E.1L({22:q(a){C.2X=a.2T();C.aJ()},aK:q(){E(!Y.2P.5L)o 1d;G e=C.2X;E(Y.1w.3j&&(e.1p("-1U-1n")||e.1p(":4n")))o 1d;E((/(\\[[\\w-]*?:|:2K)/).2d(C.2X))o 1d;o 1f},aJ:q(){E(C.aK())o C.aL();G e=C.2X,3g=O.5u,h=O.1C,c=O.54,3h,p,m;E(O.4b[e]){C.2L=O.4b[e];o}C.2L=["C.2L = q(aM) {","G r = aM, h = O.1C, c = 1d, n;"];1q(e&&3h!=e&&(/\\S/).2d(e)){3h=e;N(G i 1s 3g){p=3g[i];E(m=e.1k(p)){C.2L.14(J.1M(c[i])?c[i](m):1e 2g(c[i]).2b(m));e=e.1x(m[0],\'\');1F}}}C.2L.14("o h.85(n);\\n}");5S(C.2L.1P(\'\\n\'));O.4b[C.2X]=C.2L},aL:q(){G e=C.2X,3g=O.5u,x=O.1V,3h,m;E(O.4b[e]){C.1V=O.4b[e];o}C.2L=[\'.//*\'];1q(e&&3h!=e&&(/\\S/).2d(e)){3h=e;N(G i 1s 3g){E(m=e.1k(3g[i])){C.2L.14(J.1M(x[i])?x[i](m):1e 2g(x[i]).2b(m));e=e.1x(m[0],\'\');1F}}}C.1V=C.2L.1P(\'\');O.4b[C.2X]=C.1V},6B:q(a){a=a||V;E(C.1V)o V.7D(C.1V,a);o C.2L(a)},1k:q(a){C.86=[];G e=C.2X,3g=O.5u,as=O.87;G b,p,m;1q(e&&b!==e&&(/\\S/).2d(e)){b=e;N(G i 1s 3g){p=3g[i];E(m=e.1k(p)){E(as[i]){C.86.14([i,J.1Z(m)]);e=e.1x(m[0],\'\')}19{o C.6B(V).1p(a)}}}}G c=1f,21,88;N(G i=0,6C;6C=C.86[i];i++){21=6C[0],88=6C[1];E(!O.87[21](a,88)){c=1d;1F}}o c},24:q(){o C.2X},1W:q(){o"#<O:"+C.2X.1W()+">"}});J.U(O,{4b:{},1V:{3E:"//*",1r:"/*",42:"/5v-3F::*[1]",5w:\'/5v-3F::*\',1h:q(m){E(m[1]==\'*\')o\'\';o"[aN-21()=\'"+m[1].1G()+"\' 89 aN-21()=\'"+m[1].2f()+"\']"},1J:"[5x(1z(\' \', @5h, \' \'), \' #{1} \')]",29:"[@29=\'#{1}\']",4M:q(m){m[1]=m[1].1G();o 1e 2g("[@#{1}]").2b(m)},4N:q(m){m[1]=m[1].1G();m[3]=m[5]||m[6];o 1e 2g(O.1V.5y[m[2]]).2b(m)},5z:q(m){G h=O.1V.1H[m[1]];E(!h)o\'\';E(J.1M(h))o h(m);o 1e 2g(O.1V.1H[m[1]]).2b(m)},5y:{\'=\':"[@#{1}=\'#{3}\']",\'!=\':"[@#{1}!=\'#{3}\']",\'^=\':"[eU-97(@#{1}, \'#{3}\')]",\'$=\':"[4l(@#{1}, (5O-M(@#{1}) - 5O-M(\'#{3}\') + 1))=\'#{3}\']",\'*=\':"[5x(@#{1}, \'#{3}\')]",\'~=\':"[5x(1z(\' \', @#{1}, \' \'), \' #{3} \')]",\'|=\':"[5x(1z(\'-\', @#{1}, \'-\'), \'-#{3}-\')]"},1H:{\'2C-1r\':\'[3G(8a-3F::*)]\',\'1Q-1r\':\'[3G(5v-3F::*)]\',\'5A-1r\':\'[3G(8a-3F::* 89 5v-3F::*)]\',\'4n\':"[6D(*) = 0 8b (6D(2U()) = 0 89 eV(2U(), \' \\t\\r\\n\', \'\') = \'\')]",\'2K\':"[@2K]",\'2z\':"[@2z]",\'aO\':"[3G(@2z)]",\'3G\':q(m){G e=m[6],p=O.5u,x=O.1V,3h,v;G a=[];1q(e&&3h!=e&&(/\\S/).2d(e)){3h=e;N(G i 1s p){E(m=e.1k(p[i])){v=J.1M(x[i])?x[i](m):1e 2g(x[i]).2b(m);a.14("("+v.4l(1,v.M-1)+")");e=e.1x(m[0],\'\');1F}}}o"[3G("+a.1P(" 8b ")+")]"},\'1y-1r\':q(m){o O.1V.1H.1y("(6D(./8a-3F::*) + 1) ",m)},\'1y-1Q-1r\':q(m){o O.1V.1H.1y("(6D(./5v-3F::*) + 1) ",m)},\'1y-1U-1n\':q(m){o O.1V.1H.1y("1v() ",m)},\'1y-1Q-1U-1n\':q(m){o O.1V.1H.1y("(1Q() + 1 - 1v()) ",m)},\'2C-1U-1n\':q(m){m[6]="1";o O.1V.1H[\'1y-1U-1n\'](m)},\'1Q-1U-1n\':q(m){m[6]="1";o O.1V.1H[\'1y-1Q-1U-1n\'](m)},\'5A-1U-1n\':q(m){G p=O.1V.1H;o p[\'2C-1U-1n\'](m)+p[\'1Q-1U-1n\'](m)},1y:q(c,m){G d,4c=m[6],8c;E(4c==\'aP\')4c=\'2n+0\';E(4c==\'aQ\')4c=\'2n+1\';E(d=4c.1k(/^(\\d+)$/))o\'[\'+c+"= "+d[1]+\']\';E(d=4c.1k(/^(-?\\d*)?n(([+-])(\\d+))?/)){E(d[1]=="-")d[1]=-1;G a=d[1]?3T(d[1]):1;G b=d[2]?3T(d[2]):0;8c="[((#{8d} - #{b}) eW #{a} = 0) 8b "+"((#{8d} - #{b}) 2k #{a} >= 0)]";o 1e 2g(8c).2b({8d:c,a:a,b:b})}}}},54:{1h:\'n = h.1h(n, r, "#{1}", c);      c = 1d;\',1J:\'n = h.1J(n, r, "#{1}", c);    c = 1d;\',29:\'n = h.29(n, r, "#{1}", c);           c = 1d;\',4M:\'n = h.4M(n, r, "#{1}", c); c = 1d;\',4N:q(m){m[3]=(m[5]||m[6]);o 1e 2g(\'n = h.4N(n, r, "#{1}", "#{3}", "#{2}", c); c = 1d;\').2b(m)},5z:q(m){E(m[6])m[6]=m[6].1x(/"/g,\'\\\\"\');o 1e 2g(\'n = h.5z(n, "#{1}", "#{6}", r, c); c = 1d;\').2b(m)},3E:\'c = "3E";\',1r:\'c = "1r";\',42:\'c = "42";\',5w:\'c = "5w";\'},5u:{5w:/^\\s*~\\s*/,1r:/^\\s*>\\s*/,42:/^\\s*\\+\\s*/,3E:/^\\s/,1h:/^\\s*(\\*|[\\w\\-]+)(\\b|$)?/,29:/^#([\\w\\-\\*]+)(\\b|$)/,1J:/^\\.([\\w\\-\\*]+)(\\b|$)/,5z:/^:((2C|1Q|1y|1y-1Q|5A)(-1r|-1U-1n)|4n|2K|(en|eX)eY|3G)(\\((.*?)\\))?(\\b|$|(?=\\s|[:+~>]))/,4M:/^\\[([\\w]+)\\]/,4N:/\\[((?:[\\w-]*:)?[\\w-]+)\\s*(?:([!^$*~|]?=)\\s*(([\'"])([^\\4]*?)\\4|([^\'"][^\\]]*?)))?\\]/},87:{1h:q(a,b){o b[1].2f()==a.1h.2f()},1J:q(a,b){o I.6i(a,b[1])},29:q(a,b){o a.29===b[1]},4M:q(a,b){o I.2J(a,b[1])},4N:q(a,b){G c=I.43(a,b[1]);o c&&O.5y[b[2]](c,b[5]||b[6])}},1C:{1z:q(a,b){N(G i=0,L;L=b[i];i++)a.14(L);o a},6E:q(a){G b=Y.2q;N(G i=0,L;L=a[i];i++)L.2M=b;o a},4d:q(a){N(G i=0,L;L=a[i];i++)L.2M=3k;o a},50:q(a,b,c){a.2M=Y.2q;E(b){N(G d=a.2o,i=d.M-1,j=1;i>=0;i--){G e=d[i];E(e.2t==1&&(!c||e.2M))e.6F=j++}}19{N(G i=0,j=1,d=a.2o;e=d[i];i++)E(e.2t==1&&(!c||e.2M))e.6F=j++}},85:q(a){E(a.M==0)o a;G b=[],n;N(G i=0,l=a.M;i<l;i++)E(!(n=a[i]).2M){n.2M=Y.2q;b.14(I.U(n))}o O.1C.4d(b)},3E:q(a){G h=O.1C;N(G i=0,15=[],L;L=a[i];i++)h.1z(15,L.3i(\'*\'));o 15},1r:q(a){G h=O.1C;N(G i=0,15=[],L;L=a[i];i++){N(G j=0,1r;1r=L.2o[j];j++)E(1r.2t==1&&1r.1h!=\'!\')15.14(1r)}o 15},42:q(a){N(G i=0,15=[],L;L=a[i];i++){G b=C.5k(L);E(b)15.14(b)}o 15},5w:q(a){G h=O.1C;N(G i=0,15=[],L;L=a[i];i++)h.1z(15,I.5i(L));o 15},5k:q(a){1q(a=a.3x)E(a.2t==1)o a;o 17},5j:q(a){1q(a=a.9X)E(a.2t==1)o a;o 17},1h:q(a,b,c,d){G e=c.2f();G f=[],h=O.1C;E(a){E(d){E(d=="3E"){N(G i=0,L;L=a[i];i++)h.1z(f,L.3i(c));o f}19 a=C[d](a);E(c=="*")o a}N(G i=0,L;L=a[i];i++)E(L.1h.2f()===e)f.14(L);o f}19 o b.3i(c)},29:q(a,b,c,d){G e=$(c),h=O.1C;E(!e)o[];E(!a&&b==V)o[e];E(a){E(d){E(d==\'1r\'){N(G i=0,L;L=a[i];i++)E(e.1A==L)o[e]}19 E(d==\'3E\'){N(G i=0,L;L=a[i];i++)E(I.6j(e,L))o[e]}19 E(d==\'42\'){N(G i=0,L;L=a[i];i++)E(O.1C.5j(e)==L)o[e]}19 a=h[d](a)}N(G i=0,L;L=a[i];i++)E(L==e)o[e];o[]}o(e&&I.6j(e,b))?[e]:[]},1J:q(a,b,c,d){E(a&&d)a=C[d](a);o O.1C.aR(a,b,c)},aR:q(a,b,c){E(!a)a=O.1C.3E([b]);G d=\' \'+c+\' \';N(G i=0,15=[],L,5B;L=a[i];i++){5B=L.1J;E(5B.M==0)2F;E(5B==c||(\' \'+5B+\' \').1p(d))15.14(L)}o 15},4M:q(a,b,c,d){E(!a)a=b.3i("*");E(a&&d)a=C[d](a);G e=[];N(G i=0,L;L=a[i];i++)E(I.2J(L,c))e.14(L);o e},4N:q(a,b,c,d,e,f){E(!a)a=b.3i("*");E(a&&f)a=C[f](a);G g=O.5y[e],15=[];N(G i=0,L;L=a[i];i++){G h=I.43(L,c);E(h===17)2F;E(g(h,d))15.14(L)}o 15},5z:q(a,b,c,d,e){E(a&&e)a=C[e](a);E(!a)a=d.3i("*");o O.1H[b](a,c,d)}},1H:{\'2C-1r\':q(a,b,c){N(G i=0,15=[],L;L=a[i];i++){E(O.1C.5j(L))2F;15.14(L)}o 15},\'1Q-1r\':q(a,b,c){N(G i=0,15=[],L;L=a[i];i++){E(O.1C.5k(L))2F;15.14(L)}o 15},\'5A-1r\':q(a,b,c){G h=O.1C;N(G i=0,15=[],L;L=a[i];i++)E(!h.5j(L)&&!h.5k(L))15.14(L);o 15},\'1y-1r\':q(a,b,c){o O.1H.1y(a,b,c)},\'1y-1Q-1r\':q(a,b,c){o O.1H.1y(a,b,c,1f)},\'1y-1U-1n\':q(a,b,c){o O.1H.1y(a,b,c,1d,1f)},\'1y-1Q-1U-1n\':q(a,b,c){o O.1H.1y(a,b,c,1f,1f)},\'2C-1U-1n\':q(a,b,c){o O.1H.1y(a,"1",c,1d,1f)},\'1Q-1U-1n\':q(a,b,c){o O.1H.1y(a,"1",c,1f,1f)},\'5A-1U-1n\':q(a,b,c){G p=O.1H;o p[\'1Q-1U-1n\'](p[\'2C-1U-1n\'](a,b,c),b,c)},aS:q(a,b,d){E(a==0)o b>0?[b]:[];o $R(1,d).2E([],q(c,i){E(0==(i-b)%a&&(i-b)/a>=0)c.14(i);o c})},1y:q(c,d,e,f,g){E(c.M==0)o[];E(d==\'aP\')d=\'2n+0\';E(d==\'aQ\')d=\'2n+1\';G h=O.1C,15=[],8e=[],m;h.6E(c);N(G i=0,L;L=c[i];i++){E(!L.1A.2M){h.50(L.1A,f,g);8e.14(L.1A)}}E(d.1k(/^\\d+$/)){d=3T(d);N(G i=0,L;L=c[i];i++)E(L.6F==d)15.14(L)}19 E(m=d.1k(/^(-?\\d*)?n(([+-])(\\d+))?/)){E(m[1]=="-")m[1]=-1;G a=m[1]?3T(m[1]):1;G b=m[2]?3T(m[2]):0;G k=O.1H.aS(a,b,c.M);N(G i=0,L,l=k.M;L=c[i];i++){N(G j=0;j<l;j++)E(L.6F==k[j])15.14(L)}}h.4d(c);h.4d(8e);o 15},\'4n\':q(a,b,c){N(G i=0,15=[],L;L=a[i];i++){E(L.1h==\'!\'||(L.4x&&!L.3t.1k(/^\\s*$/)))2F;15.14(L)}o 15},\'3G\':q(a,b,c){G h=O.1C,eZ,m;G d=1e O(b).6B(c);h.6E(d);N(G i=0,15=[],L;L=a[i];i++)E(!L.2M)15.14(L);h.4d(d);o 15},\'aO\':q(a,b,c){N(G i=0,15=[],L;L=a[i];i++)E(!L.2z)15.14(L);o 15},\'2z\':q(a,b,c){N(G i=0,15=[],L;L=a[i];i++)E(L.2z)15.14(L);o 15},\'2K\':q(a,b,c){N(G i=0,15=[],L;L=a[i];i++)E(L.2K)15.14(L);o 15}},5y:{\'=\':q(a,v){o a==v},\'!=\':q(a,v){o a!=v},\'^=\':q(a,v){o a.77(v)},\'$=\':q(a,v){o a.91(v)},\'*=\':q(a,v){o a.1p(v)},\'~=\':q(a,v){o(\' \'+a+\' \').1p(\' \'+v+\' \')},\'|=\':q(a,v){o(\'-\'+a.2f()+\'-\').1p(\'-\'+v.2f()+\'-\')}},32:q(a){G b=[];a.8S(/(([\\w#:.~>+()\\s-]+|\\*|\\[.*?\\])+)\\s*(,|$)/,q(m){b.14(m[1].2T())});o b},aT:q(a,b){G c=$$(b),h=O.1C;h.6E(c);N(G i=0,15=[],1u;1u=a[i];i++)E(1u.2M)15.14(1u);h.4d(c);o 15},4y:q(a,b,c){E(J.3Q(b)){c=b;b=1d}o O.aT(a,b||\'*\')[c||0]},6f:q(a,b){b=O.32(b.1P(\',\'));G c=[],h=O.1C;N(G i=0,l=b.M,8f;i<l;i++){8f=1e O(b[i].2T());h.1z(c,8f.6B(a))}o(l>1)?h.85(c):c}});E(Y.1w.2N){J.U(O.1C,{1z:q(a,b){N(G i=0,L;L=b[i];i++)E(L.1h!=="!")a.14(L);o a},4d:q(a){N(G i=0,L;L=a[i];i++)L.7N(\'2M\');o a}})}q $$(){o O.6f(V,$A(1c))}G 1j={8g:q(a){$(a).8g();o a},aU:q(c,d){E(2R d!=\'2D\')d={6G:!!d};19 E(J.1X(d.6G))d.6G=1f;G e,1g,8h=1d,4e=d.4e;G f=c.2E({},q(a,b){E(!b.2z&&b.21){e=b.21;1g=$(b).2j();E(1g!=17&&(b.1n!=\'4e\'||(!8h&&4e!==1d&&(!4e||e==4e)&&(8h=1f)))){E(e 1s a){E(!J.3n(a[e]))a[e]=[a[e]];a[e].14(1g)}19 a[e]=1g}}o a});o d.6G?f:J.3m(f)}};1j.W={5C:q(a,b){o 1j.aU(1j.4O(a),b)},4O:q(c){o $A($(c).3i(\'*\')).2E([],q(a,b){E(1j.I.4P[b.1h.1G()])a.14(I.U(b));o a})},f0:q(a,b,c){a=$(a);G d=a.3i(\'6H\');E(!b&&!c)o $A(d).2e(I.U);N(G i=0,8i=[],M=d.M;i<M;i++){G e=d[i];E((b&&e.1n!=b)||(c&&e.21!=c))2F;8i.14(I.U(e))}o 8i},8j:q(a){a=$(a);1j.4O(a).5P(\'8j\');o a},8k:q(a){a=$(a);1j.4O(a).5P(\'8k\');o a},aV:q(b){G c=$(b).4O().4p(q(a){o\'6n\'!=a.1n&&!a.2z});G d=c.4p(q(a){o a.2J(\'6t\')&&a.6t>=0}).9e(q(a){o a.6t}).2C();o d?d:c.7f(q(a){o[\'6H\',\'20\',\'8l\'].1p(a.1h.1G())})},f1:q(a){a=$(a);a.aV().aW();o a},2V:q(a,b){a=$(a),b=J.1Z(b||{});G c=b.2v,4J=a.43(\'4J\')||\'\';E(4J.3S())4J=1i.68.ap;b.2v=a.5C(1f);E(c){E(J.2l(c))c=c.5U();J.U(b.2v,c)}E(a.2J(\'28\')&&!b.28)b.28=a.28;o 1e 1t.3V(4J,b)}};1j.I={8m:q(a){$(a).8m();o a},20:q(a){$(a).20();o a}};1j.I.W={5C:q(a){a=$(a);E(!a.2z&&a.21){G b=a.2j();E(b!=3k){G c={};c[a.21]=b;o J.3m(c)}}o\'\'},2j:q(a){a=$(a);G b=a.1h.1G();o 1j.I.4P[b](a)},f2:q(a,b){a=$(a);G c=a.1h.1G();1j.I.4P[c](a,b);o a},9h:q(a){$(a).1g=\'\';o a},f3:q(a){o $(a).1g!=\'\'},aW:q(a){a=$(a);1N{a.8m();E(a.20&&(a.1h.1G()!=\'6H\'||![\'8n\',\'8g\',\'4e\'].1p(a.1n)))a.20()}1Y(e){}o a},8j:q(a){a=$(a);a.f4();a.2z=1f;o a},8k:q(a){a=$(a);a.2z=1d;o a}};G f5=1j.I;G $F=1j.I.W.2j;1j.I.4P={6H:q(a,b){4h(a.1n.1G()){1O\'aX\':1O\'aY\':o 1j.I.4P.aZ(a,b);5r:o 1j.I.4P.8l(a,b)}},aZ:q(a,b){E(J.1X(b))o a.2K?a.1g:17;19 a.2K=!!b},8l:q(a,b){E(J.1X(b))o a.1g;19 a.1g=b},20:q(a,b){E(J.1X(b))o C[a.1n==\'20-f6\'?\'b0\':\'b1\'](a);19{G c,1g,b2=!J.3n(b);N(G i=0,M=a.M;i<M;i++){c=a.1b[i];1g=C.6I(c);E(b2){E(1g==b){c.8o=1f;o}}19 c.8o=b.1p(1g)}}},b0:q(a){G b=a.f7;o b>=0?C.6I(a.1b[b]):17},b1:q(a){G b,M=a.M;E(!M)o 17;N(G i=0,b=[];i<M;i++){G c=a.1b[i];E(c.8o)b.14(C.6I(c))}o b},6I:q(a){o I.U(a).2J(\'1g\')?a.1g:a.2U}};3P.8p=1E.1L(8N,{22:q($2Y,b,c,d){$2Y(d,c);C.1u=$(b);C.3H=C.2j()},6Y:q(){G a=C.2j();E(J.2l(C.3H)&&J.2l(a)?C.3H!=a:1B(C.3H)!=1B(a)){C.4W(C.1u,a);C.3H=a}}});1j.I.b3=1E.1L(3P.8p,{2j:q(){o 1j.I.2j(C.1u)}});1j.b3=1E.1L(3P.8p,{2j:q(){o 1j.5C(C.1u)}});3P.5D=1E.1L({22:q(a,b){C.1u=$(a);C.4W=b;C.3H=C.2j();E(C.1u.1h.1G()==\'6S\')C.b4();19 C.4Y(C.1u)},8q:q(){G a=C.2j();E(C.3H!=a){C.4W(C.1u,a);C.3H=a}},b4:q(){1j.4O(C.1u).1l(C.4Y,C)},4Y:q(a){E(a.1n){4h(a.1n.1G()){1O\'aX\':1O\'aY\':1m.3I(a,\'f8\',C.8q.1o(C));1F;5r:1m.3I(a,\'f9\',C.8q.1o(C));1F}}}});1j.I.5D=1E.1L(3P.5D,{2j:q(){o 1j.I.2j(C.1u)}});1j.5D=1E.1L(3P.5D,{2j:q(){o 1j.5C(C.1u)}});E(!1i.1m)G 1m={};J.U(1m,{fa:8,fb:9,fc:13,fd:27,fe:37,ff:38,fg:39,fh:40,fi:46,fj:36,fk:35,fl:33,fm:34,fn:45,5e:{},8r:q(a){G b;4h(a.1n){1O\'fo\':b=a.fp;1F;1O\'fq\':b=a.2x;1F;5r:o 17}o I.U(b)}});1m.W=(q(){G e;E(Y.1w.2N){G f={0:1,1:4,2:2};e=q(a,b){o a.8n==f[b]}}19 E(Y.1w.3j){e=q(a,b){4h(b){1O 0:o a.6J==1&&!a.b5;1O 1:o a.6J==1&&a.b5;5r:o 1d}}}19{e=q(a,b){o a.6J?(a.6J===b+1):(a.8n===b)}}o{fr:q(a){o e(a,0)},fs:q(a){o e(a,1)},ft:q(a){o e(a,2)},1u:q(a){G b=1m.U(a).b6;o I.U(b.2t==5d.9O?b.1A:b)},4y:q(a,b){G c=1m.1u(a);E(!b)o c;G d=[c].1z(c.7I());o O.4y(d,b,0)},6K:q(a){o{x:a.b7||(a.fu+(V.3D.3A||V.1S.3A)),y:a.b8||(a.fv+(V.3D.3z||V.1S.3z))}},fw:q(a){o 1m.6K(a).x},fx:q(a){o 1m.6K(a).y},6Z:q(a){1m.U(a);a.b9();a.ba();a.fy=1f}}})();1m.U=(q(){G c=J.4g(1m.W).2E({},q(m,a){m[a]=1m.W[a].3o();o m});E(Y.1w.2N){J.U(c,{ba:q(){C.fz=1f},b9:q(){C.fA=1d},1W:q(){o"[2D 1m]"}});o q(a){E(!a)o 1d;E(a.6y)o a;a.6y=Y.2q;G b=1m.6K(a);J.U(a,{b6:a.fB,8r:1m.8r(a),b7:b.x,b8:b.y});o J.U(a,c)}}19{1m.18=1m.18||V.5E("bb").3M;J.U(1m.18,c);o Y.K}})();J.U(1m,(q(){G h=1m.5e;q 8s(a){E(a.8t)o a.8t[0];1c.4k.29=1c.4k.29||1;o a.8t=[++1c.4k.29]}q 8u(a){E(a&&a.1p(\':\'))o"bc";o a}q 6L(a){o h[a]=h[a]||{}}q 6M(a,b){G c=6L(a);o c[b]=c[b]||[]}q bd(b,d,e){G f=8s(b);G c=6M(f,d);E(c.4q("6N").1p(e))o 1d;G g=q(a){E(!1m||!1m.U||(a.8v&&a.8v!=d))o 1d;1m.U(a);e.7E(b,a)};g.6N=e;c.14(g);o g}q 8w(b,d,e){G c=6M(b,d);o c.7f(q(a){o a.6N==e})}q be(a,b,d){G c=6L(a);E(!c[b])o 1d;c[b]=c[b].56(8w(a,b,d))}q bf(){N(G a 1s h)N(G b 1s h[a])h[a][b]=17}E(1i.5J){1i.5J("ar",bf)}o{3I:q(a,b,c){a=$(a);G d=8u(b);G e=bd(a,b,c);E(!e)o a;E(a.6O){a.6O(d,e,1d)}19{a.5J("4u"+d,e)}o a},4f:q(b,c,d){b=$(b);G e=8s(b),21=8u(c);E(!d&&c){6M(e,c).1l(q(a){b.4f(c,a.6N)});o b}19 E(!c){J.4g(6L(e)).1l(q(a){b.4f(a)});o b}G f=8w(e,c,d);E(!f)o b;E(b.bg){b.bg(21,f,1d)}19{b.fC("4u"+21,f)}be(e,c,d);o b},4Q:q(a,b,c){a=$(a);E(a==V&&V.5E&&!a.bh)a=V.3D;G d;E(V.5E){d=V.5E("bb");d.fD("bc",1f,1f)}19{d=V.fE();d.bi="fF"}d.8v=b;d.fG=c||{};E(V.5E){a.bh(d)}19{a.fH(d.bi,d)}o 1m.U(d)}}})());J.U(1m,1m.W);I.4V({4Q:1m.4Q,3I:1m.3I,4f:1m.4f});J.U(V,{4Q:I.W.4Q.3o(),3I:I.W.3I.3o(),4f:I.W.4f.3o(),5F:1d});(q(){G a;q 5G(){E(V.5F)o;E(a)1i.8P(a);V.4Q("fI:5F");V.5F=1f}E(V.6O){E(Y.1w.3j){a=1i.8O(q(){E(/5F|bj/.2d(V.2W))5G()},0);1m.3I(1i,"fJ",5G)}19{V.6O("fK",5G,1d)}}19{V.5l("<4T 29=bk 3p aq=//:><\\/4T>");$("bk").63=q(){E(C.2W=="bj"){C.63=17;5G()}}}})();2S.3m=J.3m;G fL={3e:I.9P};I.W.fM=I.W.6j;G fN={fO:q(a,b){o I.2w(a,{7H:b})},fP:q(a,b){o I.2w(a,{2h:b})},fQ:q(a,b){o I.2w(a,{41:b})},fR:q(a,b){o I.2w(a,{6c:b})}};G $2F=1e fS(\'"3l $2F" fT fU, fV "o" fW\');G 8x={bl:1d,8y:q(){C.bm=1i.aH||V.3D.3A||V.1S.3A||0;C.bn=1i.aI||V.3D.3z||V.1S.3z||0},fX:q(a,x,y){E(C.bl)o C.bo(a,x,y);C.5H=x;C.5I=y;C.2i=I.44(a);o(y>=C.2i[1]&&y<C.2i[1]+a.4F&&x>=C.2i[0]&&x<C.2i[0]+a.4E)},bo:q(a,x,y){G b=I.7W(a);C.5H=x+b[0]-C.bm;C.5I=y+b[1]-C.bn;C.2i=I.44(a);o(C.5I>=C.2i[1]&&C.5I<C.2i[1]+a.4F&&C.5H>=C.2i[0]&&C.5H<C.2i[0]+a.4E)},fY:q(a,b){E(!a)o 0;E(a==\'fZ\')o((C.2i[1]+b.4F)-C.5I)/b.4F;E(a==\'g0\')o((C.2i[0]+b.4E)-C.5H)/b.4E},44:I.W.44,5p:I.W.5p,7U:q(a){8x.8y();o I.7U(a)},7V:q(a){8x.8y();o I.7V(a)},g1:I.W.7W,3f:I.W.4I,g2:I.W.5q,1Z:q(a,b,c){c=c||{};o I.af(b,a,c)}};E(!V.6P)V.6P=q(f){q 8z(a){o a.3S()?17:"[5x(1z(\' \', @5h, \' \'), \' "+a+" \')]"}f.6P=Y.2P.5L?q(a,b){b=b.24().2T();G c=/\\s/.2d(b)?$w(b).2e(8z).1P(\'\'):8z(b);o c?V.7D(\'.//*\'+c,a):[]}:q(b,c){c=c.24().2T();G d=[],5m=(/\\s/.2d(c)?$w(c):17);E(!5m&&!c)o d;G e=$(b).3i(\'*\');c=\' \'+c+\' \';N(G i=0,1r,cn;1r=e[i];i++){E(1r.1J&&(cn=\' \'+1r.1J+\' \')&&(cn.1p(c)||(5m&&5m.7d(q(a){o!a.24().3S()&&cn.1p(\' \'+a+\' \')}))))d.14(I.U(1r))}o d};o q(a,b){o $(b||V.1S).6P(a)}}(I.W);I.6h=1E.1L();I.6h.18={22:q(a){C.1u=$(a)},3c:q(b){C.1u.1J.32(/\\s+/).20(q(a){o a.M>0}).3c(b)},58:q(a){C.1u.1J=a},g3:q(a){E(C.1p(a))o;C.58($A(C).1z(a).1P(\' \'))},9S:q(a){E(!C.1p(a))o;C.58($A(C).56(a).1P(\' \'))},24:q(){o $A(C).1P(\' \')}};J.U(I.6h.18,26);I.4V();',62,996,'||||||||||||||||||||||||return||function||||||||||||this||if||var||Element|Object||node|length|for|Selector||||||extend|document|Methods||Prototype||||||push|results||null|prototype|else|style|options|arguments|false|new|true|value|tagName|window|Form|match|each|Event|type|bind|include|while|child|in|Ajax|element|position|Browser|replace|nth|concat|parentNode|String|handlers|getStyle|Class|break|toLowerCase|pseudos|Array|className|_getEv|create|isFunction|try|case|join|last|transport|body|width|of|xpath|inspect|isUndefined|catch|clone|select|name|initialize||toString|values|Enumerable||method|id|valueL|evaluate|args|test|map|toUpperCase|Template|top|offset|getValue|div|isString|gsub||childNodes|px|emptyFunction|klass|toJSON|nodeType|toArray|parameters|insert|toElement|height|disabled|ByTag|apply|first|object|inject|continue|_attributeTranslations|opacity|left|hasAttribute|checked|matcher|_countedByPrototype|IE|indexOf|BrowserFeatures|createElement|typeof|Hash|strip|text|request|readyState|expression|super|isElement||toHTML|split||||||||RegExp|stripScripts|_each|response|display|offsetParent|ps|le|getElementsByTagName|WebKit|undefined|throw|toQueryString|isArray|methodize|defer|toPaddedString|source|slice|innerHTML|_object|onComplete|responseText|nextSibling|names|scrollTop|scrollLeft|tags|table|documentElement|descendant|sibling|not|lastValue|observe|Opera|navigator|userAgent|__proto__|shift|wrap|Abstract|isNumber|evalScripts|blank|Number|update|Request|url|dispatchException|success|decay||bottom|adjacent|readAttribute|cumulativeOffset|||_overflow|offsetTop|offsetLeft|_returnOffset|_cache|formula|unmark|submit|stopObserving|keys|switch|interpret|timer|callee|substring|evalJSON|empty|appendChild|findAll|pluck|filter|key|Responders|on|getHeader|_insertionTranslations|firstChild|findElement|getDimensions|nextAncestor|parseFloat|setStyle|setOpacity|offsetWidth|offsetHeight|absolute|static|getOffsetParent|action|tbody|Heading|attrPresence|attr|getElements|Serializers|fire|ElementExtensions|HTMLElement|script|properties|addMethods|callback|frequency|registerCallback|onTimerEvent|index|capitalize|_|expr|criteria|reverse|without|toObject|set|start|responders|post|getStatus|Node|cache|writeAttribute|removeChild|class|nextSiblings|previousElementSibling|nextElementSibling|write|classNames|sourceIndex|relative|positionedOffset|viewportOffset|default|_flag|property|patterns|following|laterSibling|contains|operators|pseudo|only|nodeClassName|serialize|EventObserver|createEvent|loaded|fireContentLoadedEvent|xcomp|ycomp|attachEvent|Gecko|XPath|SpecificElementExtensions|ScriptFragment|string|invoke|curry|currentlyExecuting|eval|escapeHTML|toQueryParams|times|charAt|detect|pair|dispatch|onCreate|asynchronous|application|onreadystatechange|status|headerJSON|isSameOrigin|port|location|container|insertion|none|after|_getContentFromAnonymousElement|recursivelyCollect|findChildElements|read|ClassNames|hasClassName|descendantOf|cssFloat|auto|00001|hidden|right|border|padding|title|_getAttr|tabIndex|insertBefore|TBODY|tr|Simulated|_extendedByPrototype|refresh|copy|findElements|token|count|mark|nodeIndex|hash|input|optionValue|which|pointer|getCacheForID|getWrappersForEventName|handler|addEventListener|getElementsByClassName|Version|opera|form|superclass|isHash|Function|delay|_methodized|execute|stop|prepareReplacement|nodeValue|decodeURIComponent|succ|camelize|len|unfilterJSON|startsWith|lastIndexOf|toTemplateReplacements|slices|array|collect|all|falses|find|_reverse|toQueryPair|get|delete|end|activeRequestCount|Base|encoding|evalJS|_complete|Response|respondToReadyState|onStateChange|Content|Complete|protocol|domain|getResponseHeader|statusText|getAllResponseHeaders|failure|updater|elements|_getElementsByXPath|call|visible|replaceChild|before|ancestors|previousSiblings|self|attributes|getAttribute|removeAttribute|float|cssText|styleFloat|visibility|_madePositioned|overflow|absolutize|relativize|cumulativeScrollOffset|zoom|currentStyle|alpha|stripAlpha|has|TD|TableSection|HTML|unique|tokens|assertions|matches|or|preceding|and|predicate|fragment|indexed|selector|reset|submitted|matchingInputs|disable|enable|textarea|focus|button|selected|TimedObserver|onElementEvent|relatedTarget|getEventID|_prototypeEventID|getDOMEventName|eventName|findWrapper|Position|prepare|iter|KHTML|MobileSafari|Safari|JSONFilter|subclasses|valueOf|argumentNames|instanceof|timeout|1000|Try|these|escape|PeriodicalExecuter|setInterval|clearInterval|specialChar|sub|scan|stripTags|gi|img|extractScripts|unescapeHTML|charCodeAt|isJSON|JSON|endsWith|interpolate|amp|lt|gt|createTextNode|with|template|pattern|Pattern|exec|eachSlice|any|sortBy|size|from|clear|flatten|uniq|forEach|arrayLength|encodeURIComponent|ObjectRange|exclusive|getTransport|XMLHttpRequest|ActiveXObject|XMLHTTP|register|contentType|setRequestHeaders|overrideMimeType|xml|2005|requestHeaders|Events|force|evalResponse|onException|getStatusText|_getHeaderJSON|responseXML|_getResponseJSON|sanitizeJSON|Updater|updateContent|updateComplete|lastText|ELEMENT_NODE|TEXT_NODE|toggle|hide|show|remove|attribute|descendants|firstDescendant|immediateDescendants|previousSibling|next|identify|counter|setAttribute|getHeight|getWidth|addClassName|removeClassName|compareDocumentPosition|scrollTo|clientWidth|clientHeight|BODY|_originalLeft|_originalTop|_originalWidth|_originalHeight|clonePosition|setLeft|setTop|setWidth|setHeight|htmlFor|parseInt|100|_getAttrNode|getAttributeNode|href|src|onunload||IMG|outerHTML|TR|td|SELECT|THEAD|TFOOT|TH|TEXTAREA|findDOMClass|Mod|TableCol|TableCell|client|pageXOffset|pageYOffset|compileMatcher|shouldUseXPath|compileXPathMatcher|root|local|enabled|even|odd|byClassName|getIndices|matchElements|serializeElements|findFirstElement|activate|checkbox|radio|inputSelector|selectOne|selectMany|single|Observer|registerFormCallbacks|metaKey|target|pageX|pageY|preventDefault|stopPropagation|HTMLEvents|dataavailable|createWrapper|destroyWrapper|destroyCache|removeEventListener|dispatchEvent|eventType|complete|__onDOMContentLoaded|includeScrollOffsets|deltaX|deltaY|withinIncludingScrolloffsets|AppleWebKit|Apple|Mobile|secure|constructor|RangeError|unknown|boolean|splice|number|bindAsEventListener|event|setTimeout|01|Date|getUTCFullYear|getUTCMonth|getUTCDate|getUTCHours|getUTCMinutes|getUTCSeconds|finally|truncate|im|data|fromCharCode|underscore|dasherize|x00|x1f|u00|Eaeflnr|SyntaxError|Badly|formed|parseQuery|grep|inGroupsOf|max|min|partition|reject|sort|zip|pop|member|entries|every|some|NodeList|compact|reduce|intersect|isNaN|toColorPart|isFinite|abs|round|ceil|floor||Math|unset|merge|Msxml2|Microsoft|unregister|www|urlencoded|UTF|_method|Konqueror|open|postBody|send|Requested|With|Accept|javascript|html|charset|Connection|close|setRequestHeader|200|300|Success|Failure|java|ecma|https|Uninitialized|Loading|Loaded|Interactive|responseJSON|getAllHeaders|json|PeriodicalUpdater|clearTimeout|getElementById|XPathResult|ORDERED_NODE_SNAPSHOT_TYPE|snapshotLength|snapshotItem|ATTRIBUTE_NODE|CDATA_SECTION_NODE|ENTITY_REFERENCE_NODE|ENTITY_NODE|PROCESSING_INSTRUCTION_NODE|COMMENT_NODE|DOCUMENT_NODE|DOCUMENT_TYPE_NODE|DOCUMENT_FRAGMENT_NODE|NOTATION_NODE|cloneNode|ownerDocument|createRange|selectNode|createContextualFragment|siblings|up|down||previous|anonymous_element_|toggleClassName|cleanWhitespace|defaultView|getComputedStyle|getOpacity|block|makePositioned|undoPositioned|makeClipping|undoClipping|getElementsBySelector|childElements|fixed|hasLayout|normal|cellpadding|cellPadding|cellspacing|cellSpacing|colSpan|rowSpan|vAlign|dateTime|accessKey|encType|maxLength|readOnly|longDesc|readonly|multiple|onload|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onfocus|onblur|onkeypress|onkeydown|onkeyup|onsubmit|onreset|onselect|onchange|rv|999999|TABLE|specified|FORM|INPUT|OPTGROUP|OptGroup|TextArea|Paragraph|FIELDSET||FieldSet|UL|UList|OL|OList|DL|DList|DIR|Directory|H1|H2|H3|H4|H5|H6|Quote|INS|DEL|Anchor|Image|CAPTION|TableCaption|COL|COLGROUP|TableRow|FRAMESET|FrameSet|IFRAME|IFrame|viewport|inner|getScrollOffsets|starts|translate|mod|dis|abled|selectorType|getInputs|focusFirstElement|setValue|present|blur|Field|one|selectedIndex|click|change|KEY_BACKSPACE|KEY_TAB|KEY_RETURN|KEY_ESC|KEY_LEFT|KEY_UP|KEY_RIGHT|KEY_DOWN|KEY_DELETE|KEY_HOME|KEY_END|KEY_PAGEUP|KEY_PAGEDOWN|KEY_INSERT|mouseover|fromElement|mouseout|isLeftClick|isMiddleClick|isRightClick|clientX|clientY|pointerX|pointerY|stopped|cancelBubble|returnValue|srcElement|detachEvent|initEvent|createEventObject|ondataavailable|memo|fireEvent|dom|load|DOMContentLoaded|Toggle|childOf|Insertion|Before|Top|Bottom|After|Error|is|deprecated|use|instead|within|overlap|vertical|horizontal|realOffset|page|add'.split('|'),0,{}))
/*  onDOMReady Extension */
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('v.q(3,{9:4(){1(c.d.b)w;c.d.b=z;1(0.6)A(0.6);0.2.B(4(f){f()});0.2=C},u:4(f){1(!0.2){t 5=0.9.r(0);1(7.a)7.a("j",5,k);1(/l/i.8(o.p)){0.6=x(4(){1(/e|g/.8(7.n))5()},s)}3.y(D,\'h\',5);3.2=[]}3.2.m(f)}});',40,40,'this|if|_readyCallbacks|Event|function|domReady|_timer|document|test|_domReady|addEventListener|done|arguments|callee|loaded||complete|load||DOMContentLoaded|false|WebKit|push|readyState|navigator|userAgent|extend|bind|10|var|onDOMReady|Object|return|setInterval|observe|true|clearInterval|each|null|window'.split('|'),0,{}))

// script.aculo.us scriptaculous.js v1.8.0, Tue Nov 06 15:01:40 +0300 2007

// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// 
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
// 
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// For details, see the script.aculo.us web site: http://script.aculo.us/

var Scriptaculous = {
  Version: '1.8.0',
  require: function(libraryName) {
    // inserting via DOM fails in Safari 2.0, so brute force approach
    document.write('<script type="text/javascript" src="'+libraryName+'"><\/script>');
  },
  REQUIRED_PROTOTYPE: '1.6.0',
  load: function() {
    function convertVersionString(versionString){
      var r = versionString.split('.');
      return parseInt(r[0])*100000 + parseInt(r[1])*1000 + parseInt(r[2]);
    }
 
    if((typeof Prototype=='undefined') || 
       (typeof Element == 'undefined') || 
       (typeof Element.Methods=='undefined') ||
       (convertVersionString(Prototype.Version) < 
        convertVersionString(Scriptaculous.REQUIRED_PROTOTYPE)))
       throw("script.aculo.us requires the Prototype JavaScript framework >= " +
        Scriptaculous.REQUIRED_PROTOTYPE);
    
    $A(document.getElementsByTagName("script")).findAll( function(s) {
      return (s.src && s.src.match(/scriptaculous\.js(\?.*)?$/))
    }).each( function(s) {
      var path = s.src.replace(/scriptaculous\.js(\?.*)?$/,'');
      var includes = s.src.match(/\?.*load=([a-z,]*)/);
      (includes ? includes[1] : 'builder,effects,dragdrop,controls,slider,sound').split(',').each(
       function(include) { Scriptaculous.require(path+include+'.js') });
    });
  }
}

Scriptaculous.load();

// script.aculo.us effects.js v1.8.0, Tue Nov 06 15:01:40 +0300 2007

// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// Contributors:
//  Justin Palmer (http://encytemedia.com/)
//  Mark Pilgrim (http://diveintomark.org/)
//  Martin Bialasinki
// 
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/ 

// converts rgb() and #xxx to #xxxxxx format,  
// returns self (or first argument) if not convertable  
String.prototype.parseColor = function() {  
  var color = '#';
  if (this.slice(0,4) == 'rgb(') {  
    var cols = this.slice(4,this.length-1).split(',');  
    var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3);  
  } else {  
    if (this.slice(0,1) == '#') {  
      if (this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase();  
      if (this.length==7) color = this.toLowerCase();  
    }  
  }  
  return (color.length==7 ? color : (arguments[0] || this));  
};

/*--------------------------------------------------------------------------*/

Element.collectTextNodes = function(element) {  
  return $A($(element).childNodes).collect( function(node) {
    return (node.nodeType==3 ? node.nodeValue : 
      (node.hasChildNodes() ? Element.collectTextNodes(node) : ''));
  }).flatten().join('');
};

Element.collectTextNodesIgnoreClass = function(element, className) {  
  return $A($(element).childNodes).collect( function(node) {
    return (node.nodeType==3 ? node.nodeValue : 
      ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? 
        Element.collectTextNodesIgnoreClass(node, className) : ''));
  }).flatten().join('');
};

Element.setContentZoom = function(element, percent) {
  element = $(element);  
  element.setStyle({fontSize: (percent/100) + 'em'});   
  if (Prototype.Browser.WebKit) window.scrollBy(0,0);
  return element;
};

Element.getInlineOpacity = function(element){
  return $(element).style.opacity || '';
};

Element.forceRerendering = function(element) {
  try {
    element = $(element);
    var n = document.createTextNode(' ');
    element.appendChild(n);
    element.removeChild(n);
  } catch(e) { }
};

/*--------------------------------------------------------------------------*/

var Effect = {
  _elementDoesNotExistError: {
    name: 'ElementDoesNotExistError',
    message: 'The specified DOM element does not exist, but is required for this effect to operate'
  },
  Transitions: {
    linear: Prototype.K,
    sinoidal: function(pos) {
      return (-Math.cos(pos*Math.PI)/2) + 0.5;
    },
    reverse: function(pos) {
      return 1-pos;
    },
    flicker: function(pos) {
      var pos = ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4;
      return pos > 1 ? 1 : pos;
    },
    wobble: function(pos) {
      return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5;
    },
    pulse: function(pos, pulses) { 
      pulses = pulses || 5; 
      return (
        ((pos % (1/pulses)) * pulses).round() == 0 ? 
              ((pos * pulses * 2) - (pos * pulses * 2).floor()) : 
          1 - ((pos * pulses * 2) - (pos * pulses * 2).floor())
        );
    },
    spring: function(pos) { 
      return 1 - (Math.cos(pos * 4.5 * Math.PI) * Math.exp(-pos * 6)); 
    },
    none: function(pos) {
      return 0;
    },
    full: function(pos) {
      return 1;
    }
  },
  DefaultOptions: {
    duration:   1.0,   // seconds
    fps:        100,   // 100= assume 66fps max.
    sync:       false, // true for combining
    from:       0.0,
    to:         1.0,
    delay:      0.0,
    queue:      'parallel'
  },
  tagifyText: function(element) {
    var tagifyStyle = 'position:relative';
    if (Prototype.Browser.IE) tagifyStyle += ';zoom:1';
    
    element = $(element);
    $A(element.childNodes).each( function(child) {
      if (child.nodeType==3) {
        child.nodeValue.toArray().each( function(character) {
          element.insertBefore(
            new Element('span', {style: tagifyStyle}).update(
              character == ' ' ? String.fromCharCode(160) : character), 
              child);
        });
        Element.remove(child);
      }
    });
  },
  multiple: function(element, effect) {
    var elements;
    if (((typeof element == 'object') || 
        Object.isFunction(element)) && 
       (element.length))
      elements = element;
    else
      elements = $(element).childNodes;
      
    var options = Object.extend({
      speed: 0.1,
      delay: 0.0
    }, arguments[2] || { });
    var masterDelay = options.delay;

    $A(elements).each( function(element, index) {
      new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay }));
    });
  },
  PAIRS: {
    'slide':  ['SlideDown','SlideUp'],
    'blind':  ['BlindDown','BlindUp'],
    'appear': ['Appear','Fade']
  },
  toggle: function(element, effect) {
    element = $(element);
    effect = (effect || 'appear').toLowerCase();
    var options = Object.extend({
      queue: { position:'end', scope:(element.id || 'global'), limit: 1 }
    }, arguments[2] || { });
    Effect[element.visible() ? 
      Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options);
  }
};

Effect.DefaultOptions.transition = Effect.Transitions.sinoidal;

/* ------------- core effects ------------- */

Effect.ScopedQueue = Class.create(Enumerable, {
  initialize: function() {
    this.effects  = [];
    this.interval = null;    
  },
  _each: function(iterator) {
    this.effects._each(iterator);
  },
  add: function(effect) {
    var timestamp = new Date().getTime();
    
    var position = Object.isString(effect.options.queue) ? 
      effect.options.queue : effect.options.queue.position;
    
    switch(position) {
      case 'front':
        // move unstarted effects after this effect  
        this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) {
            e.startOn  += effect.finishOn;
            e.finishOn += effect.finishOn;
          });
        break;
      case 'with-last':
        timestamp = this.effects.pluck('startOn').max() || timestamp;
        break;
      case 'end':
        // start effect after last queued effect has finished
        timestamp = this.effects.pluck('finishOn').max() || timestamp;
        break;
    }
    
    effect.startOn  += timestamp;
    effect.finishOn += timestamp;

    if (!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit))
      this.effects.push(effect);
    
    if (!this.interval)
      this.interval = setInterval(this.loop.bind(this), 15);
  },
  remove: function(effect) {
    this.effects = this.effects.reject(function(e) { return e==effect });
    if (this.effects.length == 0) {
      clearInterval(this.interval);
      this.interval = null;
    }
  },
  loop: function() {
    var timePos = new Date().getTime();
    for(var i=0, len=this.effects.length;i<len;i++) 
      this.effects[i] && this.effects[i].loop(timePos);
  }
});

Effect.Queues = {
  instances: $H(),
  get: function(queueName) {
    if (!Object.isString(queueName)) return queueName;
    
    return this.instances.get(queueName) ||
      this.instances.set(queueName, new Effect.ScopedQueue());
  }
};
Effect.Queue = Effect.Queues.get('global');

Effect.Base = Class.create({
  position: null,
  start: function(options) {
    function codeForEvent(options,eventName){
      return (
        (options[eventName+'Internal'] ? 'this.options.'+eventName+'Internal(this);' : '') +
        (options[eventName] ? 'this.options.'+eventName+'(this);' : '')
      );
    }
    if (options && options.transition === false) options.transition = Effect.Transitions.linear;
    this.options      = Object.extend(Object.extend({ },Effect.DefaultOptions), options || { });
    this.currentFrame = 0;
    this.state        = 'idle';
    this.startOn      = this.options.delay*1000;
    this.finishOn     = this.startOn+(this.options.duration*1000);
    this.fromToDelta  = this.options.to-this.options.from;
    this.totalTime    = this.finishOn-this.startOn;
    this.totalFrames  = this.options.fps*this.options.duration;
    
    eval('this.render = function(pos){ '+
      'if (this.state=="idle"){this.state="running";'+
      codeForEvent(this.options,'beforeSetup')+
      (this.setup ? 'this.setup();':'')+ 
      codeForEvent(this.options,'afterSetup')+
      '};if (this.state=="running"){'+
      'pos=this.options.transition(pos)*'+this.fromToDelta+'+'+this.options.from+';'+
      'this.position=pos;'+
      codeForEvent(this.options,'beforeUpdate')+
      (this.update ? 'this.update(pos);':'')+
      codeForEvent(this.options,'afterUpdate')+
      '}}');
    
    this.event('beforeStart');
    if (!this.options.sync)
      Effect.Queues.get(Object.isString(this.options.queue) ? 
        'global' : this.options.queue.scope).add(this);
  },
  loop: function(timePos) {
    if (timePos >= this.startOn) {
      if (timePos >= this.finishOn) {
        this.render(1.0);
        this.cancel();
        this.event('beforeFinish');
        if (this.finish) this.finish(); 
        this.event('afterFinish');
        return;  
      }
      var pos   = (timePos - this.startOn) / this.totalTime,
          frame = (pos * this.totalFrames).round();
      if (frame > this.currentFrame) {
        this.render(pos);
        this.currentFrame = frame;
      }
    }
  },
  cancel: function() {
    if (!this.options.sync)
      Effect.Queues.get(Object.isString(this.options.queue) ? 
        'global' : this.options.queue.scope).remove(this);
    this.state = 'finished';
  },
  event: function(eventName) {
    if (this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this);
    if (this.options[eventName]) this.options[eventName](this);
  },
  inspect: function() {
    var data = $H();
    for(property in this)
      if (!Object.isFunction(this[property])) data.set(property, this[property]);
    return '#<Effect:' + data.inspect() + ',options:' + $H(this.options).inspect() + '>';
  }
});

Effect.Parallel = Class.create(Effect.Base, {
  initialize: function(effects) {
    this.effects = effects || [];
    this.start(arguments[1]);
  },
  update: function(position) {
    this.effects.invoke('render', position);
  },
  finish: function(position) {
    this.effects.each( function(effect) {
      effect.render(1.0);
      effect.cancel();
      effect.event('beforeFinish');
      if (effect.finish) effect.finish(position);
      effect.event('afterFinish');
    });
  }
});

Effect.Tween = Class.create(Effect.Base, {
  initialize: function(object, from, to) {
    object = Object.isString(object) ? $(object) : object;
    var args = $A(arguments), method = args.last(), 
      options = args.length == 5 ? args[3] : null;
    this.method = Object.isFunction(method) ? method.bind(object) :
      Object.isFunction(object[method]) ? object[method].bind(object) : 
      function(value) { object[method] = value };
    this.start(Object.extend({ from: from, to: to }, options || { }));
  },
  update: function(position) {
    this.method(position);
  }
});

Effect.Event = Class.create(Effect.Base, {
  initialize: function() {
    this.start(Object.extend({ duration: 0 }, arguments[0] || { }));
  },
  update: Prototype.emptyFunction
});

Effect.Opacity = Class.create(Effect.Base, {
  initialize: function(element) {
    this.element = $(element);
    if (!this.element) throw(Effect._elementDoesNotExistError);
    // make this work on IE on elements without 'layout'
    if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout))
      this.element.setStyle({zoom: 1});
    var options = Object.extend({
      from: this.element.getOpacity() || 0.0,
      to:   1.0
    }, arguments[1] || { });
    this.start(options);
  },
  update: function(position) {
    this.element.setOpacity(position);
  }
});

Effect.Move = Class.create(Effect.Base, {
  initialize: function(element) {
    this.element = $(element);
    if (!this.element) throw(Effect._elementDoesNotExistError);
    var options = Object.extend({
      x:    0,
      y:    0,
      mode: 'relative'
    }, arguments[1] || { });
    this.start(options);
  },
  setup: function() {
    this.element.makePositioned();
    this.originalLeft = parseFloat(this.element.getStyle('left') || '0');
    this.originalTop  = parseFloat(this.element.getStyle('top')  || '0');
    if (this.options.mode == 'absolute') {
      this.options.x = this.options.x - this.originalLeft;
      this.options.y = this.options.y - this.originalTop;
    }
  },
  update: function(position) {
    this.element.setStyle({
      left: (this.options.x  * position + this.originalLeft).round() + 'px',
      top:  (this.options.y  * position + this.originalTop).round()  + 'px'
    });
  }
});

// for backwards compatibility
Effect.MoveBy = function(element, toTop, toLeft) {
  return new Effect.Move(element, 
    Object.extend({ x: toLeft, y: toTop }, arguments[3] || { }));
};

Effect.Scale = Class.create(Effect.Base, {
  initialize: function(element, percent) {
    this.element = $(element);
    if (!this.element) throw(Effect._elementDoesNotExistError);
    var options = Object.extend({
      scaleX: true,
      scaleY: true,
      scaleContent: true,
      scaleFromCenter: false,
      scaleMode: 'box',        // 'box' or 'contents' or { } with provided values
      scaleFrom: 100.0,
      scaleTo:   percent
    }, arguments[2] || { });
    this.start(options);
  },
  setup: function() {
    this.restoreAfterFinish = this.options.restoreAfterFinish || false;
    this.elementPositioning = this.element.getStyle('position');
    
    this.originalStyle = { };
    ['top','left','width','height','fontSize'].each( function(k) {
      this.originalStyle[k] = this.element.style[k];
    }.bind(this));
      
    this.originalTop  = this.element.offsetTop;
    this.originalLeft = this.element.offsetLeft;
    
    var fontSize = this.element.getStyle('font-size') || '100%';
    ['em','px','%','pt'].each( function(fontSizeType) {
      if (fontSize.indexOf(fontSizeType)>0) {
        this.fontSize     = parseFloat(fontSize);
        this.fontSizeType = fontSizeType;
      }
    }.bind(this));
    
    this.factor = (this.options.scaleTo - this.options.scaleFrom)/100;
    
    this.dims = null;
    if (this.options.scaleMode=='box')
      this.dims = [this.element.offsetHeight, this.element.offsetWidth];
    if (/^content/.test(this.options.scaleMode))
      this.dims = [this.element.scrollHeight, this.element.scrollWidth];
    if (!this.dims)
      this.dims = [this.options.scaleMode.originalHeight,
                   this.options.scaleMode.originalWidth];
  },
  update: function(position) {
    var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position);
    if (this.options.scaleContent && this.fontSize)
      this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType });
    this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale);
  },
  finish: function(position) {
    if (this.restoreAfterFinish) this.element.setStyle(this.originalStyle);
  },
  setDimensions: function(height, width) {
    var d = { };
    if (this.options.scaleX) d.width = width.round() + 'px';
    if (this.options.scaleY) d.height = height.round() + 'px';
    if (this.options.scaleFromCenter) {
      var topd  = (height - this.dims[0])/2;
      var leftd = (width  - this.dims[1])/2;
      if (this.elementPositioning == 'absolute') {
        if (this.options.scaleY) d.top = this.originalTop-topd + 'px';
        if (this.options.scaleX) d.left = this.originalLeft-leftd + 'px';
      } else {
        if (this.options.scaleY) d.top = -topd + 'px';
        if (this.options.scaleX) d.left = -leftd + 'px';
      }
    }
    this.element.setStyle(d);
  }
});

Effect.Highlight = Class.create(Effect.Base, {
  initialize: function(element) {
    this.element = $(element);
    if (!this.element) throw(Effect._elementDoesNotExistError);
    var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || { });
    this.start(options);
  },
  setup: function() {
    // Prevent executing on elements not in the layout flow
    if (this.element.getStyle('display')=='none') { this.cancel(); return; }
    // Disable background image during the effect
    this.oldStyle = { };
    if (!this.options.keepBackgroundImage) {
      this.oldStyle.backgroundImage = this.element.getStyle('background-image');
      this.element.setStyle({backgroundImage: 'none'});
    }
    if (!this.options.endcolor)
      this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff');
    if (!this.options.restorecolor)
      this.options.restorecolor = this.element.getStyle('background-color');
    // init color calculations
    this._base  = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this));
    this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this));
  },
  update: function(position) {
    this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){
      return m+((this._base[i]+(this._delta[i]*position)).round().toColorPart()); }.bind(this)) });
  },
  finish: function() {
    this.element.setStyle(Object.extend(this.oldStyle, {
      backgroundColor: this.options.restorecolor
    }));
  }
});

Effect.ScrollTo = function(element) {
  var options = arguments[1] || { },
    scrollOffsets = document.viewport.getScrollOffsets(),
    elementOffsets = $(element).cumulativeOffset(),
    max = (window.height || document.body.scrollHeight) - document.viewport.getHeight();  

  if (options.offset) elementOffsets[1] += options.offset;

  return new Effect.Tween(null,
    scrollOffsets.top,
    elementOffsets[1] > max ? max : elementOffsets[1],
    options,
    function(p){ scrollTo(scrollOffsets.left, p.round()) }
  );
};

/* ------------- combination effects ------------- */

Effect.Fade = function(element) {
  element = $(element);
  var oldOpacity = element.getInlineOpacity();
  var options = Object.extend({
    from: element.getOpacity() || 1.0,
    to:   0.0,
    afterFinishInternal: function(effect) { 
      if (effect.options.to!=0) return;
      effect.element.hide().setStyle({opacity: oldOpacity}); 
    }
  }, arguments[1] || { });
  return new Effect.Opacity(element,options);
};

Effect.Appear = function(element) {
  element = $(element);
  var options = Object.extend({
  from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0),
  to:   1.0,
  // force Safari to render floated elements properly
  afterFinishInternal: function(effect) {
    effect.element.forceRerendering();
  },
  beforeSetup: function(effect) {
    effect.element.setOpacity(effect.options.from).show(); 
  }}, arguments[1] || { });
  return new Effect.Opacity(element,options);
};

Effect.Puff = function(element) {
  element = $(element);
  var oldStyle = { 
    opacity: element.getInlineOpacity(), 
    position: element.getStyle('position'),
    top:  element.style.top,
    left: element.style.left,
    width: element.style.width,
    height: element.style.height
  };
  return new Effect.Parallel(
   [ new Effect.Scale(element, 200, 
      { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), 
     new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], 
     Object.extend({ duration: 1.0, 
      beforeSetupInternal: function(effect) {
        Position.absolutize(effect.effects[0].element)
      },
      afterFinishInternal: function(effect) {
         effect.effects[0].element.hide().setStyle(oldStyle); }
     }, arguments[1] || { })
   );
};

Effect.BlindUp = function(element) {
  element = $(element);
  element.makeClipping();
  return new Effect.Scale(element, 0,
    Object.extend({ scaleContent: false, 
      scaleX: false, 
      restoreAfterFinish: true,
      afterFinishInternal: function(effect) {
        effect.element.hide().undoClipping();
      } 
    }, arguments[1] || { })
  );
};

Effect.BlindDown = function(element) {
  element = $(element);
  var elementDimensions = element.getDimensions();
  return new Effect.Scale(element, 100, Object.extend({ 
    scaleContent: false, 
    scaleX: false,
    scaleFrom: 0,
    scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
    restoreAfterFinish: true,
    afterSetup: function(effect) {
      effect.element.makeClipping().setStyle({height: '0px'}).show(); 
    },  
    afterFinishInternal: function(effect) {
      effect.element.undoClipping();
    }
  }, arguments[1] || { }));
};

Effect.SwitchOff = function(element) {
  element = $(element);
  var oldOpacity = element.getInlineOpacity();
  return new Effect.Appear(element, Object.extend({
    duration: 0.4,
    from: 0,
    transition: Effect.Transitions.flicker,
    afterFinishInternal: function(effect) {
      new Effect.Scale(effect.element, 1, { 
        duration: 0.3, scaleFromCenter: true,
        scaleX: false, scaleContent: false, restoreAfterFinish: true,
        beforeSetup: function(effect) { 
          effect.element.makePositioned().makeClipping();
        },
        afterFinishInternal: function(effect) {
          effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity});
        }
      })
    }
  }, arguments[1] || { }));
};

Effect.DropOut = function(element) {
  element = $(element);
  var oldStyle = {
    top: element.getStyle('top'),
    left: element.getStyle('left'),
    opacity: element.getInlineOpacity() };
  return new Effect.Parallel(
    [ new Effect.Move(element, {x: 0, y: 100, sync: true }), 
      new Effect.Opacity(element, { sync: true, to: 0.0 }) ],
    Object.extend(
      { duration: 0.5,
        beforeSetup: function(effect) {
          effect.effects[0].element.makePositioned(); 
        },
        afterFinishInternal: function(effect) {
          effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle);
        } 
      }, arguments[1] || { }));
};

Effect.Shake = function(element) {
  element = $(element);
  var options = Object.extend({
    distance: 20,
    duration: 0.5
  }, arguments[1] || {});
  var distance = parseFloat(options.distance);
  var split = parseFloat(options.duration) / 10.0;
  var oldStyle = {
    top: element.getStyle('top'),
    left: element.getStyle('left') };
    return new Effect.Move(element,
      { x:  distance, y: 0, duration: split, afterFinishInternal: function(effect) {
    new Effect.Move(effect.element,
      { x: -distance*2, y: 0, duration: split*2,  afterFinishInternal: function(effect) {
    new Effect.Move(effect.element,
      { x:  distance*2, y: 0, duration: split*2,  afterFinishInternal: function(effect) {
    new Effect.Move(effect.element,
      { x: -distance*2, y: 0, duration: split*2,  afterFinishInternal: function(effect) {
    new Effect.Move(effect.element,
      { x:  distance*2, y: 0, duration: split*2,  afterFinishInternal: function(effect) {
    new Effect.Move(effect.element,
      { x: -distance, y: 0, duration: split, afterFinishInternal: function(effect) {
        effect.element.undoPositioned().setStyle(oldStyle);
  }}) }}) }}) }}) }}) }});
};

Effect.SlideDown = function(element) {
  element = $(element).cleanWhitespace();
  // SlideDown need to have the content of the element wrapped in a container element with fixed height!
  var oldInnerBottom = element.down().getStyle('bottom');
  var elementDimensions = element.getDimensions();
  return new Effect.Scale(element, 100, Object.extend({ 
    scaleContent: false, 
    scaleX: false, 
    scaleFrom: window.opera ? 0 : 1,
    scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
    restoreAfterFinish: true,
    afterSetup: function(effect) {
      effect.element.makePositioned();
      effect.element.down().makePositioned();
      if (window.opera) effect.element.setStyle({top: ''});
      effect.element.makeClipping().setStyle({height: '0px'}).show(); 
    },
    afterUpdateInternal: function(effect) {
      effect.element.down().setStyle({bottom:
        (effect.dims[0] - effect.element.clientHeight) + 'px' }); 
    },
    afterFinishInternal: function(effect) {
      effect.element.undoClipping().undoPositioned();
      effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); }
    }, arguments[1] || { })
  );
};

Effect.SlideUp = function(element) {
  element = $(element).cleanWhitespace();
  var oldInnerBottom = element.down().getStyle('bottom');
  var elementDimensions = element.getDimensions();
  return new Effect.Scale(element, window.opera ? 0 : 1,
   Object.extend({ scaleContent: false, 
    scaleX: false, 
    scaleMode: 'box',
    scaleFrom: 100,
    scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
    restoreAfterFinish: true,
    afterSetup: function(effect) {
      effect.element.makePositioned();
      effect.element.down().makePositioned();
      if (window.opera) effect.element.setStyle({top: ''});
      effect.element.makeClipping().show();
    },  
    afterUpdateInternal: function(effect) {
      effect.element.down().setStyle({bottom:
        (effect.dims[0] - effect.element.clientHeight) + 'px' });
    },
    afterFinishInternal: function(effect) {
      effect.element.hide().undoClipping().undoPositioned();
      effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom});
    }
   }, arguments[1] || { })
  );
};

// Bug in opera makes the TD containing this element expand for a instance after finish 
Effect.Squish = function(element) {
  return new Effect.Scale(element, window.opera ? 1 : 0, { 
    restoreAfterFinish: true,
    beforeSetup: function(effect) {
      effect.element.makeClipping(); 
    },  
    afterFinishInternal: function(effect) {
      effect.element.hide().undoClipping(); 
    }
  });
};

Effect.Grow = function(element) {
  element = $(element);
  var options = Object.extend({
    direction: 'center',
    moveTransition: Effect.Transitions.sinoidal,
    scaleTransition: Effect.Transitions.sinoidal,
    opacityTransition: Effect.Transitions.full
  }, arguments[1] || { });
  var oldStyle = {
    top: element.style.top,
    left: element.style.left,
    height: element.style.height,
    width: element.style.width,
    opacity: element.getInlineOpacity() };

  var dims = element.getDimensions();    
  var initialMoveX, initialMoveY;
  var moveX, moveY;
  
  switch (options.direction) {
    case 'top-left':
      initialMoveX = initialMoveY = moveX = moveY = 0; 
      break;
    case 'top-right':
      initialMoveX = dims.width;
      initialMoveY = moveY = 0;
      moveX = -dims.width;
      break;
    case 'bottom-left':
      initialMoveX = moveX = 0;
      initialMoveY = dims.height;
      moveY = -dims.height;
      break;
    case 'bottom-right':
      initialMoveX = dims.width;
      initialMoveY = dims.height;
      moveX = -dims.width;
      moveY = -dims.height;
      break;
    case 'center':
      initialMoveX = dims.width / 2;
      initialMoveY = dims.height / 2;
      moveX = -dims.width / 2;
      moveY = -dims.height / 2;
      break;
  }
  
  return new Effect.Move(element, {
    x: initialMoveX,
    y: initialMoveY,
    duration: 0.01, 
    beforeSetup: function(effect) {
      effect.element.hide().makeClipping().makePositioned();
    },
    afterFinishInternal: function(effect) {
      new Effect.Parallel(
        [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }),
          new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }),
          new Effect.Scale(effect.element, 100, {
            scaleMode: { originalHeight: dims.height, originalWidth: dims.width }, 
            sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true})
        ], Object.extend({
             beforeSetup: function(effect) {
               effect.effects[0].element.setStyle({height: '0px'}).show(); 
             },
             afterFinishInternal: function(effect) {
               effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle); 
             }
           }, options)
      )
    }
  });
};

Effect.Shrink = function(element) {
  element = $(element);
  var options = Object.extend({
    direction: 'center',
    moveTransition: Effect.Transitions.sinoidal,
    scaleTransition: Effect.Transitions.sinoidal,
    opacityTransition: Effect.Transitions.none
  }, arguments[1] || { });
  var oldStyle = {
    top: element.style.top,
    left: element.style.left,
    height: element.style.height,
    width: element.style.width,
    opacity: element.getInlineOpacity() };

  var dims = element.getDimensions();
  var moveX, moveY;
  
  switch (options.direction) {
    case 'top-left':
      moveX = moveY = 0;
      break;
    case 'top-right':
      moveX = dims.width;
      moveY = 0;
      break;
    case 'bottom-left':
      moveX = 0;
      moveY = dims.height;
      break;
    case 'bottom-right':
      moveX = dims.width;
      moveY = dims.height;
      break;
    case 'center':  
      moveX = dims.width / 2;
      moveY = dims.height / 2;
      break;
  }
  
  return new Effect.Parallel(
    [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }),
      new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}),
      new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition })
    ], Object.extend({            
         beforeStartInternal: function(effect) {
           effect.effects[0].element.makePositioned().makeClipping(); 
         },
         afterFinishInternal: function(effect) {
           effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); }
       }, options)
  );
};

Effect.Pulsate = function(element) {
  element = $(element);
  var options    = arguments[1] || { };
  var oldOpacity = element.getInlineOpacity();
  var transition = options.transition || Effect.Transitions.sinoidal;
  var reverser   = function(pos){ return transition(1-Effect.Transitions.pulse(pos, options.pulses)) };
  reverser.bind(transition);
  return new Effect.Opacity(element, 
    Object.extend(Object.extend({  duration: 2.0, from: 0,
      afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); }
    }, options), {transition: reverser}));
};

Effect.Fold = function(element) {
  element = $(element);
  var oldStyle = {
    top: element.style.top,
    left: element.style.left,
    width: element.style.width,
    height: element.style.height };
  element.makeClipping();
  return new Effect.Scale(element, 5, Object.extend({   
    scaleContent: false,
    scaleX: false,
    afterFinishInternal: function(effect) {
    new Effect.Scale(element, 1, { 
      scaleContent: false, 
      scaleY: false,
      afterFinishInternal: function(effect) {
        effect.element.hide().undoClipping().setStyle(oldStyle);
      } });
  }}, arguments[1] || { }));
};

Effect.Morph = Class.create(Effect.Base, {
  initialize: function(element) {
    this.element = $(element);
    if (!this.element) throw(Effect._elementDoesNotExistError);
    var options = Object.extend({
      style: { }
    }, arguments[1] || { });
    
    if (!Object.isString(options.style)) this.style = $H(options.style);
    else {
      if (options.style.include(':'))
        this.style = options.style.parseStyle();
      else {
        this.element.addClassName(options.style);
        this.style = $H(this.element.getStyles());
        this.element.removeClassName(options.style);
        var css = this.element.getStyles();
        this.style = this.style.reject(function(style) {
          return style.value == css[style.key];
        });
        options.afterFinishInternal = function(effect) {
          effect.element.addClassName(effect.options.style);
          effect.transforms.each(function(transform) {
            effect.element.style[transform.style] = '';
          });
        }
      }
    }
    this.start(options);
  },
  
  setup: function(){
    function parseColor(color){
      if (!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff';
      color = color.parseColor();
      return $R(0,2).map(function(i){
        return parseInt( color.slice(i*2+1,i*2+3), 16 ) 
      });
    }
    this.transforms = this.style.map(function(pair){
      var property = pair[0], value = pair[1], unit = null;

      if (value.parseColor('#zzzzzz') != '#zzzzzz') {
        value = value.parseColor();
        unit  = 'color';
      } else if (property == 'opacity') {
        value = parseFloat(value);
        if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout))
          this.element.setStyle({zoom: 1});
      } else if (Element.CSS_LENGTH.test(value)) {
          var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/);
          value = parseFloat(components[1]);
          unit = (components.length == 3) ? components[2] : null;
      }

      var originalValue = this.element.getStyle(property);
      return { 
        style: property.camelize(), 
        originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), 
        targetValue: unit=='color' ? parseColor(value) : value,
        unit: unit
      };
    }.bind(this)).reject(function(transform){
      return (
        (transform.originalValue == transform.targetValue) ||
        (
          transform.unit != 'color' &&
          (isNaN(transform.originalValue) || isNaN(transform.targetValue))
        )
      )
    });
  },
  update: function(position) {
    var style = { }, transform, i = this.transforms.length;
    while(i--)
      style[(transform = this.transforms[i]).style] = 
        transform.unit=='color' ? '#'+
          (Math.round(transform.originalValue[0]+
            (transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart() +
          (Math.round(transform.originalValue[1]+
            (transform.targetValue[1]-transform.originalValue[1])*position)).toColorPart() +
          (Math.round(transform.originalValue[2]+
            (transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart() :
        (transform.originalValue +
          (transform.targetValue - transform.originalValue) * position).toFixed(3) + 
            (transform.unit === null ? '' : transform.unit);
    this.element.setStyle(style, true);
  }
});

Effect.Transform = Class.create({
  initialize: function(tracks){
    this.tracks  = [];
    this.options = arguments[1] || { };
    this.addTracks(tracks);
  },
  addTracks: function(tracks){
    tracks.each(function(track){
      track = $H(track);
      var data = track.values().first();
      this.tracks.push($H({
        ids:     track.keys().first(),
        effect:  Effect.Morph,
        options: { style: data }
      }));
    }.bind(this));
    return this;
  },
  play: function(){
    return new Effect.Parallel(
      this.tracks.map(function(track){
        var ids = track.get('ids'), effect = track.get('effect'), options = track.get('options');
        var elements = [$(ids) || $$(ids)].flatten();
        return elements.map(function(e){ return new effect(e, Object.extend({ sync:true }, options)) });
      }).flatten(),
      this.options
    );
  }
});

Element.CSS_PROPERTIES = $w(
  'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' + 
  'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' +
  'borderRightColor borderRightStyle borderRightWidth borderSpacing ' +
  'borderTopColor borderTopStyle borderTopWidth bottom clip color ' +
  'fontSize fontWeight height left letterSpacing lineHeight ' +
  'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+
  'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' +
  'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' +
  'right textIndent top width wordSpacing zIndex');
  
Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;

String.__parseStyleElement = document.createElement('div');
String.prototype.parseStyle = function(){
  var style, styleRules = $H();
  if (Prototype.Browser.WebKit)
    style = new Element('div',{style:this}).style;
  else {
    String.__parseStyleElement.innerHTML = '<div style="' + this + '"></div>';
    style = String.__parseStyleElement.childNodes[0].style;
  }
  
  Element.CSS_PROPERTIES.each(function(property){
    if (style[property]) styleRules.set(property, style[property]); 
  });
  
  if (Prototype.Browser.IE && this.include('opacity'))
    styleRules.set('opacity', this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]);

  return styleRules;
};

if (document.defaultView && document.defaultView.getComputedStyle) {
  Element.getStyles = function(element) {
    var css = document.defaultView.getComputedStyle($(element), null);
    return Element.CSS_PROPERTIES.inject({ }, function(styles, property) {
      styles[property] = css[property];
      return styles;
    });
  };
} else {
  Element.getStyles = function(element) {
    element = $(element);
    var css = element.currentStyle, styles;
    styles = Element.CSS_PROPERTIES.inject({ }, function(hash, property) {
      hash.set(property, css[property]);
      return hash;
    });
    if (!styles.opacity) styles.set('opacity', element.getOpacity());
    return styles;
  };
};

Effect.Methods = {
  morph: function(element, style) {
    element = $(element);
    new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || { }));
    return element;
  },
  visualEffect: function(element, effect, options) {
    element = $(element)
    var s = effect.dasherize().camelize(), klass = s.charAt(0).toUpperCase() + s.substring(1);
    new Effect[klass](element, options);
    return element;
  },
  highlight: function(element, options) {
    element = $(element);
    new Effect.Highlight(element, options);
    return element;
  }
};

$w('fade appear grow shrink fold blindUp blindDown slideUp slideDown '+
  'pulsate shake puff squish switchOff dropOut').each(
  function(effect) { 
    Effect.Methods[effect] = function(element, options){
      element = $(element);
      Effect[effect.charAt(0).toUpperCase() + effect.substring(1)](element, options);
      return element;
    }
  }
);

$w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles').each( 
  function(f) { Effect.Methods[f] = Element[f]; }
);

Element.addMethods(Effect.Methods);



// 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!");

// This will stop image flickering in IE6 when elements with images are moved
try {
	document.execCommand("BackgroundImageCache", false, true);
} catch(e) {}

var lightwindow = Class.create();	
lightwindow.prototype = {
	//
	//	Setup Variables
	//
	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 the lightwindow.
	//
	initialize : function(options) {
		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 : '/styles/v4/images/lightbox/overlay.png',
				presetImage : '/styles/v4/images/lightbox/overlay.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" >'+
								'<img id="logo" src="/images/common/lightbox/mobile.gif" width="273" height="47" alt="w mobile" />'+
								'</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/common/spinners/ajax-loading.gif" alt="loading" />'+
								'<span>Loading</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 the lightwindow.
	//
	activate : function(e, link){		
		// Clear out the window Contents
		this._clearWindowContents(true);
			
		// Add back in out loading panel
		this._addLoadingWindowMarkup();

		// Setup the element properties
		this._setupWindowElements(link);
		
		// Setup everything
		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();
	},
	//
	//	Turn off the window
	//
	deactivate : function(){
		// The window is not active
		this.windowActive = false;
		
		// There is no longer a gallery active
		this.activeGallery = false;
		if (!this.options.hideGalleryTab) {
			this._handleGalleryAnimation(false);
		}
		
		// Kill the animation
		this.animating = false;
		
		// Clear our element
		this.element = null;
		
		// hide the window.
		this._displayLightWindow('none', 'visible');
		
		// Clear out the window Contents
		this._clearWindowContents(false);
		
		// Stop all animation
		var queue = Effect.Queues.get('lightwindowAnimation').each(function(e){e.cancel();});
		
		// Undo the setup
		this._prepareIE(false);
		this._setupDimensions();
		this._toggleTroubleElements('visible', false);	
		this._monitorKeyboard(false);	
	},
	//
	//  Initialize specific window
	//
	createWindow : function(element, attributes) {
		this._processLink($(element));
	},
	//
	//  Open a Window from a hash of attributes
	//
	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 || {});
		
		// Set the window type
		this.contentToFetch = this.element.href;
		this.windowType = this.element.type ? this.element.type : this._fileType(this.element.href);	
		
		// Clear out the window Contents
		this._clearWindowContents(true);
			
		// Add back in out loading panel
		this._addLoadingWindowMarkup();
		
		// Setup everything
		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();
	},
	//
	//  Fire off our Form handler
	//
	submitForm : function(e) {
		if (this.options.formHandler) {
			this.options.formHandler(e);
		} else {
			this._defaultFormHandler(e);
		}
	},
	//
	//	Reload the window with another location
	//
	openWindow : function(element) {
		var element = $(element);

		// The window is active
		this.windowActive = true;
		
		// Clear out the window Contents
		this._clearWindowContents(true);
		
		// Add back in out loading panel
		this._addLoadingWindowMarkup();
		
		// Setup the element properties
		this._setupWindowElements(element);

		this._setStatus(true);
		this._handleTransition();
	},
	//
	//  Navigate the window
	//
	navigateWindow : function(direction) {
		this._handleNavigation(false);
		if (direction == 'previous') {
			this.openWindow(this.navigationObservers.previous);
		} else if (direction == 'next'){ 
			this.openWindow(this.navigationObservers.next);
		}
	},
	//
	//  Build the Gallery List and Load it
	//
	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);
		
		// Attach Events
		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;};	
					}
				}
			}
		}
	},
	// 
	//  Set Links Up
	//
	_setupLinks : function() {
		var links = $$('.'+this.options.classNames.standard);
		links.each(function(link) {
			this._processLink(link);
		}.bind(this));	
	},
	//
	//  Process a Link
	//
	_processLink : function(link) {
		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);
			}
		}
		
		// Take care of our inline content
		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;};		
	},
	//
	//	Setup our actions
	//
	_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));
	},
	//
	//	Add the markup to the page.
	//
	_addLightWindowMarkup : function(rebuild) {
		var overlay = Element.extend(document.createElement('div'));
		overlay.setAttribute('id', 'lightwindow_overlay');		
		// FF Mac has a problem with putting Flash above a layer without a 100% opacity background, so we need to use a pre-made
		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;};
		}
		
		// Because we use position absolute, kill the scroll Wheel on animations
		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;};
	},
	//
	//  Add loading window markup
	//
	_addLoadingWindowMarkup : function() {
		$('lightwindow_contents').innerHTML += this.options.skin.loading;
	},
	//
	//  Setup the window elements
	//
	_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');

		// Set the window type
		this.contentToFetch = this.element.href;
		this.windowType = this._getParameter('lightwindow_type') ? this._getParameter('lightwindow_type') : this._fileType(this.contentToFetch);	
	},
	//
	//  Clear the window contents out
	//
	_clearWindowContents : function(contents) {
		// If there is an iframe, its got to go
		if ($('lightwindow_iframe')) {
			Element.remove($('lightwindow_iframe'));
		}

		// Stop playing an object if its still around
		if ($('lightwindow_media_primary')) {
			try {
				$('lightwindow_media_primary').Stop();
			} catch(e) {}
			Element.remove($('lightwindow_media_primary'));
		}

		// Stop playing an object if its still around		
		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) {
			// Empty the contents
			$('lightwindow_contents').innerHTML = '';
			
			// Reset the scroll bars
			$('lightwindow_contents').setStyle({
				overflow: 'hidden'
			});		
			
			if (!this.windowActive) {
				$('lightwindow_data_slide_inner').setStyle({
					display: 'none'
				});

				$('lightwindow_title_bar_title').innerHTML = '';
			}

			// Because of browser differences and to maintain flexible captions we need to reset this height at close
			$('lightwindow_data_slide').setStyle({
				height: 'auto'
			});
		}
		
		this.resizeTo.height = null;
		this.resizeTo.width = null;
	},
	//
	//	Set the status of our animation to keep things from getting clunky
	//
	_setStatus : function(status) {
		this.animating = status;
		if (status) {
			Element.show('lightwindow_loading');
		}
		if (!(/MSIE 6./i.test(navigator.userAgent))) {
			this._fixedWindow(status);
		}
	},
	//
	//  Make this window Fixed
	//
	_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')) {
					// Ideally here we would set a 50% value for top and left, but Safari rears it ugly head again and we need to do it by pixels
					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')
				});
			}
		}
	},
	//
	//	Prepare the window for IE.
	//
	_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;		
		}
	},
	//
	//	Get the scroll for the page.
	//
	_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;
      	}
	},
	//
	//	Reset the scroll.
	//
	_setScroll : function(x, y) {
		document.documentElement.scrollLeft = x; 
		document.documentElement.scrollTop = y; 
	},
	//
	//	Hide Selects from the page because of IE.
	//     We could use iframe shims instead here but why add all the extra markup for one browser when this is much easier and cleaner
	//
	_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;
			}
		}
	},
	// 
	//  Get the actual page size
	//
	_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;
		}
	},
	//
	//	Display the lightWindow.
	//
	_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;
	},
	//
	//	Setup Dimensions of lightwindow.

	//
	_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;
		
		// So if a theme has say shadowed edges, they should be consistant and take care of in the contentOffset
		$('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'
		});
	},
	//
	//	Get the type of file.
	//
	_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;
	},
	//
	//  Get file Extension
	//
	_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;
		}
	},
	//
	//	Monitor the keyboard while this lightwindow is up
	//
	_monitorKeyboard : function(status) {
		if (status) document.onkeydown = this._eventKeypress.bind(this); 
		else document.onkeydown = '';
	},
	//
	//  Perform keyboard actions
	//
	_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;
		}
	
		// Gotta stop those quick fingers
		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;
		}
	},
	//
	//	Get Gallery Information
	//
	_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;
		}
	},
	//
	//	Get the domain from a string.
	//
	_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;
    },
	//
	//	Get the value from the params attribute string.
	//
	_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);
		}
	},
	//
	//  Get the Browser Viewport Dimensions
	//
	_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;
        }
	},
	//
	//  Get the scrollbar offset, I don't like this method but there is really no other way I can find.
	//
	_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;
	},
	

	//
	//  Add a param to an object dynamically created
	//
	_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;
	},
	//
	//  Get the outer HTML of an object CROSS BROWSER
	//
	_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;
		}
	},
	//
	//  Convert an object to markup
	//
	_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;
	},
	//
	//  Depending what type of browser it is we have to append the object differently... DAMN YOU IE!!
	//
	_appendObject : function(object, closeTag, appendTo) {
		if (Prototype.Browser.IE) {
			appendTo.innerHTML += this._convertToMarkup(object, closeTag);
			
			// Fix the Eolas activate thing but only for specified media, for example doing this to a quicktime film breaks it.
			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);	
		}	
	},
	//
	//  Add in iframe
	//
	_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', 'no');	
		
		this._appendObject(iframe, 'iframe', $('lightwindow_contents'));
	},
	//
	//  Write Content to the iframe using the skin
	//
	_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();
		}
	},
	//
	//  Load the window Information
	//  
	_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 there is a gallery get it
				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]);

					// We have to do this instead of .onload 
					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 there is a gallery get it
			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;
		}
	},
	//
	//  Resize the Window to fit the viewport if necessary
	//
	_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);
			// We only care about ratio's with this window type			
			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);
			// We only care about ratio's with this window type
			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'
				});
			}
		}
			
	},
	//
	//  Set the Window to a preset size
	//
	_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'));
		}
	},
	//
	//  Process the Window
	//
	_processWindow : function() {
		// Clean out our effects
		this.dimensions.dataEffects = [];

		// Set up the data-slide if we have caption information
		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()};
		// Position the window
    	$('lightwindow_container').setStyle({
			height: 'auto',
			// We need to set the width to a px not auto as opera has problems with it
			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()};
 		
		// We need to record the container dimension changes
		this.containerChange = {height: originalContainerDimensions.height-newContainerDimensions.height, width: originalContainerDimensions.width-newContainerDimensions.width};

		// Get out general dimensions
		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};
		
		// Set Sizes if we need too
		this._presetWindowSize();
		this._resizeWindowToFit(); // Even if the window is preset we still don't want it to go outside of the viewport

		if (!this.windowActive) {
			// Position the window
		   	$('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'
		});
		
		// We are ready, lets show this puppy off!
		this._displayLightWindow('block', 'visible');
		this._animateLightWindow();
	},
	//
	//  Fire off our animation handler
	//
	_animateLightWindow : function() {
		if (this.options.animationHandler) {
			this.options.animationHandler().bind(this);
		} else {
			this._defaultAnimationHandler();
		}
	},
	//
	//  Fire off our transition handler
	//
	_handleNavigation : function(display) {
		if (this.options.navigationHandler) {
			this.options.navigationHandler().bind(this, display);
		} else {
			this._defaultDisplayNavigation(display);
		}
	},
	//
	//  Fire off our transition handler
	//
	_handleTransition : function() {
		if (this.options.transitionHandler) {
			this.options.transitionHandler().bind(this);
		} else {
			this._defaultTransitionHandler();
		}
	},
	//
	//  Handle the finish of the window animation
	// 
	_handleFinalWindowAnimation : function(delay) {
		if (this.options.finalAnimationHandler) {
			this.options.finalAnimationHandler().bind(this, delay);
		} else {
			this._defaultfinalWindowAnimationHandler(delay);
		}		
	},
	//
	//  Handle the gallery Animation
	// 
	_handleGalleryAnimation : function(list) {
		if (this.options.galleryAnimationHandler) {
			this.options.galleryAnimationHandler().bind(this, list);
		} else {
			this._defaultGalleryAnimationHandler(list);
		}		
	},
	//
	//  Display the navigation 
	//
	_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'
			});			
		}
	},
	//
	//  This is the default animation handler for LightWindow
	//
	_defaultAnimationHandler : function() {	
		// Now that we have figures out the cruft lets make the caption go away and add its effects
		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})
			);
		}

		// Set up the Title if we have one
		$('lightwindow_title_bar_inner').setStyle({
			height: '0px',
			marginTop: this.options.dimensions.titleHeight+'px'
		});
		
		// We always want the title bar as well
		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;
		}
		
		// We need to do our data effect since there was no resizing
		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'} 
				}
			);
		}			
		
	},
	//
	//  Finish up Window Animation
	//
	_defaultfinalWindowAnimationHandler : function(delay) {
		if (this.windowType == 'media' || this._getParameter('lightwindow_loading_animation')) {	
			// Because of major flickering with the overlay we just hide it in this case
			Element.hide('lightwindow_loading');
			this._handleNavigation(this.activeGallery);
			this._setStatus(false);
		} else {
			Effect.Fade('lightwindow_loading', {
				duration: 0.75,
				delay: 1.0, 
				afterFinish: function() {
					// Just in case we need some scroll goodness (this also avoids the swiss cheese effect)
					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'}
			});
		}
	},
	//
	//  Handle the gallery Animation
	//
	_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'}
			});	
		}
		
		
	},
	//
	//  Default Transition Handler
	//
	_defaultTransitionHandler : function() {
		// Clean out our effects
		this.dimensions.dataEffects = [];

		// Now that we have figures out the cruft lets make the caption go away and add its effects
		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'
							});
						}
					})
				);
			}
		}
		
		// We always want the title bar as well
		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'} 
			}
		);	
	},
	//
	//	Default Form handler for LightWindow
	//
	_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)
			});
		}
	},
	// 
	//  Wrap everything up
	//
	_finishWindow : function() {
		if (this.windowType == 'external') {
			// We set the externals source here because it allows for a much smoother animation
			$('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);
		}

		// Initialize any actions
		this._setupActions();
	}
}

/* =======================================================================================
 * Based upon Multifaceted Lightbox by Greg Neustaetter - http://www.gregphoto.net/lightbox/
 * ==================================================================================== */
var Lightbox = {
	initFlag: false,
	overlayedElement: null,

	showBoxByIFrame: function(href, boxWidth, boxHeight, overlayedElement) {
		if (overlayedElement) {
			this.overlayedElement = overlayedElement;
		}
		this.setLightboxDimensions(boxWidth, boxHeight);
		$("lbFrame").src = href;
		this.showBox();
		return false;
	},

	setLightboxDimensions: function(width, height) {
		var windowSize = this.getPageDimensions();
		if (width) {
			if (width < windowSize[0]) {
				$('box').style.width = width + 'px';
			} else {
				$('box').style.width = (windowSize[0] - 50) + 'px';
			}
		}
		if(height) {
			if (height < windowSize[1]) {
				$('box').style.height = height + 'px';
			} else {
				$('box').style.height = (windowSize[1] - 50) + 'px';
			}
		}
	},

	resizeEvent: function() {
    	this.reposition('box');
	},

	showBox: function() {
		Element.show('overlay');
		this.reposition('box');
		Event.observe(window, 'resize', Lightbox.cachedResize);
		return false;
	},

	hideAds: function() {
		$$('div.ad, div#ad-300x250').invoke('hide');
		$$('div.swfobject').invoke('hide');		
	},

	showAds: function() {
		$$('div.ad, div#ad-300x250').invoke('show');
		$$('div.swfobject').invoke('show');
	},
	
	hideBox: function(){
		var contents = $('boxContents');
		Event.stopObserving(window, 'resize', Lightbox.cachedResize);
		Element.remove($('box'));
		Element.remove($('overlay'));
		this.overlayedElement = null;
		this.showAds();
		return false;
	},

	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){ // all but Explorer Mac
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}

		var windowWidth, windowHeight;
		if (self.innerHeight) {	// all except Explorer
			windowWidth = self.innerWidth;
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}

		// for small pages with total height less then height of the viewport
		if (yScroll < windowHeight){
			pageHeight = windowHeight;
		} else {
			pageHeight = yScroll;
		}

		// for small pages with total width less then width of the viewport
		if (xScroll < windowWidth){
			pageWidth = windowWidth;
		} else {
			pageWidth = xScroll;
		}

		arrayPageSize = new Array(windowWidth,windowHeight,pageWidth,pageHeight)
		return arrayPageSize;
	},

	reposition: function(element){
    	try {
			element = document.getElementById(element);
		} catch(e) {
			return;
		}
        
		var windowSize = this.getPageDimensions();
		var window_width  = windowSize[0];
		var window_height = windowSize[1];

		$('overlay').style.height = windowSize[3] + 'px';

		element.style.position = 'absolute';
		element.style.zIndex   = 99;

		if (!this.overlayedElement) {
			var scrollY = 0;
			
			if (document.documentElement && document.documentElement.scrollTop){
				scrollY = document.documentElement.scrollTop;
			}else if (document.body && document.body.scrollTop){
				scrollY = document.body.scrollTop;
			}else if (window.pageYOffset){
				scrollY = window.pageYOffset;
			}else if (window.scrollY){
				scrollY = window.scrollY;
			}
			
			var elementDimensions = Element.getDimensions(element);
			var setX = (window_width - elementDimensions.width) / 2;
			var setY = (window_height - elementDimensions.height) / 2 + scrollY;
			
			setX = (setX < 0) ? 0 : setX;
			setY = (setY < 0) ? 0 : setY;		
		} else {
			var overlayedElementDimensions = Element.viewportOffset(this.overlayedElement);
			var setX = overlayedElementDimensions.left;
			var setY = overlayedElementDimensions.top;
		}

		element.style.left = setX + "px";
		element.style.top  = setY + "px";

		Element.show(element);
	},

	initFrame: function(lightboxtext) {
		this.hideAds();
		var body = document.getElementsByTagName("body").item(0);
		new Insertion.Bottom(body, lightboxtext);
		this.initFlag = true;
	}
}

Lightbox.cachedResize = Lightbox.resizeEvent.bind(Lightbox);

/*-----------------------------------------------------------------------------------------------*/


///////////////////////////////////////////////////////////////////////////////
//
//  Silverlight.js   			version 1.0
//
//  This file is provided by Microsoft as a helper file for websites that
//  incorporate Silverlight Objects. This file is provided under the Silverlight 
//  SDK 1.0 license available at http://go.microsoft.com/fwlink/?linkid=94240.  
//  You may not use or distribute this file or the code in this file except as 
//  expressly permitted under that license.
// 
//  Copyright (c) 2007 Microsoft Corporation. All rights reserved.
//
///////////////////////////////////////////////////////////////////////////////

if(!window.Silverlight)window.Silverlight={};Silverlight._silverlightCount=0;Silverlight.ua=null;Silverlight.available=false;Silverlight.fwlinkRoot="http://go.microsoft.com/fwlink/?LinkID=";Silverlight.detectUserAgent=function(){var a=window.navigator.userAgent;Silverlight.ua={OS:"Unsupported",Browser:"Unsupported"};if(a.indexOf("Windows NT")>=0)Silverlight.ua.OS="Windows";else if(a.indexOf("PPC Mac OS X")>=0)Silverlight.ua.OS="MacPPC";else if(a.indexOf("Intel Mac OS X")>=0)Silverlight.ua.OS="MacIntel";if(Silverlight.ua.OS!="Unsupported")if(a.indexOf("MSIE")>=0){if(navigator.userAgent.indexOf("Win64")==-1)if(parseInt(a.split("MSIE")[1])>=6)Silverlight.ua.Browser="MSIE"}else if(a.indexOf("Firefox")>=0){var b=a.split("Firefox/")[1].split("."),c=parseInt(b[0]);if(c>=2)Silverlight.ua.Browser="Firefox";else{var d=parseInt(b[1]);if(c==1&&d>=5)Silverlight.ua.Browser="Firefox"}}else if(a.indexOf("Safari")>=0)Silverlight.ua.Browser="Safari"};Silverlight.detectUserAgent();Silverlight.isInstalled=function(d){var c=false,a=null;try{var b=null;if(Silverlight.ua.Browser=="MSIE")b=new ActiveXObject("AgControl.AgControl");else if(navigator.plugins["Silverlight Plug-In"]){a=document.createElement("div");document.body.appendChild(a);if(Silverlight.ua.Browser=="Safari")a.innerHTML='<embed type="application/x-silverlight" />';else a.innerHTML='<object type="application/x-silverlight"  data="data:," />';b=a.childNodes[0]}document.body.innerHTML;if(b.IsVersionSupported(d))c=true;b=null;Silverlight.available=true}catch(e){c=false}if(a)document.body.removeChild(a);return c};Silverlight.createObject=function(l,g,m,j,k,i,h){var b={},a=j,c=k;a.source=l;b.parentElement=g;b.id=Silverlight.HtmlAttributeEncode(m);b.width=Silverlight.HtmlAttributeEncode(a.width);b.height=Silverlight.HtmlAttributeEncode(a.height);b.ignoreBrowserVer=Boolean(a.ignoreBrowserVer);b.inplaceInstallPrompt=Boolean(a.inplaceInstallPrompt);var e=a.version.split(".");b.shortVer=e[0]+"."+e[1];b.version=a.version;a.initParams=i;a.windowless=a.isWindowless;a.maxFramerate=a.framerate;for(var d in c)if(c[d]&&d!="onLoad"&&d!="onError"){a[d]=c[d];c[d]=null}delete a.width;delete a.height;delete a.id;delete a.onLoad;delete a.onError;delete a.ignoreBrowserVer;delete a.inplaceInstallPrompt;delete a.version;delete a.isWindowless;delete a.framerate;delete a.data;delete a.src;if(Silverlight.isInstalled(b.version)){if(Silverlight._silverlightCount==0)if(window.addEventListener)window.addEventListener("onunload",Silverlight.__cleanup,false);else window.attachEvent("onunload",Silverlight.__cleanup);var f=Silverlight._silverlightCount++;a.onLoad="__slLoad"+f;a.onError="__slError"+f;window[a.onLoad]=function(a){if(c.onLoad)c.onLoad(document.getElementById(b.id),h,a)};window[a.onError]=function(a,b){if(c.onError)c.onError(a,b);else Silverlight.default_error_handler(a,b)};slPluginHTML=Silverlight.buildHTML(b,a)}else slPluginHTML=Silverlight.buildPromptHTML(b);if(b.parentElement)b.parentElement.innerHTML=slPluginHTML;else return slPluginHTML};Silverlight.supportedUserAgent=function(){var a=Silverlight.ua,b=a.OS=="Unsupported"||a.Browser=="Unsupported"||a.OS=="Windows"&&a.Browser=="Safari"||a.OS.indexOf("Mac")>=0&&a.Browser=="IE";return !b};Silverlight.buildHTML=function(c,d){var a=[],e,i,g,f,h;if(Silverlight.ua.Browser=="Safari"){a.push("<embed ");e="";i=" ";g='="';f='"';h=' type="application/x-silverlight"/>'+"<iframe style='visibility:hidden;height:0;width:0'/>"}else{a.push('<object type="application/x-silverlight" data="data:,"');e=">";i=' <param name="';g='" value="';f='" />';h="</object>"}a.push(' id="'+c.id+'" width="'+c.width+'" height="'+c.height+'" '+e);for(var b in d)if(d[b])a.push(i+Silverlight.HtmlAttributeEncode(b)+g+Silverlight.HtmlAttributeEncode(d[b])+f);a.push(h);return a.join("")};Silverlight.default_error_handler=function(e,b){var d,c=b.ErrorType;d=b.ErrorCode;var a="\nSilverlight error message     \n";a+="ErrorCode: "+d+"\n";a+="ErrorType: "+c+"       \n";a+="Message: "+b.ErrorMessage+"     \n";if(c=="ParserError"){a+="XamlFile: "+b.xamlFile+"     \n";a+="Line: "+b.lineNumber+"     \n";a+="Position: "+b.charPosition+"     \n"}else if(c=="RuntimeError"){if(b.lineNumber!=0){a+="Line: "+b.lineNumber+"     \n";a+="Position: "+b.charPosition+"     \n"}a+="MethodName: "+b.methodName+"     \n"}alert(a)};Silverlight.createObjectEx=function(b){var a=b,c=Silverlight.createObject(a.source,a.parentElement,a.id,a.properties,a.events,a.initParams,a.context);if(a.parentElement==null)return c};Silverlight.buildPromptHTML=function(l){var a=null,d=Silverlight.fwlinkRoot,c=Silverlight.ua.OS,b="92822",e,f="Get Microsoft Silverlight",m="0x409";if(l.inplaceInstallPrompt){var n="98109",i;if(Silverlight.available){e="96189";i="96422"}else{e="96188";i="96422"}var h="93481",g="93483";if(c=="Windows"){b="92799";h="92803";g="92805"}else if(c=="MacIntel"){b="92808";h="92804";g="92806"}else if(c=="MacPPC"){b="92807";h="92815";g="92816"}var k='By clicking <b>"Get Microsoft Silverlight"</b> you accept the<br /><a title="Silverlight License Agreement" href="{2}" target="_top" style="text-decoration: underline; color: #96C5E1"><b>Silverlight license agreement</b></a>',j='Silverlight updates automatically, <a title="Silverlight Privacy Statement" href="{3}" target="_top" style="text-decoration: underline; color: #96C5E1"><b>learn more</b></a>';a='<table border="0" cellpadding="0" cellspacing="0" width="206px"><tr><td><img style="display: block; cursor: pointer; border= 0;" title="'+f+'" alt="'+f+'" onclick="javascript:Silverlight.followFWLink({0});" src="{1}" /></td></tr><tr><td style="width: 206px; margin: 0px; background: #FFFFFF; color: #C7C7C7; text-align: left; border-left-style: solid; border-right-style: solid; padding-left: 6px; padding-right: 6px; padding-top: 3px; padding-bottom: 0px; border-width: 2px; border-color: #c7c7bd; font-family: Verdana; font-size: 55%">'+k+'</td></tr><tr><td><img src="{5}" style="border: 0; display: block" /></td></tr><tr><td style="width: 206px; margin: 0px; background: #D8EFF9; color: #C7C7C7; text-align: left; border-left-style: solid; border-right-style: solid; padding-left: 6px; padding-right: 6px; padding-top: 0px; padding-bottom: 2px; border-width: 2px; border-color: #c7c7bd; font-family: Verdana; font-size: 55%">'+j+'</td></tr><tr><td><img alt="" src="{4}" /></td></tr></table>';a=a.replace("{2}",d+h);a=a.replace("{3}",d+g);a=a.replace("{4}",d+i);a=a.replace("{5}",d+n)}else{if(Silverlight.available)e="94377";else e="92801";if(c=="Windows")b="92800";else if(c=="MacIntel")b="92812";else if(c=="MacPPC")b="92811";a='<div style="display:block; width: 205px; height: 67px;"><img onclick="javascript:Silverlight.followFWLink({0});" style="border:0; cursor:pointer" src="{1}" title="'+f+'" alt="'+f+'"/></div>'}a=a.replace("{0}",b);a=a.replace("{1}",d+e+"&amp;clcid="+m);return a};Silverlight.__cleanup=function(){for(var a=Silverlight._silverlightCount-1;a>=0;a--){window["__slLoad"+a]=null;window["__slError"+a]=null}if(window.removeEventListener)window.removeEventListener("unload",Silverlight.__cleanup,false);else window.detachEvent("onunload",Silverlight.__cleanup)};Silverlight.followFWLink=function(a){top.location=Silverlight.fwlinkRoot+String(a)};Silverlight.HtmlAttributeEncode=function(c){var a,b="";if(c==null)return null;for(var d=0;d<c.length;d++){a=c.charCodeAt(d);if(a>96&&a<123||a>64&&a<91||a>43&&a<58&&a!=47||a==95)b=b+String.fromCharCode(a);else b=b+"&#"+a+";"}return b}
