(function(){var ba=new Array();var bd=false;var img_src_m=false;var img_src_o=false;var img_full=false;window.addEvent('domready',function(){for(var i=0;i<ba.length;i++){resize(ba[i]);ba[i].onInit();}});window.addEvent('resize',function(){for(var i=0;i<ba.length;i++){resize(ba[i]);ba[i].onResize();}});function resize(item){var bc=item.node.parentNode.parentNode.offsetWidth-item.fat;bc=Math.max(160,bc);bc=Math.min(item.originalWidth,bc);item.node.style.width=bc+'px';if(item.originalHeight!=0){item.node.style.height=(bc*item.originalHeight/item.originalWidth)+'px'}}this.MediaItems=new(new Class({create:function(mediaId,width,height,onInit,onResize){var node=$(mediaId);var fat=getElementFat(node);fat+=getElementFat(node.parentNode);var item={mediaId:mediaId,originalWidth:width,originalHeight:height,node:node,fat:fat,onInit:onInit,onResize:onResize};ba.push(item);},fullScreen:function(mel){if(!bd){bd=$('x-hovpanel-bg');}bd.style.display='block';if(!img_src_m){img_src_m=mel.getElementsByTagName('IMG')[0].src;var a=img_src_m.lastIndexOf('/')+1;img_src_o=img_src_m.setCharAt(a,'o');img_full=$('x-hovpanel-photofullscreen');img_full.innerHTML='<a href="#" class="x-photofullscreen" onclick="MediaItems.closeFullScreen(); return false;" title="click to close"><img src="'+img_src_o+'" title="click to close" /></a>'}var img_top=getCurrentYPos()+40+'px';img_full.style.top=img_top;img_full.style.display='block'},closeFullScreen:function(){bd.style.display='none';img_full.style.display='none'}}))();})();function getElementFat(el){var bb=0;bb+=strip_unit(getStyle(el,'paddingRight','padding-right'));bb+=strip_unit(getStyle(el,'paddingLeft','padding-left'));bb+=strip_unit(getStyle(el,'borderRightWidth','border-right-width'));bb+=strip_unit(getStyle(el,'borderLeftWidth','border-left-width'));bb+=strip_unit(getStyle(el,'marginRight','margin-right'));bb+=strip_unit(getStyle(el,'marginLeft','margin-left'));return bb}function getTileCount(){var bh=65;var bi=7;var be=$('filmstrip').getElementsByTagName("ul")[0];var width=be.offsetWidth-getElementFat(be);var bj=Math.min(Math.floor(width/bh),bi);return bj}function getStyle(el,styleProp,style_prop){if(el.currentStyle)var bf=el.currentStyle[styleProp];else if(window.getComputedStyle)var bf=document.defaultView.getComputedStyle(el,null).getPropertyValue(style_prop);return bf}function strip_unit(string){if(string.search('px')!=-1){string=string.substring(0,string.length-2);return parseInt(string);}if(isNaN(parseInt(string))){string=0}string=string;return string}String.prototype.setCharAt=function(index,c){if(index>this.length-1)return this;return this.substr(0,index)+c+this.substr(index+1);};function getCurrentYPos(){if(document.body&&document.body.scrollTop){return document.body.scrollTop}if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop}if(window.pageYOffset){return window.pageYOffset}return 0}