Event.observe(document,"dom:loaded",init);function init(){$("content").delegate("click",{".actions *":showDeleteConfirm,"#albumLink":selectPath,".unprocessed *":showProcessingPending,"#piclensLink":function(a){var b=a.element().readAttribute("rel").split("|");PicLensLite.setLiteURLs({lite:b[1]});PicLensLite.start({feedUrl:b[0]})}});if($("resultsSorting")){$("resultsSorting").observe("change",changeSorting)
}}function changeSorting(a){var b=Paginators.get().getParameters();b.set("sorting",a.element().value);Paginators.get().refresh(b)}function deleteItem(a){var b=Paginators.get().getParameters();b.set("deleteFile",a.element().up().readAttribute("rel"));Paginators.get().refresh(b)}function showDeleteConfirm(a){Dialog.Confirm.show("confirmContent",{onSuccess:function(){deleteItem(a);return},height:90,width:350,zIndex:10})
}function showProcessingPending(){Dialog.Confirm.show("processingPendingContent",{height:170,width:520,zIndex:10})}function selectPath(a){a.element().focus();a.element().select()}
/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;
if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);
if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)
}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return
}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)
}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]
}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};
ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")
}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;
E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;
if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);
X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))
}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'
}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])
}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null
}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false
}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)
}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;
for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)
}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]
}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)
}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))
}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();var PicLensLite={start:function(b){this.determineBrowserParams();clearTimeout(this.REMOVE_TIMER_ID);clearTimeout(this.AUTO_CLOSE_TIMER_ID);this.ARGS={};if(typeof b!=="undefined"&&b!==null){this.ARGS=b;if(b.feedUrl){this.THE_FEED_URL=b.feedUrl;
if(this.checkForPluginAndLaunchIfPossible(b.feedUrl,b.guid)){return}if(b.loadFeedInFlash){this.showFlashUI("")}else{this.loadViaXHR(b.feedUrl)}}if(typeof b.feedData!=="undefined"){this.showFlashUI(b.feedData)}}else{var a=this.indexFeeds();if(a.length!==0){var c=a[0];this.THE_FEED_URL=c.url;if(this.checkForPluginAndLaunchIfPossible(c.url)){return}this.loadViaXHR(c.url)}}},isRunning:function(){return this.LITE_IS_RUNNING
},hasClient:function(){return this.hasCooliris()},addCustomButton:function(c,b,a){this.CUSTOM_BUTTON={targetURL:c,labelText:b,iconImage:a}},setCallbacks:function(a){if(a.onNoPlugins){this.ON_NO_PLUGINS=a.onNoPlugins}if(a.onExit){this.ON_EXIT=a.onExit}},setLiteURLs:function(a){if(!this.LITE_URL){if(a.swf){this.LITE_URL=a.swf}else{if(a.lite){this.LITE_URL=a.lite+"PicLensLite.swf"}}}if(!this.BUTTON_URL){if(a.button){this.BUTTON_URL=a.button
}else{if(a.lite){this.BUTTON_URL=a.lite+"NoFlash.jpg"}}}var b="";if(a.lbox){b=a.lbox}else{if(a.lite){b=a.lite+"../lytebox/"}}if(!this.LBOX_CSS_URL){if(a.lboxcss){this.LBOX_CSS_URL=a.lboxcss}else{if(b!=""){this.LBOX_CSS_URL=b+"lytebox.css"}}}if(!this.LBOX_JS_URL){if(a.lboxjs){this.LBOX_JS_URL=a.lboxjs}else{if(b!=""){this.LBOX_JS_URL=b+"lytebox.js"}}}},ARGS:{},DEBUG_NOCLIENT:false,DEBUG_NOFLASH:false,HPAD:60,VPAD:20,LITE_BG_DIV:null,LITE_FG_DIV:null,LITE_URL:null,BUTTON_URL:null,LBOX_CSS_URL:null,LBOX_JS_URL:null,LBOX_COUNT:0,SHOW_LBOX:false,OS_WIN:false,OS_MAC:false,BROWSER_FFX:false,BROWSER_SAF:false,BROWSER_IE:false,BROWSER_IE6:false,OLD_B_MARGIN:null,OLD_B_OVERFLOW:null,OLD_B_HEIGHT:null,OLD_H_OVERFLOW:null,OLD_H_HEIGHT:null,THE_FEED:"",THE_FEED_URL:"",LITE_IS_RUNNING:false,piclensIsRunning_:false,FLASH_ID_1:"pllflash1",FLASH_ID_2:"pllflash2",FLASH_VER:null,FLASH_URL:"http://www.adobe.com/go/getflashplayer",PL_URL:"http://download.piclens.com/partner/",PLC:null,LEARN_PL_URL:"http://affiliate.piclens.com/partner/",FONT:"font-family: Lucida Grande, Myriad Pro, Verdana, Helvetica, Arial, sans-serif;",KEY_HANDLERS:"",ON_NO_PLUGINS:null,ON_EXIT:null,AUTO_CLOSE_TIMER_ID:0,REMOVE_TIMER_ID:0,RESIZE_TIMER_IE6:null,RESIZE_HANDLER_EXISTS:false,CUSTOM_BUTTON:null,addKeyHandlers:function(){var a=this;
if(typeof document.onkeydown!=="undefined"){this.KEY_HANDLERS=document.onkeydown}document.onkeydown=function(c){var b;if(typeof c==="undefined"||c===null){b=window.event.keyCode}else{b=c.which}var d=a.handleKeyPress(b);if(typeof c!="undefined"&&c!=null){c.returnValue=d}return d}},addMouseHandlers:function(){if(window.addEventListener){window.addEventListener("DOMMouseScroll",this.handleMouseWheel,false)
}else{if(document.attachEvent){document.attachEvent("onmousewheel",this.handleMouseWheel)}}window.onmousewheel=document.onmousewheel=this.handleMouseWheel},appendElementsToDocument:function(){if(this.BROWSER_FFX&&this.OS_MAC){this.LITE_BG_DIV.style.display="none"}document.body.appendChild(this.LITE_BG_DIV);document.body.appendChild(this.LITE_FG_DIV)},autoResize:function(){if(!this.isRunning()){clearInterval(this.RESIZE_TIMER_IE6);
return}var c=this.getPageSize();var b=this.LITE_BG_DIV;if(b){b.style.height=c.h+"px";b.style.width=c.w+"px"}if(this.LITE_FG_DIV){var a=this.LITE_FG_DIV.style;this.resizeToPaddedBox(a);this.resizeToFitPaddedBox(a,c);this.resizeFlashToFitPaddedBox()}},checkForPluginAndLaunchIfPossible:function(b,a){if(this.hasCooliris()){if(typeof(a)!="undefined"){this.PLC.launch(b,"uid",a)}else{this.PLC.launch(b,"","")
}return true}return false},createBackgroundOverlay:function(){var e=document.createElement("div");this.LITE_BG_DIV=e;e.id="lite_bg_div";var f=e.style;f.position="fixed";f.width=f.height="100%";if(this.BROWSER_IE6){var a=document.body;var d=a.currentStyle;var i=document.documentElement;var h=i.currentStyle;this.OLD_B_MARGIN=d.margin;this.OLD_B_OVERFLOW=d.overflow;this.OLD_B_HEIGHT=d.height;this.OLD_H_OVERFLOW=h.overflow;
this.OLD_H_HEIGHT=h.height;this.OLD_SCROLL_Y=i.scrollTop;a.style.margin="0";a.style.overflow="auto";a.style.height="100%";i.style.overflow="auto";i.style.height="100%";f.position="absolute";var g=this.getPageSize();f.height=g.h+"px";f.width=g.w+"px"}f.left=f.right=f.top=f.bottom="0";f.backgroundColor="#000";f.zIndex=1000;f.opacity="0.5";f.filter="alpha(opacity=50)";var c=this;e.onclick=function(){c.exitPicLensLite()
}},createForegroundFlashComponent:function(){var b=document.createElement("div");this.LITE_FG_DIV=b;b.id="lite_fg_div";var a=b.style;a.backgroundColor="#000";a.position="fixed";a.border="2px solid #555";a.zIndex=1001;this.resizeToPaddedBox(a);if(this.BROWSER_IE6){a.position="absolute";this.resizeToFitPaddedBox(a)}},closeFlashUI:function(d){var c=document;c.onkeydown=this.KEY_HANDLERS;window.onmousewheel=c.onmousewheel="";
if(window.removeEventListener){window.removeEventListener("DOMMouseScroll",this.handleMouseWheel,false)}if(c.detachEvent){c.detachEvent("onmousewheel",this.handleMouseWheel)}this.LITE_BG_DIV.style.display=this.LITE_FG_DIV.style.display="none";this.REMOVE_TIMER_ID=setTimeout(function(){PicLensLite.removeChildren()},150);if(this.BROWSER_IE6){var a=document.body;var e=document.documentElement;a.style.margin=this.OLD_B_MARGIN;
a.style.overflow=this.OLD_B_OVERFLOW;a.style.height=this.OLD_B_HEIGHT;e.style.overflow=this.OLD_H_OVERFLOW;e.style.height=this.OLD_H_HEIGHT;window.scrollTo(0,this.OLD_SCROLL_Y)}if(this.ON_EXIT!==null){this.ON_EXIT(d)}this.setRunningFlag(false)},determineBrowserParams:function(){var c=BrowserDetect.OS;var a=BrowserDetect.browser;this.OS_MAC=(c=="Mac");this.OS_WIN=(c=="Windows");this.BROWSER_FFX=(a=="Firefox");
this.BROWSER_SAF=(a=="Safari");this.BROWSER_IE=(a=="Explorer");this.BROWSER_IE6=(this.BROWSER_IE&&BrowserDetect.version=="6");this.FLASH_VER=swfobjlite.getFlashPlayerVersion()},exitPicLensLite:function(){var a=this.getFlash();if(a!==null&&a.fl_exitPicLensLite){a.fl_exitPicLensLite();this.AUTO_CLOSE_TIMER_ID=setTimeout(function(){if(PicLensLite.isRunning()){PicLensLite.closeFlashUI()}},500)}else{this.closeFlashUI()
}},findScriptLocation:function(){var e=document.getElementsByTagName("script");for(var c=0;c!=e.length;++c){var a=e[c];var d=a.getAttribute("type");if(d=="text/javascript"){var f=a.getAttribute("src");if(f===null){continue}var b=f.indexOf("piclens.js");if(b!=-1){this.setLiteURLs({lite:f.substring(0,b)});return}else{b=f.indexOf("piclens_optimized.js");if(b!=-1){this.setLiteURLs({lite:f.substring(0,b)});
return}}}}},getPageSize:function(){var j,f,g,c;var i=document;var e=i.body;var d;if(window.innerHeight&&window.scrollMaxY){j=i.scrollWidth;f=(this.isFrame?parent.innerHeight:self.innerHeight)+(this.isFrame?parent.scrollMaxY:self.scrollMaxY)}else{if(e.scrollHeight>e.offsetHeight){j=e.scrollWidth;f=e.scrollHeight}else{d=i.getElementsByTagName("html").item(0);j=d.offsetWidth;f=d.offsetHeight;j=(j<e.offsetWidth)?e.offsetWidth:j;
f=(f<e.offsetHeight)?e.offsetHeight:f}}var a=i.documentElement;if(self.innerHeight){g=(this.isFrame)?parent.innerWidth:self.innerWidth;c=(this.isFrame)?parent.innerHeight:self.innerHeight}else{if(a&&a.clientHeight){g=a.clientWidth;c=a.clientHeight}else{if(e){d=i.getElementsByTagName("html").item(0);g=d.clientWidth;c=d.clientHeight;g=(g==0)?e.clientWidth:g;c=(c==0)?e.clientHeight:c}}}var b=(f<c)?c:f;
var h=(j<g)?g:j;return{pw:h,ph:b,w:g,h:c}},getElementsFromXMLFeed:function(){var b;if(window.ActiveXObject){b=new ActiveXObject("Microsoft.XMLDOM");b.async=false;b.loadXML(PicLensLite.THE_FEED)}else{var c=new DOMParser();b=c.parseFromString(PicLensLite.THE_FEED,"text/xml")}var a=b.getElementsByTagName("*");return a},getBasicSlideShowHTML:function(){if(!this.LBOX_JS_URL||!this.LBOX_CSS_URL){return""
}var d=document.getElementsByTagName("head").item(0);var a=document.createElement("script");a.src=this.LBOX_JS_URL;a.type="text/javascript";d.appendChild(a);var g=document.createElement("link");g.rel="stylesheet";g.href=this.LBOX_CSS_URL;g.type="text/css";g.media="screen";d.appendChild(g);var f=this.getElementsFromXMLFeed();var c;var h="";for(c=0;c<f.length;c++){if(f[c].nodeName=="media:content"){var b=f[c].getAttribute("url");
if(b.indexOf(".flv")==-1){h+='<a id="lboxImage" href="'+b+'" rel="lytebox[lite]"></a> '}}}var e="<div id='lightbox_images' align='center' style='display: none; padding-top:10px; color:#FFFFFF; font-size:.8em; "+this.FONT+" color:#999999;'>";e+='( Alternatively, <a onclick="javascript:PicLensLite.invokeLytebox();return false;" href="#" style="color:#656588">click here for a basic slideshow</a>. )';e+=h;
e+="</div><br/>";return e},generateAlternativeContent:function(){var j='<div id="altContent" style="text-align:center; margin: 0 0 0 0; padding: 0 0 0 0; background-color: #000; min-width:860px;">';j+='<div align="center" style="width: 100%; padding-top:60px; '+this.FONT+'">';var i=this.FLASH_VER;var g;if(i.major>0){g="update your Flash Player from version "+i.major+"."+i.minor+"."+i.release+" to version 9.0.28 or newer"
}else{g="install the most recent Flash Player"}var d="";if(this.THE_FEED!==""){d=this.getBasicSlideShowHTML()}var a=this.PL_URL;var e=this.LEARN_PL_URL;var f=this.ARGS.pid;if(f){a+=f+"/";e+=f+"/"}else{var h="000000000001/";a+=h;e+=h}if(this.SHOW_LBOX){}else{var c="<span style='padding-left:25px; color:#C6C6C6; font-size:";j+="<div style='padding:10px;'>"+c+"1.5em; font-weight: bold; "+this.FONT+"'>You're clicks away from going full screen!</span><br/>"+c+".9em; padding-bottom: 15px; "+this.FONT+"'>You must get the <a href='"+a+"' style='color:#656588'>Cooliris</a> browser plugin, or "+g+".</span></div>";
if(!this.BUTTON_URL){j+='<a href="'+a+'" style="color:#ACD">Get Cooliris Now!</a>'}else{var b='<area shape="rect" coords=';j+='<img src="'+this.BUTTON_URL+'" alt="" border="0" usemap="#Map"><map name="Map" id="Map">'+b+'"0,0,33,33" href="#" onclick="javascript:PicLensLite.closeFlashUI();" />'+b+'"35,35,325,325" href="'+a+'" />'+b+'"593,209,825,301" href="'+this.FLASH_URL+'" />'+b+'"327,148,448,178" href="'+e+'" /></map>'
}}j+="</div>";j+=d;j+='<div align="center" style="color:#666666; font-size:11px; '+this.FONT+'">&copy; 2008 Cooliris, Inc. All trademarks are property of their respective holders.<br/><br/><br/></div>';j+="</div>";return j},generateFlashVars:function(){var c="";var b=this.ARGS;if(typeof b.guid!=="undefined"){c+="&startItemGUID="+b.guid}if(b.loadFeedInFlash){c+="&feedURL="+encodeURIComponent(this.THE_FEED_URL)
}if(b.paused){c+="&paused="+b.paused}if(b.loop){c+="&loop="+b.loop}if(b.delay){c+="&delay="+b.delay}if(b.pid){c+="&pid="+b.pid}if(typeof b.maxScale!="undefined"){c+="&maxScale="+b.maxScale}if(typeof b.overlayToolbars!="undefined"){c+="&overlayToolbars="+b.overlayToolbars}var a=this.CUSTOM_BUTTON;if(a!=null){c+="&cButtonURL="+encodeURIComponent(a.targetURL);if(a.labelText!=null){c+="&cButtonLabel="+encodeURIComponent(a.labelText)
}if(a.iconImage!=null){c+="&cButtonIcon="+encodeURIComponent(a.iconImage)}}c+="&swfURL="+encodeURIComponent(this.LITE_URL);c=c.substring(1);return c},getFlash:function(){if(this.BROWSER_SAF||this.BROWSER_IE){return document.getElementById(this.FLASH_ID_1)}else{return document.getElementById(this.FLASH_ID_2)}},getWindowSize:function(){var b=document.documentElement;var d=document.body;var a=0,c=0;if(typeof(window.innerWidth)=="number"){a=window.innerWidth;
c=window.innerHeight}else{if(b&&(b.clientWidth||b.clientHeight)){a=b.clientWidth;c=b.clientHeight}else{if(d&&(d.clientWidth||d.clientHeight)){a=d.clientWidth;c=d.clientHeight}}}return{w:a,h:c}},handleKeyPress:function(a){if(!this.isRunning()){return true}var b=this.getFlash();if(b!=null&&b.fl_keyPressed){b.fl_keyPressed(a)}else{if(a==27){this.closeFlashUI();return false}}if(a==9||a==13){return false
}return true},handleMouseWheel:function(a){var c=0;if(!a){a=window.event}if(a.wheelDelta){c=a.wheelDelta/120;if(window.opera){c=-c}}else{if(a.detail){var b=a.detail;if(Math.abs(b)<3){c=-b}else{c=-b/3}}}if(c){PicLensLite.sendMouseScrollToFlash(c)}if(a.preventDefault){a.preventDefault()}a.returnValue=false;return false},hasPicLensClient:function(){return this.hasCooliris()},hasCooliris:function(){if(this.DEBUG_NOCLIENT){return false
}var f=false;if(this.PLC){f=true}else{if(window.piclens&&window.piclens.launch){this.PLC=window.piclens;f=true}else{var b=null;if(typeof PicLensContext!="undefined"){b=new PicLensContext()}else{try{b=new ActiveXObject("PicLens.Context")}catch(d){if(navigator.mimeTypes["application/x-cooliris"]){b=document.createElement("object");b.style.height="0px";b.style.width="0px";b.type="application/x-cooliris";
document.documentElement.appendChild(b)}else{b=null}}}this.PLC=b;if(this.PLC){f=true}}}if(f){if(this.BROWSER_SAF){return true}var a;try{a=this.PLC.version}catch(d){return false}var c=a.split(".");if(c[0]>1){return true}else{if(c[0]==1){if(c[1]>6){return true}else{if(c[1]==6){if(c[2]>0){return true}else{if(c[2]==0){if(c[3]>=824){return true}}}}}}}return false}else{return false}},invokeLytebox:function(){this.SHOW_LBOX=true;
myLytebox.start(document.getElementById("lboxImage"),false,false);this.closeFlashUI()},showLyteboxLink:function(){myLytebox.updateLyteboxItems();myLytebox.doAnimations=false;var a=document.getElementById("lightbox_images");if(a!=null){a.style.display="block";if(this.SHOW_LBOX&&this.getFlash()==null){this.invokeLytebox()}}},startLytebox:function(){if(typeof myLytebox!="undefined"){this.showLyteboxLink()
}else{if(typeof initLytebox!="undefined"){initLytebox();this.showLyteboxLink()}else{if(this.LBOX_COUNT>=4){return}setTimeout(function(){PicLensLite.startLytebox()},150);this.LBOX_COUNT++}}},injectFlashPlayer:function(){var a=this.LITE_FG_DIV;var d;var f;d=f="100%";if(this.BROWSER_IE6){d=f="0"}var e=this.generateFlashVars();var b=this.generateAlternativeContent();if(this.meetsReqs()){var c="<param name=";
a.innerHTML='<object id="'+this.FLASH_ID_1+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%">'+c+'"movie" value="'+this.LITE_URL+'" />'+c+'"quality" value="high"/> '+c+'"bgcolor" value="#000000"/> '+c+'"allowScriptAccess" value="always"/> '+c+'"FlashVars" value="'+e+'"/> '+c+'"allowFullScreen" value="true"/> '+c+'"wmode" value="window"/> '+c+'"scale" value="noscale"/> <object type="application/x-shockwave-flash" data="'+this.LITE_URL+'" width="'+d+'" height="'+f+'" quality="high" bgcolor="#000000" id="'+this.FLASH_ID_2+'" quality="high" FlashVars="'+e+'" allowFullScreen="true" scale="noscale" wmode="window" allowScriptAccess="always">'+b+"</object></object>"
}else{if(this.ON_NO_PLUGINS){this.ON_NO_PLUGINS()}else{a.innerHTML=b;a.style.minWidth="860px";a.style.minHeight="550px"}}if(this.BROWSER_SAF){this.resizeUI()}},indexFeeds:function(){var e=document.getElementsByTagName("link");var a=[];for(var b=0;b!=e.length;++b){var d=e[b],c=d.getAttribute("type");if(c=="application/rss+xml"||c=="text/xml"){a.push({title:d.getAttribute("title"),url:d.getAttribute("href")})
}}return a},loadViaXHR:function(b){var a=this;var d=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("MSXML2.XMLHTTP.3.0");try{d.open("GET",b,true);d.onreadystatechange=function(){if(d.readyState==4){if((d.status==200||d.status==0)){if(d.responseText){a.showFlashUI(d.responseText)}}else{if(console){console.log("PicLens Lite could not load the RSS Feed: "+b)}}}};d.send("")}catch(c){this.ARGS.loadFeedInFlash=true;
this.showFlashUI("")}},meetsReqs:function(){if(this.DEBUG_NOFLASH){return false}var b=(this.FLASH_VER.major==0)&&this.BROWSER_IE;var a=swfobjlite.hasFlashPlayerVersion("9.0.28");return a||b},removeChildren:function(){this.REMOVE_TIMER_ID=0;if(this.LITE_BG_DIV!==null){document.body.removeChild(this.LITE_BG_DIV);this.LITE_BG_DIV=null}if(this.LITE_FG_DIV!==null){document.body.removeChild(this.LITE_FG_DIV);
this.LITE_FG_DIV=null}},resizeFlashToFitPaddedBox:function(){var b=this.getFlash();if(b){var c=this.getPageSize();var a=c.w-this.HPAD*2;var d=c.h-this.VPAD*2;b.style.width=a;b.style.height=d;b.width=a;b.height=d}},resizeToFitPaddedBox:function(b,a){if(typeof a=="undefined"){a=this.getPageSize()}b.width=(a.w-this.HPAD*2)+"px";b.height=(a.h-this.VPAD*2)+"px"},resizeToPaddedBox:function(a){a.left=a.right=this.HPAD+"px";
a.top=a.bottom=this.VPAD+"px"},resizeUI:function(){if(this.LITE_FG_DIV){var a=this.LITE_FG_DIV.style;this.resizeToPaddedBox(a);this.resizeToFitPaddedBox(a);this.resizeFlashToFitPaddedBox()}},setRunningFlag:function(a){this.LITE_IS_RUNNING=a;this.piclensIsRunning_=a},setResizeHandler:function(){if(!this.RESIZE_HANDLER_EXISTS&&this.BROWSER_SAF){var a=this;window.addEventListener("resize",function(){a.resizeUI()
},false);this.RESIZE_HANDLER_EXISTS=true}},setResizeTimer:function(){if(this.BROWSER_IE6){this.RESIZE_TIMER_IE6=setInterval(function(){PicLensLite.autoResize()},1000)}},showFlashUI:function(a){this.THE_FEED=a;this.findScriptLocation();this.createBackgroundOverlay();this.createForegroundFlashComponent();if(this.BROWSER_IE){this.appendElementsToDocument()}this.injectFlashPlayer();if(!this.BROWSER_IE){this.appendElementsToDocument()
}this.addKeyHandlers();this.addMouseHandlers();this.setRunningFlag(true);this.setResizeTimer();this.setResizeHandler();this.startLytebox()},sendMouseScrollToFlash:function(b){if(!this.isRunning()){return}var a=this.getFlash();if(a!=null&&a.fl_mouseMoved){a.fl_mouseMoved(b)}}};var swfobjlite=function(){var UNDEF="undefined",OBJECT="object",SHOCKWAVE_FLASH="Shockwave Flash",SHOCKWAVE_FLASH_AX="ShockwaveFlash.ShockwaveFlash",win=window,doc=document,nav=navigator;
var ua=function(){var w3cdom=typeof doc.getElementById!=UNDEF&&typeof doc.getElementsByTagName!=UNDEF&&typeof doc.createElement!=UNDEF&&typeof doc.appendChild!=UNDEF&&typeof doc.replaceChild!=UNDEF&&typeof doc.removeChild!=UNDEF&&typeof doc.cloneNode!=UNDEF,playerVersion=[0,0,0],d=null;if(typeof nav.plugins!=UNDEF&&typeof nav.plugins[SHOCKWAVE_FLASH]==OBJECT){d=nav.plugins[SHOCKWAVE_FLASH].description;
if(d){d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");playerVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);playerVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);playerVersion[2]=/r/.test(d)?parseInt(d.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof win.ActiveXObject!=UNDEF){var a=null,fp6Crash=false;try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".7")}catch(e){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".6");
playerVersion=[6,0,21];a.AllowScriptAccess="always"}catch(e){if(playerVersion[0]==6){fp6Crash=true}}if(!fp6Crash){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX)}catch(e){}}}if(!fp6Crash&&a){try{d=a.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");playerVersion=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)]}}catch(e){}}}}var u=nav.userAgent.toLowerCase(),p=nav.platform.toLowerCase(),webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,ie=false,windows=p?/win/.test(p):/win/.test(u),mac=p?/mac/.test(p):/mac/.test(u);
/*@cc_on
			ie = true;
			@if (@_win32)
				windows = true;
			@elif (@_mac)
				mac = true;
			@end
		@*/
return{w3cdom:w3cdom,pv:playerVersion,webkit:webkit,ie:ie,win:windows,mac:mac}}();return{hasFlashPlayerVersion:function(rv){var pv=ua.pv,v=rv.split(".");v[0]=parseInt(v[0],10);v[1]=parseInt(v[1],10);v[2]=parseInt(v[2],10);return(pv[0]>v[0]||(pv[0]==v[0]&&pv[1]>v[1])||(pv[0]==v[0]&&pv[1]==v[1]&&pv[2]>=v[2]))?true:false
},getFlashPlayerVersion:function(){return{major:ua.pv[0],minor:ua.pv[1],release:ua.pv[2]}}}}();var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"Unknown Browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"Unknown Version";this.OS=this.searchString(this.dataOS)||"Unknown OS"},searchString:function(d){for(var a=0;
a<d.length;a++){var b=d[a].string;var c=d[a].prop;this.versionSearchString=d[a].versionSearch||d[a].identity;if(b){if(b.indexOf(d[a].subString)!=-1){return d[a].identity}}else{if(c){return d[a].identity}}}},searchVersion:function(b){var a=b.indexOf(this.versionSearchString);if(a==-1){return}return parseFloat(b.substring(a+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};
BrowserDetect.init();var Paginators={paginators:new Hash(),group:new Hash(),add:function(b,a){this.paginators.set(b,a);if(Object.isUndefined(this.group.get(b))){this.group.set(b,[a])}else{this.group.get(b).push(a)}return a},get:function(a){a=a||"default";return this.paginators.get(a)},getGroup:function(a){a=a||"default";return this.group.get(a)}};var Paginator=Class.create({sliderMinWidth:20,STYLE_SEO:"pagination-seo",STYLE_CLASSIC:"pagination-lite",STYLE_SLIDER:"pagination-slider",initialize:function(e,f,b){this.group=e||"default";
Paginators.add(this.group,this);this.uniqueId=this.group+f;this.handler=b;this.handler.parameters=$H(this.handler.parameters);this.currentPage=this.handler.config.currentPage;this.totalPages=this.handler.config.totalPages;this.page=null;this.refreshPagination=false;this.loading=false;if(this.totalPages>1){this.visible=true}else{this.hide()}var d=new RegExp("(pagination-(seo|lite|slider))","g");var c=$("paginationContainer_"+this.uniqueId).className;
var a=d.exec(c);if(a){this.style=a[1]}else{this.style=this.STYLE_SLIDER}if(this.style!=this.STYLE_SEO){this.goTo=$("goTo_"+this.uniqueId);if(this.style==this.STYLE_SLIDER){this.initSlider()}}},initSlider:function(){this.navigationBar=$("navigationBar_"+this.uniqueId);this.slider=$("slider_"+this.uniqueId);this.leftArrow=$("left_"+this.uniqueId);this.rightArrow=$("right_"+this.uniqueId);this.pageNumber=$("pageNumber_"+this.uniqueId);
if(this.visible){this.calculateWidths(true)}this.mouseXPos=0;this.clickXPos=0;this.startPos=0},calculateWidths:function(){this.barWidth=this.navigationBar.getWidth();this.sliderWidth=this.barWidth/this.totalPages;if(this.sliderWidth<this.sliderMinWidth){this.sliderWidth=this.sliderMinWidth;this.stepWidth=(this.barWidth-this.sliderWidth)/this.totalPages}else{this.stepWidth=this.sliderWidth}this.slider.style.width=this.sliderWidth+"px";
this.moveSlider("init",this.currentPage)},addListeners:function(a){if(this.style==this.STYLE_SEO){return}if(!a){this.bGoToPage=this.goToPage.bindAsEventListener(this)}if(this.style==this.STYLE_CLASSIC){Event.observe("form_goTo_"+this.uniqueId,"submit",this.bGoToPage)}else{if(!a){this.bClickOnBar=this.clickOnBar.bindAsEventListener(this);this.bMoveLeft=this.moveLeft.bindAsEventListener(this);this.bMoveRight=this.moveRight.bindAsEventListener(this);
this.bMouseDown=this.mouseDown.bindAsEventListener(this)}Event.observe(this.navigationBar.identify(),"mousedown",this.bClickOnBar);Event.observe(this.leftArrow.identify(),"click",this.bMoveLeft);Event.observe(this.rightArrow.identify(),"click",this.bMoveRight);Event.observe("lnk_"+this.goTo.identify(),"click",this.bGoToPage);Event.observe(this.slider.identify(),"mousedown",this.bMouseDown)}},findPos:function(a){var b=curtop=0;
if(a.offsetParent){b=a.offsetLeft;curtop=a.offsetTop;while(a=a.offsetParent){b+=a.offsetLeft;curtop+=a.offsetTop}}return[b,curtop]},getXOffset:function(){var b=this.findPos(this.navigationBar);var a=this.mouseXPos-b[0];if(a<0){a=0}if(a>=this.barWidth){a=this.barWidth}return a},getTargetPage:function(b){switch(b){case"click":var c=this.getXOffset();var d={page:Math.ceil(this.totalPages*(c/this.barWidth)),xOffset:c};
if(d.page>this.currentPage){d.page=this.currentPage+1}if(d.page<this.currentPage){d.page=this.currentPage-1}return d;break;default:var a;if((a=this.startPos+(this.mouseXPos-this.clickXPos))<=this.barWidth&&a>=18){a=(a<(this.barWidth/2)?a-9:a+9);return{page:Math.ceil(this.totalPages*((a-9)/this.barWidth))}}else{if(a<18){return{page:1}}return{page:this.totalPages}}break}},updateCaption:function(a){this.page=a;
$(this.pageNumber).update(a+"/"+this.totalPages)},moveSlider:function(b,d){if(this.style!=this.STYLE_SLIDER){return}var c=(d?{page:parseInt(d)}:this.getTargetPage(b,d));if(!c.page){return null}else{if(b=="click"||d){if(Object.isUndefined(this.stepWidth)){return}this.slider.style.left=(18+(c.page-1)*parseFloat(this.stepWidth))+"px"}else{var a;var e=(this.mouseXPos-this.clickXPos);if((a=this.startPos+e)>18&&a<(this.barWidth-this.sliderWidth+18)){this.slider.style.left=a+"px"
}}}this.currentPage=d;this.updateCaption(c.page)},clickOnBar:function(a){this.mouseXPos=Event.pointerX(a);this.moveSlider("click");this.go()},mouseDown:function(a){Event.stop(a);this.clickXPos=Event.pointerX(a);this.startPos=parseFloat(this.slider.style.left);this.bMouseMove=this.mouseMove.bindAsEventListener(this);this.bMouseUp=this.mouseUp.bindAsEventListener(this);Event.observe(document.body,"mousemove",this.bMouseMove);
Event.observe(document.body,"mouseup",this.bMouseUp)},mouseMove:function(a){this.mouseXPos=Event.pointerX(a);this.moveSlider()},mouseUp:function(a){Event.stopObserving(document.body,"mousemove",this.mouseMoveBinded);if(!this.page){return}Event.stopObserving(document.body,"mousemove",this.bMouseMove);Event.stopObserving(document.body,"mouseup",this.bMouseUp);this.slider.style.left=18+(this.page-1)*this.stepWidth+"px";
this.go()},moveLeft:function(a){if(this.currentPage==1){Event.stop(a);return}var b=this.currentPage;this.slider.style.left=18+(b-2)*this.stepWidth+"px";this.updateCaption(--b);this.go(b)},moveRight:function(a){if(this.currentPage==this.totalPages){Event.stop(a);return}var b=this.currentPage;this.slider.style.left=18+b*this.stepWidth+"px";this.updateCaption(++b);this.go(b)},goToPage:function(b){b.stop();
var a=parseInt(this.goTo.value);if((0<a)&&(a<=this.totalPages)){this.moveSlider("goTo",a);this.go(a)}else{this.goTo.select()}},go:function(page){if(this.loading){return}if(this.style==this.STYLE_CLASSIC){window.location.replace(this.handler.url+"?"+(this.handler.queryString.length?this.handler.queryString+"&":"")+"page="+page);return}this.loading=true;if(!page){page=this.page}var createHandler=eval(this.handler.onCreate)||Prototype.emptyFunction;
var failureHandler=eval(this.handler.onFailure)||Prototype.emptyFunction;this.handler.parameters.set("page",page);this.handler.parameters.set("paginator",this.group);if(this.refreshPagination){this.handler.parameters.unset("cacheId");this.handler.parameters.set("refreshPagination",this.group)}else{this.handler.parameters.unset("refreshPagination")}createHandler(this);this.handler.parameters.each(function(item){if(item.value&&item.value.toString()=="[object Object]"){this.unset(item.key);
$H(item.value).each(function(it){var newKey=item.key+"["+it.key+"][]";this.set(newKey,it.value)},this)}},this.handler.parameters);var ajaxParameters={method:"get",parameters:this.handler.parameters,onSuccess:function(tr){var successHandler=!(Object.isFunction(this.handler.onSuccess))?eval(this.handler.onSuccess)||Prototype.emptyFunction:this.handler.onSuccess;var response=null;try{response=tr.responseText.evalJSON()
}catch(ex){if(window.console){window.console.error("The pagination response is not a valid JSON")}}this.loading=false;try{successHandler(tr,response);this.handleUpdate(response)}catch(ex){if(window.console){console.log(ex)}}}.bind(this),onFailure:function(tr){this.loading=false;failureHandler(tr)}};if(!Object.isUndefined(this.handler.parameters.get("overlayer"))){ajaxParameters.overlayer={id:this.handler.parameters.get("overlayer"),autoReposition:!this.handler.fixedHeight}
}else{if(this.handler.update){ajaxParameters.overlayer={id:this.handler.update,autoReposition:!this.handler.fixedHeight}}}if(this.handler.message){ajaxParameters.message=this.handler.message}new Ajax.Request(this.handler.url,ajaxParameters);this.currentPage=page;this.updateFriends(page)},handleUpdate:function(a){if(this.handler.update){$(this.handler.update).update(a.results)}if(this.refreshPagination){Paginators.getGroup(this.group).each(function(b){b.rewind(a.handler.config);
b.setParameters(a.handler.parameters)});this.refreshPagination=false}},refresh:function(a){this.refreshPagination=true;if(!Object.isUndefined(a)){if(!Object.isHash(a)){throw ("'newParameters' must be a Hash object!")}this.setParameters(a);this.currentPage=0;var b=a.get("page");if(Object.isUndefined(b)){this.go(1)}else{this.go(b)}}else{this.go(this.currentPage)}},getHandler:function(){return this.handler
},setHandler:function(a){this.handler=a},setParameters:function(a){this.handler.parameters=$H(a);this.handler.queryString=Object.toQueryString(this.handler.parameters)},getParameters:function(){return this.handler.parameters},getCurrentPage:function(){return this.currentPage},updateFriends:function(a){$A(Paginators.getGroup(this.group)).each(function(b){b.moveSlider("goTo",a)})},hide:function(){$("paginationContainer_"+this.uniqueId).hide();
this.visible=false},show:function(){if(this.visible==false){$("paginationContainer_"+this.uniqueId).show();this.visible=true}},rewind:function(a){if(parseInt(a.totalPages)<2){this.hide()}else{this.show();this.totalPages=a.totalPages;this.currentPage=(a.currentPage?a.currentPage:1);this.calculateWidths();this.moveSlider("rewind",(a.currentPage?a.currentPage:1))}},_garbageCollector:function(){Event.stopObserving(this.navigationBar.identify(),"mousedown",this.bClickOnBar);
Event.stopObserving(this.leftArrow.identify(),"click",this.bMoveLeft);Event.stopObserving(this.rightArrow.identify(),"click",this.bMoveRight);Event.stopObserving("lnk_"+this.goTo.identify(),"click",this.bGoToPage);Event.stopObserving(this.slider.identify(),"mousedown",this.bMouseDown)}});var queryString=new Hash({letter:"A-Z"});function getResults(d,c){if(!Object.isUndefined(d)){if(Object.isNumber(d)||parseInt(d)){queryString.set("page",parseInt(d))
}else{if(Object.isElement(d)){if(d.tagName.toLowerCase()=="a"){queryString.set(d.readAttribute("rel"),d.innerHTML)}else{var b=Element.extend(d).readAttribute("name");var a=$F(d);if(parseInt(a)==0){queryString.unset(b)}else{queryString.set(b,a)}}queryString.set("page",1)}else{for(b in d){queryString.set(b,d[b])}}}}var e=Paginators.get();if(Object.isUndefined(queryString.get("page"))){queryString.set("page",e.getCurrentPage())
}e.refresh(e.getParameters().update(queryString))}document.observe("dom:loaded",function(){if($("lettersIndex")){Event.observe("lettersIndex","click",function(a){if((element=Event.findElement(a,"A"))){getResults(element)}})}if($("graduateYear")){$("graduateYear").observe("change",function(a){var b=Paginators.get().getParameters();b.set("endYear",a.element().value);Paginators.get().refresh(b)})}if($("start")){$("start").observe("change",function(a){var b=Paginators.get().getParameters();
b.set("startYear",a.element().value);b.set("endYear",$("end").value);Paginators.get().refresh(b)})}if($("end")){$("end").observe("change",function(a){var b=Paginators.get().getParameters();b.set("endYear",a.element().value);b.set("startYear",$("start").value);Paginators.get().refresh(b)})}if($("albumsTypes")){$("albumsTypes").observe("click",function(b){var a=b.findElement("a");if(a&&a.hasClassName("beenDragged")){b.stop();
a.removeClassName("beenDragged")}});$("albumsTypes").select("li.nonMandatory").each(function(a){new Draggable(a.identify(),{revert:true,snap:[40,40],starteffect:null,endeffect:null,onStart:function(b,d){var c=b.element.down("a");if(d.element().descendantOf(c)){c.addClassName("beenDragged")}}})});Droppables.add("deleteDropContainer",{accept:"albumType",hoverclass:"hover",onDrop:function(a,e,d){var c=d.element();
if(c.tagName.toLowerCase()!="li"){c=d.element().up("li")}if(!window.confirm($("confirmDelete").innerHTML.replace("%s","'"+c.down("h2").innerHTML+"' ?\n\n"))){return}var b=c.down("a").readAttribute("rel");new Ajax.Request("/community/albums/delete-album.ajax",{method:"GET",parameters:{albumId:b},onSuccess:function(f){c.remove();$("sidebarMenu").select("li h4 a[rel="+b+"]").first().up("li").remove();
alert(f.responseText)},onFailure:function(f){alert(f.responseText)}})}})}});if(typeof SelectCollection=="undefined"){StringFilter=Class.create({initialize:function(a){this.lastSearchedString=null;this.lastResultSet=null;this.values=a},filter:function(e){var c=String(e).toLowerCase();var a=[];if(c.length==0){this.lastSearchedString="";return true}if(c==this.lastSearchedString){return false}var b=this.values;
if(c.indexOf(this.lastSearchedString)!=-1){}for(var d=0;d<b.length;d++){a[d]=this.values[d].indexOf(c)}this.lastSearchedString=c;return a}});JsonFilterMethods={MAX_ITEMS:100,CLASS_LAST:"last",CLASS_FIRST:"first",CLASS_DISABLED:"disabled",CLASS_ACTIVE:"active",initialize:function(c,b,a){this.list=c;this.update(b);this.currentIndex=0;this.defaultValue=a;this.highlighted=null;this.errorText=b.error||"Nu a fost gasit";
this.titleText=b.title||false;this.defaultText=b["default"]||"";this.moreText=b.more||"- Mai multe -";this.moreTitleText=b.moreTitle||"Tastati pentru rezultate"},update:function(a){this.initialized=false;this.updated=false;this.initialItems=false;this.elements=a;this.filterObject=null;this.currentItems=[]},_lazyUpdate:function(){if(this.updated){return}this.updated=true;var a=this.elements;this.errorText=a.error||this.errorText;
this.titleText=a.title||this.titleText;this.defaultText=a["default"]||this.defaultText;this.moreText=a.more||this.moreText;this.moreTitleText=a.moreTitle||this.moreTitleText;delete a.title;delete a.error;delete a["default"];delete a.more;delete a.moreTitle;this._elements=$H(a);this.options=this._elements.values();this.values=this._elements.keys();this.indexesLookup=this._getValueToIndexLookup(this.values);
this.currentIndex=this.getIndexByValue(this.defaultValue);this.errorShown=false},_addInitialItems:function(){if(this.initialItems){return}this.initialItems=true;this._clear();this.titleText&&this.addDisabledItem(this.titleText);this.defaultText&&this.addItemBulk({text:this.defaultText});this._addAllItems()},init:function(){if(this.initialized){return}this.initialized=true;this._lazyUpdate();this._addInitialItems();
this.hideError()},reset:function(){this.initialized=false},refresh:function(){this.initialized=false;this.initialItems=false},_getFilter:function(){if(this.filterObject){return this.filterObject}var b;var a=[];for(b=0;b<this.options.length;b++){a[b]=String(this.options[b]).toLowerCase()}this.filterObject=new StringFilter(a);return this.filterObject},_getValueToIndexLookup:function(a){var c={};for(var b=0;
b<a.length;b++){c[a[b]]=b+1}return c},showError:function(a){this._clear();this.addDisabledItem(a||this.errorText);this.errorShown=true},showMore:function(){this.showError(this.moreTitleText||this.titleText)},hideError:function(){this.errorShown=false},addItem:function(b){if(typeof b!="object"){return null}if(this.list.lastChild){this.list.lastChild.removeClassName(this.CLASS_LAST)}var a=this.addItemBulk(b,true);
a.addClassName(this.CLASS_LAST);if(this.list.childNodes.length==1){a.addClassName(this.CLASS_FIRST)}return a},addDisabledItem:function(b){var a=this.addItemBulk({text:b,disabled:true});a.addClassName(this.CLASS_DISABLED)},addItemBulk:function(b){var a=new Element("li");this.list.appendChild(a);b.text=typeof(b.text)=="undefined"?"":b.text.toString();b.value=typeof(b.value)=="undefined"?"":b.value.toString();
a.update(b.text||b.value);a._value=b.value||"";a._text=b.text;if(b.meta){a._meta=b.meta}if(b.disabled||b.notIndexed){if(b.disabled){a._disabled=true}a._index=-1}else{a._index=this.currentItems.length;this.currentItems.push(a)}return a},morph:function(a){this._clear();for(var b=0;b<a.length;b++){if(a[b].disabled){this.addDisabledItem(a[b].text)}else{this.addItemBulk(a[b])}}this.initialized=false},isOversized:function(){if(!this.options){return false
}return this.options.length>this.MAX_ITEMS},_addAllItems:function(){var c=this.isOversized()?this.MAX_ITEMS:this.options.length;for(var b=0;b<c;b++){this.addItemBulk({text:this.options[b],value:this.values[b]})}if(this.isOversized()){if(this.currentIndex>this.currentItems.length&&this.currentIndex<this.options.length){var a=this.addItemBulk({text:this.options[this.currentIndex-1],value:this.values[this.currentIndex-1]});
this.setIndex(a._index)}this.addItemBulk({text:this.moreText,meta:"showMore"})}if(typeof(this.defaultValue)!="undefined"){this.setIndex(this.currentIndex)}if(this.currentItems.length){this.currentItems[this.currentItems.length-1].addClassName(this.CLASS_LAST)}},_addAndMarkItems:function(b,a){var d=0;for(var c=0;c<b.length;c++){if(b[c]==-1){continue}this.addItemBulk({text:this.mark(this.options[c],b[c],a),value:this.values[c]});
if(++d>this.MAX_ITEMS){return}}if(this.currentItems.length){this.currentItems[this.currentItems.length-1].addClassName(this.CLASS_LAST)}},_clear:function(){delete this.currentItems;this.currentItems=[];this.list.update()},filter:function(b){b=String(b);var a=this._getFilter().filter(b);if(a===false){return}if(a===true){this.refresh();this.init();return}this.initialItems=false;this._clear();this._addAndMarkItems(a,b.length);
if(this.size()==0){this.showError();return}this.setIndex(0);this.hideError()},mark:function(b,a,c){var d=String(b).replace("<b>","").replace("<B>","").replace("</b>","").replace("</B>","");return d.slice(0,a)+"<b>"+d.slice(a,a+c)+"</b>"+d.slice(a+c)},unmark:function(a){return String(a).replace("<b>","").replace("<B>","").replace("</b>","").replace("</B>","")},next:function(){this.setIndex(this.currentIndex+1);
if(this.currentIndex>this.size()-1){this.setIndex(0)}return this.current("next")},previous:function(){this.setIndex(this.currentIndex-1);if(this.currentIndex<0){this.setIndex(this.size()-1)}return this.current("previous")},current:function(a){if(!this.currentItems.length||this.errorShown){return null}var b=this.currentItems[this.currentIndex];if(b._disabled){if(a=="previous"){return this.previous()
}else{return this.next()}}return b},highlight:function(a){if(typeof(a)=="undefined"){a=this.currentIndex}if(this.highlighted){this.highlighted.removeClassName(this.CLASS_ACTIVE)}if(!this.currentItems[a]){return}this.highlighted=this.currentItems[a];this.highlighted.addClassName(this.CLASS_ACTIVE)},getIndex:function(){return this.currentIndex},setIndex:function(a){this.currentIndex=a;if(this.isOversized()){if(this.currentIndex>this.currentItems.length&&this.currentIndex<this.options.length){this.refresh()
}}this.init();this.highlight()},getIndexByValue:function(a){this.init();if(this.indexesLookup[a]){return this.indexesLookup[a]}return 0},setIndexByValue:function(a){this.init();if(this.indexesLookup[a]){this.setIndex(this.indexesLookup[a])}else{this.setIndex(0)}},getOption:function(a){if(!this.options){this.init()}if(a==-1){return this.defaultText}return this.options[a]},getOptions:function(a){if(!this.options){this.init()
}if(a==-1){return this.defaultText}return this.options},getValue:function(a){if(!this.values){this.init()}if(a==-1){return""}return this.values[a]},getValues:function(){if(!this.values){this.init()}return this.values},getCurrentItems:function(){return this.currentItems},size:function(){return this.currentItems.length},removeClass:function(a,c){var b=this.options[this.visibleIndexes[a]];if(b){b.removeClassName(c)
}},addClass:function(a,c){var b=this.options[this.visibleIndexes[a]];if(b){b.addClassName(c)}}};JsonFilter=Class.create(JsonFilterMethods);SelectMethods={initialize:function(c){this.active=false;this.enabled=true;this.initialized=false;this.locked=false;this.lastSelectedText=null;this.lastSelectedValue=null;this.parent=c;this.textInput=c.select(".selector_input")[0];this.valueInput=c.select(".result_input")[0];
this.mainContainer=c.select(".selector")[0];this.dropdownButton=c.select(".selector_dropdown")[0];this.resultsContainer=c.select(".results_container")[0];this.list=c.select(".results_container .result_list")[0];var a=selectsData[this.parent.identify()]||{};this.filter=new JsonFilter(this.list.down("ul"),a,this.getValue());this._setText(a[this.getValue()]||a["default"]||"");this._onClickHandler=this._onClick.bindAsEventListener(this);
this._onClickPopupHandler=this._onClickPopup.bindAsEventListener(this);this._onHideHandler=this.hide.bindAsEventListener(this);this.textInput.observe("keyup",this._onKeyUp.bindAsEventListener(this));this.textInput.observe("keydown",this._onKeyDown.bindAsEventListener(this));this.mainContainer.observe("click",this._onClickHandler);this.dropdownButton.observe("click",this._onClickHandler);this.resultsContainer.observe("click",this._onClickPopupHandler);
this.resultsContainer.observe("mouseover",this._onMouseOver.bindAsEventListener(this));var b=this.parent.getWidth();if(b>24){this.textInput.style.width=(this.parent.getWidth()-24)+"px"}},getValue:function(){return this.valueInput.value},getText:function(){return this.textInput.value},disable:function(){this.enabled=false;this.textInput.disable();this.textInput.addClassName("disabled")},enable:function(){this.enabled=true;
this.textInput.enable();this.textInput.removeClassName("disabled")},updateAjax:function(b,a,c){this._lock();new Ajax.Request(b,Object.extend({onComplete:function(e){var d=e.responseText.evalJSON();this._unlock();this.update(d);if(!Object.isUndefined(c)&&Object.isFunction(c)){c(this)}}.bind(this)},a))},update:function(c,a){if(typeof(c)=="undefined"){c={}}var b={};var d=0;if(Object.isArray(c)){for(d=0;
d<c.length;d++){b[d]=c[d]}}else{if("getOptions" in c){c=c.getOptions();for(d=0;d<c.length;d++){b[d]=c[d]}}else{$H(c).each(function(e){b[e.key]=e.value}.bind(this))}}this.filter.update(b);this._setText(this.filter.defaultText||c["default"]||"");if(typeof(a)!="undefined"){this.selectValue(a)}},insert:function(a){this._add(a);this.filter.refresh()},markNext:function(){this.filter.next();this._render()
},markPrevious:function(){this.filter.previous();this._render()},hide:function(a){if(!this.active){return}this.active=false;if(a){this._setText();this._setValue();this.filter.reset();this.filter.setIndexByValue(this.getValue())}document.stopObserving("click",this._onHideHandler);this.resultsContainer.hide()},show:function(){if(this.active||this.locked){return}SelectCollection.hideAllActive();this.active=true;
document.observe("click",this._onHideHandler);this.resultsContainer.absolutize();this.resultsContainer.show();this.filter.init();this.filter.highlight();if(this.getValue()==""){this._setText("")}this._getHeights();this._render()},fire:function(){this.parent.fire("select:changed",{id:this.parent.identify()})},getOptions:function(){return this.filter.getOptions()},getSelectedIndex:function(){return this.filter.getIndex()
},selectIndex:function(b,a){this.filter.reset();this.filter.setIndex(b);this._selectEntry(a)},selectValue:function(c,a){var b=this.filter.getIndexByValue(c);if(b===false){b=0}this.selectIndex(b,a)},_filter:function(a){a=String(a);this.filter.filter(a);this._render()},_lock:function(){if(this.locked){return}this.locked=true;this.mainContainer.addClassName("locked")},_unlock:function(){if(!this.locked){return
}this.locked=false;this.mainContainer.removeClassName("locked")},_onKeyDown:function(a){if(this.active){switch(a.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:this._selectEntry(false);this.active=false;a.stop();return;case Event.KEY_ESC:this.hide();this.active=false;a.stop();return;case Event.KEY_LEFT:case Event.KEY_RIGHT:return}return}if(a.keyCode==Event.KEY_TAB||a.keyCode==Event.KEY_RETURN||(Prototype.Browser.WebKit>0&&a.keyCode==0)){return
}this.show()},_onKeyUp:function(b){if(this.active){switch(b.keyCode){case Event.KEY_UP:this.markPrevious();return;case Event.KEY_DOWN:this.markNext();return}var a=String(this.getText());this._filter(a);return}},_onMouseOver:function(b){var a=b.findElement("li");if(!a||a.hasClassName(this.filter.CLASS_DISABLED)){return}this.filter.setIndex(a._index)},_onClick:function(a){if(a.element().hasClassName(this.filter.CLASS_DISABLED)){return
}if(this.active){this.filter.reset();this.hide()}else{this.textInput.select();this.show()}a.stop()},_onClickPopup:function(a){if(a.element().hasClassName(this.filter.CLASS_DISABLED)){return}if(a.findElement("#"+this.parent.identify()+" .results_container")){this._selectEntry(false)}},_selectEntry:function(a){var b=this.filter.current();if(!b){return false}if(b&&b._meta=="showMore"){this.filter.showMore();
this.active=false;this._render();this.textInput.select();return true}this.filter.reset();this.filter.setIndexByValue(b._value);this._setText(this.filter.unmark(b._text.strip()));this._setValue(b._value);if(!a){this.fire()}this.hide();return true},_setText:function(a){if(typeof(a)!="undefined"){this.textInput.value=this.lastSelectedText=a}else{this.textInput.value=this.lastSelectedText}},_setValue:function(a){if(typeof(a)!="undefined"){this.valueInput.value=this.lastSelectedValue=a
}else{this.valueInput.value=this.lastSelectedValue}},_render:function(){this._setListDimensions();var a=this.filter.getIndex();if(a==0){this.list.scrollTop=0;return}this.list.scrollTop=this.heights[a]-this.listHeight},_setListDimensions:function(){this.textInput.style.width=(this.parent.getWidth()-24)+"px";var a=this.list.down("ul").getHeight();if(a>this.listHeight){a=this.listHeight}this.list.style.height=a+"px";
this.resultsContainer.style.width=this.parent.getWidth()+"px"},_getHeights:function(){if(this.initialized){return}var b=this.filter.getCurrentItems();this.heights=[];this.heights[0]=b[0].getHeight();for(var a=1;a<b.length;a++){this.heights[a]=this.heights[a-1]+b[a].getHeight()}this.listHeight=this.list.getHeight()-2;var c=Math.max(parseInt(document.viewport.getHeight()/3),100);if(this.listHeight>c){this.listHeight=c
}this.initialized=true},_add:function(a){this.filter.addItem(a)}};Select=Class.create(SelectMethods);SelectCollection={initialized:false,init:function(){if(this.initialized){return}this.initialized=true;this.selects=new Hash();this.update()},update:function(){if(!this.initialized){this.init();return}$$(".selectField").each(function(a){this.register(a.identify())}.bind(this));this.selects.each(function(a){if(!$(a.key)){this.unregister(a.key)
}}.bind(this))},get:function(a){return this.selects.get(a)},register:function(a){if(this.selects.get(a)){return}this.selects.set(a,new Select($(a)))},unregister:function(a){this.selects.unset(a)},unregisterAllUnder:function(a){$$(a+" .selectField").each(function(b){this.unregister(b.identify())}.bind(this))},hideAllActive:function(){this.selects.each(function(a){if(a.value.active){a.value.hide()}}.bind(this))
},cleanup:function(){try{this.selects.each(function(b){this.unregister(b.key)}.bind(this));delete (selectsData)}catch(a){}}}};
