PGL.viz=PGL.viz||{};PGL.viz.miscClass=Class.create({initialize:function(){PGL.viz.misc=this;this.vml()},vml:function(){if(Prototype.Browser.IE8)document.namespaces.add("ns_vml","urn:schemas-microsoft-com:vml","#default#VML");else if(Prototype.Browser.IE&&!Prototype.Browser.IE8)document.createStyleSheet().cssText="ns_vml\\:*{behavior:url(#default#VML)}"},body:function(){$$("html").first().setStyle({height:"100%"});$$("body").first().setStyle({height:"100%",margin:"0px",overflow:"hidden"});$$("body").first().writeAttribute("scroll","no")},
style:function(a,b){if(a=$(a)){b=b.camelize();var c=["#"+a.id];a.className.split(/\s+/).each(function(a){c.push("."+a)});if(a.style[b]!="undefined"&&a.style[b]!="")return a.style[b];var e=!1;$H(document.styleSheets).each(function(a){try{$H(a.value.cssRules?a.value.cssRules:a.value.rules).each(function(a){a.value.style&&a.value.style[b]&&a.value.selectorText.split(/\s+/).each(function(d){c.indexOf(d)!=-1&&(e=a.value.style[b])})})}catch(j){}});return e?e:!1}},format:function(a){a=a.toString();a.indexOf("%")==
-1&&(a=parseFloat(a)+"px");return a},px:function(a,b,c,e){e=e.toString();e.indexOf("%")!=-1&&(a=c=="width"?b.getWidth():b.getHeight(),e=parseFloat(e.replace("%","")),e/=100,e*=a);e==""&&(e=0);return e=this.format(e)},style_float:function(a,b){b=parseFloat(a.getStyle(b));if(!b||isNaN(b))b=0;return b},margin:function(a){var b={};b.left=this.style_float(a,"marginLeft");b.right=this.style_float(a,"marginRight");b.top=this.style_float(a,"marginTop");b.bottom=this.style_float(a,"marginBottom");b.width=
b.left+b.right;b.height=b.top+b.bottom;return b},padding:function(a){var b={};b.left=this.style_float(a,"paddingLeft");b.right=this.style_float(a,"paddingRight");b.top=this.style_float(a,"paddingTop");b.bottom=this.style_float(a,"paddingBottom");b.width=b.left+b.right;b.height=b.top+b.bottom;return b},border:function(a){var b={};b.color=a.getStyle("borderLeftColor");b.left=this.style_float(a,"borderLeftWidth");b.right=this.style_float(a,"borderRightWidth");b.top=this.style_float(a,"borderTopWidth");
b.bottom=this.style_float(a,"borderBottomWidth");b.width=b.left+b.right;b.height=b.top+b.bottom;return b},center:function(a,b,c,e){var d={position:"absolute"};a=this.margin(a);if(e)a.left=0,a.right=0,a.top=0,a.bottom=0;value=b.toString();value.indexOf("%")!=-1?(value=parseFloat(value.replace("%","")),value=(100-value)/2,value=this.format(value+"%"),d.left=value,d.right=value,d.marginLeft=a.left+"px",d.marginRight=a.right+"px"):(value=parseFloat(value),b=value/2,value=this.format(value),b=this.format(b),
d.left="50%",d.right="50%",d.marginLeft="-"+b,d.marginRight="-"+b);value=c.toString();value.indexOf("%")!=-1?(value=parseFloat(value.replace("%","")),value=(100-value)/2,value=this.format(value+"%"),d.top=value,d.bottom=value,d.marginTop=a.top+"px",d.marginBottom=a.bottom+"px"):(value=parseFloat(value),b=value/2,value=this.format(value),b=this.format(b),d.top="50%",d.bottom="50%",d.marginTop="-"+b,d.marginBottom="-"+b);return d},content:function(a){var b=!1;a.childElements().each(function(a){a.id==
"viz_content"&&(b=a)});if(!b){a.getStyle("position")!="absolute"&&a.setStyle({position:"relative"});b=new Element("div",{id:"viz_content"});var c=this.padding(a),e=this.border(a);b.setStyle({position:"absolute",zIndex:2,left:"0px",right:"0px",top:"0px",bottom:"0px",overflow:a.getStyle("overflow"),textAlign:a.getStyle("textAlign"),paddingLeft:c.left,paddingRight:c.right,paddingTop:c.top,paddingBottom:c.bottom,border:e.left+"px "+e.color+" solid",backgroundImage:a.getStyle("backgroundImage"),backgroundColor:a.getStyle("backgroundColor")});
a.setStyle({overflow:"visible",textAlign:"",padding:"0px",border:"0px",background:"",backgroundImage:"",backgroundColor:"transparent"});a.style.width&&a.setStyle({width:a.getStyle("width")});a.style.height&&a.setStyle({height:a.getStyle("height")});b.className=a.className;for(a.className="";a.firstChild;)b.appendChild(a.firstChild);a.appendChild(b);a.content=b;a.update=function(a){this.content&&this.content.update(a)}}return b},elements:function(a,b,c){var e=!1;a.childElements().each(function(a){a.id==
b&&(e=a)});if(!e){e=new Element("div",{id:b});e.elements={};e.setStyle({position:"absolute",zIndex:c,left:"0px",right:"0px",top:"0px",bottom:"0px"});c=new Element("div");c.setStyle({position:"absolute",overflow:"hidden"});var d=c.clone();e.insert(d);e.elements.lt=d;d=c.clone();e.insert(d);e.elements.mt=d;d=c.clone();e.insert(d);e.elements.rt=d;d=c.clone();e.insert(d);e.elements.lm=d;d=c.clone();e.insert(d);e.elements.mm=d;d=c.clone();e.insert(d);e.elements.rm=d;d=c.clone();e.insert(d);e.elements.lb=
d;d=c.clone();e.insert(d);e.elements.mb=d;c=c.clone();e.insert(c);e.elements.rb=c;this.update_elements(e.elements,6);a.insert(e)}return e},update_elements:function(a,b){a.lt.setStyle({left:"0px",top:"0px",width:b+"px",height:b+"px"});a.mt.setStyle({left:b+"px",top:"0px",right:b+"px",height:b+"px"});a.rt.setStyle({right:"0px",top:"0px",width:b+"px",height:b+"px"});a.lm.setStyle({left:"0px",top:b+"px",bottom:b+"px",width:b+"px"});a.mm.setStyle({left:b+"px",bottom:b+"px",right:b+"px",top:b+"px"});a.rm.setStyle({right:"0px",
bottom:b+"px",width:b+"px",top:b+"px"});a.lb.setStyle({left:"0px",bottom:"0px",width:b+"px",height:b+"px"});a.mb.setStyle({left:b+"px",bottom:"0px",right:b+"px",height:b+"px"});a.rb.setStyle({right:"0px",bottom:"0px",width:b+"px",height:b+"px"})},rgb_color:function(a,b){var c={};a.charAt(0)=="#"&&(a=a.substr(1,6));a=a.replace(/ /g,"");a=a.toLowerCase();for(var e=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(a){return[parseInt(a[1]),
parseInt(a[2]),parseInt(a[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]}}],d=0;d<e.length;d++){var j=e[d].process,i=e[d].re.exec(a);if(i)channels=j(i),c.r=channels[0],c.g=channels[1],c.b=channels[2]}c.r=c.r<0||isNaN(c.r)?0:c.r>255?255:c.r;c.g=c.g<
0||isNaN(c.g)?0:c.g>255?255:c.g;c.b=c.b<0||isNaN(c.b)?0:c.b>255?255:c.b;c.rgb="rgb("+c.r+", "+c.g+", "+c.b+")";c.rgba=b?"rgba("+c.r+", "+c.g+", "+c.b+", "+b+")":"rgba("+c.r+", "+c.g+", "+c.b+", 1)";return c},draw:function(a){a=Object.clone(a);var b=Prototype.Browser.IE?new Element("div"):new Element("canvas"),c=100,e=100,d=0;if(a.radius)d=a.radius,c=a.radius*2,e=a.radius*2;if(a.width)c=a.width;if(a.height)e=a.height;var j="#fff";if(a.color)j=a.color;var i=0;if(a.borderWidth)i=a.borderWidth;var n=
j;if(a.borderColor)n=a.borderColor;var m=1;if(a.alpha)m=a.alpha;var l=1;if(a.level)l=a.level;b.writeAttribute("width",c);b.writeAttribute("height",e);b.setStyle({position:"absolute",overflow:"hidden",left:"0px",top:"0px",right:"0px",bottom:"0px",width:c+"px",height:e+"px"});a.position&&a.position.startsWith("r")&&b.setStyle({left:"",right:"0px"});a.position&&a.position.endsWith("b")&&b.setStyle({top:"",bottom:"0px"});if(!(l<1)){for(var f=0,g=0,k=0;k<l;k++)if(width=c-k*2,height=e-k*2,a.position&&(width=
c,height=e),g=f=k,a.position&&(a.position.startsWith("r")&&(f*=-1),a.position.endsWith("b")&&(g*=-1)),l>1&&(m=k==l-1?0.29:0.045+k*0.01),Prototype.Browser.IE)f*=10,g*=10,tWidth=width*10-10,tHeight=height*10-10,tRadius=d*10,tBorder="f",i>0&&(tBorder="t"),path="m "+f+","+(g+tRadius),path+="qy "+(f+tRadius)+","+g,path+="l "+(f+tWidth-tRadius)+","+g,path+="qx "+(f+tWidth)+","+(g+tRadius),path+="l "+(f+tWidth)+","+(g+tHeight-tRadius),path+="qy "+(f+tWidth-tRadius)+","+(g+tHeight),path+="l "+(f+tRadius)+
","+(g+tHeight),path+="qx "+f+","+(g+tHeight-tRadius),path+="l "+f+","+(g+tRadius),path+="e",html='<ns_vml:shape style="position:absolute; width:10px; height:10px;" coordsize="100,100" filled="t" fillcolor="'+j+'" stroked="'+tBorder+'" strokecolor="'+n+'" strokeweight="'+i+'px" path="'+path+'"><ns_vml:fill opacity="'+m+'"></ns_vml:fill></ns_vml:shape>',b.insert(html);else{var o=this.rgb_color(j,m),h=b.getContext("2d");h.fillStyle=o.rgba;h.beginPath();h.moveTo(f,g);h.lineTo(f,g+height-d);h.quadraticCurveTo(f,
g+height,f+d,g+height);h.lineTo(f+width-d,g+height);h.quadraticCurveTo(f+width,g+height,f+width,g+height-d);h.lineTo(f+width,g+d);h.quadraticCurveTo(f+width,g,f+width-d,g);h.lineTo(f+d,g);h.quadraticCurveTo(f,g,f,g+d);h.fill();if(i>0)tBorderColor=this.rgb_color(n),h.strokeStyle=tBorderColor.rgb,h.lineWidth=i+0.5,h.beginPath(),h.arc(d,d,d,0,Math.PI*2,!0),h.stroke()}if(a.element&&(a.element.insert(b),Prototype.Browser.IE))b.outerHTML=b.outerHTML}}});new PGL.viz.miscClass;

