/** vicaima.js */
var slideshows=null;window.addEvent("domready",function(){applySIFR();accordionMenu();accordionModules();preload();rollover();menuToggler();new Menu2Level();siteMap();assignGalleries();hiddenMenuItems();slideshows=new Array()});function hiddenMenuItems(){var a=$$("ul.submenus-escondidos > li");if(a){a.each(function(c){if(c.getElement("ul")){var b=c.getElement("ul");b.setStyle("visibility","hidden");c.addEvent("mouseenter",function(d){d=new Event(d).preventDefault();b.setStyle("visibility","visible")});c.addEvent("mouseleave",function(d){d=new Event(d).preventDefault();b.setStyle("visibility","hidden")})}})}}function assignGalleries(){var a=$$("a[id^=mostrar-gall]");if(a&&a.length>0){a.each(function(c,b){c.addEvent("click",function(d){new Event(d).preventDefault();milkbox.showGallery({gallery:c.getProperty("id").substring("mostrar-".length),index:0})})})}}function equalHeights(){var a=0;divs=$$("div.skel-conteudo-esquerda","div.skel-conteudo-principal","div.skel-conteudo-direito");divs.each(function(b){if(b.offsetHeight>a){a=b.offsetHeight}});divs.each(function(b){if(!b.hasClass("skel-conteudo-principal")){b.setStyle("height",(a-120)+"px")}if(b.offsetHeight>a){b.setStyle("height",(a-(b.offsetHeight-a))+"px")}})}function changeSlideshowState(a){if(slideshows){slideshows.each(function(b){if("toggle-"+b.slideshow.getProperty("id")==a){b.first()}else{b.pause(1)}})}}function getSlideshow(b){var a=null;if(slideshows){slideshows.each(function(c){if(c.slideshow.getProperty("id")==b){a=c}})}return a}function accordionModules(){var b=$$(".modulos-acordeao");if(b&&b.length>0){if($$("div.barra-modulo h1").length>0){var d=new URI(window.location);var a=parseInt(d.get("fragment"))-1;var c=$$("div.barra-modulo h1");var f=c.getParent().getElement("div");new Fx.Accordion(c,f,{fixedHeight:"365",opacity:false,alwaysHide:true,show:a,initialDisplayFx:false,onActive:function(h,g){h.addClass("seta-activo");h.removeClass("seta-inactivo");changeSlideshowState(h.getProperty("id"))},onBackground:function(h,g){h.removeClass("seta-activo");h.addClass("seta-inactivo")}})}}}function siteMap(){var a=$$("li.item37 a");if(a){a.addEvent("click",function(c){new Event(c).preventDefault();var b=$("mapa-do-site");if(!b){b=new Element("div",{id:"mapa-do-site","class":"mapa-site"});b.set("text","a carregar...");b.setStyles({opacity:"0",visibility:"hidden"});b.injectInside(document.body);new Request.HTML({method:"get",onComplete:function(){b.getElement("a.fechar").addEvent("click",function(d){new Event(d).preventDefault();b.fade("out")});b.makeDraggable({handle:b.getElement("h1")})},url:a.getProperty("href")+"?format=raw",update:"mapa-do-site"}).get()}if(b.getOpacity()==0){a.addClass("activo");b.fade("in");b.setStyle("left",(window.getScrollLeft()+(window.getWidth()-b.getStyle("width").toInt())/2)+"px");b.setStyle("top",(window.getScrollTop()+(window.getHeight()-b.getStyle("height").toInt())/3)+"px")}else{a.removeClass("activo");b.fade("out")}})}}function applySIFR(){var a=$("menu-principal");if(a){sIFR.replace(myriad_pro_light,{selector:"ul.menumenu-principal > li > span.item-menu-sifr",wmode:"transparent",fitExactly:false,tuneWidth:0,forceSingleLine:true,preventWrap:true,css:{".sIFR-root":{cursor:"pointer",color:"#000000","font-size":"17px"},a:{"text-decoration":"none",color:"#000000",cursor:"pointer"},"a:hover":{"text-decoration":"none",color:"#C7131B"}}})}a=$$("div.sifr-nome-area");if(a&&a.length>0){sIFR.replace(myriad_pro_light,{selector:"div.sifr-nome-area p",wmode:"transparent",fitExactly:false,tuneWidth:0,forceSingleLine:false,preventWrap:false,css:{".sIFR-root":{"text-transform":"uppercase",color:"#C7131B","font-size":"20px"}}})}}function accordionMenu(){var a=$$("ul.acordeao-menu");if(a&&a.length>0){a.each(function(c,b){new ImageMenu(c.getChildren("li"),{openWidth:458})})}}var Menu2Level=new Class({Implements:[Options,Events],options:{mainElementId:"menu-principal",minHeight:0,targetHeight:22,enterEffectDuration:150,leaveEffectDuration:150},menu:null,active:true,initialize:function(a){var c=0;var d=0;var b=null;var f=null;this.setOptions(a);this.menu=$(this.options.mainElementId);if(this.menu){this.menu.getChildren("li").each(function(h,g){if(h.hasClass("parent")){b=h.getElement("ul");if(Browser.Engine.trident4){b.setStyle("display","block")}if(b){b.fade("out");b.setStyle("left",c+"px");b.setStyle("margin-top","0px");b.setStyle("padding-top","0px");f=new Element("div",{height:this.options.minHeight+"px","class":"menu-content"});f.injectInside(h);f.adopt(b);d=0;lis=b.getChildren("li");lis.each(function(i){d+=i.measure(function(){return this.getSize().x})});if(d+(c-9)>980){b.setStyle("left",c-(d-(c-9)))}h.addEvent("mouseenter",function(k,i){var j=i.getElement("ul");var l=i.getElement("div");if(j&&l){l.setStyle("display","block");l.set("tween",{duration:this.options.enterEffectDuration,onComplete:Class.empty});l.tween("height",this.options.targetHeight+"px");j.fade("in")}}.bindWithEvent(this,h));h.addEvent("mouseleave",function(k,i){var j=i.getElement("ul");var l=i.getElement("div");if(j&&l){l.set("tween",{duration:this.options.leaveEffectDuration,onComplete:function(m){m.setStyle("display","none")}});l.tween("height",this.options.minHeight+"px");j.fade("out")}}.bindWithEvent(this,h))}}c+=h.getDimensions().width}.bind(this))}}});function effect_expand(b,f,g,a){var c=$(b);var d=0;if(c){d=((300/screen.width)*100);c.setStyle("width",d+"%");c.store("widthPercent",d);c.set("tween",{unit:"%",duration:"long"});c.addEvents({mouseover:function(){this.get("tween").cancel();this.tween("width","100");for(e in a){if($(a[e])){$(a[e]).fade("out")}}},mouseout:function(){this.get("tween").cancel();this.tween("width",this.retrieve("widthPercent"));for(e in a){if($(a[e])){$(a[e]).fade("in")}}}})}}var DoorPopup=new Class({Implements:[Options],options:{},request:null,door:null,popup:null,loader:null,sendto:null,popupName:"",url:"",doorFinish:0,locked:false,initialize:function(a,b){this.door=$(a);this.url=a.getElement("a").getProperty("href")+"&format=raw";this.doorFinish=new URI(a.getElement("a").getProperty("href")).getData("f");this.popupName="info-"+this.door.getProperty("id")+"-revestimento-"+this.getCurrentFinish();this.request=new Request.HTML({method:"get",url:this.url,update:this.popupName+"-content",onComplete:this.handleHtml.bind(this)});this.setup()},setup:function(){this.door.removeEvents();this.door.setOpacity(1);this.door.addEvents({click:function(a){if(!this.exists(this.popupName)){this.create(this.popupName);this.createSendToFriend(this.popupName);this.request.get();this.loaderDisplay("show")}this.position();this.show()}.bind(this),mouseleave:function(b,a){if(!this.locked){this.hide()}}.bind(this)});mainLink=this.door.getElement("a.porta");if(mainLink){mainLink.addEvent("click",function(a){a.preventDefault()})}},setupSendto:function(){var a=this.popup.getElement("a.enviar-amigo");if(a){a.addEvent("click",function(b){b=new Event(b).stopPropagation();b.preventDefault();this.positionSendto();this.sendto.fade("in");this.locked=true;new Request.HTML({update:this.popupName+"-enviar",onComplete:function(){this.sendto.getElement("a.fechar").addEvent("click",function(c){new Event(c).preventDefault();this.sendto.fade("out");this.sendto.removeClass("visivel");this.locked=false}.bind(this));this.sendto.makeDraggable({handle:$("ea-handle")});this.sendto.getElement("form").addEvent("submit",function(d){new Event(d).preventDefault();var c=$("mensagens-fea");c.addClass("sending");c.set("html","");this.set("send",{onComplete:function(f){c.removeClass("sending");c.set("html",f)}});this.send()})}.bind(this)}).get(a.getProperty("href")+"&format=raw")}.bind(this))}},handleHtml:function(c,a,d,b){this.loaderDisplay("hide");this.setupSendto()},loaderDisplay:function(a){if(a=="show"){this.loader.setStyle("display","block")}else{this.loader.setStyle("display","none")}},create:function(c){this.popup=new Element("div",{"class":"popup",id:c});var b=new Element("img",{"class":"fundo-popup"});b.setProperty("src",SITE_ROOT+"templates/vicaima/imagens/doors_mouse_over.png");this.loader=new Element("img",{"class":"loader",id:"loader-"+c,src:SITE_ROOT+"templates/vicaima/imagens/ajax-loader.gif"});var a=new Element("div",{id:c+"-content","class":"popup-content"});b.injectInside(this.popup);this.loader.injectInside(this.popup);a.injectInside(this.popup);this.popup.injectInside(this.door);this.popup.setStyles({opacity:"0",visibility:"hidden"});window.addEvent("scroll",function(){this.positionSendto();this.position()}.bind(this))},createSendToFriend:function(a){this.sendto=new Element("div",{"class":"enviar-amigo",id:a+"-enviar"});this.sendto.injectInside(this.door);this.sendto.setStyles({opacity:"0",visibility:"hidden"})},show:function(a){if(this.popup){$$("div.visivel").fade("out");this.popup.fade("in");this.popup.addClass("visivel")}},hide:function(a){if(this.popup&&this.sendto){this.popup.removeClass("visivel");this.locked=false;this.popup.fade("out");this.sendto.fade("out")}},exists:function(){return this.popup?true:false},positionSendto:function(){var a=(this.door.getCoordinates().left+this.door.getCoordinates().width)-130;var b=this.sendto.getStyle("width").toInt();this.sendto.setStyle("left",a+"px");this.sendto.setStyle("top",(window.getScrollTop()+(window.getHeight()-this.sendto.getStyle("height").toInt())/2)+"px")},position:function(){var a=(this.door.getCoordinates().left+this.door.getCoordinates().width)-90;var b=this.popup.getStyle("width").toInt();if((a+b)>window.getWidth()){a=(this.door.getCoordinates().left-this.door.getCoordinates().width*3.1);this.popup.getElement("img").setProperty("src",SITE_ROOT+"templates/vicaima/imagens/inv_doors_mouse_over.png");this.popup.addClass("invertido")}this.popup.setStyle("left",a+"px");this.popup.setStyle("top",(window.getScrollTop()+(window.getHeight()-this.popup.getStyle("height").toInt())/2)+"px")},getCurrentFinish:function(){return this.doorFinish}});var FinishSwitch=new Class({Implements:[Options,Events],options:{switchBaseClass:"alterar-rev",baseContainerId:"contentor-portas",basedoorContainerId:"porta",mainContentId:"coleccao-portas",selectedFinishInputId:"revestimento-seleccionado"},request:null,actual:"",initialize:function(a){var b=$$("."+this.options.switchBaseClass);this.request=new Request.HTML({method:"get",onComplete:this.handleHtml.bind(this)});this.actual=$$("div[id^="+this.options.baseContainerId+"]");if(b){b.each(function(d,c){d.addEvent("click",function(h,g){new Event(h).preventDefault();if(g.getProperty("id")!=this.actual){var f=true;this.hide(this.actual,f);this.actual=g.getProperty("id");this.setCurrentFinish(this.actual);if(!$(this.options.baseContainerId+"-"+g.getProperty("id"))){this.get(g.getProperty("href"));f=false;$(this.options.mainContentId).setStyle("min-height",$(this.options.mainContentId).getStyle("height").toInt()+"px")}}}.bindWithEvent(this,d))}.bind(this))}},setCurrentFinish:function(a){a=a.substring("revestimento-".length);$(this.options.selectedFinishInputId).setProperty("value",a)},show:function(b){var a=$(this.options.baseContainerId+"-"+b);if(a){a.setStyles({opacity:0,display:"block"});new Fx.Tween(a,{property:"opacity",duration:400}).start(0,1);$(this.options.mainContentId).setStyle("min-height","auto")}},hide:function(d,a){var b=$$("div[id^="+this.options.baseContainerId+"-]");var c=null;if(b){b.each(function(g,f){if(g.getOpacity()>0){c=g}});if(c){c.setStyles({opacity:1});new Fx.Tween(c,{property:"opacity",duration:500,onComplete:function(){c.setStyle("display","none");if(a){this.show(this.actual)}}.bind(this)}).start(1,0)}}},get:function(a){this.request.get(a+"&format=raw")},handleHtml:function(g,b,h,c){var a=$(this.options.mainContentId);if(!$(this.options.baseContainerId+"-"+this.actual)){var f=new Element("div",{id:this.options.baseContainerId+"-"+this.actual});f.innerHTML=h;f.injectInside(a);f.getElements("div[id^="+this.options.basedoorContainerId+"]").each(function(j,d){new DoorPopup(j)});this.show(this.actual)}}});var ScrollableElement=new Class({Implements:[Options,Events],options:{previousId:"revestimentos-nav-anterior",nextId:"revestimentos-nav-seguinte"},increment:125,initialize:function(a){this.setOptions(a);this.bindNavigation();var b=$$("ul[id$=scroll-area]");if(b){b.each(function(d,c){d.store("total",1);d.store("max","124"*(-(d.getChildren("li").length-6)))}.bind(this))}},move:function(c){var b=$("revestimento-seleccionado").getProperty("value");var a=$("revestimentos-conteudo-"+$$("ul.revestimentos-tabs li.seleccionado")[0].getProperty("id").substring("conteudo-".length)+"-scroll-area");if(a){tempinc=this.increment;if((a.retrieve("total")+(this.increment*c))<a.retrieve("max")){tempinc=(a.retrieve("total")-a.retrieve("max"))+5}else{if((a.retrieve("total")+(this.increment*c))>1){tempinc=1}}if((c==1&&a.retrieve("total")<0)||(c==-1&&a.retrieve("total")>a.retrieve("max"))){if(tempinc==1){a.store("total",tempinc)}else{a.store("total",a.retrieve("total")+(tempinc*c))}a.get("tween").cancel();a.tween("margin-left",a.retrieve("total"))}}},bindNavigation:function(){$("revestimentos-nav-anterior").addEvent("click",function(a){new Event(a).preventDefault();this.move(1)}.bind(this));$("revestimentos-nav-seguinte").addEvent("click",function(a){new Event(a).preventDefault();this.move(-1)}.bind(this))}});var TabGroup=new Class({Implements:[Options,Events],options:{tabGroupClass:"revestimentos-tabs",contentBaseId:"revestimentos"},initialize:function(c){this.setOptions(c);var b=$$("."+this.options.tabGroupClass);var d=null;var a=null;if($("mostrar-barra").getProperty("value")=="0"){$("revestimentos-interior-wrapper").setStyles({height:"0px"})}b.each(function(f){d=f.getChildren("li");if(d){d.each(function(g){a=$("revestimentos-"+g.getProperty("id"));g.addEvent("click",function(i,h){i=new Event(i).preventDefault();this.activateTab(h.getProperty("id"))}.bindWithEvent(this,g))}.bind(this))}}.bind(this))},activateTab:function(a){var h=$(a);if(h){var k=$("revestimentos-"+h.getProperty("id"));var d=$("revestimentos-interior-wrapper");if(h&&k&&d){h.addClass("seleccionado");k.addClass("seleccionado");if(d&&d.getStyle("height").toInt()==0){d.tween("height","47px")}else{if(d.retrieve("open")==h.getProperty("id")){d.tween("height","0px")}}var b=$("nav-"+h.getProperty("id"));if(b){if(b.getProperty("value")==1){$("navegacao-revestimentos").setStyle("display","block")}else{$("navegacao-revestimentos").setStyle("display","none")}}d.store("open",h.getProperty("id"));var c=h.getParent().getChildren();var f=c.length;var j=null;for(var g=0;g<f;g++){if(c[g]&&c[g].getProperty("id")!=h.getProperty("id")){c[g].removeClass("seleccionado");j=$("revestimentos-"+c[g].getProperty("id"));if(j){j.store("open",false);j.removeClass("seleccionado")}}}}}}});function getOverUrl(b){if(!b||b.length<=0){return""}var a=b.lastIndexOf(".");return rolloverImage=b.substring(0,a)+"-over"+b.substring(a)}function preload(){var b=$$(".preload");var a=new Array();b.each(function(d,c){a[c]=getOverUrl(cleanupUrl(d.getStyle("background-image")))});new Asset.images(a)}function rollover(){var a=$$(".mm-swap");a.each(function(c){var d=c.getProperty("src");var b=getOverUrl(d);c.addEvent("mouseover",function(){c.setProperty("src",b)}.bind(b));c.addEvent("mouseout",function(){c.setProperty("src",d)}.bind(d))})}function menuToggler(){var b=$$(".menu-toggler");var a=null;if(b){b.each(function(d,c){a=$(d.getProperty("id")+"-content");a.fade("out");if(a){d.addEvent("click",function(g){new Event(g).preventDefault();a=$(this.getProperty("id")+"-content");if(a.getStyle("display")=="none"){var f=$$(".menu-toggler");f.each(function(j,h){toggleCloseContent=$(j.getProperty("id")+"-content");toggleCloseContent.setStyle("display","none");j.getParent().removeClass("seleccionado");j.removeClass("seta-up");j.addClass("seta-down")});this.getParent().addClass("seleccionado");this.addClass("seta-up");this.removeClass("seta-down");a.setStyle("display","block");a.set("tween",{duration:250,onComplete:Class.empty});a.fade("in")}else{this.getParent().removeClass("seleccionado");this.removeClass("seta-up");this.addClass("seta-down");a.set("tween",{duration:250,onComplete:function(){a.setStyle("display","none")}});a.fade("out")}})}})}}function assignDoorPopups(){var a=$$("div[id^=porta]");a.each(function(b,c){new DoorPopup(b)})}function loadNewSlideshow(c,b){var a=getSlideshow(c);if(a){a.load(b)}};

