TimeStep=33;MozOpacStep=0.0333;IEOpacStep=3.333;var app={preloadedimages:[],Preloadedthumbs:[],targetlinks:[],alreadyrunflag:false,isImageLoaded:[],image_baseopacity:0,showcontainer:"",browser:"",timer_img:"",timer_page:"",Preload:"",curimage:"",currCount:0,isFading:false,op:0,moz:0,konq:0,saf:0,ie:0,StepFadeIn:function(B,C){if(app.moz&&B.style.MozOpacity<0.95){B.style.MozOpacity=parseFloat(B.style.MozOpacity)+MozOpacStep}else{if(app.ie){if(B.filters){B.filters.alpha.opacity+=IEOpacStep}else{var A=B.style.filter.split("=");A=A[1].split(")");if(parseFloat(A[0])<100){B.style.filter="alpha(opacity="+Math.min((parseFloat(A[0])+IEOpacStep),100)+")"}}}else{if(app.saf&&B.style.opacity<0.99){B.style.opacity=parseFloat(B.style.opacity)+MozOpacStep}else{if(C){clearInterval(C)}}}}},StepFadeOut:function(A,B){if(A.style&&A.style.filter){sOpac=A.style.filter.split("=");sOpac=sOpac[1].split(")")}if(app.moz&&A.style.MozOpacity>0){A.style.MozOpacity=parseFloat(A.style.MozOpacity)-MozOpacStep}else{if(app.ie&&A.filters&&A.filters.alpha.opacity>0){A.filters.alpha.opacity+=IEOpacStep}else{if(app.ie&&A.style&&A.style.filter&&(parseFloat(sOpac[0])>0)){A.style.filter="alpha(opacity="+(parseFloat(sOpac[0])-IEOpacStep)+")"}else{if(app.saf&&A.style.opacity>0){A.style.opacity-=0.0333}else{if(B){clearInterval(B)}}}}}},SetOpacity:function(B,A){imgobj=A;if(app.moz){imgobj.style.MozOpacity=Math.min(B/100,0.95)}else{if(app.ie){if(A.filters&&A.filters.alpha){A.filters.alpha.opacity=B}else{A.style.filter="alpha(opacity="+B+")";A.style.zoom=1}}else{if(app.saf){imgobj.style.opacity=B/100}}}},FadeIn:function(A){app.SetOpacity(0,A);clearInterval(app.timer_img);app.timer_img=setInterval("app.StepFadeIn(imgobj, app.timer_img)",TimeStep)},FadeOutPage:function(){ss=document.styleSheets[0];csrule=(ss.cssRules)?ss.cssRules[5]:ss.rules[8];clearInterval(app.timer_page);app.timer_page=setInterval("app.StepFadeOut(csrule, app.timer_page)",TimeStep)},FadeInPage:function(){ss=document.styleSheets[0];csrule=(ss.cssRules)?ss.cssRules[5]:ss.rules[8];clearInterval(app.timer_page);document.innerHTML=csrule;app.timer_page=setInterval("app.StepFadeIn(csrule, app.timer_page)",TimeStep)},LoadImage:function(A){var D=A.getAttribute("href");if(app.curimage==D){return }app.curimage=D;var G=document.getElementById(A.getAttribute("rev").split("::")[0]);var C=A.getAttribute("rev").split("::")[1];var F=(A.getAttribute("title"))?A.getAttribute("title"):"";var B=(A.getAttribute("subtitle"))?A.getAttribute("subtitle"):"";var E='<table id="largeimagebg"><tr><td><img src="'+D+'" id= "largeimage"/></td></tr></table>';E+='<br /><span id="idesc">'+F+"</span><br />";E+='<span id="idesc_subtitle">'+B+"</span>";G.innerHTML=E;img=G.getElementsByTagName("img")[0];app.FadeIn(img)},Cleanup:function(){if(this.featureImage){this.featureImage.onload=null;this.featureImage.onerror=null;this.featureImage=null}this.showcontainer=null;for(var A=0;A<this.targetlinks.length;A++){this.targetlinks[A].onclick=null;this.targetlinks[A].onmouseover=null;this.targetlinks[A].onmouseout=null}},addEvent:function(B,C,A){var A=(window.addEventListener)?A:"on"+A;if(B.addEventListener){B.addEventListener(A,C,false)}else{if(B.attachEvent){B.attachEvent(A,C)}}},init:function(){app.DetectBrowser();var B=document.getElementsByTagName("a");for(var A=0;A<B.length;A++){if(B[A].getAttribute("rel")&&/enlargeimage/i.test(B[A].getAttribute("rel"))){this.preloadedimages[this.preloadedimages.length]=new Image();this.preloadedimages[this.preloadedimages.length-1].src=B[A].href;this.Preloadedthumbs[this.Preloadedthumbs.length]=new Image();this.Preloadedthumbs[this.Preloadedthumbs.length-1].src=B[A].src;app.isImageLoaded[this.Preloadedthumbs.length-1]=false;B[A]["onmouseover"]=function(){app.LoadImage(this);return false};B[A]["onmouseout"]=function(){return false};B[A]["onclick"]=function(){return false};this.targetlinks[this.targetlinks.length]=B[A]}else{if(B[A].getAttribute("portfolio")){if(B[A].href==window.location.href){B[A]["onmouseover"]=function(){return false};B[A]["onmouseout"]=function(){return false}}else{app.SetOpacity(50,B[A]);B[A]["onmouseover"]=function(){return false};B[A]["onmouseout"]=function(){return false}}}}}},CheckLoad:function(){if(app.currCount==app.Preloadedthumbs.length){app.FadeInPage();clearInterval(app.Preload);return }for(i=0;i<app.Preloadedthumbs.length;i++){if(app.isImageLoaded[i]==false&&app.preloadedimages[i].complete){app.isImageLoaded[i]=true;app.currCount++}}},LoadPage:function(A){document.location=A},DetectBrowser:function(){d=document;n=navigator;na=n.appVersion;nua=n.userAgent;app.op=(nua.indexOf("Opera")!=-1);app.konq=(nua.indexOf("Konqueror")!=-1);app.saf=(nua.indexOf("Safari")!=-1);app.moz=(nua.indexOf("Gecko")!=-1&&!app.saf&&!app.konq);app.ie=(d.all&&!app.op)}};if(document.addEventListener){app.addEvent(document,function(){app.alreadyrunflag=1;app.init()},"DOMContentLoaded")}else{if(document.all&&document.getElementsByTagName("a").length>0){app.alreadyrunflag=1;app.init()}}app.addEvent(window,function(){if(!app.alreadyrunflag){app.init()}},"load");app.addEvent(window,function(){app.Cleanup()},"unload");