var _class=Class.create(PGL.viz.miscClass,{initialize:function(){PGL.viz.rounded=this.init.bind(this);PGL.viz.roundedClass=this;this.load()},load:function(){$$("div[rounded]").each(function(a){typeof a.readAttribute("rounded")!="function"&&!a.readAttribute("rounded").startsWith("function")&&(a.writeAttribute("drounded",a.readAttribute("rounded")),a.removeAttribute("rounded"))});if((element=$$("div[drounded]").first())&&typeof element!="undefined")options=element.readAttribute("drounded").evalJSON(),
element.removeAttribute("drounded"),PGL.viz.rounded(element,options),PGL.viz.roundedClass.load()},options:function(a,e){if(typeof e=="boolean"&&e==!1)return{lt:!1,rt:!1,lb:!1,rb:!1,radius:0};typeof e!="object"&&(e={});oOptions={lt:!0,rt:!0,lb:!0,rb:!0,radius:6};e=Object.extend(oOptions,e);if(!e.backgroundColor)e.backgroundColor=a.getStyle("backgroundColor");return e},init:function(a,e){a=$(a);var c=this.content(a),f=this.elements(a,"viz_rounded",1),g=f.elements;$H(g).each(function(a){a=a.value;a.setStyle({backgroundColor:"transparent",
border:"0px"});a.down(0)&&a.down(0).destroy()});if(a.oRounded&&a.oRounded.org_color){var b=a.oRounded.org_border;c.setStyle({top:"0px",bottom:"0px",backgroundColor:a.oRounded.org_color,border:b.left+"px "+b.color+" solid"})}a.oRounded=this.options(c,e);a.oRounded.element=f;a.oRounded.org_color=c.getStyle("backgroundColor");a.oRounded.org_border=this.border(c);this.build(a,c,g);c.setStyle({backgroundColor:"transparent",border:"0px"});(a.oRounded.lt||a.oRounded.rt)&&c.setStyle({top:a.oRounded.radius+
"px"});(a.oRounded.lb||a.oRounded.rb)&&c.setStyle({bottom:a.oRounded.radius+"px"});try{PGL.viz.view&&a.id&&PGL.viz.view.elements.get(a.id)&&PGL.viz.view.calculate(a)}catch(d){}if(!a.rounded)a.rounded=function(a){PGL.viz.rounded(this.id,a)};a.bRounded=!0;PGL.viz.shadow&&a.bShadow&&PGL.viz.shadow(a)},build:function(a,e,c){c=$H(c);var f=$H(a.oRounded),g=f.get("radius");this.update_elements(c.toObject(),g);c.each(function(b){var d=b.value,c=e.getStyle("backgroundColor");if((b.key=="lt"||b.key=="mt"||
b.key=="rt")&&f.get("backgroundColorTop"))c=f.get("backgroundColorTop");if((b.key=="lb"||b.key=="mb"||b.key=="rb")&&f.get("backgroundColorBottom"))c=f.get("backgroundColorBottom");if(f.get(b.key)){b={element:d,radius:g,color:c,position:b.key};if(a.oRounded.org_border.left>0)b.borderWidth=a.oRounded.org_border.left,b.borderColor=a.oRounded.org_border.color;this.draw(b)}else d.setStyle({backgroundColor:c}),b.key=="mt"&&(d.setStyle({borderTop:a.oRounded.org_border.left+"px "+a.oRounded.org_border.color+
" solid"}),d.setStyle({height:a.oRounded.radius-a.oRounded.org_border.left+"px"}),Prototype.Browser.IE&&d.setStyle({height:a.oRounded.radius-a.oRounded.org_border.left+1+"px"})),b.key=="lm"&&d.setStyle({borderLeft:a.oRounded.org_border.left+"px "+a.oRounded.org_border.color+" solid"}),b.key=="rm"&&d.setStyle({borderRight:a.oRounded.org_border.left+"px "+a.oRounded.org_border.color+" solid"}),b.key=="mb"&&(d.setStyle({borderBottom:a.oRounded.org_border.left+"px "+a.oRounded.org_border.color+" solid"}),
d.setStyle({height:a.oRounded.radius-a.oRounded.org_border.left+"px"}),Prototype.Browser.IE&&d.setStyle({height:a.oRounded.radius-a.oRounded.org_border.left+1+"px"})),b.key=="lt"&&(d.setStyle({borderTop:a.oRounded.org_border.left+"px "+a.oRounded.org_border.color+" solid"}),d.setStyle({borderLeft:a.oRounded.org_border.left+"px "+a.oRounded.org_border.color+" solid"})),b.key=="rt"&&(d.setStyle({borderTop:a.oRounded.org_border.left+"px "+a.oRounded.org_border.color+" solid"}),d.setStyle({borderRight:a.oRounded.org_border.left+
"px "+a.oRounded.org_border.color+" solid"})),b.key=="lb"&&(d.setStyle({borderBottom:a.oRounded.org_border.left+"px "+a.oRounded.org_border.color+" solid"}),d.setStyle({borderLeft:a.oRounded.org_border.left+"px "+a.oRounded.org_border.color+" solid"})),b.key=="rb"&&(d.setStyle({borderBottom:a.oRounded.org_border.left+"px "+a.oRounded.org_border.color+" solid"}),d.setStyle({borderRight:a.oRounded.org_border.left+"px "+a.oRounded.org_border.color+" solid"}))}.bind(this))}});new _class;
Element.addMethods({rounded:function(a,e){PGL.viz.rounded(a,e)},pgx_clone_rounded:Element.Methods.pgx,pgx:function(a,e,c){c=Object.clone(c);var f=c.onComplete;c.onComplete=function(a,b){try{Object.isFunction(f)&&f(a,b)}catch(c){}PGL.viz.roundedClass.load()};return a.pgx_clone_rounded(e,c)}});

