(function(){var namespace="picGallery";if(!window[namespace]){window[namespace]={}}var picGal=window[namespace];picGal.test="picGal.test";var oLayer,iLayer,pImg,nImg;var curImg=null;picGal.init=function(){var over=document.createElement("div");over.id="opacLayer";document.body.appendChild(over);var gallery=document.createElement("div");gallery.id="imgLayer";gallery.innerHTML='<div id="closeLink"><a href="" title="Close">[ Close ]</a></div><div id="image"></div><div id="imgPrev"><a href="" title="Prev">&laquo; Prev</a></div><div id="imgNext"><a href="" title="Next">Next &raquo;</a></div><div id="imgText"></div>';document.body.appendChild(gallery);pImg=document.getElementById("imgPrev");nImg=document.getElementById("imgNext");pImg.onclick=prev;nImg.onclick=next;document.getElementById("closeLink").onclick=hide;var il=document.getElementById("imgList");var al=il.getElementsByTagName("a");for(var i=0,len=al.length;i<len;i++){al[i].onclick=function(){showLayer();showImg(this);return false}}oLayer=document.getElementById("opacLayer");iLayer=document.getElementById("imgLayer")};picGal.addDOMLoadEvent=(function(){var load_events=[],load_timer,script,done,exec,old_onload,init=function(){done=true;clearInterval(load_timer);while(exec=load_events.shift()){exec()}if(script){script.onreadystatechange=""}};return function(func){if(done){return func()}if(!load_events[0]){if(document.addEventListener){document.addEventListener("DOMContentLoaded",init,false);
/*@cc_on @*/
/*@if (@_win32)
					document.write("<script id=__ie_onload defer src=//0><\/scr"+"ipt>");
					script = document.getElementById("__ie_onload");
					script.onreadystatechange = function() {
						if (this.readyState == "complete")
							init(); // call the onload handler
					};
				/*@end @*/
}if(/WebKit/i.test(navigator.userAgent)){load_timer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){init()}},10)}old_onload=window.onload;window.onload=function(){init();if(old_onload){old_onload()}}}load_events.push(func)}})();var hide=function(){curImg=null;oLayer.style.display="none";iLayer.style.display="none";return false};var prev=function(){var prevImgParent=prevNode(curImg.parentNode);var prevImg=prevImgParent.getElementsByTagName("a")[0];showImg(prevImg);return false};var next=function(){var nextImgParent=nextNode(curImg.parentNode);var nextImg=nextImgParent.getElementsByTagName("a")[0];showImg(nextImg);return false};var showLayer=function(){var o=oLayer;o.style.height=document.body.scrollHeight+100+"px";o.style.width=document.body.scrollWidth+100+"px";o.style.display="block"};var showImg=function(obj){curImg=obj;var il=iLayer;var img=document.getElementById("image");if(img.firstChild){img.removeChild(img.firstChild)}var tempImg=document.createElement("img");tempImg.src=obj.href;tempImg.alt=document.getElementById("imgText").innerHTML=obj.firstChild.alt;img.appendChild(tempImg);il.className=obj.parentNode.className;il.style.display="block";img.style.display="block";adjPos();if(!prevNode(obj.parentNode)){pImg.style.display="none"}else{pImg.style.display="block"}if(!nextNode(obj.parentNode)){nImg.style.display="none"}else{nImg.style.display="block"}};var adjPos=function(){var layer=iLayer;if(!layer){return}var w=parseInt(getStyle(layer,"width"));var h=parseInt(getStyle(layer,"height"));var posX=scrollX()+windowWidth()/2-w/2;var posY=scrollY()+windowHeight()/2-h/2;if(posX<0){posX=0}if(posY<0){posY=0}layer.style.left=posX+"px";layer.style.top=posY+"px"};window.onresize=window.onscroll=adjPos;var getStyle=function(elem,name){if(elem.style[name]){return elem.style[name]}else{if(elem.currentStyle){return elem.currentStyle[name]}else{if(document.defaultView&&document.defaultView.getComputedStyle){var sName=name.replace(/([A-Z])/g,"-$1");sName=sName.toLowerCase();var s=document.defaultView.getComputedStyle(elem,"");return s&&s.getPropertyValue(sName)}else{return null}}}};var setOpac=function(elem,level){if(elem.style.filters){elem.style.filters="alpha(opacity="+level+")"}else{elem.style.opacity=level}};var fadeIn=function(elem,maxOpac,interval){setOpac(elem,0);elem.style.display="block";for(var i=0;i<=maxOpac;i+=interval){(function(){var p=i;setTimeout(function(){setOpac(elem,p)},(p+1)*10)})()}};var prevNode=function(elem){do{elem=elem.previousSibling}while(elem&&elem.nodeType!=1);return elem};var nextNode=function(elem){do{elem=elem.nextSibling}while(elem&&elem.nodeType!=1);return elem};var scrollX=function(){var temp=document.documentElement;return self.pageXOffset||(temp&&temp.scrollLeft)||document.body.scrollLeft};var scrollY=function(){var temp=document.documentElement;return self.pageYOffset||(temp&&temp.scrollTop)||document.body.scrollTop};var windowWidth=function(){var temp=document.documentElement;return self.innerWidth||(temp&&temp.clientWidth)||document.body.clientWidth};var windowHeight=function(){var temp=document.documentElement;return self.innerHeight||(temp&&temp.clientHeight)||document.body.clientHeight}})();picGallery.addDOMLoadEvent(picGallery.init);