/** sifr.js */
var sIFR=new function(){var self=this;var ClassNames={ACTIVE:"sIFR-active",REPLACED:"sIFR-replaced",IGNORE:"sIFR-ignore",ALTERNATE:"sIFR-alternate",CLASS:"sIFR-class",LAYOUT:"sIFR-layout",FLASH:"sIFR-flash",FIX_FOCUS:"sIFR-fixfocus",DUMMY:"sIFR-dummy"};ClassNames.IGNORE_CLASSES=[ClassNames.REPLACED,ClassNames.IGNORE,ClassNames.ALTERNATE];this.MIN_FONT_SIZE=6;this.MAX_FONT_SIZE=126;this.FLASH_PADDING_BOTTOM=5;this.VERSION="436";this.isActive=false;this.isEnabled=true;this.fixHover=true;this.autoInitialize=true;this.setPrefetchCookie=true;this.cookiePath="/";this.domains=[];this.forceWidth=true;this.fitExactly=false;this.forceTextTransform=true;this.useDomLoaded=true;this.useStyleCheck=false;this.hasFlashClassSet=false;this.repaintOnResize=true;this.replacements=[];var elementCount=0;var isInitialized=false;function Errors(){this.fire=function(id){if(this[id+"Alert"]){alert(this[id+"Alert"])}throw new Error(this[id])};this.isFile="sIFR: Did not activate because the page is being loaded from the filesystem.";this.isFileAlert="Hi!\n\nThanks for using sIFR on your page. Unfortunately sIFR couldn't activate, because it was loaded directly from your computer.\nDue to Flash security restrictions, you need to load sIFR through a web server.\n\nWe apologize for the inconvenience."}function Util(sIFR){function capitalize($){return $.toLocaleUpperCase()}this.normalize=function(str){return str.replace(/\n|\r|\xA0/g,Util.SINGLE_WHITESPACE).replace(/\s+/g,Util.SINGLE_WHITESPACE)};this.textTransform=function(type,str){switch(type){case"uppercase":return str.toLocaleUpperCase();case"lowercase":return str.toLocaleLowerCase();case"capitalize":return str.replace(/^\w|\s\w/g,capitalize)}return str};this.toHexString=function(str){if(str.charAt(0)!="#"||str.length!=4&&str.length!=7){return str}str=str.substring(1);return"0x"+(str.length==3?str.replace(/(.)(.)(.)/,"$1$1$2$2$3$3"):str)};this.toJson=function(obj,strFunc){var json="";switch(typeof(obj)){case"string":json='"'+strFunc(obj)+'"';break;case"number":case"boolean":json=obj.toString();break;case"object":json=[];for(var prop in obj){if(obj[prop]==Object.prototype[prop]){continue}json.push('"'+prop+'":'+this.toJson(obj[prop]))}json="{"+json.join(",")+"}";break}return json};this.convertCssArg=function(arg){if(!arg){return{}}if(typeof(arg)=="object"){if(arg.constructor==Array){arg=arg.join("")}else{return arg}}var obj={};var rules=arg.split("}");for(var i=0;i<rules.length;i++){var $=rules[i].match(/([^\s{]+)\s*\{(.+)\s*;?\s*/);if(!$||$.length!=3){continue}if(!obj[$[1]]){obj[$[1]]={}}var properties=$[2].split(";");for(var j=0;j<properties.length;j++){var $2=properties[j].match(/\s*([^:\s]+)\s*\:\s*([^;]+)/);if(!$2||$2.length!=3){continue}obj[$[1]][$2[1]]=$2[2].replace(/\s+$/,"")}}return obj};this.extractFromCss=function(css,selector,property,remove){var value=null;if(css&&css[selector]&&css[selector][property]){value=css[selector][property];if(remove){delete css[selector][property]}}return value};this.cssToString=function(arg){var css=[];for(var selector in arg){var rule=arg[selector];if(rule==Object.prototype[selector]){continue}css.push(selector,"{");for(var property in rule){if(rule[property]==Object.prototype[property]){continue}var value=rule[property];if(Util.UNIT_REMOVAL_PROPERTIES[property]){value=parseInt(value,10)}css.push(property,":",value,";")}css.push("}")}return css.join("")};this.escape=function(str){return escape(str).replace(/\+/g,"%2B")};this.encodeVars=function(vars){return vars.join("&").replace(/%/g,"%25")};this.copyProperties=function(from,to){for(var property in from){if(to[property]===undefined){to[property]=from[property]}}return to};this.domain=function(){var domain="";try{domain=document.domain}catch(e){}return domain};this.domainMatches=function(domain,match){if(match=="*"||match==domain){return true}var wildcard=match.lastIndexOf("*");if(wildcard>-1){match=match.substr(wildcard+1);var matchPosition=domain.lastIndexOf(match);if(matchPosition>-1&&(matchPosition+match.length)==domain.length){return true}}return false};this.uriEncode=function(s){return encodeURI(decodeURIComponent(s))};this.delay=function(ms,func,scope){var args=Array.prototype.slice.call(arguments,3);setTimeout(function(){func.apply(scope,args)},ms)}}Util.UNIT_REMOVAL_PROPERTIES={leading:true,"margin-left":true,"margin-right":true,"text-indent":true};Util.SINGLE_WHITESPACE=" ";function DomUtil(sIFR){var self=this;function getDimensionFromStyle(node,property,offsetProperty){var dimension=self.getStyleAsInt(node,property,sIFR.ua.ie);if(dimension==0){dimension=node[offsetProperty];for(var i=3;i<arguments.length;i++){dimension-=self.getStyleAsInt(node,arguments[i],true)}}return dimension}this.getBody=function(){return document.getElementsByTagName("body")[0]||null};this.querySelectorAll=function(selector){return window.parseSelector(selector)};this.addClass=function(name,node){if(node){node.className=((node.className||"")==""?"":node.className+" ")+name}};this.removeClass=function(name,node){if(node){node.className=node.className.replace(new RegExp("(^|\\s)"+name+"(\\s|$)"),"").replace(/^\s+|(\s)\s+/g,"$1")}};this.hasClass=function(name,node){return new RegExp("(^|\\s)"+name+"(\\s|$)").test(node.className)};this.hasOneOfClassses=function(names,node){for(var i=0;i<names.length;i++){if(this.hasClass(names[i],node)){return true}}return false};this.ancestorHasClass=function(node,name){node=node.parentNode;while(node&&node.nodeType==1){if(this.hasClass(name,node)){return true}node=node.parentNode}return false};this.create=function(name,className){var node=document.createElementNS?document.createElementNS(DomUtil.XHTML_NS,name):document.createElement(name);if(className){node.className=className}return node};this.getComputedStyle=function(node,property){var result;if(document.defaultView&&document.defaultView.getComputedStyle){var style=document.defaultView.getComputedStyle(node,null);result=style?style[property]:null}else{if(node.currentStyle){result=node.currentStyle[property]}}return result||""};this.getStyleAsInt=function(node,property,requirePx){var value=this.getComputedStyle(node,property);if(requirePx&&!/px$/.test(value)){return 0}return parseInt(value)||0};this.getWidthFromStyle=function(node){return getDimensionFromStyle(node,"width","offsetWidth","paddingRight","paddingLeft","borderRightWidth","borderLeftWidth")};this.getHeightFromStyle=function(node){return getDimensionFromStyle(node,"height","offsetHeight","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth")};this.getDimensions=function(node){var width=node.offsetWidth;var height=node.offsetHeight;if(width==0||height==0){for(var i=0;i<node.childNodes.length;i++){var child=node.childNodes[i];if(child.nodeType!=1){continue}width=Math.max(width,child.offsetWidth);height=Math.max(height,child.offsetHeight)}}return{width:width,height:height}};this.getViewport=function(){return{width:window.innerWidth||document.documentElement.clientWidth||this.getBody().clientWidth,height:window.innerHeight||document.documentElement.clientHeight||this.getBody().clientHeight}};this.blurElement=function(element){try{element.blur();return}catch(e){}var input=this.create("input");input.style.width="0px";input.style.height="0px";element.parentNode.appendChild(input);input.focus();input.blur();input.parentNode.removeChild(input)}}DomUtil.XHTML_NS="http://www.w3.org/1999/xhtml";function UserAgentDetection(sIFR){var ua=navigator.userAgent.toLowerCase();var product=(navigator.product||"").toLowerCase();var platform=navigator.platform.toLowerCase();this.parseVersion=UserAgentDetection.parseVersion;this.macintosh=/^mac/.test(platform);this.windows=/^win/.test(platform);this.linux=/^linux/.test(platform);this.quicktime=false;this.opera=/opera/.test(ua);this.konqueror=/konqueror/.test(ua);this.ie=false
/*@cc_on || true @*/
;this.ieSupported=this.ie&&!/ppc|smartphone|iemobile|msie\s5\.5/.test(ua)
/*@cc_on && @_jscript_version >= 5.5 @*/
;this.ieWin=this.windows&&this.ie
/*@cc_on && @_jscript_version >= 5.1 @*/
;this.windows=this.windows&&(!this.ie||this.ieWin);this.ieMac=this.macintosh&&this.ie
/*@cc_on && @_jscript_version < 5.1 @*/
;this.macintosh=this.macintosh&&(!this.ie||this.ieMac);this.safari=/safari/.test(ua);this.webkit=!this.konqueror&&/applewebkit/.test(ua);this.khtml=this.webkit||this.konqueror;this.gecko=!this.khtml&&product=="gecko";this.ieVersion=this.ie&&/.*msie\s(\d\.\d)/.exec(ua)?this.parseVersion(RegExp.$1):"0";this.operaVersion=this.opera&&/.*opera(\s|\/)(\d+\.\d+)/.exec(ua)?this.parseVersion(RegExp.$2):"0";this.webkitVersion=this.webkit&&/.*applewebkit\/(\d+).*/.exec(ua)?this.parseVersion(RegExp.$1):"0";this.geckoVersion=this.gecko&&/.*rv:\s*([^\)]+)\)\s+gecko/.exec(ua)?this.parseVersion(RegExp.$1):"0";this.konquerorVersion=this.konqueror&&/.*konqueror\/([\d\.]+).*/.exec(ua)?this.parseVersion(RegExp.$1):"0";this.flashVersion=0;if(this.ieWin){var axo;var stop=false;try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(e){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");this.flashVersion=this.parseVersion("6");axo.AllowScriptAccess="always"}catch(e){stop=this.flashVersion==this.parseVersion("6")}if(!stop){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(e){}}}if(!stop&&axo){this.flashVersion=this.parseVersion((axo.GetVariable("$version")||"").replace(/^\D+(\d+)\D+(\d+)\D+(\d+).*/g,"$1.$2.$3"))}}else{if(navigator.plugins&&navigator.plugins["Shockwave Flash"]){var d=navigator.plugins["Shockwave Flash"].description.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var v=d.replace(/^\D*(\d+\.\d+).*$/,"$1");if(/r/.test(d)){v+=d.replace(/^.*r(\d*).*$/,".$1")}else{if(/d/.test(d)){v+=".0"}}this.flashVersion=this.parseVersion(v);var foundEnabled=false;for(var i=0,valid=this.flashVersion>=UserAgentDetection.MIN_FLASH_VERSION;valid&&i<navigator.mimeTypes.length;i++){var mime=navigator.mimeTypes[i];if(mime.type!="application/x-shockwave-flash"){continue}if(mime.enabledPlugin){foundEnabled=true;if(mime.enabledPlugin.description.toLowerCase().indexOf("quicktime")>-1){valid=false;this.quicktime=true}}}if(this.quicktime||!foundEnabled){this.flashVersion=this.parseVersion("0")}}}this.flash=this.flashVersion>=UserAgentDetection.MIN_FLASH_VERSION;this.transparencySupport=this.macintosh||this.windows||this.linux&&(this.flashVersion>=this.parseVersion("10")&&(this.gecko&&this.geckoVersion>=this.parseVersion("1.9")||this.opera));this.computedStyleSupport=this.ie||!!document.defaultView.getComputedStyle;this.fixFocus=this.gecko&&this.windows;this.nativeDomLoaded=this.gecko||this.webkit&&this.webkitVersion>=this.parseVersion("525")||this.konqueror&&this.konquerorMajor>this.parseVersion("03")||this.opera;this.mustCheckStyle=this.khtml||this.opera;this.forcePageLoad=this.webkit&&this.webkitVersion<this.parseVersion("523");this.properDocument=typeof(document.location)=="object";this.supported=this.flash&&this.properDocument&&(!this.ie||this.ieSupported)&&this.computedStyleSupport&&(!this.opera||this.operaVersion>=this.parseVersion("9.61"))&&(!this.webkit||this.webkitVersion>=this.parseVersion("412"))&&(!this.gecko||this.geckoVersion>=this.parseVersion("1.8.0.12"))&&(!this.konqueror)}UserAgentDetection.parseVersion=function(s){return s.replace(/(^|\D)(\d+)(?=\D|$)/g,function(s,nonDigit,digits){s=nonDigit;for(var i=4-digits.length;i>=0;i--){s+="0"}return s+digits})};UserAgentDetection.MIN_FLASH_VERSION=UserAgentDetection.parseVersion("8");function FragmentIdentifier(sIFR){this.fix=sIFR.ua.ieWin&&window.location.hash!="";var cachedTitle;this.cache=function(){cachedTitle=document.title};function doFix(){document.title=cachedTitle}this.restore=function(){if(this.fix){setTimeout(doFix,0)}}}function PageLoad(sIFR){var dummy=null;function pollLoad(){try{if(sIFR.ua.ie||document.readyState!="loaded"&&document.readyState!="complete"){document.documentElement.doScroll("left")}}catch(e){return setTimeout(pollLoad,10)}afterDomLoad()}function afterDomLoad(){if(sIFR.useStyleCheck){checkStyle()}else{if(!sIFR.ua.mustCheckStyle){fire(null,true)}}}function checkStyle(){dummy=sIFR.dom.create("div",ClassNames.DUMMY);sIFR.dom.getBody().appendChild(dummy);pollStyle()}function pollStyle(){if(sIFR.dom.getComputedStyle(dummy,"marginLeft")=="42px"){afterStyle()}else{setTimeout(pollStyle,10)}}function afterStyle(){if(dummy&&dummy.parentNode){dummy.parentNode.removeChild(dummy)}dummy=null;fire(null,true)}function fire(evt,preserveReplacements){sIFR.initialize(preserveReplacements);if(evt&&evt.type=="load"){if(document.removeEventListener){document.removeEventListener("DOMContentLoaded",fire,false)}if(window.removeEventListener){window.removeEventListener("load",fire,false)}}}function verifyUnload(){sIFR.prepareClearReferences();if(document.readyState=="interactive"){document.attachEvent("onstop",unloadByStop);setTimeout(function(){document.detachEvent("onstop",unloadByStop)},0)}}function unloadByStop(){document.detachEvent("onstop",unloadByStop);fireUnload()}function fireUnload(){sIFR.clearReferences()}this.attach=function(){if(window.addEventListener){window.addEventListener("load",fire,false)}else{window.attachEvent("onload",fire)}if(!sIFR.useDomLoaded||sIFR.ua.forcePageLoad||sIFR.ua.ie&&window.top!=window){return}if(sIFR.ua.nativeDomLoaded){document.addEventListener("DOMContentLoaded",afterDomLoad,false)}else{if(sIFR.ua.ie||sIFR.ua.khtml){pollLoad()}}};this.attachUnload=function(){if(!sIFR.ua.ie){return}window.attachEvent("onbeforeunload",verifyUnload);window.attachEvent("onunload",fireUnload)}}var PREFETCH_COOKIE="sifrFetch";function Prefetch(sIFR){var hasPrefetched=false;this.fetchMovies=function(movies){if(sIFR.setPrefetchCookie&&new RegExp(";?"+PREFETCH_COOKIE+"=true;?").test(document.cookie)){return}try{hasPrefetched=true;prefetch(movies)}catch(e){}if(sIFR.setPrefetchCookie){document.cookie=PREFETCH_COOKIE+"=true;path="+sIFR.cookiePath}};this.clear=function(){if(!hasPrefetched){return}try{var nodes=document.getElementsByTagName("script");for(var i=nodes.length-1;i>=0;i--){var node=nodes[i];if(node.type=="sifr/prefetch"){node.parentNode.removeChild(node)}}}catch(e){}};function prefetch(args){for(var i=0;i<args.length;i++){document.write('<script defer type="sifr/prefetch" src="'+args[i].src+'"><\/script>')}}}function BrokenFlashIE(sIFR){var active=sIFR.ua.ie;var fixFlash=active&&sIFR.ua.flashVersion<sIFR.ua.parseVersion("9.0.115");var resetMovies={};var registry={};this.fixFlash=fixFlash;this.register=function(flashNode){if(!active){return}var id=flashNode.getAttribute("id");this.cleanup(id,false);registry[id]=flashNode;delete resetMovies[id];if(fixFlash){window[id]=flashNode}};this.reset=function(){if(!active){return false}for(var i=0;i<sIFR.replacements.length;i++){var flash=sIFR.replacements[i];var flashNode=registry[flash.id];if(!resetMovies[flash.id]&&(!flashNode.parentNode||flashNode.parentNode.nodeType==11)){flash.resetMovie();resetMovies[flash.id]=true}}return true};this.cleanup=function(id,usePlaceholder){var node=registry[id];if(!node){return}for(var expando in node){if(typeof(node[expando])=="function"){node[expando]=null}}registry[id]=null;if(fixFlash){window[id]=null}if(node.parentNode){if(usePlaceholder&&node.parentNode.nodeType==1){var placeholder=document.createElement("div");placeholder.style.width=node.offsetWidth+"px";placeholder.style.height=node.offsetHeight+"px";node.parentNode.replaceChild(placeholder,node)}else{node.parentNode.removeChild(node)}}};this.prepareClearReferences=function(){if(!fixFlash){return}__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}};this.clearReferences=function(){if(fixFlash){var objects=document.getElementsByTagName("object");for(var i=objects.length-1;i>=0;i--){registry[objects[i].getAttribute("id")]=objects[i]}}for(var id in registry){if(Object.prototype[id]!=registry[id]){this.cleanup(id,true)}}}}function FlashInteractor(sIFR,id,vars,forceWidth,events){this.sIFR=sIFR;this.id=id;this.vars=vars;this.movie=null;this.__forceWidth=forceWidth;this.__events=events;this.__resizing=0}FlashInteractor.prototype={getFlashElement:function(){return document.getElementById(this.id)},getAlternate:function(){return document.getElementById(this.id+"_alternate")},getAncestor:function(){var ancestor=this.getFlashElement().parentNode;return !this.sIFR.dom.hasClass(ClassNames.FIX_FOCUS,ancestor)?ancestor:ancestor.parentNode},available:function(){var flashNode=this.getFlashElement();return flashNode&&flashNode.parentNode},call:function(type){var flashNode=this.getFlashElement();if(!flashNode[type]){return false}return Function.prototype.apply.call(flashNode[type],flashNode,Array.prototype.slice.call(arguments,1))},attempt:function(){if(!this.available()){return false}try{this.call.apply(this,arguments)}catch(e){if(this.sIFR.debug){throw e}return false}return true},updateVars:function(name,value){for(var i=0;i<this.vars.length;i++){if(this.vars[i].split("=")[0]==name){this.vars[i]=name+"="+value;break}}var vars=this.sIFR.util.encodeVars(this.vars);this.movie.injectVars(this.getFlashElement(),vars);this.movie.injectVars(this.movie.html,vars)},storeSize:function(type,value){this.movie.setSize(type,value);this.updateVars(type,value)},fireEvent:function(name){if(this.available()&&this.__events[name]){this.sIFR.util.delay(0,this.__events[name],this,this)}},resizeFlashElement:function(height,width,firstResize){if(!this.available()){return}this.__resizing++;var flashNode=this.getFlashElement();flashNode.setAttribute("height",height);this.getAncestor().style.minHeight="";this.updateVars("renderheight",height);this.storeSize("height",height);if(width!==null){flashNode.setAttribute("width",width);this.movie.setSize("width",width)}if(this.__events.onReplacement){this.sIFR.util.delay(0,this.__events.onReplacement,this,this);delete this.__events.onReplacement}if(firstResize){this.sIFR.util.delay(0,function(){this.attempt("scaleMovie");this.__resizing--},this)}else{this.__resizing--}},blurFlashElement:function(){if(this.available()){this.sIFR.dom.blurElement(this.getFlashElement())}},resetMovie:function(){this.sIFR.util.delay(0,this.movie.reset,this.movie,this.getFlashElement(),this.getAlternate())},resizeAfterScale:function(){if(this.available()&&this.__resizing==0){this.sIFR.util.delay(0,this.resize,this)}},resize:function(){if(!this.available()){return}this.__resizing++;var flashNode=this.getFlashElement();var currentWidth=flashNode.offsetWidth;if(currentWidth==0){return}var originalWidth=flashNode.getAttribute("width");var originalHeight=flashNode.getAttribute("height");var ancestor=this.getAncestor();var minHeight=this.sIFR.dom.getHeightFromStyle(ancestor);flashNode.style.width="1px";flashNode.style.height="1px";ancestor.style.minHeight=minHeight+"px";var nodes=this.getAlternate().childNodes;var clones=[];for(var i=0;i<nodes.length;i++){var node=nodes[i].cloneNode(true);clones.push(node);ancestor.appendChild(node)}var width=this.sIFR.dom.getWidthFromStyle(ancestor);for(var i=0;i<clones.length;i++){ancestor.removeChild(clones[i])}flashNode.style.width=flashNode.style.height=ancestor.style.minHeight="";flashNode.setAttribute("width",this.__forceWidth?width:originalWidth);flashNode.setAttribute("height",originalHeight);if(sIFR.ua.ie){flashNode.style.display="none";var repaint=flashNode.offsetHeight;flashNode.style.display=""}if(width!=currentWidth){if(this.__forceWidth){this.storeSize("width",width)}this.attempt("resize",width)}this.__resizing--},replaceText:function(content,alternate){var escapedContent=this.sIFR.util.escape(content);if(!this.attempt("replaceText",escapedContent)){return false}this.updateVars("content",escapedContent);var node=this.getAlternate();if(alternate){while(node.firstChild){node.removeChild(node.firstChild)}for(var i=0;i<alternate.length;i++){node.appendChild(alternate[i])}}else{try{node.innerHTML=content}catch(e){}}return true},changeCSS:function(css){css=this.sIFR.util.escape(this.sIFR.util.cssToString(this.sIFR.util.convertCssArg(css)));this.updateVars("css",css);return this.attempt("changeCSS",css)},remove:function(){if(this.movie&&this.available()){this.movie.remove(this.getFlashElement(),this.id)}}};var MovieCreator=new function(){this.create=function(sIFR,brokenFlash,node,fixFocus,id,src,width,height,vars,wmode,backgroundColor){var klass=sIFR.ua.ie?IEFlashMovie:FlashMovie;return new klass(sIFR,brokenFlash,node,fixFocus,id,src,width,height,["flashvars",vars,"wmode",wmode,"bgcolor",backgroundColor,"allowScriptAccess","always","quality","best"])};function FlashMovie(sIFR,brokenFlash,node,fixFocus,id,src,width,height,params){var object=sIFR.dom.create("object",ClassNames.FLASH);var attrs=["type","application/x-shockwave-flash","id",id,"name",id,"data",src,"width",width,"height",height];for(var i=0;i<attrs.length;i+=2){object.setAttribute(attrs[i],attrs[i+1])}var insertion=object;if(fixFocus){insertion=dom.create("div",ClassNames.FIX_FOCUS);insertion.appendChild(object)}for(var i=0;i<params.length;i+=2){if(params[i]=="name"){continue}var param=dom.create("param");param.setAttribute("name",params[i]);param.setAttribute("value",params[i+1]);object.appendChild(param)}node.style.minHeight=height+"px";while(node.firstChild){node.removeChild(node.firstChild)}node.appendChild(insertion);this.html=insertion.cloneNode(true)}FlashMovie.prototype={reset:function(flashNode,alternate){flashNode.parentNode.replaceChild(this.html.cloneNode(true),flashNode)},remove:function(flashNode,id){flashNode.parentNode.removeChild(flashNode)},setSize:function(type,value){this.html.setAttribute(type,value)},injectVars:function(flash,encodedVars){var params=flash.getElementsByTagName("param");for(var i=0;i<params.length;i++){if(params[i].getAttribute("name")=="flashvars"){params[i].setAttribute("value",encodedVars);break}}}};function IEFlashMovie(sIFR,brokenFlash,node,fixFocus,id,src,width,height,params){this.dom=sIFR.dom;this.broken=brokenFlash;this.html='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="'+id+'" width="'+width+'" height="'+height+'" class="'+ClassNames.FLASH+'"><param name="movie" value="'+src+'"></param></object>';var paramsHtml="";for(var i=0;i<params.length;i+=2){paramsHtml+='<param name="'+params[i]+'" value="'+params[i+1]+'"></param>'}this.html=this.html.replace(/(<\/object>)/,paramsHtml+"$1");node.style.minHeight=height+"px";node.innerHTML=this.html;this.broken.register(node.firstChild)}IEFlashMovie.prototype={reset:function(flashNode,alternate){alternate=alternate.cloneNode(true);var parent=flashNode.parentNode;parent.innerHTML=this.html;this.broken.register(parent.firstChild);parent.appendChild(alternate)},remove:function(flashNode,id){this.broken.cleanup(id)},setSize:function(type,value){this.html=this.html.replace(type=="height"?/(height)="\d+"/:/(width)="\d+"/,'$1="'+value+'"')},injectVars:function(flash,encodedVars){if(flash!=this.html){return}this.html=this.html.replace(/(flashvars(=|\"\svalue=)\")[^\"]+/,"$1"+encodedVars)}}};this.errors=new Errors(self);var util=this.util=new Util(self);var dom=this.dom=new DomUtil(self);var ua=this.ua=new UserAgentDetection(self);var hacks={fragmentIdentifier:new FragmentIdentifier(self),pageLoad:new PageLoad(self),prefetch:new Prefetch(self),brokenFlashIE:new BrokenFlashIE(self)};this.__resetBrokenMovies=hacks.brokenFlashIE.reset;var replaceKwargsStore={kwargs:[],replaceAll:function(preserve){for(var i=0;i<this.kwargs.length;i++){self.replace(this.kwargs[i])}if(!preserve){this.kwargs=[]}}};this.activate=function(){if(Browser.Engine.trident4){return}if(!ua.supported||!this.isEnabled||this.isActive||!isValidDomain()||isFile()){return}hacks.prefetch.fetchMovies(arguments);this.isActive=true;this.setFlashClass();hacks.fragmentIdentifier.cache();hacks.pageLoad.attachUnload();if(!this.autoInitialize){return}hacks.pageLoad.attach()};this.setFlashClass=function(){if(this.hasFlashClassSet){return}dom.addClass(ClassNames.ACTIVE,dom.getBody()||document.documentElement);this.hasFlashClassSet=true};this.removeFlashClass=function(){if(!this.hasFlashClassSet){return}dom.removeClass(ClassNames.ACTIVE,dom.getBody());dom.removeClass(ClassNames.ACTIVE,document.documentElement);this.hasFlashClassSet=false};this.initialize=function(preserveReplacements){if(!this.isActive||!this.isEnabled){return}if(isInitialized){if(!preserveReplacements){replaceKwargsStore.replaceAll(false)}return}isInitialized=true;replaceKwargsStore.replaceAll(preserveReplacements);if(self.repaintOnResize){if(window.addEventListener){window.addEventListener("resize",resize,false)}else{window.attachEvent("onresize",resize)}}hacks.prefetch.clear()};this.replace=function(kwargs,mergeKwargs){if(!ua.supported){return}if(mergeKwargs){kwargs=util.copyProperties(kwargs,mergeKwargs)}if(!isInitialized){return replaceKwargsStore.kwargs.push(kwargs)}if(this.onReplacementStart){this.onReplacementStart(kwargs)}var nodes=kwargs.elements||dom.querySelectorAll(kwargs.selector);if(nodes.length==0){return}var src=getSource(kwargs.src);var css=util.convertCssArg(kwargs.css);var filters=getFilters(kwargs.filters);var forceSingleLine=kwargs.forceSingleLine===true;var preventWrap=kwargs.preventWrap===true&&!forceSingleLine;var fitExactly=forceSingleLine||(kwargs.fitExactly==null?this.fitExactly:kwargs.fitExactly)===true;var forceWidth=fitExactly||(kwargs.forceWidth==null?this.forceWidth:kwargs.forceWidth)===true;var ratios=kwargs.ratios||[];var pixelFont=kwargs.pixelFont===true;var tuneHeight=parseInt(kwargs.tuneHeight)||0;var events=!!kwargs.onRelease||!!kwargs.onRollOver||!!kwargs.onRollOut;if(fitExactly){util.extractFromCss(css,".sIFR-root","text-align",true)}var fontSize=util.extractFromCss(css,".sIFR-root","font-size",true)||"0";var backgroundColor=util.extractFromCss(css,".sIFR-root","background-color",true)||"#FFFFFF";var kerning=util.extractFromCss(css,".sIFR-root","kerning",true)||"";var opacity=util.extractFromCss(css,".sIFR-root","opacity",true)||"100";var cursor=util.extractFromCss(css,".sIFR-root","cursor",true)||"default";var leading=parseInt(util.extractFromCss(css,".sIFR-root","leading"))||0;var gridFitType=kwargs.gridFitType||(util.extractFromCss(css,".sIFR-root","text-align")=="right")?"subpixel":"pixel";var textTransform=this.forceTextTransform===false?"none":util.extractFromCss(css,".sIFR-root","text-transform",true)||"none";fontSize=/^\d+(px)?$/.test(fontSize)?parseInt(fontSize):0;opacity=parseFloat(opacity)<1?100*parseFloat(opacity):opacity;var cssText=kwargs.modifyCss?"":util.cssToString(css);var wmode=kwargs.wmode||"";if(!wmode){if(kwargs.transparent){wmode="transparent"}else{if(kwargs.opaque){wmode="opaque"}}}if(wmode=="transparent"){if(!ua.transparencySupport){wmode="opaque"}else{backgroundColor="transparent"}}else{if(backgroundColor=="transparent"){backgroundColor="#FFFFFF"}}for(var i=0;i<nodes.length;i++){var node=nodes[i];if(dom.hasOneOfClassses(ClassNames.IGNORE_CLASSES,node)||dom.ancestorHasClass(node,ClassNames.ALTERNATE)){continue}var dimensions=dom.getDimensions(node);var height=dimensions.height;var width=dimensions.width;var display=dom.getComputedStyle(node,"display");if(!height||!width||!display||display=="none"){continue}width=dom.getWidthFromStyle(node);var size,lines;if(!fontSize){var calculation=calculate(node);size=Math.min(this.MAX_FONT_SIZE,Math.max(this.MIN_FONT_SIZE,calculation.fontSize));if(pixelFont){size=Math.max(8,8*Math.round(size/8))}lines=calculation.lines}else{size=fontSize;lines=1}var alternate=dom.create("span",ClassNames.ALTERNATE);var contentNode=node.cloneNode(true);node.parentNode.appendChild(contentNode);for(var j=0,l=contentNode.childNodes.length;j<l;j++){var child=contentNode.childNodes[j];if(!/^(style|script)$/i.test(child.nodeName)){alternate.appendChild(child.cloneNode(true))}}if(kwargs.modifyContent){kwargs.modifyContent(contentNode,kwargs.selector)}if(kwargs.modifyCss){cssText=kwargs.modifyCss(css,contentNode,kwargs.selector)}var content=parseContent(contentNode,textTransform,kwargs.uriEncode);contentNode.parentNode.removeChild(contentNode);if(kwargs.modifyContentString){content.text=kwargs.modifyContentString(content.text,kwargs.selector)}if(content.text==""){continue}var renderHeight=Math.round(lines*getRatio(size,ratios)*size)+this.FLASH_PADDING_BOTTOM+tuneHeight;if(lines>1&&leading){renderHeight+=Math.round((lines-1)*leading)}var forcedWidth=forceWidth?width:"100%";var id="sIFR_replacement_"+elementCount++;var vars=["id="+id,"content="+util.escape(content.text),"width="+width,"renderheight="+renderHeight,"link="+util.escape(content.primaryLink.href||""),"target="+util.escape(content.primaryLink.target||""),"size="+size,"css="+util.escape(cssText),"cursor="+cursor,"tunewidth="+(kwargs.tuneWidth||0),"tuneheight="+tuneHeight,"offsetleft="+(kwargs.offsetLeft||""),"offsettop="+(kwargs.offsetTop||""),"fitexactly="+fitExactly,"preventwrap="+preventWrap,"forcesingleline="+forceSingleLine,"antialiastype="+(kwargs.antiAliasType||""),"thickness="+(kwargs.thickness||""),"sharpness="+(kwargs.sharpness||""),"kerning="+kerning,"gridfittype="+gridFitType,"flashfilters="+filters,"opacity="+opacity,"blendmode="+(kwargs.blendMode||""),"selectable="+(kwargs.selectable==null||wmode!=""&&!sIFR.ua.macintosh&&sIFR.ua.gecko&&sIFR.ua.geckoVersion>=sIFR.ua.parseVersion("1.9")?"true":kwargs.selectable===true),"fixhover="+(this.fixHover===true),"events="+events,"delayrun="+hacks.brokenFlashIE.fixFlash,"version="+this.VERSION];var encodedVars=util.encodeVars(vars);var interactor=new FlashInteractor(self,id,vars,forceWidth,{onReplacement:kwargs.onReplacement,onRollOver:kwargs.onRollOver,onRollOut:kwargs.onRollOut,onRelease:kwargs.onRelease});interactor.movie=MovieCreator.create(sIFR,hacks.brokenFlashIE,node,ua.fixFocus&&kwargs.fixFocus,id,src,forcedWidth,renderHeight,encodedVars,wmode,backgroundColor);this.replacements.push(interactor);this.replacements[id]=interactor;if(kwargs.selector){if(!this.replacements[kwargs.selector]){this.replacements[kwargs.selector]=[interactor]}else{this.replacements[kwargs.selector].push(interactor)}}alternate.setAttribute("id",id+"_alternate");node.appendChild(alternate);dom.addClass(ClassNames.REPLACED,node)}hacks.fragmentIdentifier.restore()};this.getReplacementByFlashElement=function(node){for(var i=0;i<self.replacements.length;i++){if(self.replacements[i].id==node.getAttribute("id")){return self.replacements[i]}}};this.redraw=function(){for(var i=0;i<self.replacements.length;i++){self.replacements[i].resetMovie()}};this.prepareClearReferences=function(){hacks.brokenFlashIE.prepareClearReferences()};this.clearReferences=function(){hacks.brokenFlashIE.clearReferences();hacks=null;replaceKwargsStore=null;delete self.replacements};function isValidDomain(){if(self.domains.length==0){return true}var domain=util.domain();for(var i=0;i<self.domains.length;i++){if(util.domainMatches(domain,self.domains[i])){return true}}return false}function isFile(){if(document.location.protocol=="file:"){if(self.debug){self.errors.fire("isFile")}return true}return false}function getSource(src){if(ua.ie&&src.charAt(0)=="/"){src=window.location.toString().replace(/([^:]+)(:\/?\/?)([^\/]+).*/,"$1$2$3")+src}return src}function getRatio(size,ratios){for(var i=0;i<ratios.length;i+=2){if(size<=ratios[i]){return ratios[i+1]}}return ratios[ratios.length-1]||1}function getFilters(obj){var filters=[];for(var filter in obj){if(obj[filter]==Object.prototype[filter]){continue}var properties=obj[filter];filter=[filter.replace(/filter/i,"")+"Filter"];for(var property in properties){if(properties[property]==Object.prototype[property]){continue}filter.push(property+":"+util.escape(util.toJson(properties[property],util.toHexString)))}filters.push(filter.join(","))}return util.escape(filters.join(";"))}function resize(evt){var current=resize.viewport;var viewport=dom.getViewport();if(current&&viewport.width==current.width&&viewport.height==current.height){return}resize.viewport=viewport;if(self.replacements.length==0){return}if(resize.timer){clearTimeout(resize.timer)}resize.timer=setTimeout(function(){delete resize.timer;for(var i=0;i<self.replacements.length;i++){self.replacements[i].resize()}},200)}function calculate(node){var fontSize=dom.getComputedStyle(node,"fontSize");var deduce=fontSize.indexOf("px")==-1;var html=node.innerHTML;if(deduce){node.innerHTML="X"}node.style.paddingTop=node.style.paddingBottom=node.style.borderTopWidth=node.style.borderBottomWidth="0px";node.style.lineHeight="2em";node.style.display="block";fontSize=deduce?node.offsetHeight/2:parseInt(fontSize,10);if(deduce){node.innerHTML=html}var lines=Math.round(node.offsetHeight/(2*fontSize));node.style.paddingTop=node.style.paddingBottom=node.style.borderTopWidth=node.style.borderBottomWidth=node.style.lineHeight=node.style.display="";if(isNaN(lines)||!isFinite(lines)||lines==0){lines=1}return{fontSize:fontSize,lines:lines}}function parseContent(source,textTransform,uriEncode){uriEncode=uriEncode||util.uriEncode;var stack=[],content=[];var primaryLink=null;var nodes=source.childNodes;var whiteSpaceEnd=false,firstText=false;var i=0;while(i<nodes.length){var node=nodes[i];if(node.nodeType==3){var text=util.textTransform(textTransform,util.normalize(node.nodeValue)).replace(/</g,"&lt;");if(whiteSpaceEnd&&firstText){text=text.replace(/^\s+/,"")}content.push(text);whiteSpaceEnd=/\s$/.test(text);firstText=false}if(node.nodeType==1&&!/^(style|script)$/i.test(node.nodeName)){var attributes=[];var nodeName=node.nodeName.toLowerCase();var className=node.className||"";if(/\s+/.test(className)){if(className.indexOf(ClassNames.CLASS)>-1){className=className.match("(\\s|^)"+ClassNames.CLASS+"-([^\\s$]*)(\\s|$)")[2]}else{className=className.match(/^([^\s]+)/)[1]}}if(className!=""){attributes.push('class="'+className+'"')}if(nodeName=="a"){var href=uriEncode(node.getAttribute("href")||"");var target=node.getAttribute("target")||"";attributes.push('href="'+href+'"','target="'+target+'"');if(!primaryLink){primaryLink={href:href,target:target}}}content.push("<"+nodeName+(attributes.length>0?" ":"")+attributes.join(" ")+">");firstText=true;if(node.hasChildNodes()){stack.push(i);i=0;nodes=node.childNodes;continue}else{if(!/^(br|img)$/i.test(node.nodeName)){content.push("</",node.nodeName.toLowerCase(),">")}}}if(stack.length>0&&!node.nextSibling){do{i=stack.pop();nodes=node.parentNode.parentNode.childNodes;node=nodes[i];if(node){content.push("</",node.nodeName.toLowerCase(),">")}}while(i==nodes.length-1&&stack.length>0)}i++}return{text:content.join("").replace(/^\s+|\s+$|\s*(<br>)\s*/g,"$1"),primaryLink:primaryLink||{}}}};var parseSelector=(function(){var b=/\s*,\s*/;var a=/\s*([\s>+~(),]|^|$)\s*/g;var l=/([\s>+~,]|[^(]\+|^)([#.:@])/g;var f=/(^|\))[^\s>+~]/g;var m=/(\)|^)/;var k=/[\s#.:>+~()@]|[^\s#.:>+~()@]+/g;function h(r,p){p=p||document.documentElement;var s=r.split(b),x=[];for(var u=0;u<s.length;u++){var n=[p],w=g(s[u]);for(var t=0;t<w.length;){var q=w[t++],o=w[t++],v="";if(w[t]=="("){while(w[t++]!=")"&&t<w.length){v+=w[t]}v=v.slice(0,-1)}n=i(n,q,o,v)}x=x.concat(n)}return x}function g(n){var o=n.replace(a,"$1").replace(l,"$1*$2").replace(f,d);return o.match(k)||[]}function d(n){return n.replace(m,"$1 ")}function i(n,p,q,o){return(h.selectors[p])?h.selectors[p](n,q,o):[]}var e={toArray:function(o){var n=[];for(var p=0;p<o.length;p++){n.push(o[p])}return n}};var c={isTag:function(o,n){return(n=="*")||(n.toLowerCase()==o.nodeName.toLowerCase())},previousSiblingElement:function(n){do{n=n.previousSibling}while(n&&n.nodeType!=1);return n},nextSiblingElement:function(n){do{n=n.nextSibling}while(n&&n.nodeType!=1);return n},hasClass:function(n,o){return(o.className||"").match("(^|\\s)"+n+"(\\s|$)")},getByTag:function(n,o){return o.getElementsByTagName(n)}};var j={"#":function(n,p){for(var o=0;o<n.length;o++){if(n[o].getAttribute("id")==p){return[n[o]]}}return[]}," ":function(o,q){var n=[];for(var p=0;p<o.length;p++){n=n.concat(e.toArray(c.getByTag(q,o[p])))}return n},">":function(o,r){var n=[];for(var q=0,s;q<o.length;q++){s=o[q];for(var p=0,t;p<s.childNodes.length;p++){t=s.childNodes[p];if(t.nodeType==1&&c.isTag(t,r)){n.push(t)}}}return n},".":function(o,q){var n=[];for(var p=0,r;p<o.length;p++){r=o[p];if(c.hasClass([q],r)){n.push(r)}}return n},":":function(n,p,o){return(h.pseudoClasses[p])?h.pseudoClasses[p](n,o):[]}};h.selectors=j;h.pseudoClasses={};h.util=e;h.dom=c;return h})();

/* 
 * flowplayer.js 3.1.4. The Flowplayer API
 * 
 * Copyright 2009 Flowplayer Oy
 * 
 * This file is part of Flowplayer.
 * 
 * Flowplayer is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Flowplayer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Flowplayer.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * Date: 2009-09-04 11:42:25 +0000 (Fri, 04 Sep 2009)
 * Revision: 316 
 */
(function(){function g(o){console.log("$f.fireEvent",[].slice.call(o))}function k(q){if(!q||typeof q!="object"){return q}var o=new q.constructor();for(var p in q){if(q.hasOwnProperty(p)){o[p]=k(q[p])}}return o}function m(t,q){if(!t){return}var o,p=0,r=t.length;if(r===undefined){for(o in t){if(q.call(t[o],o,t[o])===false){break}}}else{for(var s=t[0];p<r&&q.call(s,p,s)!==false;s=t[++p]){}}return t}function c(o){return document.getElementById(o)}function i(q,p,o){if(typeof p!="object"){return q}if(q&&p){m(p,function(r,s){if(!o||typeof s!="function"){q[r]=s}})}return q}function n(s){var q=s.indexOf(".");if(q!=-1){var p=s.substring(0,q)||"*";var o=s.substring(q+1,s.length);var r=[];m(document.getElementsByTagName(p),function(){if(this.className&&this.className.indexOf(o)!=-1){r.push(this)}});return r}}function f(o){o=o||window.event;if(o.preventDefault){o.stopPropagation();o.preventDefault()}else{o.returnValue=false;o.cancelBubble=true}return false}function j(q,o,p){q[o]=q[o]||[];q[o].push(p)}function e(){return"_"+(""+Math.random()).substring(2,10)}var h=function(t,r,s){var q=this;var p={};var u={};q.index=r;if(typeof t=="string"){t={url:t}}i(this,t,true);m(("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop").split(","),function(){var v="on"+this;if(v.indexOf("*")!=-1){v=v.substring(0,v.length-1);var w="onBefore"+v.substring(2);q[w]=function(x){j(u,w,x);return q}}q[v]=function(x){j(u,v,x);return q};if(r==-1){if(q[w]){s[w]=q[w]}if(q[v]){s[v]=q[v]}}});i(this,{onCuepoint:function(x,w){if(arguments.length==1){p.embedded=[null,x];return q}if(typeof x=="number"){x=[x]}var v=e();p[v]=[x,w];if(s.isLoaded()){s._api().fp_addCuepoints(x,r,v)}return q},update:function(w){i(q,w);if(s.isLoaded()){s._api().fp_updateClip(w,r)}var v=s.getConfig();var x=(r==-1)?v.clip:v.playlist[r];i(x,w,true)},_fireEvent:function(v,y,w,A){if(v=="onLoad"){m(p,function(B,C){if(C[0]){s._api().fp_addCuepoints(C[0],r,B)}});return false}A=A||q;if(v=="onCuepoint"){var z=p[y];if(z){return z[1].call(s,A,w)}}if(y&&"onBeforeBegin,onMetaData,onStart,onUpdate,onResume".indexOf(v)!=-1){i(A,y);if(y.metaData){if(!A.duration){A.duration=y.metaData.duration}else{A.fullDuration=y.metaData.duration}}}var x=true;m(u[v],function(){x=this.call(s,A,y,w)});return x}});if(t.onCuepoint){var o=t.onCuepoint;q.onCuepoint.apply(q,typeof o=="function"?[o]:o);delete t.onCuepoint}m(t,function(v,w){if(typeof w=="function"){j(u,v,w);delete t[v]}});if(r==-1){s.onCuepoint=this.onCuepoint}};var l=function(p,r,q,t){var s={};var o=this;var u=false;if(t){i(s,t)}m(r,function(v,w){if(typeof w=="function"){s[v]=w;delete r[v]}});i(this,{animate:function(y,z,x){if(!y){return o}if(typeof z=="function"){x=z;z=500}if(typeof y=="string"){var w=y;y={};y[w]=z;z=500}if(x){var v=e();s[v]=x}if(z===undefined){z=500}r=q._api().fp_animate(p,y,z,v);return o},css:function(w,x){if(x!==undefined){var v={};v[w]=x;w=v}r=q._api().fp_css(p,w);i(o,r);return o},show:function(){this.display="block";q._api().fp_showPlugin(p);return o},hide:function(){this.display="none";q._api().fp_hidePlugin(p);return o},toggle:function(){this.display=q._api().fp_togglePlugin(p);return o},fadeTo:function(y,x,w){if(typeof x=="function"){w=x;x=500}if(w){var v=e();s[v]=w}this.display=q._api().fp_fadeTo(p,y,x,v);this.opacity=y;return o},fadeIn:function(w,v){return o.fadeTo(1,w,v)},fadeOut:function(w,v){return o.fadeTo(0,w,v)},getName:function(){return p},getPlayer:function(){return q},_fireEvent:function(w,v,x){if(w=="onUpdate"){var y=q._api().fp_getPlugin(p);if(!y){return}i(o,y);delete o.methods;if(!u){m(y.methods,function(){var A=""+this;o[A]=function(){var B=[].slice.call(arguments);var C=q._api().fp_invoke(p,A,B);return C==="undefined"||C===undefined?o:C}});u=true}}var z=s[w];if(z){z.apply(o,v);if(w.substring(0,1)=="_"){delete s[w]}}}})};function b(o,t,z){var E=this,y=null,x,u,p=[],s={},B={},r,v,w,D,A,q;i(E,{id:function(){return r},isLoaded:function(){return(y!==null)},getParent:function(){return o},hide:function(F){if(F){o.style.height="0px"}if(y){y.style.height="0px"}return E},show:function(){o.style.height=q+"px";if(y){y.style.height=A+"px"}return E},isHidden:function(){return y&&parseInt(y.style.height,10)===0},load:function(F){if(!y&&E._fireEvent("onBeforeLoad")!==false){m(a,function(){this.unload()});x=o.innerHTML;if(x&&!flashembed.isSupported(t.version)){o.innerHTML=""}flashembed(o,t,{config:z});if(F){F.cached=true;j(B,"onLoad",F)}}return E},unload:function(){if(x.replace(/\s/g,"")!==""){if(E._fireEvent("onBeforeUnload")===false){return E}try{if(y){y.fp_close()}}catch(F){}y=null;o.innerHTML=x;E._fireEvent("onUnload")}return E},getClip:function(F){if(F===undefined){F=D}return p[F]},getCommonClip:function(){return u},getPlaylist:function(){return p},getPlugin:function(F){var H=s[F];if(!H&&E.isLoaded()){var G=E._api().fp_getPlugin(F);if(G){H=new l(F,G,E);s[F]=H}}return H},getScreen:function(){return E.getPlugin("screen")},getControls:function(){return E.getPlugin("controls")},getConfig:function(F){return F?k(z):z},getFlashParams:function(){return t},loadPlugin:function(I,H,K,J){if(typeof K=="function"){J=K;K={}}var G=J?e():"_";E._api().fp_loadPlugin(I,H,K,G);var F={};F[G]=J;var L=new l(I,null,E,F);s[I]=L;return L},getState:function(){return y?y.fp_getState():-1},play:function(G,F){function H(){if(G!==undefined){E._api().fp_play(G,F)}else{E._api().fp_play()}}if(y){H()}else{E.load(function(){H()})}return E},getVersion:function(){var G="flowplayer.js 3.1.4";if(y){var F=y.fp_getVersion();F.push(G);return F}return G},_api:function(){if(!y){throw"Flowplayer "+E.id()+" not loaded when calling an API method"}return y},setClip:function(F){E.setPlaylist([F]);return E},getIndex:function(){return w}});m(("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut").split(","),function(){var F="on"+this;if(F.indexOf("*")!=-1){F=F.substring(0,F.length-1);var G="onBefore"+F.substring(2);E[G]=function(H){j(B,G,H);return E}}E[F]=function(H){j(B,F,H);return E}});m(("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,toggleFullscreen,reset,close,setPlaylist,addClip,playFeed").split(","),function(){var F=this;E[F]=function(H,G){if(!y){return E}var I=null;if(H!==undefined&&G!==undefined){I=y["fp_"+F](H,G)}else{I=(H===undefined)?y["fp_"+F]():y["fp_"+F](H)}return I==="undefined"||I===undefined?E:I}});E._fireEvent=function(O){if(typeof O=="string"){O=[O]}var P=O[0],M=O[1],K=O[2],J=O[3],I=0;if(z.debug){g(O)}if(!y&&P=="onLoad"&&M=="player"){y=y||c(v);A=y.clientHeight;m(p,function(){this._fireEvent("onLoad")});m(s,function(Q,R){R._fireEvent("onUpdate")});u._fireEvent("onLoad")}if(P=="onLoad"&&M!="player"){return}if(P=="onError"){if(typeof M=="string"||(typeof M=="number"&&typeof K=="number")){M=K;K=J}}if(P=="onContextMenu"){m(z.contextMenu[M],function(Q,R){R.call(E)});return}if(P=="onPluginEvent"){var F=M.name||M;var G=s[F];if(G){G._fireEvent("onUpdate",M);G._fireEvent(K,O.slice(3))}return}if(P=="onPlaylistReplace"){p=[];var L=0;m(M,function(){p.push(new h(this,L++,E))})}if(P=="onClipAdd"){if(M.isInStream){return}M=new h(M,K,E);p.splice(K,0,M);for(I=K+1;I<p.length;I++){p[I].index++}}var N=true;if(typeof M=="number"&&M<p.length){D=M;var H=p[M];if(H){N=H._fireEvent(P,K,J)}if(!H||N!==false){N=u._fireEvent(P,K,J,H)}}m(B[P],function(){N=this.call(E,M,K);if(this.cached){B[P].splice(I,1)}if(N===false){return false}I++});return N};function C(){if($f(o)){$f(o).getParent().innerHTML="";w=$f(o).getIndex();a[w]=E}else{a.push(E);w=a.length-1}q=parseInt(o.style.height,10)||o.clientHeight;if(typeof t=="string"){t={src:t}}r=o.id||"fp"+e();v=t.id||r+"_api";t.id=v;t.cachebusting=true;z.playerId=r;if(typeof z=="string"){z={clip:{url:z}}}if(typeof z.clip=="string"){z.clip={url:z.clip}}z.clip=z.clip||{};if(o.getAttribute("href",2)&&!z.clip.url){z.clip.url=o.getAttribute("href",2)}u=new h(z.clip,-1,E);z.playlist=z.playlist||[z.clip];var F=0;m(z.playlist,function(){var H=this;if(typeof H=="object"&&H.length){H={url:""+H}}m(z.clip,function(I,J){if(J!==undefined&&H[I]===undefined&&typeof J!="function"){H[I]=J}});z.playlist[F]=H;H=new h(H,F,E);p.push(H);F++});m(z,function(H,I){if(typeof I=="function"){if(u[H]){u[H](I)}else{j(B,H,I)}delete z[H]}});m(z.plugins,function(H,I){if(I){s[H]=new l(H,I,E)}});if(!z.plugins||z.plugins.controls===undefined){s.controls=new l("controls",null,E)}s.canvas=new l("canvas",null,E);t.bgcolor=t.bgcolor||"#000000";t.version=t.version||[9,0];t.expressInstall="http://www.flowplayer.org/swf/expressinstall.swf";function G(H){if(!E.isLoaded()&&E._fireEvent("onBeforeClick")!==false){E.load()}return f(H)}x=o.innerHTML;if(x.replace(/\s/g,"")!==""){if(o.addEventListener){o.addEventListener("click",G,false)}else{if(o.attachEvent){o.attachEvent("onclick",G)}}}else{if(o.addEventListener){o.addEventListener("click",f,false)}E.load()}}if(typeof o=="string"){flashembed.domReady(function(){var F=c(o);if(!F){throw"Flowplayer cannot access element: "+o}else{o=F;C()}})}else{C()}}var a=[];function d(o){this.length=o.length;this.each=function(p){m(o,p)};this.size=function(){return o.length}}window.flowplayer=window.$f=function(){var p=null;var o=arguments[0];if(!arguments.length){m(a,function(){if(this.isLoaded()){p=this;return false}});return p||a[0]}if(arguments.length==1){if(typeof o=="number"){return a[o]}else{if(o=="*"){return new d(a)}m(a,function(){if(this.id()==o.id||this.id()==o||this.getParent()==o){p=this;return false}});return p}}if(arguments.length>1){var r=arguments[1];var q=(arguments.length==3)?arguments[2]:{};if(typeof o=="string"){if(o.indexOf(".")!=-1){var t=[];m(n(o),function(){t.push(new b(this,k(r),k(q)))});return new d(t)}else{var s=c(o);return new b(s!==null?s:o,r,q)}}else{if(o){return new b(o,r,q)}}}return null};i(window.$f,{fireEvent:function(){var o=[].slice.call(arguments);var q=$f(o[0]);return q?q._fireEvent(o.slice(1)):null},addPlugin:function(o,p){b.prototype[o]=p;return $f},each:m,extend:i});if(typeof jQuery=="function"){jQuery.prototype.flowplayer=function(q,p){if(!arguments.length||typeof arguments[0]=="number"){var o=[];this.each(function(){var r=$f(this);if(r){o.push(r)}});return arguments.length?o[arguments[0]]:new d(o)}return this.each(function(){$f(this,k(q),p?k(p):{})})}}})();(function(){var e=typeof jQuery=="function";var i={width:"100%",height:"100%",allowfullscreen:true,allowscriptaccess:"always",quality:"high",version:null,onFail:null,expressInstall:null,w3c:false,cachebusting:false};if(e){jQuery.tools=jQuery.tools||{};jQuery.tools.flashembed={version:"1.0.4",conf:i}}function j(){if(c.done){return false}var l=document;if(l&&l.getElementsByTagName&&l.getElementById&&l.body){clearInterval(c.timer);c.timer=null;for(var k=0;k<c.ready.length;k++){c.ready[k].call()}c.ready=null;c.done=true}}var c=e?jQuery:function(k){if(c.done){return k()}if(c.timer){c.ready.push(k)}else{c.ready=[k];c.timer=setInterval(j,13)}};function f(l,k){if(k){for(key in k){if(k.hasOwnProperty(key)){l[key]=k[key]}}}return l}function g(k){switch(h(k)){case"string":k=k.replace(new RegExp('(["\\\\])',"g"),"\\$1");k=k.replace(/^\s?(\d+)%/,"$1pct");return'"'+k+'"';case"array":return"["+b(k,function(n){return g(n)}).join(",")+"]";case"function":return'"function()"';case"object":var l=[];for(var m in k){if(k.hasOwnProperty(m)){l.push('"'+m+'":'+g(k[m]))}}return"{"+l.join(",")+"}"}return String(k).replace(/\s/g," ").replace(/\'/g,'"')}function h(l){if(l===null||l===undefined){return false}var k=typeof l;return(k=="object"&&l.push)?"array":k}if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}function b(k,n){var m=[];for(var l in k){if(k.hasOwnProperty(l)){m[l]=n(k[l])}}return m}function a(r,t){var q=f({},r);var s=document.all;var n='<object width="'+q.width+'" height="'+q.height+'"';if(s&&!q.id){q.id="_"+(""+Math.random()).substring(9)}if(q.id){n+=' id="'+q.id+'"'}if(q.cachebusting){q.src+=((q.src.indexOf("?")!=-1?"&":"?")+Math.random())}if(q.w3c||!s){n+=' data="'+q.src+'" type="application/x-shockwave-flash"'}else{n+=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'}n+=">";if(q.w3c||s){n+='<param name="movie" value="'+q.src+'" />'}q.width=q.height=q.id=q.w3c=q.src=null;for(var l in q){if(q[l]!==null){n+='<param name="'+l+'" value="'+q[l]+'" />'}}var o="";if(t){for(var m in t){if(t[m]!==null){o+=m+"="+(typeof t[m]=="object"?g(t[m]):t[m])+"&"}}o=o.substring(0,o.length-1);n+='<param name="flashvars" value=\''+o+"' />"}n+="</object>";return n}function d(m,p,l){var k=flashembed.getVersion();f(this,{getContainer:function(){return m},getConf:function(){return p},getVersion:function(){return k},getFlashvars:function(){return l},getApi:function(){return m.firstChild},getHTML:function(){return a(p,l)}});var q=p.version;var r=p.expressInstall;var o=!q||flashembed.isSupported(q);if(o){p.onFail=p.version=p.expressInstall=null;m.innerHTML=a(p,l)}else{if(q&&r&&flashembed.isSupported([6,65])){f(p,{src:r});l={MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title};m.innerHTML=a(p,l)}else{if(m.innerHTML.replace(/\s/g,"")!==""){}else{m.innerHTML="<h2>Flash version "+q+" or greater is required</h2><h3>"+(k[0]>0?"Your version is "+k:"You have no flash plugin installed")+"</h3>"+(m.tagName=="A"?"<p>Click here to download latest version</p>":"<p>Download latest version from <a href='http://www.adobe.com/go/getflashplayer'>here</a></p>");if(m.tagName=="A"){m.onclick=function(){location.href="http://www.adobe.com/go/getflashplayer"}}}}}if(!o&&p.onFail){var n=p.onFail.call(this);if(typeof n=="string"){m.innerHTML=n}}if(document.all){window[p.id]=document.getElementById(p.id)}}window.flashembed=function(l,m,k){if(typeof l=="string"){var n=document.getElementById(l);if(n){l=n}else{c(function(){flashembed(l,m,k)});return}}if(!l){return}if(typeof m=="string"){m={src:m}}var o=f({},i);f(o,m);return new d(l,o,k)};f(window.flashembed,{getVersion:function(){var m=[0,0];if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){var l=navigator.plugins["Shockwave Flash"].description;if(typeof l!="undefined"){l=l.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var n=parseInt(l.replace(/^(.*)\..*$/,"$1"),10);var r=/r/.test(l)?parseInt(l.replace(/^.*r(.*)$/,"$1"),10):0;m=[n,r]}}else{if(window.ActiveXObject){try{var p=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(q){try{p=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");m=[6,0];p.AllowScriptAccess="always"}catch(k){if(m[0]==6){return m}}try{p=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(o){}}if(typeof p=="object"){l=p.GetVariable("$version");if(typeof l!="undefined"){l=l.replace(/^\S+\s+(.*)$/,"$1").split(",");m=[parseInt(l[0],10),parseInt(l[2],10)]}}}}return m},isSupported:function(k){var m=flashembed.getVersion();var l=(m[0]>k[0])||(m[0]==k[0]&&m[1]>=k[1]);return l},domReady:c,asString:g,getHTML:a});if(e){jQuery.fn.flashembed=function(l,k){var m=null;this.each(function(){m=flashembed(this,l,k)});return l.api===false?this:m}}})();

/** imageMenu.js */
var ImageMenu=new Class({getOptions:function(){return{onOpen:false,onClose:Class.empty,openWidth:200,transition:Fx.Transitions.quadOut,duration:400,open:null,border:0}},initialize:function(b,a){this.setOptions(this.getOptions(),a);this.elements=$$(b);this.widths={};this.widths.closed=this.elements[0].getStyle("width").toInt();this.widths.openSelected=this.options.openWidth;this.widths.openOthers=Math.round(((this.widths.closed*this.elements.length)-(this.widths.openSelected+this.options.border))/(this.elements.length-1));this.fx=new Fx.Elements(this.elements,{wait:false,duration:this.options.duration,transition:this.options.transition});this.fx2=new Fx.Elements($$(".sombra-esquerda"),{wait:false,duration:this.options.duration,transition:this.options.transition});this.fx3=new Fx.Elements($$(".imagem-fundo"),{wait:false,duration:this.options.duration,transition:this.options.transition});this.elements.each(function(d,c){d.addEvent("mouseenter",function(f){new Event(f).stop();this.reset(c)}.bind(this));d.addEvent("mouseleave",function(f){new Event(f).stop();this.reset(this.options.open)}.bind(this));var e=this;d.addEvent("click",function(f){if(e.options.onOpen){new Event(f).stop();if(e.options.open==c){e.options.open=null;e.options.onClose(this.href,c)}else{e.options.open=c;e.options.onOpen(this.href,c)}}})}.bind(this));if(this.options.open){if($type(this.options.open)=="number"){this.reset(this.options.open)}else{this.elements.each(function(d,c){if(d.id==this.options.open){this.reset(c)}},this)}}},reset:function(g){var d=0;var h=0;var i=0;var j=0;var e=0;var a=0;if($type(g)=="number"){a=this.widths.openOthers+20;d=0}else{a=this.widths.closed;d=20}h=this.options.openWidth-22;i=this.options.openWidth-4;j=a-22;e=a-4;var f={};var c={};var b={};this.elements.each(function(l,k){if(k==g){f[k]={width:this.widths.openSelected,"margin-left":d+"px"}}else{if(k!=0){f[k]={width:a,"margin-left":d+"px"}}else{f[k]={width:a}}}if(k!=g){c[k]={width:j};b[k]={width:e}}else{c[k]={width:h};b[k]={width:i}}}.bind(this));this.fx.start(f);this.fx2.start(c);this.fx3.start(b)}});ImageMenu.implement(new Options);ImageMenu.implement(new Events);

/** milkbox.js */
var Milkbox=new Class({Implements:[Options,Events],options:{overlayOpacity:0.7,topPosition:50,initialWidth:300,initialHeight:300,canvasBorderWidth:"0px",canvasBorderColor:"#000000",canvasPadding:"0px",resizeDuration:500,resizeTransition:"sine:in:out",autoPlay:false,autoPlayDelay:7,removeTitle:false,onXmlGalleries:$empty,onClosed:$empty,onFileReady:$empty,minWidth:291,minHeight:224},initialize:function(a){this.setOptions(a);this.autoPlayBkup={autoPlayDelay:this.options.autoPlayDelay,autoPlay:this.options.autoPlay};this.fullOptionsBkup={};this.galleries=[];this.families=[];this.xmlFiles=[];this.loadedImages=[];this.currentFile=null;this.currentIndex=null;this.currentGallery=null;this.currentRequest=null;this.currentResponse=null;this.mode=null;this.closed=true;this.busy=true;this.paused=true;this.fileReady=false;this.eventsok=false;this.first=true;this.intObj=null;this.formtags=null;this.prepareGalleries();if(this.galleries.length==0){return}this.initMilkbox();this.saveOptions()},initMilkbox:function(){this.prepareHTML();this.prepareEffects();this.prepareEvents();this.formtags=$$("select","textarea");this.activated=true},openMilkbox:function(c,e){this.closed=false;if(this.formtags.length!=0){this.formtags.setStyle("display","none")}this.overlay.setStyles({top:-$(window).getScroll().y,height:$(window).getScrollSize().y+$(window).getScroll().y});this.center.setStyle("top",$(window).getScroll().y+this.options.topPosition);this.currentGallery=c;this.currentIndex=e;this.overlay.tween("opacity",this.options.overlayOpacity);if(c.length==1){this.mode="singleFile";this.loadFile(c[e],e)}else{this.mode="fileGallery";var a=0;$$(this.prev,this.next,this.count).setStyle("display","block");if(this.options.autoPlay){this.playpause.setStyle("display","block");var a=this.playpause.getSize().x}var d=this.center.getStyle("border-right-width").toInt();var g=(e!=c.length-1)?c[e+1]:c[0];var h=(e!=0)?c[e-1]:c[c.length-1];var f=(h==g)?[h]:[h,g];this.loadFile(c[e],f)}},loadFile:function(d,c){this.fileReady=false;var a=this.checkFileType(d,"swf");if(!a){if(!this.loadedImages.contains(d.retrieve("href"))){this.center.addClass("mbLoading")}this.loadImage(d.retrieve("href"))}else{this.loadSwf(d)}if(c){this.preloadFiles(c)}},preloadFiles:function(a){a.each(function(e,c){var d=this.checkFileType(e.retrieve("href"),"swf");if(!d){this.preloadImage(e.retrieve("href"))}},this)},loadImage:function(c){var a=new Asset.image(c,{onload:function(d){if(!this.loadedImages.contains(c)){this.loadedImages.push(c)}this.currentFile=d;this.loadAux(this.currentFile)}.bindWithEvent(this)})},preloadImage:function(c){if(!this.loadedImages.contains(c)){var a=new Asset.image(c,{onload:function(d){this.loadedImages.push(c)}.bindWithEvent(this)})}},loadSwf:function(c){var a=new Swiff(c.retrieve("href"),{width:c.retrieve("width").toInt(),height:c.retrieve("height").toInt(),params:{wMode:"opaque",swLiveConnect:"false"}});this.currentFile=a;this.loadAux(c)},loadAux:function(a){this.fileReady=true;this.fireEvent("fileReady");$$(this.description).setStyle("visibility","hidden");this.navigation.setStyle("height","");$$(this.next,this.prev,this.close).setStyle("backgroundPosition","0 0");this.showFile(a)},showFile:function(c){if(this.closed){return}var f=new Hash();var g={};var i=null;var a=null;if(this.options.canvasBorderWidth.toInt()!=0&&this.canvas.getStyle("borderWidth").toInt()==0){i=this.options.canvasBorderWidth+" solid "+this.options.canvasBorderColor;this.canvas.setStyle("border",i)}if(this.options.canvasPadding.toInt()!=0&&this.canvas.getStyle("padding").toInt()==0){a=this.options.canvasPadding;this.canvas.setStyle("padding",a)}var l=this.canvas.getSize();var e=this.canvas.getStyle("borderWidth").toInt()*2+this.canvas.getStyle("padding").toInt()*2;this.canvas.setStyles({opacity:0,width:"",height:""});if(!c.retrieve("width")){f=f.extend(c.getProperties("width","height")).map(function(m,d){return m.toInt()})}else{f.extend({height:c.retrieve("height").toInt(),width:c.retrieve("width").toInt()})}var k=new Hash(this.center.getStyles("width","height")).map(function(m,d){return m.toInt()});if(f.width!=k.width){g.width=((f.width+e)<this.options.minWidth)?this.options.minWidth:(f.width+e);g.marginLeft=-(g.width/2).round()}var j=(l.y-e>0)?k.height-l.y:0;g.height=((f.height+e+j)<this.options.minHeight)?this.options.minHeight:(f.height+e+j);f.width=f.width<this.options.minWidth?this.options.minWidth:f.width;f.height=f.height<this.options.minHeight?this.options.minHeight:f.height;this.canvas.setStyles({width:f.width,height:f.height});this.center.removeClass("mbLoading");var h=0;if(this.first){h=500;this.first=false}(function(){this.center.morph(g)}).delay(h,this)},showGallery:function(a){if(!a||!a.gallery){return}var e=($chk(a.index))?a.index:0;var c=this.getGallery(a.gallery);var h=false;var f;if(a.autoplay||(c.options&&c.options.autoplay)){h=true}if(c!=-1&&!this.opened){if(h){f=(a&&a.delay)?a.delay:(c.options&&c.options.delay)?c.options.delay:this.autoPlayDelay;this.startAutoPlay({gallery:c,index:e,delay:f})}else{this.openMilkbox(c,e)}}},addGalleries:function(a){this.currentRequest=new Request({method:"get",autoCancel:true,url:a,onRequest:function(){}.bindWithEvent(this),onSuccess:function(e,c){var d=e.replace(/(<a.+)\/>/gi,"$1></a>");this.setGalleries(new Element("div",{html:d}),a)}.bindWithEvent(this),onFailure:function(c){alert("Milkbox :: addGalleries: XML file path error or local Ajax test: please test addGalleries() on-line")}});this.currentRequest.send()},setGalleries:function(e,g){if(!this.xmlFiles.contains(g)){this.xmlFiles.push(g)}var h=e;var d=h.getElements(".gallery");var f=[];var a=[];d.each(function(j,k){var n={gallery:j.getProperty("name"),autoplay:Boolean(j.getProperty("autoplay")),delay:Number(j.getProperty("delay"))};var c=j.getChildren("a");var m=c.map(function(i){return i.setProperty("rel","milkbox["+n.gallery+"]")});f.push(m);if(n.autoplay){a.push(n)}});this.prepareGalleries(f.flatten());this.setAutoPlay(a);if(!this.activated){this.initMilkbox()}this.fireEvent("xmlGalleries")},checkFileType:function(c,d){var a=null;if($type(c)!="string"){a=c.retrieve("href")}else{a=c}var e=new RegExp(".("+d+")$","i");return a.split("?")[0].test(e)},getGallery:function(a){var e=null;if(a.test(/^milkbox/i)){e=this.families}else{e=this.families.map(function(h){var i=h.trim();var f=i.slice(0,i.length).substr(8);var g=f.replace(/(.+)]$/,"$1");return g})}var c=e.indexOf(a);var d=(c!=-1)?this.galleries[c]:c;return d},setFileProps:function(d,a){var c=a.split(",");c.each(function(g,f){var e=g.trim().split(":");d.store(e[0].trim(),e[1].trim())},this)},changeOptions:function(a){if(!a){return}this.setOptions(a);this.center.get("morph").setOptions({transition:this.options.resizeTransition,duration:this.options.resizeDuration})},saveOptions:function(a){if($chk(a)){this.fullOptionsBkup=a}else{this.fullOptionsBkup=this.options}},restoreOptions:function(){this.setOptions(this.fullOptionsBkup);b=this.options.canvasBorderWidth+" solid "+this.options.canvasBorderColor;this.canvas.setStyles({border:b,padding:this.options.canvasPadding});this.center.get("morph").setOptions({transition:this.options.resizeTransition,duration:this.options.resizeDuration})},reloadGalleries:function(){this.galleries=[];this.families=[];this.formtags=$$("select","textarea");this.prepareGalleries();this.removeGalleriesEvents();this.setGalleriesEvents();if(this.xmlFiles.length==0){return}this.xmlFiles.each(function(c,a){this.addGalleries(c)}.bind(this))},setAutoPlay:function(c){var a=($type(c)=="object")?[c]:c;a.each(function(h){var f=this.getGallery(h.gallery);if(f==-1){return}var e=(h.autoplay==true)?h.autoplay:false;var i=($chk(h.delay)&&e)?h.delay:this.options.autoPlayDelay;f.options={autoplay:e,delay:i}},this)},startAutoPlay:function(c){var e=-1;var a,f;if(c&&c.gallery){if($type(c.gallery)=="array"){e=c.gallery}else{if($type(c.gallery)=="string"){e=this.getGallery(c.gallery)}}}if(e==-1){e=this.galleries[0]}f=(c&&c.delay&&($type(c.delay)=="number"))?c.delay*1000:(e.options&&e.options.delay)?e.options.delay*1000:this.options.autoPlayDelay*1000;a=(c&&c.index&&($type(c.index)=="number"))?c.index:0;if(f<this.options.resizeDuration*2){f=this.options.resizeDuration*2}this.options.autoPlayDelay=f/1000;if(!this.options.autoPlay){this.setOptions({autoPlay:true,autoPlayDelay:this.options.autoPlayDelay})}if(this.closed){this.openMilkbox(e,a);if(this.mode!="fileGallery"){return}this.addEvent("fileReady",function(){this.intObj=this.next_prev_aux.periodical(f,this,[null,"next"]);this.removeEvents("fileReady")}.bindWithEvent(this))}else{if(!this.closed){this.next_prev_aux(null,"next")}this.intObj=this.next_prev_aux.periodical(f,this,[null,"next"])}this.paused=false},stopAutoPlay:function(){if(this.intObj){$clear(this.intObj);this.intObj=null}this.playpause.setStyle("backgroundPosition","0 -44px");this.paused=true},removeGalleriesEvents:function(){this.galleries.each(function(a){$$(a).removeEvents("click")},this)},setGalleriesEvents:function(){this.galleries.each(function(a){$$(a).addEvent("click",function(f){var c=($(f.target).match("a"))?$(f.target):$(f.target).getParent("a");f.preventDefault();var d=this.getGallery(c.rel);if(d.options&&d.options.autoplay){this.setOptions({autoPlay:d.options.autoplay,autoPlayDelay:d.options.delay})}if(this.options.autoPlay){this.startAutoPlay({gallery:a,index:a.indexOf(c)})}else{this.openMilkbox(a,a.indexOf(c))}}.bindWithEvent(this))},this)},prepareEvents:function(a){this.setGalleriesEvents();this.next.addEvent("click",this.next_prev_aux.bindWithEvent(this,"next"));this.prev.addEvent("click",this.next_prev_aux.bindWithEvent(this,"prev"));$$(this.next,this.prev).addEvents({mouseover:function(){this.setStyle("backgroundPosition","0 -23px")},mouseout:function(){this.setStyle("backgroundPosition","0 0")}});$$(this.close).addEvents({mouseover:function(){this.setStyle("backgroundPosition","0 -26px")},mouseout:function(){this.setStyle("backgroundPosition","0 0")}});$(window.document).addEvent("keydown",function(c){if(this.mode!="fileGallery"||this.busy==true){return}if(c.key=="right"||c.key=="space"){this.next_prev_aux(c,"next")}else{if(c.key=="left"){this.next_prev_aux(c,"prev")}else{if(c.key=="esc"){this.closeMilkbox()}}}}.bindWithEvent(this));this.playpause.addEvents({mouseover:function(c){if(this.paused==false){this.playpause.setStyle("backgroundPosition","0 -22px")}else{this.playpause.setStyle("backgroundPosition","0 -66px")}}.bindWithEvent(this),mouseout:function(){if(this.paused==false){this.playpause.setStyle("backgroundPosition","0 0")}else{this.playpause.setStyle("backgroundPosition","0 -44px")}}.bindWithEvent(this),click:function(){if(this.paused==false){this.stopAutoPlay();this.paused=true;this.playpause.setStyle("backgroundPosition","0 -66px")}else{var c=(this.currentGallery.options&&this.currentGallery.options.delay)?this.currentGallery.options.delay:this.options.autoPlayDelay;this.startAutoPlay({gallery:this.currentGallery,index:this.currentIndex+1,delay:c});this.paused=false;this.playpause.setStyle("backgroundPosition","0 0")}}.bindWithEvent(this)});this.overlay.get("tween").addEvent("onComplete",function(){if(this.overlay.getStyle("opacity")==this.options.overlayOpacity){this.center.tween("opacity",1)}else{if(this.overlay.getStyle("opacity")==0){this.overlay.setStyles({height:0,top:""})}}}.bindWithEvent(this));this.center.get("morph").addEvent("onComplete",function(){if($type(this.currentFile)=="element"){this.canvas.grab(this.currentFile)}else{(function(){this.canvas.grab(this.currentFile)}).delay(500,this)}this.canvas.tween("opacity",1);var h=(!(this.mode=="showThisImage"))?this.currentGallery[this.currentIndex].retrieve("title"):this.specialDescription;if($chk(h)){this.description.innerHTML=h;var k=this.currentGallery[this.currentIndex].getProperty("id");var g=new Array("ft","dwg","dim","cat");var f=null;for(var c=0;c<g.length;c++){fileInfo=$(g[c]+"-"+k);f=$("link-"+g[c]);if(f&&fileInfo){f.setProperty("href",fileInfo.getProperty("value"));f.setStyle("display","block")}else{if(f){f.setStyle("display","none")}}}}if(this.mode=="fileGallery"){this.count.set("text",(this.currentIndex+1)+"/"+this.currentGallery.length)}var e=this.center.getStyle("height").toInt();var j=this.bottom.getSize().y;this.center.retrieve("setFinalHeight").start(e,e);this.canvas.getElement("img").setStyle("margin-top","-"+(this.canvas.getElement("img").getProperty("height").toInt()/2)+"px")}.bindWithEvent(this));this.center.retrieve("setFinalHeight").addEvent("onComplete",function(){this.bottom.setStyles({visibility:"visible",display:"block"});$$(this.description,this.navigation).setStyle("visibility","visible");var c=$(window).getScrollSize().y;var d=$(window).getScroll().y;this.overlay.setStyles({height:c+d,top:-d});this.busy=false}.bindWithEvent(this));window.addEvent("resize",function(){if(this.overlay.getStyle("opacity")==0){return}var c=$(window).getScrollSize().y;var d=$(window).getScroll().y;this.overlay.setStyles({height:c+d,top:-d})}.bindWithEvent(this));$$(this.overlay,this.close).addEvent("click",function(){this.closeMilkbox()}.bindWithEvent(this));this.eventsok=true},next_prev_aux:function(f,d){if(f){f.preventDefault();this.stopAutoPlay()}else{if(this.busy||!this.fileReady){return}}this.busy=true;var g=this.currentIndex;if(d=="next"){var a=(this.currentIndex!=this.currentGallery.length-1)?this.currentIndex+=1:this.currentIndex=0;var c=(this.currentIndex!=this.currentGallery.length-1)?this.currentIndex+1:0}else{var a=(this.currentIndex!=0)?this.currentIndex-=1:this.currentIndex=this.currentGallery.length-1;var c=(this.currentIndex!=0)?this.currentIndex-1:this.currentGallery.length-1}this.canvas.empty();this.description.empty();this.loadFile(this.currentGallery[a],[this.currentGallery[c]])},prepareEffects:function(){this.overlay.set("tween",{duration:"short",link:"cancel"});this.center.set("tween",{duration:"short",link:"chain"});this.center.set("morph",{duration:this.options.resizeDuration,link:"chain",transition:this.options.resizeTransition});this.center.store("setFinalHeight",new Fx.Tween(this.center,{property:"height",duration:"short"}));this.canvas.set("tween",{link:"chain"})},prepareGalleries:function(a){var e=[];var d;var c=(a)?a:$$("a");c.each(function(f){if(f.rel&&f.rel.test(/^milkbox/i)&&f.href.split("?")[0].test(/\.(gif|jpg|jpeg|png|swf)$/i)){if(f.rel.length>7&&!this.families.contains(f.rel)){this.families.push(f.rel)}e.push(f)}},this);e.each(function(f){$(f).store("href",f.href);$(f).store("rel",f.rel);$(f).store("title",f.title);if(this.checkFileType(f.href,"swf")){this.setFileProps($(f),f.rev)}if(this.options.removeTitle){$(f).removeProperty("title")}if(f.rel.length>7){this.families.each(function(k,j){if(f.rel==k){var g=false;var h;this.galleries.each(function(l,i){if(l[0].rel==k){g=true;h=i;return}});if(g==true){this.galleries[h].push($(f))}else{this.galleries.push([$(f)])}}},this)}else{this.galleries.push([$(f)])}},this)},prepareHTML:function(){this.overlay=new Element("div",{id:"mbOverlay",styles:{opacity:0,visibility:"visible",height:0,overflow:"hidden"}}).inject($(document.body));this.center=new Element("div",{id:"mbCenter",styles:{width:this.options.initialWidth,height:this.options.initialHeight,marginLeft:-(this.options.initialWidth/2),opacity:0}}).inject($(document.body));this.top=new Element("div",{id:"mbTop"}).inject(this.center);this.canvas=new Element("div",{id:"mbCanvas"}).inject(this.center);this.bottom=new Element("div",{id:"mbBottom"}).inject(this.center).setStyle("visibility","hidden");this.navigation=new Element("div",{id:"mbNavigation"}).setStyle("visibility","hidden");this.description=new Element("div",{id:"mbDescription"}).setStyle("visibility","hidden");this.ft=new Element("a",{"class":"finish-files",id:"link-ft",href:"#",text:"ficha tecnica"});this.dwg=new Element("a",{"class":"finish-files",id:"link-dwg",href:"#",text:"desenhos dwg"});this.dim=new Element("a",{"class":"finish-files",id:"link-dim",href:"#",text:"dimensoes"});this.cat=new Element("a",{"class":"finish-files",id:"link-cat",href:"#",text:"catalogo"});this.top.adopt(this.description);this.bottom.adopt(this.cat,this.ft,this.dwg,this.dim,this.navigation);this.close=new Element("a",{id:"mbCloseLink",text:""});this.next=new Element("a",{id:"mbNextLink"});this.prev=new Element("a",{id:"mbPrevLink"});this.playpause=new Element("a",{id:"mbPlayPause"});this.count=new Element("span",{id:"mbCount"});$$(this.next,this.prev,this.count,this.playpause).setStyle("display","none");this.top.adopt(this.close);this.navigation.adopt(this.next,this.count,this.prev,this.playpause)},closeMilkbox:function(){this.cancelAllEffects();this.stopAutoPlay();this.setOptions(this.autoPlayBkup);this.currentFile=null;this.currentIndex=null;this.currentGallery=null;this.currentRequest=null;this.currentResponse=null;$$(this.prev,this.next,this.playpause,this.count).setStyle("display","none");this.playpause.setStyle("backgroundPosition","0 0");var a=this.center.getStyle("border-right-width").toInt();var c=this.close.getSize().x+a;this.navigation.setStyles({width:c,height:"",visibility:"hidden"});this.description.setStyle("margin-right",c);this.description.empty();this.bottom.setStyles({visibility:"hidden",display:""});this.canvas.setStyles({opacity:0,width:"",height:""});this.canvas.empty();this.count.empty();this.center.setStyles({opacity:0,width:this.options.initialWidth,height:this.options.initialHeight,marginLeft:-(this.options.initialWidth/2)});this.overlay.tween("opacity",0);if(this.formtags.length!=0){this.formtags.setStyle("display","")}this.mode=null;this.closed=true;this.first=true;this.fileReady=false;this.fireEvent("closed")},cancelAllEffects:function(){this.overlay.get("tween").cancel();this.center.get("morph").cancel();this.center.get("tween").cancel();this.center.retrieve("setFinalHeight").cancel();this.canvas.get("tween").cancel()}});window.addEvent("domready",function(){milkbox=new Milkbox()});

/** slideshow.js */
Slideshow=new Class({Implements:[Chain,Events,Options],options:{captions:false,center:true,classes:[],controller:false,delay:2000,duration:750,fast:false,height:false,href:"",hu:"",linked:false,loader:{animate:["css/loader-#.png",12]},loop:true,match:/\?slide=(\d+)$/,overlap:true,paused:false,properties:["href","rel","rev","title"],random:false,replace:[/(\.[^\.]+)$/,"t$1"],resize:"width",slide:0,thumbnails:false,titles:true,transition:function(a){return -(Math.cos(Math.PI*a)-1)/2},width:false,numbers:false,multiple:false},initialize:function(c,f,l){this.setOptions(l);this.slideshow=$(c);if(!this.slideshow){return}this.slideshow.set("styles",{display:"block",position:"relative","z-index":0});var h=window.location.href.match(this.options.match);this.slide=(this.options.match&&h)?h[1].toInt():this.options.slide;this.counter=this.delay=this.transition=0;this.direction="left";this.paused=false;if(!this.options.overlap){this.options.duration*=2}var g=this.slideshow.getElement("a")||new Element("a");if(!this.options.href){this.options.href=g.get("href")||""}if(this.options.hu.length&&!this.options.hu.test(/\/$/)){this.options.hu+="/"}if(this.options.fast===true){this.options.fast=2}var k=["slideshow","first","prev","play","pause","next","last","images","captions","controller","thumbnails","hidden","visible","inactive","active","loader","galleries"];var j=k.map(function(n,m){return this.options.classes[m]||n},this);this.classes=j.associate(k);this.classes.get=function(){var o="."+this.slideshow;for(var n=0,m=arguments.length;n<m;n++){o+=("-"+this[arguments[n]])}return o}.bind(this.classes);if(!f){this.options.hu="";f={};var d=this.slideshow.getElements(this.classes.get("thumbnails")+" img");this.slideshow.getElements(this.classes.get("images")+" img").each(function(o,q){var s=o.get("src");var n=$pick(o.get("alt"),o.get("title"),"");var r=o.getParent();var p=(r.get("tag")=="a")?r.getProperties:{};var m=o.getParent().get("href")||"";var t=(d[q])?d[q].get("src"):"";f[s]={caption:n,href:m,thumbnail:t}})}var e=this.load(f);if(!e){return}this.events=$H({keydown:[],keyup:[],mousemove:[]});var b=function(m){switch(m.key){case"left":this.prev(m.shift);break;case"right":this.next(m.shift);break;case"p":this.pause();break}}.bind(this);this.events.keyup.push(b);document.addEvent("keyup",b);var c=this.slideshow.getElement(this.classes.get("images"));var i=(c)?c.empty():new Element("div",{overflow:"auto","class":this.classes.get("images").substr(1)}).inject(this.slideshow);var a=i.getSize();this.height=this.options.height||a.y;this.width=this.options.width||a.x;i.set({styles:{display:"block",height:this.height,overflow:"hidden",position:"relative",width:this.width}});this.slideshow.store("images",i);this.a=this.image=((c)?c.getElement("img"):this.slideshow.getElement("img"))||new Element("img");if(Browser.Engine.trident&&Browser.Engine.version>4){this.a.style.msInterpolationMode="bicubic"}this.a.set("styles",{display:"none",position:"absolute",zIndex:1});this.b=this.a.clone();[this.a,this.b].each(function(m){g.clone().cloneEvents(g).grab(m).inject(i)});if(this.options.captions){this._captions()}if(this.options.controller){this._controller()}if(this.options.loader){this._loader()}if(this.options.thumbnails){this._thumbnails()}if(this.options.multiple){this._thumbnailsGalleries()}this._preload()},go:function(b,a){if(this.data.images.length>1&&(this.slide-1+this.data.images.length)%this.data.images.length==b||$time()<this.transition){return}$clear(this.timer);this.delay=0;this.direction=(a)?a:((b<this.slide)?"right":"left");this.slide=b;if(this.preloader){this.preloader=this.preloader.destroy()}this._preload(this.options.fast==2||(this.options.fast==1&&this.paused))},first:function(){this.prev(true)},prev:function(a){var b=0;if(!a){if(this.options.random){if(this.showed.i<2){return}this.showed.i-=2;b=this.showed.array[this.showed.i]}else{b=(this.slide-2+this.data.images.length)%this.data.images.length}}this.go(b,"right")},pause:function(a){if($chk(a)){this.paused=(a)?false:true}if(this.paused){this.paused=false;this.delay=this.transition=0;this.timer=this._preload.delay(100,this);[this.a,this.b].each(function(b){["morph","tween"].each(function(c){if(this.retrieve(c)){this.get(c).resume()}},b)});if(this.options.controller){this.slideshow.getElement("."+this.classes.pause).removeClass(this.classes.play)}}else{this.paused=true;this.delay=Number.MAX_VALUE;this.transition=0;$clear(this.timer);[this.a,this.b].each(function(b){["morph","tween"].each(function(c){if(this.retrieve(c)){this.get(c).pause()}},b)});if(this.options.controller){this.slideshow.getElement("."+this.classes.pause).addClass(this.classes.play)}}},next:function(a){var b=(a)?this.data.images.length-1:this.slide;this.go(b,"left")},last:function(){this.next(true)},load:function(c){this.firstrun=true;this.showed={array:[],i:0};if($type(c)=="array"){this.options.captions=false;c=new Array(c.length).associate(c.map(function(h,g){return h+"?"+g}))}this.data={images:[],captions:[],hrefs:[],thumbnails:[]};for(var e in c){var d=c[e]||{};var b=(d.caption)?d.caption.trim():"";var a=(d.href)?d.href.trim():((this.options.linked)?this.options.hu+e:this.options.href);var f=(d.thumbnail)?d.thumbnail.trim():e.substring(0,e.lastIndexOf("/"))+"/thumbs/phoca_thumb_s_"+e.substring(e.lastIndexOf("/")+1);this.data.images.push(e);this.data.captions.push(b);this.data.hrefs.push(a);this.data.thumbnails.push(f)}if(this.options.random){this.slide=$random(0,this.data.images.length-1)}if(this.options.thumbnails&&this.slideshow.retrieve("thumbnails")){this._thumbnails()}if(this.slideshow.retrieve("images")){[this.a,this.b].each(function(g){["morph","tween"].each(function(h){if(this.retrieve(h)){this.get(h).cancel()}},g)});this.slide=this.transition=0;this.go(0)}return this.data.images.length},destroy:function(a){this.events.each(function(c,b){c.each(function(d){document.removeEvent(b,d)})});this.pause(1);if(this.options.loader){$clear(this.slideshow.retrieve("loader").retrieve("timer"))}if(this.options.thumbnails){$clear(this.slideshow.retrieve("thumbnails").retrieve("timer"))}this.slideshow.uid=Native.UID++;if(a){this.slideshow[a]()}},_preload:function(a){if(!this.preloader){this.preloader=new Asset.image(this.options.hu+this.data.images[this.slide],{onload:function(){this.store("loaded",true)}})}if(this.preloader.retrieve("loaded")&&$time()>this.delay&&$time()>this.transition){if(this.stopped){if(this.options.captions){this.slideshow.retrieve("captions").get("morph").cancel().start(this.classes.get("captions","hidden"))}this.pause(1);if(this.end){this.fireEvent("end")}this.stopped=this.end=false;return}this.image=(this.counter%2)?this.b:this.a;this.image.set("styles",{display:"block",height:"auto",visibility:"hidden",width:"auto",zIndex:this.counter});["src","height","width"].each(function(d){this.image.set(d,this.preloader.get(d))},this);this._resize(this.image);this._center(this.image);var b=this.image.getParent();if(this.data.hrefs[this.slide]){b.set("href",this.data.hrefs[this.slide])}else{b.erase("href")}var c=(this.data.captions[this.slide])?this.data.captions[this.slide].replace(/<.+?>/gm,"").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"'"):"";this.image.set("alt",c);if(this.options.titles){b.set("title",c)}if(this.options.loader){this.slideshow.retrieve("loader").fireEvent("hide")}if(this.options.captions){this.slideshow.retrieve("captions").fireEvent("update",a)}if(this.options.thumbnails){this.slideshow.retrieve("thumbnails").fireEvent("update",a)}this._show(a);this._loaded()}else{if($time()>this.delay&&this.options.loader){this.slideshow.retrieve("loader").fireEvent("show")}this.timer=(this.paused&&this.preloader.retrieve("loaded"))?null:this._preload.delay(100,this,a)}},_show:function(b){if(!this.image.retrieve("morph")){var c=(this.options.overlap)?{duration:this.options.duration,link:"cancel"}:{duration:this.options.duration/2,link:"chain"};$$(this.a,this.b).set("morph",$merge(c,{onStart:this._start.bind(this),onComplete:this._complete.bind(this),transition:this.options.transition}))}var e=this.classes.get("images",((this.direction=="left")?"next":"prev"));var f=this.classes.get("images","visible");var a=(this.counter%2)?this.a:this.b;if(b){a.get("morph").cancel().set(e);this.image.get("morph").cancel().set(f)}else{if(this.options.overlap){a.get("morph").set(f);this.image.get("morph").set(e).start(f)}else{var d=function(g,h){this.image.get("morph").set(g).start(h)}.pass([e,f],this);e=this.classes.get("images",((this.direction=="left")?"prev":"next"));a.get("morph").set(f).start(e).chain(d)}}},_loaded:function(){this.counter++;this.delay=(this.paused)?Number.MAX_VALUE:$time()+this.options.duration+this.options.delay;this.direction="left";this.transition=(this.options.fast==2||(this.options.fast==1&&this.paused))?0:$time()+this.options.duration;if(this.slide+1==this.data.images.length&&!this.options.loop&&!this.options.random){this.stopped=this.end=true}if(this.options.random){this.showed.i++;if(this.showed.i>=this.showed.array.length){var a=this.slide;if(this.showed.array.getLast()!=a){this.showed.array.push(a)}while(this.slide==a){this.slide=$random(0,this.data.images.length-1)}}else{this.slide=this.showed.array[this.showed.i]}}else{this.slide=(this.slide+1)%this.data.images.length}if(this.image.getStyle("visibility")!="visible"){(function(){this.image.setStyle("visibility","visible")}).delay(1,this)}if(this.preloader){this.preloader=this.preloader.destroy()}this._preload()},_center:function(a){if(this.options.center){var b=a.getSize();a.set("styles",{left:(b.x-this.width)/-2,top:(b.y-this.height)/-2})}},_resize:function(d){if(this.options.resize){var b=this.preloader.get("width");var i=this.preloader.get("height");var c=b/i;var a=this.slideshow.getDimensions().width;var g=a/c;var e=0;var f=0;e=this.slideshow.getDimensions().height-g;if(g<this.slideshow.getDimensions().height){g+=e;a+=e}else{if(Math.abs(e)>0){f=(e/2)}}d.set("styles",{height:g,width:a,"margin-top":f})}},_start:function(){this.fireEvent("start")},_complete:function(){if(this.firstrun&&this.options.paused){this.firstrun=false;this.pause(1)}this.fireEvent("complete")},_captions:function(){if(this.options.captions===true){this.options.captions={}}var b=this.slideshow.getElement(this.classes.get("captions"));var a=(b)?b.empty():new Element("div",{"class":this.classes.get("captions").substr(1)}).inject(this.slideshow);a.set({events:{update:function(d){var c=this.slideshow.retrieve("captions");var f=(this.data.captions[this.slide]==="");if(d){var g=(f)?"hidden":"visible";c.set("html",this.data.captions[this.slide]).get("morph").cancel().set(this.classes.get("captions",g))}else{var e=(f)?$empty:function(h){this.slideshow.retrieve("captions").set("html",this.data.captions[h]).morph(this.classes.get("captions","visible"))}.pass(this.slide,this);c.get("morph").cancel().start(this.classes.get("captions","hidden")).chain(e)}}.bind(this)},morph:$merge(this.options.captions,{link:"chain"})});this.slideshow.store("captions",a)},_controller:function(){if(this.options.controller===true){this.options.controller={}}var e=this.slideshow.getElement(this.classes.get("controller"));var a=(e)?e.empty():new Element("div",{"class":this.classes.get("controller").substr(1)}).inject(this.slideshow);var c=new Element("ul").inject(a);$H({first:"Shift + Leftwards Arrow",prev:"Leftwards Arrow",pause:"P",next:"Rightwards Arrow",last:"Shift + Rightwards Arrow"}).each(function(j,i){var g=new Element("li",{"class":(i=="pause"&&this.options.paused)?this.classes.play+" "+this.classes[i]:this.classes[i]}).inject(c);var h=this.slideshow.retrieve(i,new Element("a",{title:((i=="pause")?this.classes.play.capitalize()+" / ":"")+this.classes[i].capitalize()+" ["+j+"]"}).inject(g));h.set("events",{click:function(k){this[k]()}.pass(i,this),mouseenter:function(k){this.addClass(k)}.pass(this.classes.active,h),mouseleave:function(k){this.removeClass(k)}.pass(this.classes.active,h)})},this);a.set({events:{hide:function(g){if(!this.retrieve("hidden")){this.store("hidden",true).morph(g)}}.pass(this.classes.get("controller","hidden"),a),show:function(g){if(this.retrieve("hidden")){this.store("hidden",false).morph(g)}}.pass(this.classes.get("controller","visible"),a)},morph:$merge(this.options.controller,{link:"cancel"})}).store("hidden",false);var b=function(h){if(["left","right","p"].contains(h.key)){var g=this.slideshow.retrieve("controller");if(g.retrieve("hidden")){g.get("morph").set(this.classes.get("controller","visible"))}switch(h.key){case"left":this.slideshow.retrieve((h.shift)?"first":"prev").fireEvent("mouseenter");break;case"right":this.slideshow.retrieve((h.shift)?"last":"next").fireEvent("mouseenter");break;default:this.slideshow.retrieve("pause").fireEvent("mouseenter");break}}}.bind(this);this.events.keydown.push(b);var f=function(h){if(["left","right","p"].contains(h.key)){var g=this.slideshow.retrieve("controller");if(g.retrieve("hidden")){g.store("hidden",false).fireEvent("hide")}switch(h.key){case"left":this.slideshow.retrieve((h.shift)?"first":"prev").fireEvent("mouseleave");break;case"right":this.slideshow.retrieve((h.shift)?"last":"next").fireEvent("mouseleave");break;default:this.slideshow.retrieve("pause").fireEvent("mouseleave");break}}}.bind(this);this.events.keyup.push(f);var d=function(h){var g=this.slideshow.retrieve("images").getCoordinates();if(h.page.x>g.left&&h.page.x<g.right&&h.page.y>g.top&&h.page.y<g.bottom){this.slideshow.retrieve("controller").fireEvent("show")}else{this.slideshow.retrieve("controller").fireEvent("hide")}}.bind(this);this.events.mousemove.push(d);document.addEvents({keydown:b,keyup:f,mousemove:d});this.slideshow.retrieve("controller",a).fireEvent("hide")},_loader:function(){if(this.options.loader===true){this.options.loader={}}var a=new Element("div",{"class":this.classes.get("loader").substr(1),morph:$merge(this.options.loader,{link:"cancel"})}).store("hidden",false).store("i",1).inject(this.slideshow.retrieve("images"));if(this.options.loader.animate){for(var b=0;b<this.options.loader.animate[1];b++){img=new Asset.image(this.options.loader.animate[0].replace(/#/,b))}if(Browser.Engine.trident4&&this.options.loader.animate[0].contains("png")){a.setStyle("backgroundImage","none")}}a.set("events",{animate:function(){var c=this.slideshow.retrieve("loader");var e=(c.retrieve("i").toInt()+1)%this.options.loader.animate[1];c.store("i",e);var d=this.options.loader.animate[0].replace(/#/,e);if(Browser.Engine.trident4&&this.options.loader.animate[0].contains("png")){c.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+d+'", sizingMethod="scale")'}else{c.setStyle("backgroundImage","url("+d+")")}}.bind(this),hide:function(){var c=this.slideshow.retrieve("loader");if(!c.retrieve("hidden")){c.store("hidden",true).morph(this.classes.get("loader","hidden"));if(this.options.loader.animate){$clear(c.retrieve("timer"))}}}.bind(this),show:function(){var c=this.slideshow.retrieve("loader");if(c.retrieve("hidden")){c.store("hidden",false).morph(this.classes.get("loader","visible"));if(this.options.loader.animate){c.store("timer",function(){this.fireEvent("animate")}.periodical(50,c))}}}.bind(this)});this.slideshow.retrieve("loader",a).fireEvent("hide")},_thumbnailsGalleries:function(){if(!this.options.numbers){return}var g=this.slideshow.getElement(this.classes.get("galleries"));g.setStyle("overflow","hidden");var f=g.getCoordinates();g.store("props",(f.height>f.width)?["top","bottom","height","y"]:["left","right","width","x"]);var d=function(h){var i=this.getCoordinates();if(h.page.x>i.left&&h.page.x<i.right&&h.page.y>i.top&&h.page.y<i.bottom){this.store("page",h.page);if(!this.retrieve("mouseover")){this.store("mouseover",true);this.store("timer",function(){this.fireEvent("scroll")}.periodical(50,this))}}else{if(this.retrieve("mouseover")){this.store("mouseover",false);$clear(this.retrieve("timer"))}}}.bind(g);var f=g.getCoordinates();var c=g.retrieve("props");var a=0,e=c[1],b=c[2];g.getElements("li").each(function(h){h=h.getCoordinates();if(h[e]>a){a=h[e]}},this);g.store("limit",f[b]+f[c[0]]-a);g.set("events",{scroll:function(j,m){var h=this.getCoordinates();var o=this.getElement("ul").getPosition();var q=this.retrieve("props");var k=q[3],u,r=q[0],w=q[2],s;var v=this.getElement("ul").get("tween",{property:r});if($chk(j)){var t=this.getElements("li")[j].getCoordinates();u=h[r]+(h[w]/2)-(t[w]/2)-t[r];s=(o[k]-h[r]+u).limit(this.retrieve("limit"),0);if(m){v.set(s)}else{v.start(s)}}else{var i=h[q[2]]/3,p=this.retrieve("page"),l=-0.2;if(p[k]<(h[r]+i)){u=(p[k]-h[r]-i)*l}else{if(p[k]>(h[r]+h[w]-i)){u=(p[k]-h[r]-h[w]+i)*l}}if(u){s=(o[k]-h[r]+u).limit(this.retrieve("limit"),0);v.set(s)}}}.bind(g),update:function(h){var i=this.slideshow.retrieve("galleries");i.getElements("a").each(function(j,k){if(k==this.slide){if(!j.retrieve("active",false)){j.store("active",true);var m=this.classes.get("galleries","active");if(h){j.get("morph").set(m)}else{j.morph(m)}}}else{if(j.retrieve("active",true)){j.store("active",false);var l=this.classes.get("galleries","inactive");if(h){j.get("morph").set(l)}else{j.morph(l)}}}},this);if(!i.retrieve("mouseover")){i.fireEvent("scroll",[this.slide,h])}}.bind(this)});this.events.mousemove.push(d);document.addEvent("mousemove",d);this.slideshow.store("galleries",g)},_thumbnails:function(){if(this.options.thumbnails===true){this.options.thumbnails={}}var c=this.slideshow.getElement(this.classes.get("thumbnails"));var e=(c)?c.empty():new Element("div",{"class":this.classes.get("thumbnails").substr(1)}).inject(this.slideshow);e.setStyle("overflow","hidden");var a=new Element("ul",{tween:{link:"cancel"}}).inject(e);this.data.thumbnails.each(function(l,j){var f=new Element("li").inject(a);var g=new Element("a",{events:{click:function(m){this.go(m);return false}.pass(j,this),loaded:function(){this.data.thumbnails.pop();if(!this.data.thumbnails.length){var p=e.getCoordinates();var n=e.retrieve("props");var i=0,o=n[1],m=n[2];e.getElements("li").each(function(q){var q=q.getCoordinates();if(q[o]>i){i=q[o]}},this);e.store("limit",p[m]+p[n[0]]-i)}}.bind(this)},href:this.options.hu+this.data.images[j],morph:$merge(this.options.thumbnails,{link:"cancel"})}).inject(f);if(this.data.captions[j]&&this.options.titles){g.set("title",this.data.captions[j].replace(/<.+?>/gm,"").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"'"))}if(this.options.numbers){var k=new Element("span",{text:(j+1)}).inject(g)}else{var h=new Asset.image(this.options.hu+l,{onload:function(){this.fireEvent("loaded")}.bind(g)}).inject(g)}},this);e.set("events",{scroll:function(h,k){var f=this.getCoordinates();var l=this.getElement("ul").getPosition();var o=this.retrieve("props");var i=o[3],s,p=o[0],u=o[2],q;var t=this.getElement("ul").get("tween",{property:p});if($chk(h)){var r=this.getElements("li")[h].getCoordinates();s=f[p]+(f[u]/2)-(r[u]/2)-r[p];q=(l[i]-f[p]+s).limit(this.retrieve("limit"),0);if(k){t.set(q)}else{t.start(q)}}else{var g=f[o[2]]/3,m=this.retrieve("page"),j=-0.2;if(m[i]<(f[p]+g)){s=(m[i]-f[p]-g)*j}else{if(m[i]>(f[p]+f[u]-g)){s=(m[i]-f[p]-f[u]+g)*j}}if(s){q=(l[i]-f[p]+s).limit(this.retrieve("limit"),0);t.set(q)}}}.bind(e),update:function(f){var g=this.slideshow.retrieve("thumbnails");g.getElements("a").each(function(h,j){if(j==this.slide){if(!h.retrieve("active",false)){h.store("active",true);var l=this.classes.get("thumbnails","active");if(f){h.get("morph").set(l)}else{h.morph(l)}}}else{if(h.retrieve("active",true)){h.store("active",false);var k=this.classes.get("thumbnails","inactive");if(f){h.get("morph").set(k)}else{h.morph(k)}}}},this);if(!g.retrieve("mouseover")){g.fireEvent("scroll",[this.slide,f])}}.bind(this)});var d=e.getCoordinates();e.store("props",(d.height>d.width)?["top","bottom","height","y"]:["left","right","width","x"]);var b=function(f){var g=this.getCoordinates();if(f.page.x>g.left&&f.page.x<g.right&&f.page.y>g.top&&f.page.y<g.bottom){this.store("page",f.page);if(!this.retrieve("mouseover")){this.store("mouseover",true);this.store("timer",function(){this.fireEvent("scroll")}.periodical(50,this))}}else{if(this.retrieve("mouseover")){this.store("mouseover",false);$clear(this.retrieve("timer"))}}}.bind(e);this.events.mousemove.push(b);document.addEvent("mousemove",b);this.slideshow.store("thumbnails",e)}});

/** caption.js */
var JCaption=new Class({initialize:function(b){this.selector=b;var a=$$(b);a.each(function(c){this.createCaption(c)},this)},createCaption:function(d){var b=document.createTextNode(d.title);var a=document.createElement("div");var f=document.createElement("p");var e=d.getAttribute("width");var g=d.getAttribute("align");var c=document.documentMode;if(!g){g=d.getStyle("float")}if(!g){g=d.style.styleFloat}f.appendChild(b);f.className=this.selector.replace(".","_");if(g=="none"){if(d.title!=""){d.parentNode.replaceChild(f,d);f.parentNode.insertBefore(d,f)}}else{d.parentNode.insertBefore(a,d);a.appendChild(d);if(d.title!=""){a.appendChild(f)}a.className=this.selector.replace(".","_");a.className=a.className+" "+g;a.setAttribute("style","float:"+g);if(!c||c<8){a.style.width=e+"px"}}}});document.caption=null;window.addEvent("load",function(){var a=new JCaption("img.caption");document.caption=a});