var _class=Class.create({initialize:function(){PGL.prototip={};PGL.prototip.tip=this.tip},tip:function(a,b,c){if(typeof b=="object"){c=b;b=""}if(typeof b=="undefined")b="";if(typeof c=="undefined")c={};$(a).prototip_clone=$(a).prototip;tip=new Tip(a,b,c);$(a).prototip.remove_clone=$(a).prototip.remove;$(a).prototip.remove=function(){$(a).prototip.remove_clone();$(a).prototip=$(a).prototip_clone}.bind(a);$(a).prototip.show();$(a).prototip.hide();tip=$(tip.tip);tip.prototip=$(a).prototip;return tip}});
new _class;Element.addMethods({prototip:function(a,b,c){return PGL.prototip.tip(a,b,c)}});

var _class=Class.create({initialize:function(){PGL.browser=PGL.browser||{};PGL.browser.detect={};PGL.browser.detect.browser=this.searchString(this.dataBrowser)||false;PGL.browser.detect.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||false;PGL.browser.detect.os=this.searchString(this.dataOS)||false},searchString:function(b){for(var a=0;a<b.length;a++){var c=b[a].string,d=b[a].prop;this.versionSearchString=b[a].versionSearch||b[a].identity;if(c){if(c.indexOf(b[a].subString)!=
-1)return b[a].identity}else if(d)return b[a].identity}},searchVersion:function(b){var a=b.indexOf(this.versionSearchString);if(a!=-1)return parseFloat(b.substring(a+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,
subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",
identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.userAgent,subString:"iPhone",identity:"iPhone/iPod"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]});new _class;

var _class = Class.create({

	initialize: function() {
		
		if (typeof pgiEdit == 'undefined') {
			this.menuelm = $$('.menu_ov').first();
			this.menu();
		}
		
		this.animate.delay(1.5);
		
		// Element
		this.element = $('gallery');
		
		// Body
		PGL.viz.misc.body();
		
		// Get
		this.getphotos();
		
		// Resize
		Event.observe(window, 'resize', (function() {
			window.clearTimeout(this.delay);
			this.delay = (function() {
				this.draw(this.current);
			}).bind(this).delay(0.5);
		}).bind(this));
	},
	
	getphotos: function() {
		pgx('local.portfolio', {
			onComplete: function(response) {
				// Response
				sResponse = response.responseText;				
				if (sResponse.search('<html>') !== -1) {
					return this.getphotos();
				}
				this.images = response.responseText.evalJSON();
				this.length = this.images.length-1;
				
				// First
				this.current = 0;
				this.show(this.current);
			}.bind(this)
		});
	},
	
	periodical: function() {
		this.pe = new PeriodicalExecuter(function(pe) {
			this.next();
		}.bind(this), 4);
	},
	
	show: function(n, recent) {
		
		if (recent) {
			var check = false;
			this.images.each(function(pair) {
				if (pair.value.id == n) {
					check = pair.key;
				}
			});
			n = check;
		}
		
		// Draw
		this.draw(n);
	},
	
	next: function() {
		this.current++;
		if (this.current > this.length) {
			this.current = 0;
		}
		this.show(this.current);
	},
	
	previous: function() {
		this.current--;
		if (this.current < 0) {
			this.current = this.length;
		}
		this.show(this.current);
	},
	
	draw: function(n) {		
		// Periodical
		try {
			this.pe.stop();
		} catch(e) {}
		
		// Fade
		if (!this.element.innerHTML.empty()) {
			if (this.element.down('#vml_background')) {
				$('vml_background').fade({
					duration: 0.15,
					afterFinish: function() {
						this.element.update();
						this.draw(n);
					}.bind(this)
				});
			} else {
				this.element.fade({
					duration: 0.15,
					afterFinish: function() {
						this.element.update();
						this.draw(n);
					}.bind(this)
				});
			}
			
			return;
		}
		// Draw
		var dimensions = this.element.getDimensions();
		dimensions.width += 20;
		dimensions.height += 20;
		
		this.element.setStyle({
			left: '50%',
			marginLeft: '-' + ((dimensions.width) / 2) + 'px',
			top: '50%',
			marginTop: '-' + ((dimensions.height) / 2) + 'px'
		});

		var image = new Image();
		image.onload = function() {
			var width = dimensions.width;
			var height = dimensions.height;
			
			var factor = (image.width / image.height);
			height = (width / factor);
			
			if (height < dimensions.height) {
				factor = (dimensions.height / height);
				width = (width * factor);
				height = (height * factor);
			}
			
			var margin = {
				left: ((dimensions.width - width) / 2),
				top: ((dimensions.height - height) / 2)
			}
			
			if (!Prototype.Browser.IE6 && !Prototype.Browser.IE7 && !Prototype.Browser.IE8) {
				var canvas = new Element('canvas');
				var ctx = canvas.getContext('2d');
				
				canvas.width = dimensions.width;
				canvas.height = dimensions.height;
				this.element.update(canvas);
				this.element.setOpacity(0.0);
				
				ctx.drawImage(image, margin.left, margin.top, width, height);
				this.element.appear({ duration: 0.3 });
			} else {
				var vml = new Element("ns_vml:image", { id: 'vml_background' });
				vml.setStyle({
					position: 'absolute',
					width: parseInt(width) + 'px',
					height: parseInt(height) + 'px',
					marginLeft: parseInt(margin.left) + 'px',
					marginTop: parseInt(margin.top) + 'px'
				});
				
				this.element.update(vml);
				$('vml_background').setOpacity(0.0);
				vml.src = image.src;
				vml.outerHTML = vml.outerHTML;
				$('vml_background').appear({
					duration: 0.3,
					afterFinish: function() {
						$('vml_background').outerHTML = $('vml_background').outerHTML;
					}
				});
			}
			
			// Periodical
			this.periodical();
		}.bind(this);
		
		image.src = this.images[n];
		
	},
	
	animate: function() {
		iDelay = 0;
		$$('.recent_rep').each( function(rep, index) {
			(function() {
				rep.setStyle({ display: 'inline' });
				rep.morph('width:82px; height:60px;', {
					transition: Effect.Transitions.spring,
					duration: 1.0
				});
			}).bind(rep).delay((index * 0.1));
		});
	},
	
	menu: function() {
		
		var width = document.viewport.getDimensions().width;
		if (width < 1080) {
			var right = width - 980;
			if (right < 0) right = 0;
			this.menuelm.setStyle({ right: right + 'px' });
		} else {
			this.menuelm.setStyle({ right: '100px' });
		}
		
	}
	
	

});


var Home = new _class();

Event.observe(window, 'resize', function() { if (typeof pgiEdit == 'undefined') Home.menu(); });

var _class = new Class.create({
	
	initialize: function() {
		
		this.Menu.menu();
		this.Menu.top();
		
		if (typeof pgiEdit == 'undefined') {
			this.chat();
		}
		
	},
	
	chat: function() {
		window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=
		z.s=d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o
		){z.set._.push(o)};$.setAttribute('charset','utf-8');$.async=!0;z.set.
		_=[];$.src=('https:'==d.location.protocol?'https://ssl':'http://cdn')+
		'.zopim.com/?lwQsMPU5349n4nL9lg4K9KlyF68EGxvb';$.type='text/java'+s;z.
		t=+new Date;z._=[];e.parentNode.insertBefore($,e)})(document,'script')
		$zopim(function() {$zopim.livechat.setLanguage(document.body.readAttribute('lang'));});
	},
	
	Menu: {
	
		menu: function() {
			
			$$('.menu').each( function(menu) {
				
				menu.observe('click', function() {
					window.location = menu.down('a').href;
				});
				
			});
			
		},
		
		top: function() {
			
			$$('.li_menu_top').each( function(menu) {
				var link = menu.down('a');
				ct = link.innerHTML;
				if (ct == 'Zoeken' || ct == 'Search') {
					
					menu.insert({ 'top': $('search_ov') });					
					link.href = 'javascript:;';					
					link.observe('click', function() {
						$('search_ov').toggle();
					});
							
				}
			});
			
		}
	}

});

