function PromoBanner(d,e,b,a,c){this.slideRepository=[];this.slide=[];this.placeholderWidth=b;this.placeholderHeight=a;this.color={blue:"#46a0eb",pink:"#ef037e",orange:"#f89d15",purple:"#782779",black:"Black"};this.init(d,e,c)}PromoBanner.prototype.init=function(c,d,b){this.canvas=document.getElementById(c);this.canvas.style.position="relative";this.displayWindow=document.getElementById(d);this.displayWindow.style.position="relative";this.displayWindow.style.width=this.placeholderWidth+"px";this.displayWindow.style.height=this.placeholderHeight+"px";this.buildSlideRepository();this.selectSlides(b);var a=this;setTimeout(function(){a.showNextSlide(1)},1500)};PromoBanner.prototype.selectSlides=function(c){var a,b;for(a=0;a<c.length;a++){b=this.getSlideFromRepository(c[a]);if(b){this.slide.push(b)}}};PromoBanner.prototype.getSlideFromRepository=function(b){var a;for(a=0;a<this.slideRepository.length;a++){if(this.slideRepository[a].id===b){return this.slideRepository[a]}}};PromoBanner.prototype.buildSlideRepository=function(){this.slideRepository.push(new PBSlideWordMess("wordmess",this));this.slideRepository.push(new PBSlideNormal("eugenevanbaal",this,"/images/promoBanner/eugenevanbaal.jpg",6000,1200,[{text:"Eugene van Baal",color:this.color.blue,posx:545,posy:72,delay:1500},{text:"Website + CMS",color:this.color.blue,posx:565,posy:102,delay:2500}]));this.slideRepository.push(new PBSlideNormal("hansjanssen",this,"/images/promoBanner/hansjanssen.jpg",6000,1200,[{text:"Hans Janssen Bedrijfsmakelaars",color:this.color.blue,posx:540,posy:110,delay:1500},{text:"Website + CMS + RSS + Twitter",color:this.color.blue,posx:560,posy:140,delay:2500}]));this.slideRepository.push(new PBSlideNormal("duycker",this,"/images/promoBanner/duycker.png",6000,1200));this.slideRepository.push(new PBSlideNormal("kinderfonds",this,"/images/promoBanner/kinderfonds.png",6000,1200));this.slideRepository.push(new PBSlideNormal("zoover",this,"/images/promoBanner/zoover.png",6000,1200));this.slideRepository.push(new PBSlideNormal("axitraxi",this,"/images/promoBanner/axitraxi.jpg",6000,1200,[{text:"Axitraxi",color:this.color.blue,posx:520,posy:90,delay:1500},{text:"Website + CMS + SEO + PDF + Mailblast Pro",color:this.color.blue,posx:490,posy:120,delay:2500}]));this.slideRepository.push(new PBSlideNormal("beleefreizen",this,"/images/promoBanner/beleefreizen.jpg",6000,1200,[{text:"BeleefReizen",color:this.color.blue,posx:690,posy:30,delay:1500},{text:"Mailblast Pro",color:this.color.blue,posx:710,posy:60,delay:2500}]));this.slideRepository.push(new PBSlideNormal("millingertheetuin",this,"/images/promoBanner/millingertheetuin.jpg",6000,1200,[{text:"Millinger Theetuin",color:this.color.blue,posx:690,posy:30,delay:1500},{text:"Website",color:this.color.blue,posx:710,posy:60,delay:2500}]));this.slideRepository.push(new PBSlideNormal("savarijn",this,"/images/promoBanner/savarijn.jpg",6000,1200,[{text:"Savarijn",color:this.color.blue,posx:540,posy:30,delay:1500},{text:"Website + CMS + Mailblast Pro",color:this.color.blue,posx:560,posy:60,delay:2500}]));this.slideRepository.push(new PBSlideNormal("vakantiereiswijzer",this,"/images/promoBanner/vakantiereiswijzer.png",6000,1200));this.slideRepository.push(new PBSlideNormal("forfarmers",this,"/images/promoBanner/forfarmers.png",6000,1200));this.slideRepository.push(new PBSlideNormal("stoetenslagh",this,"/images/promoBanner/stoetenslagh.png",6000,1200));this.slideRepository.push(new PBSlideNormal("duchenne",this,"/images/promoBanner/duchenne.png",6000,1200));this.slideRepository.push(new PBSlideNormal("alpenparks",this,"/images/promoBanner/alpenparks.png",6000,1200))};PromoBanner.prototype.showNextSlide=function(a){if(this.slide.length===0){return}if(!this.currentSlideIndex&&this.currentSlideIndex!=0){this.currentSlideIndex=0}else{this.currentSlideIndex=this.getSiblingSlideIndex(this.currentSlideIndex,a)}this.slide[this.currentSlideIndex].start()};PromoBanner.prototype.setCurrentSlideIndex=function(a){this.currentSlideIndex=this.getSlideIndex(a)};PromoBanner.prototype.getSlideIndex=function(b){for(var a=0;a<this.slide.length;a++){if(this.slide[a]==b){return a}}};PromoBanner.prototype.getSiblingSlide=function(b,a){return this.slide[this.getSiblingSlideIndex(b,a)]};PromoBanner.prototype.getSiblingSlideIndex=function(b,a){var c;if(typeof(b)!="number"){c=this.getSlideIndex(b)}else{c=b}c+=a;while(c>=this.slide.length||c<0){if(c>=this.slide.length){c-=this.slide.length}else{if(c<0){c=this.slide.length+c}}}return c};PromoBanner.prototype.initNextSlide=function(){this.getSiblingSlide(this.currentSlideIndex,1).init()};function PBSlide(){this.startType="normal";this.endType="normal";this.pauseAfter=1200;this.mainShowDuration=5000;this.eventAction=[];this.event={start:"start",startMainShow:"startMainShow",startHideAnim:"startHideAnim",end:"end"}}PBSlide.prototype.init=function(){if(this.slideElem){return}this.colorBlue="#46a0eb";this.colorPink="#ef037e";this.colorOrange="#f89d15";this.colorPurple="#782779";this.slideElem=this.buildSlideElement();this.promoBanner.displayWindow.appendChild(this.slideElem)};PBSlide.prototype.buildSlideElement=function(){var a=document.createElement("div");a.style.position="absolute";a.style.top="0px";a.style.left=this.promoBanner.placeholderWidth+"px";a.style.width=this.promoBanner.placeholderWidth+"px";a.style.height=this.promoBanner.placeholderHeight+"px";return a};PBSlide.prototype.start=function(){this.init();switch(this.startType){case"slide":this.showWithShiftAnim();break;default:this.show()}this.eventStart()};PBSlide.prototype.startMainShow=function(){this.eventFired(this.event.startMainShow);var a=this;setTimeout(function(){a.end()},this.mainShowDuration)};PBSlide.prototype.end=function(){this.eventFired(this.event.end);switch(this.endType){case"slide":this.hideWithShiftAnim();break;default:this.hide()}};PBSlide.prototype.showWithShiftAnim=function(){this.shiftSlideShow(this.slideElem,this.promoBanner.placeholderWidth,0,400)};PBSlide.prototype.hideWithShiftAnim=function(){this.shiftSlideHide(this.slideElem,0,-(this.promoBanner.placeholderWidth),400)};PBSlide.prototype.show=function(){this.slideElem.style.left="0px";this.startMainShow()};PBSlide.prototype.hide=function(){this.slideElem.style.display="none";this.eventEnd()};PBSlide.prototype.destroy=function(){if(this.slideElem){this.promoBanner.displayWindow.removeChild(this.slideElem)}this.slideElem=null};PBSlide.prototype.shiftSlideShow=function(i,c,a,j,d){var e=40;var g=a-c;if(!d){d=0}var f=j-d;var b=(g*Math.pow(f,2))/Math.pow(j,2);i.style.left=a-Math.round(b)+"px";if(d<j){d+=e;var h=this;setTimeout(function(){h.shiftSlideShow(i,c,a,j,d)},e)}else{this.eventShowWithShiftAnimEnd()}};PBSlide.prototype.shiftSlideHide=function(i,c,a,j,d){var e=40;var g=a-c;if(!d){d=0}var f=j-d;var b=(g*Math.pow(d,2))/Math.pow(j,2);i.style.left=c+Math.round(b)+"px";if(d<j){d+=e;var h=this;setTimeout(function(){h.shiftSlideHide(i,c,a,j,d)},e)}else{this.eventHideWithShiftAnimEnd()}};PBSlide.prototype.addEventAction=function(a){this.eventAction.push(a)};PBSlide.prototype.eventFired=function(a){for(var b=0;b<this.eventAction.length;b++){if(this.eventAction[b].eventId===a){this.eventAction[b].action()}}};PBSlide.prototype.eventStart=function(){this.eventFired("start");this.promoBanner.setCurrentSlideIndex(this);if(this.promoBanner.slide.length>1){this.promoBanner.getSiblingSlide(this,1).init()}};PBSlide.prototype.eventEnd=function(){this.destroy();var a=this;setTimeout(function(){a.promoBanner.showNextSlide(1)},this.pauseAfter)};PBSlide.prototype.eventShowWithShiftAnimEnd=function(){this.startMainShow()};PBSlide.prototype.eventHideWithShiftAnimEnd=function(){this.eventEnd()};PBSlideNormal.prototype=new PBSlide();PBSlideNormal.prototype.constructor=PBSlideNormal;function PBSlideNormal(e,d,f,b,c,a){this.id=e;this.promoBanner=d;this.imageSource=f;this.label=a||[];this.pauseAfter=c;this.mainShowDuration=b;this.startType="slide";this.endType="slide";this.eventAction=[]}PBSlideNormal.prototype.init=function(){var c,b,a;if(this.slideElem){return}function d(j,l,i,e,h,f){var g=document.createElement("img");g.src=l;g.style.width=i+"px";g.style.height=e+"px";g.style.position="absolute";g.style.top=h+"px";g.style.left=f+"px";j.appendChild(g)}this.slideElem=this.buildSlideElement();d(this.slideElem,this.imageSource,this.promoBanner.placeholderWidth,this.promoBanner.placeholderHeight,0,0);c=[];for(a=0;a<this.label.length;a++){b=new PBLabel(this.slideElem,this.label[a].text,this.label[a].color,this.promoBanner.color.black,16,this.label[a].posx,this.label[a].posy,false,false,true,this.label[a].delay);this.addEventAction({self:b,eventId:"startMainShow",action:function(){this.self.showElement()}})}this.promoBanner.displayWindow.appendChild(this.slideElem)};PBSlideWordMess.prototype=new PBSlide();PBSlideWordMess.prototype.constructor=PBSlideWordMess;function PBSlideWordMess(b,a){this.id=b;this.promoBanner=a;this.startType="normal";this.endType="slide";this.pauseAfter=500;this.mainShowDuration=11000}PBSlideWordMess.prototype.addItems=function(){function m(){return(Math.round(Math.random())-0.5)}var n=["Facebook","RSS","Website","HTML","Twitter",".Net","ASP","PHP","Google","JavaScript","XML","XHTML","SEO","Webapplicatie","SAAS","E-mail","Flash","CSS","SQL","XSLT","PDF","Cookie","Cache","CMS","Sitemap","XML Schema","Wireframe","Interactieontwerp","Analytics","AdWords","Atom","MySQL","LinkedIn","Database","Ajax","XSL-FO","Bloggen","404","Semantic web","Webservice","Applet","Java","Soap","SVG","PNG","Encoding","OOP","DNS","YouTube","Mobile","DOM","URL","API","Xpath","XForms","Namespaces","Widget","UTF8","FTP","HTTP","HTTPS","SSL","DocBook","Server","Client","Browser","Mailclient","Pagerank","403","Actionscript","Apache","Bandwidth","Buffer","C#","Cache","CDN","Chrome","Class Diagram","Cloud Computing","Compatibility","Cross Browser Support","Debugging","Doctype","Documentation","Encryption","Entity-relationship model","Embedding","Event Handling","Firefox","Firewall","Flow Charts","Forum","Framework","Gateway","Globalisation","HTML 5","I/O","IIS","Interface","Internet Explorer","IP","JSON","Load balancing","Logging","Meta data","MVC","Packet","Page hits","Perl","Port","Proxy","Python","Requirements","Ruby","SaaS","Security","Session","Scripting","Sequence Diagram","Security Testing","Stress Testing","Software Scalability","Scaling up","Scaling out","Software design patterns","TCP","Templates","Time out","TLS","Typography","UML","Unicode","Use Cases","Use Case Diagram","User Experience","UX Testing","W3C","Web 2.0","Wordpress"];n.sort(m);word=n.concat(n);var a=[this.promoBanner.color.blue,this.promoBanner.color.orange,this.promoBanner.color.pink,this.promoBanner.color.purple];var g=[];var b=new PBLabel(this.slideElem,"Bel Tekwerk.",this.promoBanner.color.orange,this.promoBanner.color.black,60,485,105,true,true,true,1000);var c=word.length;var e=c;var h=new PBLabelRandom(this.slideElem,word[0],a[Math.floor(Math.random()*a.length)],"Black",16,true,b,0);g.push(h);do{var d=e-c;if(d>0){h=new PBLabelRandom(this.slideElem,word[d],a[Math.floor(Math.random()*a.length)],"Black",16,true,h,d/e);g.push(h)}}while(--c);var f=g.length;do{g[f-1].init()}while(--f);b.init();h.showElement()};PBSlideWordMess.prototype.eventStart=function(){this.promoBanner.setCurrentSlideIndex(this);if(this.promoBanner.slide.length>1){this.promoBanner.getSiblingSlide(this,1).init()}this.addItems()};function PBItem(){this.posX;this.posY;this.centerX=false;this.centerY=false}PBItem.prototype.getBaseElement=function(b){var a=document.createElement(b);a.style.position="absolute";return a};PBItem.prototype.positionElement=function(a){var b=this.posX;var c=this.posY;if(this.centerX){b-=(0.5*a.offsetWidth)}if(this.centerY){c-=(0.5*a.offsetHeight)}a.style.top=c+"px";a.style.left=b+"px"};PBItem.prototype.buildElement=function(){this.elem=this.getElement()};PBItem.prototype.getElement=function(){return this.getBaseElement("p")};PBItem.prototype.drawElement=function(){this.placeholder.appendChild(this.elem);this.positionElement(this.elem)};PBItem.prototype.showElement=function(){if(!this.elem){this.init()}if(this.delay){var a=this;setTimeout(function(){a.elem.style.visibility="visible"},this.delay)}else{this.elem.style.visibility="visible"}};PBLabel.prototype=new PBItem();PBLabel.prototype.constructor=PBLabel;function PBLabel(h,j,i,l,e,f,g,a,b,c,d){this.placeholder=h;this.text=j;this.backgroundColor=i;this.textColor=l;this.fontSize=(e?e:12);this.posX=f;this.posY=g;this.centerX=a;this.centerY=b;this.roundedCorners=c;this.delay=d}PBLabel.prototype.init=function(){this.buildElement();this.drawElement()};PBLabel.prototype.getElement=function(){var a=this.getBaseElement("p");a.appendChild(document.createTextNode(this.text));a.style.backgroundColor=this.backgroundColor;a.style.color=this.textColor;a.style.padding="0.2em 0.3em 0.2em 0.3em";a.style.fontSize=this.fontSize+"px";a.style.fontWeight="bold";a.style.textTransform="uppercase";a.style.whiteSpace="nowrap";a.style.margin="0px";a.style.lineHeight="1em";a.style.visibility="hidden";if(this.roundedCorners){a.style.borderRadius="0.2em"}return a};PBLabel.prototype.animElement=function(){var a=this};PBLabel.prototype.hideElement=function(){this.elem.style.display="none"};PBLabel.prototype.moveElement=function(){if(this.displacement==2){this.displacement=-2}else{this.displacement=2}this.elem.style.top=this.posY+this.displacement+"px";this.elem.style.left=this.posX+this.displacement+"px"};PBLabel.prototype.shakeElement=function(){var a=this;this.posY=this.elem.offsetTop;this.posX=this.elem.offsetLeft;setInterval(function(){a.moveElement()},50)};PBLabelRandom.prototype=new PBLabel();PBLabelRandom.prototype.constructor=PBLabelRandom;function PBLabelRandom(e,g,f,h,c,a,d,b){this.placeholder=e;this.text=g;this.backgroundColor=f;this.textColor=h;this.fontSize=c;this.nextLabel=d;this.indexFactor=b;this.roundedCorners=a}PBLabelRandom.prototype.drawElement=function(){this.placeholder.appendChild(this.elem);this.positionElement(this.elem)};PBLabelRandom.prototype.showElement=function(){if(this.nextLabel){var a=this;setTimeout(function(){a.nextLabel.showElement()},100*Math.log(this.indexFactor*2))}if(this.delay){var a=this;setTimeout(function(){a.elem.style.visibility="visible"},this.delay)}else{this.elem.style.visibility="visible"}};PBLabelRandom.prototype.positionElement=function(a){function b(f,e){return f+Math.floor(Math.random()*(e-f))}var c=24;var d=8;a.style.top=b(d,210-a.offsetHeight-d)+"px";a.style.left=b(c,970-a.offsetWidth-c)+"px"};function Menu(b,a){this.placeholderId=b;this.imagePath=a+"/images/layout";this.menuRoot}Menu.prototype.init=function(){this.placeholder=document.getElementById(this.placeholderId);this.menuRoot.passObjects(this);this.menuRoot.init();this.preloadImages()};Menu.prototype.preloadImages=function(){function a(d){var c=document.createElement("img");c.src=d;return c}var b=document.createElement("div");b.style.visibility="hidden";b.appendChild(a(this.imagePath+"/submenu_bg.png"));this.placeholder.appendChild(b)};function MenuItem(d,e,f,h,a,b,c,g){this.id=d;this.name=f;this.targetUrl=h;this.selected=b;this.width=c;this.payoff=g;this.menuItem=a}MenuItem.prototype.initChildren=function(b){var c,a;c=b.length;if(c>0){do{a=(c==b.length);b[c-1].init(a)}while(--c)}};MenuItem.prototype.init=function(a){this.initChildren(this.menuItem);this.box=document.createElement("div");this.box.style.cursor="pointer";this.box.onclick=createMethodReference(this,this.click);this.box.style.padding="7px 13px 6px 13px";this.box.style.position="relative";if(a){this.box.style.borderBottomLeftRadius="5px";this.box.style.borderBottomRightRadius="5px"}this.box.onmouseover=createMethodReference(this,this.mouseOver);this.box.onmouseout=createMethodReference(this,this.mouseOut);this.link=document.createElement("a");this.link.className="link";this.link.style.margin="0px";this.link.style.whiteSpace="nowrap";this.link.appendChild(document.createTextNode(this.name));if(this.targetUrl){this.link.href=this.targetUrl}this.box.appendChild(this.link);if(this.payoff.length>0){payoffPar=document.createElement("p");payoffPar.appendChild(document.createTextNode(this.payoff));payoffPar.style.marginBottom="0px";payoffPar.style.whiteSpace="nowrap";this.box.appendChild(payoffPar)}};MenuItem.prototype.click=function(a){location.href=this.targetUrl};MenuItem.prototype.passObjects=function(a){this.menu=a;var b=this.menuItem.length;if(b>0){do{this.menuItem[b-1].passObjects(a)}while(--b)}};MenuItem.prototype.getMenuItemById=function(b){var a=this.menuItem.length;if(a>0){do{if(this.menuItem[a-1].id===b){return this.menuItem[a-1]}else{var c=this.menuItem[a-1].getMenuItemById(b);if(c){return c}}}while(--a)}};MenuItem.prototype.mouseOver=function(a){this.box.style.backgroundColor="#46a0eb";this.link.style.textDecoration="underline"};MenuItem.prototype.mouseOut=function(a){this.box.style.backgroundColor="transparent";this.link.style.textDecoration="none"};RootMenuItem.prototype=new MenuItem();function RootMenuItem(a){this.menuItem=a}RootMenuItem.prototype.init=function(a){this.initChildren(this.menuItem)};MainMenuItem.prototype=new MenuItem();function MainMenuItem(d,e,f,g,a,b,c){this.id=d;this.name=f;this.targetUrl=g;this.selected=b;this.width=c;this.margin=38;this.menuItem=a}MainMenuItem.prototype.init=function(a){this.initChildren(this.menuItem);this.placeholder=document.getElementById("P"+this.id);this.link=document.getElementById("M"+this.id);this.link.onmouseover=createMethodReference(this,this.mouseOver);this.link.onmouseout=createMethodReference(this,this.mouseOut)};MainMenuItem.prototype.mouseOver=function(a){if(this.menuItem.length>0&&!this.submenuBox){this.showSubmenu()}};MainMenuItem.prototype.mouseOut=function(a){if(this.submenuBox&&this.checkMouseLeave(this.submenuBox,a)&&this.checkMouseLeave(this.link,a)){this.removeSubmenu()}};MainMenuItem.prototype.mouseOverSubmenu=function(){};MainMenuItem.prototype.mouseOutSubmenu=function(a){if(this.submenuBox&&this.checkMouseLeave(this.submenuBox,a)&&this.checkMouseLeave(this.link,a)){this.removeSubmenu()}};MainMenuItem.prototype.showSubmenu=function(){if(!this.submenuBox){this.drawSubmenu()}this.menu.placeholder.appendChild(this.submenuBox);this.submenuShowing=true};MainMenuItem.prototype.drawSubmenu=function(){this.submenuBox=document.createElement("div");this.submenuBox.style.position="absolute";this.submenuBox.style.top=(this.placeholder.offsetTop+this.link.offsetHeight).toString()+"px";this.submenuBox.style.left=(this.placeholder.offsetLeft+this.margin-27).toString()+"px";this.submenuBox.style.backgroundImage="url("+this.menu.imagePath+"/submenu_bg.png)";this.submenuBox.style.zIndex="50";this.submenuBox.style.padding="10px 0px 0px 0px";this.submenuBox.style.borderTopRightRadius="6px";this.submenuBox.style.borderBottomLeftRadius="6px";this.submenuBox.style.borderBottomRightRadius="6px";this.submenuBox.style.borderBottom="1px solid silver";this.submenuBox.style.borderLeft="1px solid #eee";this.submenuBox.style.borderRight="1px solid #eee";this.submenuBox.onmouseover=createMethodReference(this,this.mouseOverSubmenu);this.submenuBox.onmouseout=createMethodReference(this,this.mouseOutSubmenu);var b=k=this.menuItem.length;do{var a=k-b;this.submenuBox.appendChild(this.menuItem[a].box)}while(--b)};MainMenuItem.prototype.removeSubmenu=function(){this.menu.placeholder.removeChild(this.submenuBox);this.submenuBox=null;this.submenuShowing=false};MainMenuItem.prototype.containsDOM=function(b,a){var c=false;do{if((c=b==a)){break}a=a.parentNode}while(a!=null);return c};MainMenuItem.prototype.checkMouseEnter=function(b,a){if(!a){var a=window.event}if(b.contains&&a.fromElement){return !b.contains(a.fromElement)}else{if(a.relatedTarget){return !this.containsDOM(b,a.relatedTarget)}}};MainMenuItem.prototype.checkMouseLeave=function(b,a){if(!a){var a=window.event}if(b.contains&&a.toElement){return !b.contains(a.toElement)}else{if(a.relatedTarget){return !this.containsDOM(b,a.relatedTarget)}}};function GoogleMap(c,a,b){this.address=a;this.markerUrl=b;this.zoom=8;this.placeholderId=c;this.init()}GoogleMap.prototype.init=function(){var c={zoom:this.zoom,disableDefaultUI:true,navigationControl:true,navigationControlOptions:{style:google.maps.NavigationControlStyle.DEFAULT},mapTypeControl:true,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},streetViewControl:false,mapTypeId:google.maps.MapTypeId.ROADMAP};var b=new google.maps.Map(document.getElementById(this.placeholderId),c);var a=new google.maps.Geocoder();a.geocode({address:this.address},function(f,g){if(g==google.maps.GeocoderStatus.OK){b.setCenter(f[0].geometry.location);var d=new google.maps.MarkerImage("http://www.tekwerk.be/images/layout/googlemaps_marker.png",new google.maps.Size(70,98),new google.maps.Point(0,0),new google.maps.Point(19,49));var e=new google.maps.Marker({map:b,position:f[0].geometry.location,icon:d})}else{Debug("Geocode was not successful for the following reason: "+g)}})};function writeEmail(c,a,b){if(!c){c="tekwerk.nl"}sEmail=a+"\u0040"+c;if(!b){b=sEmail}document.write('<a title="'+sEmail+'" href="mailto:'+a+"\u0040"+c+'">'+b+"</a>")}function setCookie(b,c,a){document.cookie=b+"="+escape(c)+((a==null)?"":("; expires="+a.toUTCString()))}function getCookie(a){var b=a+"=";if(document.cookie.length>0){offset=document.cookie.indexOf(b);if(offset!=-1){offset+=b.length;end=document.cookie.indexOf(";",offset);if(end==-1){end=document.cookie.length}return unescape(document.cookie.substring(offset,end))}else{return""}}}function createMethodReference(b,a){if(!(a instanceof Function)){a=b[a]}return function(){a.apply(b,arguments)}}function Debug(a){console.log(a)}function DataBoxSet(c,d,a,b,e){this.id=c;this.submitFile=d;this.startWithEdit=a;this.serverResponses=b;this.dataBox=[];this.param=[];this.placeholderBackgroundColor="";this.placeholderPadding="0px";this.imageFolder="http://static.tekwerk.nl/images/layout/databox/";this.messageNormalColor="Green";this.messageErrorColor="#ef037e";this.dataBoxLabelWidth="80px";this.messageBoxPosition="right"}DataBoxSet.prototype.addDataBox=function(a){a.dataBoxSet=this;this.dataBox.push(a)};DataBoxSet.prototype.addParam=function(a){this.param.push(a)};DataBoxSet.prototype.init=function(){this.drawPlaceholders();this.drawDataBoxes();if(this.startWithEdit){this.drawActionButtons()}};DataBoxSet.prototype.drawDataBoxes=function(){for(var a=0;a<this.dataBox.length;a++){var b=document.getElementById(this.dataBox[a].placeholderId);if(b){b.appendChild(this.dataBox[a].getPlaceholder(this.startWithEdit))}else{this.dataBoxesPlaceholder.appendChild(this.dataBox[a].getPlaceholder(this.startWithEdit))}}};DataBoxSet.prototype.getMainPlaceholder=function(){document.write('<div id="'+this.id+'"></div>');return document.getElementById(this.id)};DataBoxSet.prototype.getPlaceholder=function(){var a=document.createElement("div");a.style.display="inline-block";a.style.position="relative";return a};DataBoxSet.prototype.getDataBoxesPlaceholder=function(){var a=document.createElement("div");a.style.padding=this.placeholderPadding;a.style.position="relative";if(this.startWithEdit){a.style.backgroundColor=this.placeholderBackgroundColor}return a};DataBoxSet.prototype.drawPlaceholders=function(){var c=this.getMainPlaceholder();this.placeholder=this.getPlaceholder();this.dataBoxesPlaceholder=this.getDataBoxesPlaceholder();this.placeholder.appendChild(this.dataBoxesPlaceholder);var a=document.createElement("div");var b=document.getElementById(this.customPlaceholderActionButton);if(b){this.actionButtonsPlaceholder=b}else{this.actionButtonsPlaceholder=document.createElement("div");a.appendChild(this.actionButtonsPlaceholder)}this.actionButtonsPlaceholder.style.backgroundColor=this.placeholderBackgroundColor;this.actionButtonsPlaceholder.style.cssFloat="right";this.actionButtonsPlaceholder.style.styleFloat="right";this.actionButtonsPlaceholder.style.padding="0px 1px 4px 4px";this.actionButtonsPlaceholder.style.position="relative";this.actionButtonsPlaceholder.style.clear="both";this.placeholder.appendChild(a);c.appendChild(this.placeholder)};DataBoxSet.prototype.drawActionButtons=function(){};DataBoxSet.prototype.getSubmitButton=function(){var a=document.createElement("button");a.appendChild(document.createTextNode(this.getTextValueById("submit")));a.style.marginBotttom="10px";a.style.marginRight="3px";a.onclick=createMethodReference(this,this.submitButtonClicked);return a};DataBoxSet.prototype.getWaitImage=function(){var a=document.createElement("img");a.src=this.imageFolder+"wait16trans.gif";a.style.position="absolute";a.style.top="6px";a.style.left="38px";a.style.display="none";return a};DataBoxSet.prototype.submitButtonClicked=function(){this.updateSubmitButton(true);var a=new DataBoxSubmitSessionAjax(this);this.removeMessages();a.submit(this.submitFile,"")};DataBoxSet.prototype.updateSubmitButton=function(a){if(a){this.submitButton.disabled=true;this.waitImage.style.display="block"}else{this.submitButton.disabled=false;this.waitImage.style.display="none"}};DataBoxSet.prototype.cancelButtonClicked=function(){this.removeMessages();this.makeDataBoxSetNonEditable()};DataBoxSet.prototype.showGeneralMessage=function(a){this.actionButtonsPlaceholder.appendChild(a.getPlaceholder(this.actionButtonsPlaceholder,this.actionButtonsPlaceholder))};DataBoxSet.prototype.buildMessage=function(a){if(a.type=="error"){return new DataBoxMessageError(this,a.message)}else{return new DataBoxMessageNormal(this,a.message)}};DataBoxSet.prototype.broadcastMessage=function(b){for(var a=0;a<this.dataBox.length;a++){this.dataBox[a].showMessage(new DataBoxMessageNormal(this,b))}};DataBoxSet.prototype.removeMessages=function(){for(var a=0;a<this.dataBox.length;a++){this.dataBox[a].removeMessage()}};DataBoxSet.prototype.commitDataBoxSetValues=function(){for(var a=0;a<this.dataBox.length;a++){this.dataBox[a].commitValue()}};DataBoxSet.prototype.getDataBoxById=function(b){for(var a=0;a<this.dataBox.length;a++){if(this.dataBox[a].positiveMatchOnId(b)){return this.dataBox[a]}}};DataBoxSet.prototype.makeDataBoxSetEditable=function(b){this.dataBoxesPlaceholder.style.backgroundColor=this.placeholderBackgroundColor;for(var a=0;a<this.dataBox.length;a++){this.dataBox[a].drawEditableValue(this.dataBox[a]==b)}this.drawActionButtons()};DataBoxSet.prototype.removeActionButtons=function(){removeChildNodes(this.actionButtonsPlaceholder)};DataBoxSet.prototype.makeDataBoxSetNonEditable=function(){this.dataBoxesPlaceholder.style.backgroundColor="transparent";for(var a=0;a<this.dataBox.length;a++){this.dataBox[a].drawNonEditableValue()}this.removeActionButtons()};DataBoxSet.prototype.showMessagesPerDataBox=function(d){for(var c=0;c<d.length;c++){var a=this.getDataBoxById(d[c].id);if(a){var b=(d[c].response.type=="error")?new DataBoxMessageError(this,d[c].response.message):new DataBoxMessageNormal(this,d[c].response.message);a.showMessage(b)}}};DataBoxSet.prototype.getTextValueById=function(b){if(this.text){for(var a=0;a<this.text.length;a++){if(this.text[a].id==b){return this.text[a].value}}}return"NoText"};DataBoxSetDynEdit.prototype=new DataBoxSet();DataBoxSetDynEdit.prototype.constructor=DataBoxSetDynEdit;function DataBoxSetDynEdit(b,c,a,d){this.id=b;this.submitFile=c;this.startWithEdit=false;this.serverResponses=a;this.text=d;this.dataBox=[];this.param=[];this.messageBoxPosition="right"}DataBoxSetDynEdit.prototype.drawActionButtons=function(){this.submitButton=this.getSubmitButton();this.waitImage=this.getWaitImage();var a=this.getCancelButton();this.actionButtonsPlaceholder.appendChild(a);this.actionButtonsPlaceholder.appendChild(this.submitButton);this.actionButtonsPlaceholder.appendChild(this.waitImage)};DataBoxSetDynEdit.prototype.getCancelButton=function(){var a=document.createElement("button");a.appendChild(document.createTextNode(this.getTextValueById("cancel")));a.onclick=createMethodReference(this,this.cancelButtonClicked);a.style.marginBotttom="10px";return a};DataBoxSetDynEdit.prototype.actionOnResponse=function(a){switch(a.mainErrorId){case"None":this.commitDataBoxSetValues();this.makeDataBoxSetNonEditable();this.showGeneralMessage(this.buildMessage(a.mainErrorResponse));break;case"Databox":this.showMessagesPerDataBox(a.dataBoxResponse);break;default:this.showGeneralMessage(this.buildMessage(a.mainErrorResponse))}this.updateSubmitButton(false)};DataBoxSetAdd.prototype=new DataBoxSet();DataBoxSetAdd.prototype.constructor=DataBoxSetAdd;function DataBoxSetAdd(a,c,d,b,g,e,f){this.customPlaceholderActionButton=a;this.id=c;this.submitFile=d;this.startWithEdit=true;this.serverResponses=b;this.targetUrl=e;this.text=g;this.dataBox=[];this.param=[];if(f){this.dataBoxLabelWidth=((f.labelWidth)?f.labelWidth:"80")+"px"}this.messageBoxPosition="right"}DataBoxSetAdd.prototype.actionOnResponse=function(a){switch(a.mainErrorId){case"None":location.href=this.buildUrl(this.targetUrl,a.parameter);break;case"Databox":this.showMessagesPerDataBox(a.dataBoxResponse);this.updateSubmitButton(false);break;default:this.showGeneralMessage(this.buildMessage(a.mainErrorResponse));this.updateSubmitButton(false)}};DataBoxSetAdd.prototype.buildUrl=function(c,b){var e=c;for(var a=0;a<b.length;a++){var d=encodeURIComponent(b[a].id)+"="+encodeURIComponent(b[a].value);e+="&"+d}return e};DataBoxSetAdd.prototype.drawActionButtons=function(){this.submitButton=this.getSubmitButton();this.waitImage=this.getWaitImage();this.actionButtonsPlaceholder.appendChild(this.submitButton);this.actionButtonsPlaceholder.appendChild(this.waitImage)};DataBoxSetClassic.prototype=new DataBoxSet();DataBoxSetClassic.prototype.constructor=DataBoxSetClassic;function DataBoxSetClassic(b,c,a,d){this.id=b;this.submitFile=c;this.startWithEdit=true;this.serverResponses=a;this.text=d;this.dataBox=[];this.param=[];this.messageBoxPosition="right"}DataBoxSetClassic.prototype.submitButtonClicked=function(){var a=new DataBoxSubmitSessionClassic(this);this.removeMessages();a.submit()};DataBoxSetClassic.prototype.drawActionButtons=function(){this.submitButton=this.getSubmitButton();this.waitImage=this.getWaitImage();this.actionButtonsPlaceholder.appendChild(this.submitButton);this.actionButtonsPlaceholder.appendChild(this.waitImage)};function Text(a,b){this.id=a;this.value=b}function Param(a,b){this.id=a;this.value=b}Param.prototype.getQuery=function(){return encodeURIComponent(this.id)+"="+encodeURIComponent(this.value)};function DataBoxSubmitSession(){}DataBoxSubmitSession.prototype.getQuery=function(){var d="";for(var a=0;a<this.dataBox.length;a++){var c=this.dataBox[a].getQuery();if(d!=""&&c!=""){d+="&"}d+=c}for(var b=0;b<this.param.length;b++){var c=this.param[b].getQuery();if(d!=""&&c!=""){d+="&"}d+=c}return d};DataBoxSubmitSessionClassic.prototype=new DataBoxSubmitSession();DataBoxSubmitSessionClassic.prototype.constructor=DataBoxSubmitSessionClassic;function DataBoxSubmitSessionClassic(a){this.dataBoxSet=a;this.dataBox=a.dataBox;this.param=a.param}DataBoxSubmitSessionClassic.prototype.submit=function(){var a=this.getQuery();location.href=this.dataBoxSet.submitFile+"&"+a};DataBoxSubmitSessionAjax.prototype=new DataBoxSubmitSession();DataBoxSubmitSessionAjax.prototype.constructor=DataBoxSubmitSessionAjax;function DataBoxSubmitSessionAjax(a){this.dataBoxSet=a;this.dataBox=a.dataBox;this.param=a.param;this.submitFileFolder="/system"}DataBoxSubmitSessionAjax.prototype.submit=function(a){var b=this;var c=this.getQuery();this.oXmlHttp=this.createXMLHttp();this.action=this.submitFileFolder+"/"+a+((c!="")?"?"+c:"");this.oXmlHttp.open("POST",this.action,true);this.oXmlHttp.onreadystatechange=function(){b.onResponse()};this.oXmlHttp.send(this.action)};DataBoxSubmitSessionAjax.prototype.onResponse=function(){if(this.oXmlHttp.readyState==4){this.dataBoxSet.actionOnResponse(new ServerResponse(this.oXmlHttp,this.dataBoxSet.serverResponses));delete this.oXmlHttp}};DataBoxSubmitSessionAjax.prototype.createXMLHttp=function(){if(typeof XMLHttpRequest!="undefined"){return new XMLHttpRequest()}else{if(window.ActiveXObject){var a=["MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0","MSXML2.XMLHttp","Microsoft,XMLHttp"];for(var b=0;b<a.lenght;b++){try{var d=new ActiveXObject(a[b]);return d}catch(c){}}}}};function ServerResponse(a,b){this.xml=a.responseXML;this.responses=b;this.validXML=this.isValidXML(a.responseXML);this.mainErrorId=this.getMainErrorId();this.mainErrorResponse=this.getMainErrorResponse();this.dataBoxResponse=this.getFields();this.parameter=this.getParameters()}ServerResponse.prototype.containsErrors=function(){if(this.mainErrorId=="None"){return false}return true};ServerResponse.prototype.isValidXML=function(){if(!this.xml){return false}if(this.xml.firstChild==null){return false}var a=this.xml.getElementsByTagName("DataBoxSet");if(!a[0]){return false}return true};ServerResponse.prototype.getParameters=function(){function g(e,i){this.id=e;this.value=i}var f=[];if(this.validXML){try{var h=this.xml.getElementsByTagName("Parameter")}catch(a){}for(var b=0;b<h.length;b++){var d=h[b];var c=new g(d.getAttribute("Id"),d.childNodes[0].nodeValue);f.push(c)}}return f};ServerResponse.prototype.getMainErrorId=function(){if(this.validXML){var a=this.xml.getElementsByTagName("DataBoxSet");if(a[0]){return a[0].getAttribute("errorId")}}else{return"nonValidXML"}};ServerResponse.prototype.getMainErrorResponse=function(){return this.responses.getMessageById(this.mainErrorId)};ServerResponse.prototype.getFields=function(){function b(i,h){this.id=i;this.response=h}try{var c=this.xml.getElementsByTagName("DataBox")}catch(e){return[]}var a=[];for(var d=0;d<c.length;d++){var g=c[d];var f=new b(g.getAttribute("Id"),this.responses.getMessageById(g.getAttribute("ErrorId")));a.push(f)}return a};function ServerResponseMessages(a){this.message=a;this.defaultMessage=new ServerResponseMessage("unknown","error","An unknown error occured.")}ServerResponseMessages.prototype.getMessageById=function(c){var b=this.message.length;if(b>0){do{var a=b-1;if(this.message[a].id===c){return this.message[a]}}while(--b)}return this.defaultMessage};function ServerResponseMessage(a,c,b){this.id=a;this.type=c;this.message=b}function DataBox(c,b,a){this.placeholderId=c;this.id=b;this.dataBoxSet;this.mandatory=a;this.noLabel=false}DataBox.prototype.getPlaceholder=function(a){if(!this.placeholder){this.buildPlaceholder(a)}return this.placeholder};DataBox.prototype.buildPlaceholder=function(a){this.placeholder=document.createElement("div");this.placeholder.style.clear="both";this.placeholder.style.marginBottom="0.5em";var b=document.createElement("p");if(!this.noLabel){b.appendChild(document.createTextNode(this.name))}var c=document.createElement("div");c.style.width=this.dataBoxSet.dataBoxLabelWidth;c.style.cssFloat="left";c.style.styleFloat="left";c.appendChild(b);this.valuePlaceholder=document.createElement("div");this.valuePlaceholder.style.position="relative";this.valuePlaceholder.style.maxWidth="346px";this.valuePlaceholder.style.cssFloat="left";this.valuePlaceholder.style.styleFloat="left";this.placeholder.appendChild(c);this.placeholder.appendChild(this.valuePlaceholder);if(a){this.drawEditableValue()}else{this.drawNonEditableValue()}};DataBox.prototype.drawEditableValue=function(a){};DataBox.prototype.drawNonEditableValue=function(){var a=(this.value=="")?"":this.displayValue;this.valuePar=document.createElement("p");this.valuePar.appendChild(document.createTextNode(a));this.valuePar.style.backgroundColor=this.databoxSet.placeholderBackgroundColor;this.valuePar.style.paddingLeft="3px";this.valuePar.style.paddingRight="3px";this.valuePar.style.paddingTop="1px";this.valuePar.style.paddingBottom="0px";if(this.value==""){this.valuePar.style.width="13px";this.valuePar.style.height="18px"}this.valuePar.onclick=createMethodReference(this,this.clickOnNonEditableValue);this.clearValuePlaceholder();this.valuePlaceholder.appendChild(this.valuePar)};DataBox.prototype.clickOnNonEditableValue=function(){this.dataBoxSet.makeDataBoxSetEditable(this)};DataBox.prototype.clearValuePlaceholder=function(){removeChildNodes(this.valuePlaceholder)};DataBox.prototype.getQuery=function(){return encodeURIComponent(this.id)+"="+encodeURIComponent(this.getProposedValue())};DataBox.prototype.getProposedValue=function(){return this.input.value};DataBox.prototype.commitValue=function(){this.value=this.getProposedValue();this.displayValue=this.value};DataBox.prototype.showMessage=function(b){if(this.message){return}this.message=b;var a=b.getPlaceholder(this.valuePlaceholder,this.dataBoxSet.placeholder);this.dataBoxSet.placeholder.appendChild(a)};DataBox.prototype.removeMessage=function(){if(this.message){this.message.remove();this.message=null}};DataBox.prototype.inputChanged=function(){};DataBox.prototype.getValue=function(){return this.value};DataBox.prototype.positiveMatchOnId=function(a){return(this.id==a)};DataBoxHidden.prototype=new DataBox();DataBoxHidden.prototype.constructor=DataBoxText;function DataBoxHidden(a,b){this.id=a;this.value=b;this.dataBoxSet}DataBoxHidden.prototype.buildPlaceholder=function(a){this.placeholder=document.createElement("div")};DataBoxHidden.prototype.getQuery=function(){return encodeURIComponent(this.id)+"="+encodeURIComponent(this.getValue())};DataBoxHidden.prototype.getProposedValue=function(){return this.getValue()};DataBoxHidden.prototype.commitValue=function(){this.value=this.getProposedValue()};DataBoxText.prototype=new DataBox();DataBoxText.prototype.constructor=DataBoxText;function DataBoxText(g,e,f,h,c,d,a,b){this.placeholderId=g;this.id=e;this.name=f;this.value=unescape(h);this.displayValue=this.value;this.valueBackup=this.value;this.displayValueBackup=this.displayValue;this.maxChar=d;this.estimatedChar=c;this.mandatory=a;this.noLabel=(b)?b:false;this.dataBoxSet;this.minValueWidth=30;this.minInputWidth=100}DataBoxText.prototype.drawEditableValue=function(a){this.input=this.inputElem();this.clearValuePlaceholder();this.valuePlaceholder.appendChild(this.input);if(a){this.input.focus();this.input.select()}};DataBoxText.prototype.inputElem=function(){if(this.estimatedChar>100){return this.bigInputElem()}else{return this.normalInputElem()}};DataBoxText.prototype.normalInputElem=function(){var a=document.createElement("input");a.value=this.value;a.name=this.id;a.style.width=this.inputSize()+"px";a.style.height="15px";a.style.marginBottom="8px";a.maxLength=this.maxChar;return a};DataBoxText.prototype.bigInputElem=function(){var a=document.createElement("textarea");a.value=this.value;a.name=this.id;a.style.width="290px";a.style.height="60px";a.style.marginBottom="8px";a.maxLength=this.maxChar;return a};DataBoxText.prototype.inputSize=function(){iSizeAprox=this.estimatedChar;if(iSizeAprox<3){return 18}if(iSizeAprox<5){return 32}if(iSizeAprox<8){return 50}if(iSizeAprox<12){return 90}if(iSizeAprox<20){return 120}if(iSizeAprox<30){return 160}if(iSizeAprox<40){return 220}return 340};DataBoxPass.prototype=new DataBox();DataBoxPass.prototype.constructor=DataBoxPass;function DataBoxPass(f,d,e,c,a,b){this.placeholderId=f;this.id=d;this.name=e;this.value="";this.displayValue=this.value;this.maxChar=c;this.mandatory=a;this.noLabel=(b)?b:false;this.dataBoxSet;this.minValueWidth=30;this.minInputWidth=100}DataBoxPass.prototype.drawEditableValue=function(a){this.input=document.createElement("input");this.input.type="password";this.input.value=this.value;this.input.style.height="15px";if(this.valuePar){this.input.style.width=((this.valuePar.offsetWidth<this.minInputWidth)?this.minInputWidth:(this.valuePar.offsetWidth-4))+"px"}else{this.input.style.width=this.minInputWidth+"px"}this.input.style.marginBottom="8px";if(this.maxChar){this.input.maxLength=this.maxChar}this.clearValuePlaceholder();this.valuePlaceholder.appendChild(this.input);if(a){this.input.focus();this.input.select()}};DataBoxDropdown.prototype=new DataBox();DataBoxDropdown.prototype.constructor=DataBoxDropdown;function DataBoxDropdown(f,d,e,g,a,c,b){this.placeholderId=f;this.id=d;this.name=e;this.selectedOptionId=g;this.option=(c)?c:[];this.mandatory=a;this.noLabel=(b)?b:false;this.selectedOption=this.getOptionByValue(g);this.value=this.selectedOption.value;this.displayValue=this.selectedOption.name;this.dataBoxSet}DataBoxDropdown.prototype.drawEditableValue=function(a){this.input=document.createElement("select");for(var b=0;b<this.option.length;b++){this.input.appendChild(this.option[b].buildOption(this.option[b].value==this.selectedOptionId))}this.input.style.marginBottom="8px";this.input.value=this.value;this.input.onchange=createMethodReference(this,this.inputChanged);this.clearValuePlaceholder();this.valuePlaceholder.appendChild(this.input);if(a){this.input.focus()}};DataBoxDropdown.prototype.getOptionByValue=function(b){for(var a=0;a<this.option.length;a++){if(this.option[a].value===b){return this.option[a]}}return new DataOption("","Onbekend")};DataBoxDropdown.prototype.getProposedValue=function(){return this.input.value};DataBoxDropdown.prototype.commitValue=function(){this.selectedOption=this.getOptionByValue(this.input.value);this.value=this.selectedOption.value;this.displayValue=this.selectedOption.name};DataBoxDropdown.prototype.emptySelectbox=function(){while(this.input.hasChildNodes()){this.input.removeChild(this.input.firstChild)}};function DataOption(b,a){this.value=b;this.name=a}DataOption.prototype.buildOption=function(a){var b=document.createElement("option");b.appendChild(document.createTextNode(this.name));b.value=this.value;b.selected=a;return b};DataCheckboxOption.prototype=new DataOption();DataCheckboxOption.prototype.constructor=DataCheckboxOption;function DataCheckboxOption(b,a){this.value=b;this.name=a;this.dataBox}DataCheckboxOption.prototype.buildOption=function(a){this.buildInputOption(a);var b=document.createElement("div");b.style.paddingLeft="23px";b.style.position="relative";if(this.dataBox.floatOptions){b.style.cssFloat="left";b.style.styleFloat="left";b.style.paddingRight="7px"}var c=document.createElement("p");c.style.marginBottom="0.2em";c.appendChild(document.createTextNode(this.name));c.onclick=dataBoxCreateMethodReference(this,this.clickedOnName);b.appendChild(this.inputOption);b.appendChild(c);return b};DataCheckboxOption.prototype.buildInputOption=function(a){this.inputOption=document.createElement("input");this.inputOption.type="checkbox";if(a){this.inputOption.defaultChecked="checked"}this.inputOption.style.position="absolute";this.inputOption.style.top="-2px";this.inputOption.style.left="0px"};DataCheckboxOption.prototype.clickedOnName=function(){if(this.inputOption.checked){this.inputOption.checked=false}else{this.inputOption.checked=true}};DataCheckboxOption.prototype.selected=function(){return this.inputOption.checked};DataRadioOption.prototype=new DataCheckboxOption();DataRadioOption.prototype.constructor=DataRadioOption;function DataRadioOption(b,a){this.value=b;this.name=a;this.dataBox}DataRadioOption.prototype.buildInputOption=function(a){this.inputOption=document.createElement("input");this.inputOption.type="radio";this.inputOption.name=this.dataBox.id;this.inputOption.value=this.value;this.inputOption.checked=a;this.inputOption.style.position="absolute";this.inputOption.style.top="-2px";this.inputOption.style.left="0px"};DataRadioOption.prototype.clickedOnName=function(){this.inputOption.checked=true};DataBoxRadio.prototype=new DataBoxDropdown();DataBoxRadio.prototype.constructor=DataBoxRadio;function DataBoxRadio(g,e,f,h,b,d,c,a){this.placeholderId=g;this.id=e;this.name=f;this.selectedOptionValue=h;this.option=(d)?d:[];this.mandatory=b;this.noLabel=(c)?c:false;this.floatOptions=(a)?a:false;this.dataBoxSet}DataBoxRadio.prototype.drawEditableValue=function(b){this.input=document.createElement("div");var a=(this.selectedOptionValue.length==0&&this.selectAllIfNothing);for(var c=0;c<this.option.length;c++){this.option[c].dataBox=this;this.input.appendChild(this.option[c].buildOption(this.isSelected(this.option[c].value)||a))}this.valuePlaceholder.appendChild(this.input)};DataBoxRadio.prototype.isSelected=function(a){return false};DataBoxRadio.prototype.getProposedValue=function(){for(var a=0;a<this.option.length;a++){if(this.option[a].inputOption.checked){return this.option[a].inputOption.value}}return""};DataBoxCheckboxMultiple.prototype=new DataBoxDropdown();DataBoxCheckboxMultiple.prototype.constructor=DataBoxCheckboxMultiple;function DataBoxCheckboxMultiple(h,f,g,i,b,e,d,c,a){this.placeholderId=h;this.id=f;this.name=g;this.selectedOptionValue=this.makeArray(i);this.option=(e)?e:[];this.mandatory=b;this.noLabel=(c)?c:false;this.floatOptions=(a)?a:false;this.selectAllIfNothing=d;this.dataBoxSet}DataBoxCheckboxMultiple.prototype.makeArray=function(a){if(typeof a=="string"&&a.length>0){return a.split(",")}if(typeof a=="object"){return a}return[]};DataBoxCheckboxMultiple.prototype.isSelected=function(b){for(var a=0;a<this.selectedOptionValue.length;a++){if(this.selectedOptionValue[a]==b){return true}}return false};DataBoxCheckboxMultiple.prototype.drawEditableValue=function(b){this.input=document.createElement("div");var a=(this.selectedOptionValue.length==0&&this.selectAllIfNothing);for(var c=0;c<this.option.length;c++){this.option[c].dataBox=this;this.input.appendChild(this.option[c].buildOption(this.isSelected(this.option[c].value)||a))}this.valuePlaceholder.appendChild(this.input)};DataBoxCheckboxMultiple.prototype.getQuery=function(){return encodeURIComponent(this.id)+"="+this.getProposedValue()};DataBoxCheckboxMultiple.prototype.getProposedValue=function(){return this.getValue()};DataBoxCheckboxMultiple.prototype.getValue=function(){var b="";for(var a=0;a<this.option.length;a++){if(this.option[a].selected()){if(b.length>0){b+=","}b+=encodeURIComponent(this.option[a].value)}}return b};DataBoxCheckbox.prototype=new DataBox();DataBoxCheckbox.prototype.constructor=DataBoxCheckbox;function DataBoxCheckbox(d,b,c,e,a){this.placeholderId=d;this.id=b;this.name=c;this.value=unescape(e);this.displayValue=this.value;this.mandatory=a;this.dataBoxSet}DataBoxCheckbox.prototype.drawEditableValue=function(a){};DataBoxCheckbox.prototype.drawNonEditableValue=function(){this.input=document.createElement("input");this.input.type="checkbox";this.input.style.marginBottom="8px";this.clearValuePlaceholder();this.valuePlaceholder.appendChild(this.input)};function DataBoxMessage(){}DataBoxMessage.prototype.build=function(h,i){var b=findPos(h);var c=findPos(i);this.placeholder=document.createElement("div");this.placeholder.style.position="absolute";var f=document.createElement("div");f.style.backgroundColor=this.color;f.style.color="White";f.style.position="absolute";f.style.minWidth="200px";f.style.padding="2px 4px 4px 16px";f.style.zIndex="1";var d=document.createElement("p");d.style.margin="0px";d.style.lineHeight="1em";d.appendChild(document.createTextNode(this.message));var g=document.createElement("img");g.style.position="absolute";var e=document.createElement("img");e.src=this.imageFolder+this.iconSrc;e.style.position="absolute";e.style.left="3px";e.style.top="3px";e.style.width="10px";e.style.height="10px";var a=document.createElement("img");a.src=this.imageFolder+"close.png";a.style.position="absolute";a.style.right="2px";a.style.top="2px";a.style.width="10px";a.style.height="10px";a.style.cursor="pointer";a.onclick=dataBoxCreateMethodReference(this,this.remove);if(this.position=="bottom"){g.style.width="16px";g.style.height="6px";g.src=this.imageFolder+this.arrowSrcFileTop;this.placeholder.style.top=(h.offsetHeight-9)+"px";this.placeholder.style.left=(b[0]-c[0]+10)+"px";f.style.left="0px";f.style.top="6px";g.style.left="0px";g.style.top="0px"}else{g.style.width="6px";g.style.height="16px";g.src=this.imageFolder+this.arrowSrcFileLeft;this.placeholder.style.top=(b[1]-c[1]+((h.offsetHeight/2)-Math.floor(this.placeholder.offsetHeight/2)-13))+"px";this.placeholder.style.left=((b[0]-c[0]+h.offsetWidth)+3)+"px";f.style.left="6px";f.style.top="0px";g.style.left="0px";g.style.top="0px"}f.appendChild(d);f.appendChild(e);f.appendChild(a);this.placeholder.appendChild(g);this.placeholder.appendChild(f)};DataBoxMessage.prototype.remove=function(){removeChildNodes(this.placeholder)};DataBoxMessage.prototype.getPlaceholder=function(a,b){if(!this.placeholder){this.build(a,b)}return this.placeholder};DataBoxMessageNormal.prototype=new DataBoxMessage();DataBoxMessageNormal.prototype.constructor=DataBoxMessage;function DataBoxMessageNormal(a,b){this.message=b;this.color=a.messageNormalColor;this.imageFolder=a.imageFolder;this.arrowSrcFileLeft="messagebox_arrow_left.png";this.arrowSrcFileTop="messagebox_arrow_top.png";this.iconSrc="icon_ok.png";this.position=a.messageBoxPosition}DataBoxMessageError.prototype=new DataBoxMessage();DataBoxMessageError.prototype.constructor=DataBoxMessage;function DataBoxMessageError(a,b){this.message=b;this.color=a.messageErrorColor;this.imageFolder=a.imageFolder;this.arrowSrcFileLeft="messagebox_arrow_left.png";this.arrowSrcFileTop="messagebox_arrow_top.png";this.iconSrc="icon_attention.png";this.position=a.messageBoxPosition}function dataBoxCreateMethodReference(b,a){if(!(a instanceof Function)){a=b[a]}return function(){a.apply(b,arguments)}}function removeChildNodes(a){if(a){while(a.hasChildNodes()){a.removeChild(a.firstChild)}}}function findPos(c){var a=0;var b=0;if(c.offsetParent){do{a+=c.offsetLeft;b+=c.offsetTop}while(c=c.offsetParent)}return[a,b]}function TWTicker(b,a){this.tickerObject=[];this.tickerStrip=[];this.placeholder=document.getElementById(b);this.objectSpace=a.objectSpace||35;this.timer=a.timer||50;this.pixMove=a.pixMove||1;if(!this.placeholder){throw new Error("Placeholder niet gevonden.")}if(isNaN(this.objectSpace)){throw new Error("The space between objects requires a number.")}if(isNaN(this.timer)){throw new Error("The timer requires a number.")}if(isNaN(this.pixMove)){throw new Error("The amount of pixels to move requires a number.")}}TWTicker.prototype.addTickerObject=function(a){this.tickerObject.push(a)};TWTicker.prototype.stripNeeded=function(){var d=0,e=0,f=0,g=0;if(this.tickerStrip.length<=0){return 1}else{d=this.placeholderWidth;e=this.tickerStrip[0].width;f=this.placeholderLeftPos-this.tickerStrip[0].currentPosX;while(g<Math.ceil((d+f)/e)){g++}return g}};TWTicker.prototype.fillStrips=function(){var a;while(this.tickerStrip.length<this.stripNeeded()){a=this.addStrip();this.calculateStripWidth();this.placeholder.appendChild(a.element);a.width=this.tickerStripWidth;a.height=this.placeholderHeight;a.currentPosX=a.element.offsetLeft;a.element.style.width=this.tickerStripWidth+"px";this.positionStrips()}};TWTicker.prototype.positionStrips=function(){var a,b,c;for(a=0;a<this.tickerStrip.length;a++){if(a!==0){b=a-1;c=this.tickerStrip[b].width+this.tickerStrip[b].currentPosX;this.tickerStrip[a].element.style.left=c+"px";this.tickerStrip[a].currentPosX=c}}};TWTicker.prototype.addStrip=function(){var a=new TWTickerStrip(this.tickerObject,this.objectSpace);this.tickerStrip.push(a);return a};TWTicker.prototype.deleteStrip=function(){var c=0,d=0;c=this.tickerStrip[0].currentPosX;d=this.tickerStrip[0].width;if(c<(-d)){this.placeholder.removeChild(this.tickerStrip[0].element);this.tickerStrip.splice(0,1)}};TWTicker.prototype.calculateStripWidth=function(){var a=0,c=0,b=0;while(a<this.tickerObject.length){c=c+this.tickerObject[a].width;a++}b=this.objectSpace*this.tickerObject.length;this.tickerStripWidth=(c+b)};TWTicker.prototype.animate=function(){var b=this,a=0;this.deleteStrip();this.fillStrips();while(a<this.tickerStrip.length){this.tickerStrip[a].moveToPosition(this.pixMove);a++}window.setTimeout(function(){b.animate()},this.timer)};TWTicker.prototype.init=function(){this.placeholderWidth=this.placeholder.offsetWidth;this.placeholderHeight=this.placeholder.offsetHeight;this.placeholderLeftPos=this.placeholder.offsetLeft;this.fillStrips();if(this.placeholderHeight===0){throw new Error("The height of the TWTicker placeholder could not be determined.")}this.placeholder.style.position="relative";this.placeholder.style.overflow="hidden";this.placeholder.style.height=this.placeholderHeight+"px";this.placeholder.style.width=this.placeholderWidth+"px";this.placeholder.style.margin="auto";this.animate()};function TWTickerStrip(b,a){this.tickerObject=b;this.objectSpace=a;this.element=this.buildElement()}TWTickerStrip.prototype.buildElement=function(){var a=0,b;b=document.createElement("div");b.className="tickerStrip";b.style.position="absolute";b.style.whiteSpace="nowrap";while(a<this.tickerObject.length){b.appendChild(this.tickerObject[a].buildElement(this.objectSpace));a++}return b};TWTickerStrip.prototype.moveToPosition=function(c){var a=c,b=this.currentPosX-a;this.element.style.left=b+"px";this.currentPosX=b};function TWTickerImage(b,a,c){this.width=b;this.height=a;this.src=c}TWTickerImage.prototype.buildElement=function(c){var b,a;a=document.createElement("div");a.className="tickerObject";a.style.cssFloat="left";a.style.styleFloat="left";a.style.width=this.width+"px";a.style.marginRight=c+"px";b=document.createElement("img");b.src=this.src;b.style.width=this.width+"px";b.style.height=this.height+"px";b.style.display="block";a.appendChild(b);return a};
