var oPopup=new popup();function popup(){var oBody;var popupBackground;var imageBackground;var oImage;var closeBox;var aViewPort;var aSize=0;var winWidth=0;var winHeight=0;var bodyWidth=0;var bodyHeight=0;var scrollTop=0;var scrollLeft=0;var bIE=false;this.show=function(image){oBody=document.body;popupBackground=document.createElement('div');popupBackground.setAttribute('id','popupBackground');oBody.appendChild(popupBackground);popupBackground.style.position='absolute';popupBackground.style.display='block';popupBackground.style.opacity=0;popupBackground.style.filter='alpha(opacity=0)';popupBackground.style.top='0px';popupBackground.style.left='0px';popupBackground.style.width='100%';popupBackground.style.height='100%';popupBackground.style.zIndex=100;popupBackground.style.backgroundColor='#000';aSize=this.getWindowSize();winWidth=aSize[0];winHeight=aSize[1];bodyWidth=this.f_clientWidth();bodyHeight=this.f_clientHeight();aViewPort=this.viewPort();if(winWidth>popupBackground.clientWidth){if(winWidth==aViewPort[0]){bIE=true;popupBackground.style.width=winWidth+16+'px';window.document.documentElement.style.overflow='hidden';}else{popupBackground.style.width=winWidth+'px';popupBackground.style.position='fixed';}}this.setOpacity('popupBackground',1,3);this.loadImage(image,popupBackground,this);};this.setOpacity=function(sObj,value,maxOpacity){value+=1;document.getElementById(sObj).style.opacity=value/10;document.getElementById(sObj).style.filter='alpha(opacity='+value*10+')';if(value<maxOpacity){var thisObj=this;var interval=window.setTimeout(function(){thisObj.setOpacity(sObj,value,maxOpacity)},1);}else{clearInterval(interval);return;}};this.loadImage=function(image,popupBackground,ref){if(document.images){var img_loaded=false;oImage=new Image();oImage.src=image+'?'+randomnumber();oImage.onload=function(){if(oImage.complete){img_loaded=true}else{if(oImage.readyState=='complete'){img_loaded=true;}}if(img_loaded){scrollTop=0;scrollLeft=0;oImage.setAttribute('id','popupImage');oImage.onclick=function(){ref.closePop();};oImage.style.cursor='pointer';oImage.style.position='absolute';oImage.style.zIndex=300;if(bIE){scrollTop=ref.f_scrollTop();scrollLeft=ref.f_scrollLeft();}oImage.style.top=(popupBackground.offsetHeight/2)-(oImage.height/2)+scrollTop+'px';oImage.style.left=(popupBackground.offsetWidth/2)-(oImage.width/2)+scrollLeft+'px';if(!bIE){oImage.style.position='fixed';}else{window.document.documentElement.style.overflow='hidden';}oBody.appendChild(oImage);ref.setOpacity('popupImage',1,10);ref.loadImageBg(oImage,ref);}}}};this.loadImageBg=function(oImage,ref){imageBackground=document.createElement('div');imageBackground.setAttribute('id','imageBackground');imageBackground.style.zIndex=200;imageBackground.style.border='1px solid';imageBackground.style.position='absolute';imageBackground.style.display='block';imageBackground.style.top=oImage.offsetTop-10+'px';imageBackground.style.left=oImage.offsetLeft-10+'px';imageBackground.style.height=oImage.offsetHeight+40+'px';imageBackground.style.width=oImage.offsetWidth+20+'px';imageBackground.style.backgroundColor='#fff';if(!bIE){imageBackground.style.position='fixed';}else{imageBackground.style.position='absolute'}oBody.appendChild(imageBackground);closeBox=document.createElement('div');closeBox.style.cursor='pointer';closeBox.style.position='absolute';closeBox.style.bottom=0;closeBox.style.right=0;closeBox.style.margin='0 10px 5px 0';closeBox.style.color='#7F7F7F';closeBox.style.textDecoration='none';closeBox.style.font='18px arial';closeBox.onclick=function(){ref.closePop();};closeBox.innerHTML='sluit';imageBackground.appendChild(closeBox);imageBackground.style.visibility='visible';};this.closePop=function(){oBody.removeChild(document.getElementById('popupImage'));oBody.removeChild(document.getElementById('imageBackground'));oBody.removeChild(document.getElementById('popupBackground'));window.document.documentElement.style.overflow='';};this.relocate=function(){try{popupBackground.style.width='100%';popupBackground.style.height='100%';aSize=this.getWindowSize();winWidth=aSize[0];winHeight=aSize[1];bodyWidth=this.f_clientWidth();bodyHeight=this.f_clientHeight();aViewPort=this.viewPort();if(winWidth>popupBackground.clientWidth){popupBackground.style.width=winWidth+'px';if(winWidth==aViewPort[0]){bIE=true;document.body.style.overflow='hidden';}else{popupBackground.style.position='fixed';}}oImage.style.top=(popupBackground.offsetHeight/2)-(oImage.height/2)+scrollTop+'px';oImage.style.left=(popupBackground.offsetWidth/2)-(oImage.width/2)+scrollLeft+'px';imageBackground.style.top=oImage.offsetTop-10+'px';imageBackground.style.left=oImage.offsetLeft-10+'px';imageBackground.style.height=oImage.offsetHeight+40+'px';imageBackground.style.width=oImage.offsetWidth+20+'px';}catch(err){return;}};this.getBodyPosition=function(element){if(element){if(element.tagName=='BODY'){var p=getStyle(element,'position');}return p;}};function getStyle(oElm,strCssRule){var strValue="";if(document.defaultView&&document.defaultView.getComputedStyle){strValue=document.defaultView.getComputedStyle(oElm,"").getPropertyValue(strCssRule);}else if(oElm.currentStyle){strCssRule=strCssRule.replace(/\-(\w)/g,function(strMatch,p1){return p1.toUpperCase();});strValue=oElm.currentStyle[strCssRule];}return strValue;}this.getBodyLeft=function(){var bodyLeft=0;if(self.innerWidth){bodyLeft=((self.innerWidth-document.body.offsetWidth)/2)+(self.scrollMaxX);}else if(document.documentElement&&document.documentElement.clientWidth){bodyLeft=document.body.offsetLeft;}else if(document.body){bodyLeft=document.body.offsetLeft;}return Math.round(bodyLeft);};this.f_clientWidth=function(){return this.f_filterResults(window.innerWidth?window.innerWidth:0,document.documentElement?document.documentElement.clientWidth:0,document.body?document.body.clientWidth:0);};this.f_clientHeight=function(){return this.f_filterResults(window.innerHeight?window.innerHeight:0,document.documentElement?document.documentElement.clientHeight:0,document.body?document.body.clientHeight:0);};this.f_scrollLeft=function(){return this.f_filterResults(window.pageXOffset?window.pageXOffset:0,document.documentElement?document.documentElement.scrollLeft:0,document.body?document.body.scrollLeft:0);};this.f_scrollTop=function(){return this.f_filterResults(window.pageYOffset?window.pageYOffset:0,document.documentElement?document.documentElement.scrollTop:0,document.body?document.body.scrollTop:0);};this.f_filterResults=function(n_win,n_docel,n_body){var n_result=n_win?n_win:0;if(n_docel&&(!n_result||(n_result>n_docel)))n_result=n_docel;return n_body&&(!n_result||(n_result>n_body))?n_body:n_result;};this.scrollbarWidth=function(){return 0;if(this.getBodyPosition(document.body)=='relative'){var sbWidth=self.outerWidth-self.innerWidth;}else{var sbWidth=window.innerWidth-document.documentElement.clientWidth;}return(sbWidth&&sbWidth>0)?sbWidth:0;};this.scrollbarHeight=function(){return 0;if(this.getBodyPosition(document.body)=='relative'){var sbHeight=self.outerHeight-self.innerHeight;}else{var sbHeight=window.innerHeight-document.body.clientHeight}return(sbHeight&&sbHeight>0)?sbHeight:0;};this.viewPort=function(){var windowX=(document.documentElement&&document.documentElement.clientWidth)||window.innerWidth||self.innerWidth||document.body.clientWidth;var windowY=(document.documentElement&&document.documentElement.clientHeight)||window.innerHeight||self.innerHeight||document.body.clientHeight;var scrollX=(document.documentElement&&document.documentElement.scrollLeft)||window.pageXOffset||self.pageXOffset||document.body.scrollLeft;var scrollY=(document.documentElement&&document.documentElement.scrollTop)||window.pageYOffset||self.pageYOffset||document.body.scrollTop;var pageX=(document.documentElement&&document.documentElement.scrollWidth)?document.documentElement.scrollWidth:(document.body.scrollWidth>document.body.offsetWidth)?document.body.scrollWidth:document.body.offsetWidth;var pageY=(document.documentElement&&document.documentElement.scrollHeight)?document.documentElement.scrollHeight:(document.body.scrollHeight>document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight;return[windowX,windowY,scrollX,scrollY,pageX,pageY];};this.getWindowSize=function(){var myWidth=0,myHeight=0;if(typeof(window.innerWidth)=='number'){myWidth=window.innerWidth;myHeight=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){myWidth=document.documentElement.clientWidth;myHeight=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){myWidth=document.body.clientWidth;myHeight=document.body.clientHeight;}return[myWidth,myHeight];};this.getScrollXY=function(){var scrOfX=0,scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;scrOfX=window.pageXOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;scrOfX=document.body.scrollLeft;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;scrOfX=document.documentElement.scrollLeft;}return[scrOfX,scrOfY];};function randomnumber(){return Math.round((99977562-10016486)*Math.random()+1)+22423;}}window.onresize=function(){oPopup.relocate();}