new _class();

_gaq.push(['_setAccount', 'UA-22732052-1'], ['_trackPageview']);

var addthis_config = addthis_config || {}; addthis_config.data_ga_property = 'UA-22732052-1'; addthis_config.data_ga_social = true;

PGX.js.push("http:\/\/www.tiypg.com\/_pgx\/shared\/viz\/misc\/2.5\/misc.js","http:\/\/www.tiypg.com\/_pgx\/shared\/viz\/rounded\/2.5\/rounded.js","http:\/\/www.tiypg.com\/_pgx\/shared\/prototip\/2.1.2\/prototip.js","http:\/\/www.tiypg.com\/_pgx\/shared\/browser\/detect\/2.3\/detect.js","\/_templates\/root\/scripts\/home.js","\/_templates\/root\/scripts\/overall.js","http:\/\/www.tiypg.com\/_pgx\/shared\/prototip\/2.1.2\/scripts\/prototip.js");
PGX.css.push("\/_pgx\/core\/load\/2.3\/env.css","http:\/\/www.tiypg.com\/_pgx\/shared\/prototip\/2.1.2\/styles\/prototip.css","e24a9b72-05e9-765b-7ad8-4dac5817c237","\/_templates\/root\/styles\/home.css","\/_templates\/root\/styles\/overall.css","\/_templates\/menu\/styles\/top.css","\/_templates\/search\/styles\/search.css");
PGX.track({"play.site.config":{"p":"21315","c":"21310","r":"21305"},"shared.loader":{"p":"21315","c":"21310","r":"21305"},"shared.viz.rounded":{"p":"21315","c":"21310","r":"21305"},"shared.viz.misc":{"p":"21315","c":"21310","r":"21305"},"shared.prototip":{"p":"21315","c":"21310","r":"21305"},"shared.font":{"p":"21315","c":"21310","r":"21305"},"shared.browser.detect":{"p":"21315","c":"21310","r":"21305"},"play.site":{"p":"21315","c":"21310","r":"21305"},"play.site.tdk":{"p":"21315","c":"21310","r":"21305"},"play.site.content":{"p":"21315","c":"21310","r":"21305"},"play.site.menu":{"p":"21315","c":"21310","r":"21305"},"shared.google.analytics":{"p":"21315","c":"21310","r":"21305"}});

