//var scroller 		= "";var Slider_home	="", ctvrede='';var el			= (Cookie.get('el')!="" && Cookie.get('el')!="undefined")? Cookie.get('el') : "home";var k_el		= (Cookie.get('k_el')!="" && Cookie.get('k_el')!="undefined")? Cookie.get('k_el') : "voormelden";var onlineservice	= "";var ctvrede		="";var scrolltime		= 2500;var titel		= '';var locatie		= (Cookie.get('l')!="" && Cookie.get('l')!="undefined")? Cookie.get('l') : "zaandam";var route		= '';var Slider_home	='';function init(el){		scroller = new Fx.Scroll('sliderdiv', {		wait: false,		duration: scrolltime,		offset: {'x': 0, 'y': 0},		transition: Fx.Transitions.Back.easeInOut		});	titel	= document.title;				ctvrede = new siteFuncties($$('#menutab'), {el: el, pagina:'updater.php'});	if(window.ie6)	$('tabbaan').setStyle("left", $('woordmerk').getLeft()-10);	//$('tabbaan').setStyle("width", 900);	}siteFuncties= new Class({	initialize: function(menutabs, options) {		this.options = Object.extend({		el:		"home",		scrolltime:	2500,		pagina:		"updater.php"		}, options || {});			this.menutabs	= $$('#menu div#menutab') //an array of all anchor tags with theclass "myClass"		this.sliders	= $$('#slider .contentdiv'); 		this.el		= this.options.el;		this.pagina	= this.options.pagina;		this.scaleSite();		this.setEvents();					Window.addEvent('resize', function() {		ctvrede.scaleSite();		});		this.scrolltoEl();		},				getDimensions: function(){		this.windowhoogte	= Window.getHeight();		this.windowbreedte	= Window.getWidth();			},scaleSite: function(){		this.getDimensions();		$('menudiv').setStyle("width", this.windowbreedte);		$('tabbaandiv').setStyle("width", this.windowbreedte);		$('sliderdiv').setStyle("width", this.windowbreedte);		$('footerdiv').setStyle("width", this.windowbreedte);						},		scrolltoEl: function(status){				//this.getDimensions();		//	console.log(status);		this.menutabs.each(function(menutab){				if(menutab.className==el){		menutab.style.top="3px";		menutab.style.background='url(images/button_on.gif) no-repeat';			}else{		menutab.style.top="2px";		menutab.style.background='url(images/button_of.gif) no-repeat';		}				});		//startup werkt nog niet		this.elem	= $(el);//(!$(ctvrede.el) ) ? Cookie.get('el'): $(ctvrede.el);										this.marg	=  (this.windowbreedte-980)/2;		this.ob_x	= Math.round(this.elem.offsetLeft-this.marg);					scroller.scrollTo(this.ob_x, 0);					Cookie.set('el', el, {duration: 2}); // save this for 1 day				this.halftime=scrolltime/2;								if(status!=0){		this.elem.innerHTML="<div class=\"loader\"><img src='images/loading.gif' align='absmiddle' border='0'> laadt: "+el+"</div>";										//if(window.ie7){		//alert(2);		//Cookie.set('el', el, {duration: 2}); 		//document.location.reload();			//}else{		(function(){		new Ajax('updater.php', {method: 'post', update: el, data: "f="+el}).request();		}).delay(50); 		//}					}		this.sliders.each(function(slider){		this.op=(slider.id==el)? 1: 0.2;		slider.setStyle("opacity", this.op);				});				},setEvents: function(){			this.menutabs.each(function(menutab){				/**/		if(menutab.className==el){		menutab.style.background='url(images/button_on.gif) no-repeat';			}				menutab.addEvent('mouseover', function(){     	  		  		//$('woordmerk').innerHTML=el;  		if(menutab.className!=el){  		menutab.style.cursor='pointer';  		menutab.style.background='url(images/button_over.gif) no-repeat';  		menutab.style.top="3px";  		}else{  		menutab.style.background='url(images/button_on.gif) no-repeat';	  		}  		//menutab.setStyle('background', 'url(images/button_on.gif) no-repeat');//='url(images/button_on.gif) no-repeat';				});			menutab.addEvent('mouseout', function(){     	  		if(menutab.className!=el){		menutab.style.background='url(images/button_of.gif) no-repeat';		menutab.style.cursor='default';		menutab.style.top="2px";  		}				});					menutab.addEvent('click', function(){     	  		menutab.style.background='url(images/button_on.gif) no-repeat';		//menutab.style.cursor='pointer';  		el=menutab.className;		ctvrede.scrolltoEl()		});					});							}});function togglehome(){//if((Slider_home.wrapper.offsetWidth==0){//}else{//}if(Slider_home==''){Slider_home = new Fx.Slide('content_home', {duration: 500, mode: 'horizontal'});}var Ooverflow	=(Slider_home.wrapper.offsetWidth==0)? "auto": "hidden";var Pijl		= (Slider_home.wrapper.offsetWidth==0)? "&lsaquo;": "&rsaquo;";$('content_home').setStyle('overflow', Ooverflow);	$('toggle_b').innerHTML=Pijl;Slider_home.toggle();	}var tb 	="";function home(f){Slider_home = new Fx.Slide('content_home', {duration: 500, mode: 'horizontal'});$('content_home').setStyle('opacity','0.85');	$$('.toggle_button').each(function(tip){tip.setStyle('opacity','0.85');	});document.title=titel+" | Home";}function sponsoring(){$('content_sponsoring').setStyle('opacity','0.85');	}function vacatures(){$('content_vacatures').setStyle('opacity','0.85');$('tabbaan').setStyle('height', '6px');/*var accordion = new Accordion('div.subtitel', 'div.text', {	opacity: false,	onActive: function(toggler, element){		//toggler.setStyle('color', '#ff3300');		}, 	onBackground: function(toggler, element){		(function(){		element.setStyle('height', '110px');		}).delay(501); 	}}, $('content_vacatures'));*/document.title=titel+" | Vacatures";	}function online_service(){$('menu_kcontent').setStyle('opacity','0.97');$('tabbaan').setStyle('height', '6px');onlineservice=new kleinMenu($$('#menutab_k'), {el: 'voormelden', pagina:'online_service.php'});	}function tariefaanvraag(){var Tips1 = new Tips($$('.Tips1'));document.title=titel+" | Tariefaanvraag";	}kleinMenu= new Class({	initialize: function(menutabs, options) {		this.options = Object.extend({		k_el:		"voormelden",		pagina:		"online_service.php"		}, options || {});		this.menutabs	= $$('#menu_k div#menutab_k') //an array of all anchor tags with theclass "myClass"		//this.menutabs	= menutabs;		this.pagina	= this.options.pagina;				this.setEvents();		this.sendRequest();		},				setEvents: function(){	this.menutabs.each(function(menutab){				if(menutab.className==k_el){		menutab.style.background='url(images/button_on.gif) no-repeat';			}				menutab.addEvent('mouseover', function(){     	  		  		//$('woordmerk').innerHTML=el;  		if(menutab.className!=k_el){  		menutab.style.cursor='pointer';  		menutab.style.background='url(images/button_over.gif) no-repeat';  		menutab.style.top="3px";  		}else{  		menutab.style.background='url(images/button_on.gif) no-repeat';	  		}  		//menutab.setStyle('background', 'url(images/button_on.gif) no-repeat');//='url(images/button_on.gif) no-repeat';				});			menutab.addEvent('mouseout', function(){     	  		if(menutab.className!=k_el){		menutab.style.background='url(images/button_of.gif) no-repeat';		menutab.style.cursor='default';		menutab.style.top="2px";  		}				});					menutab.addEvent('click', function(){     	  		menutab.style.background='url(images/button_on.gif) no-repeat';		//menutab.style.cursor='pointer';  		k_el=menutab.className;		onlineservice.sendRequest()		});					});			},		sendRequest: function(){				this.menutabs.each(function(menutab){		//alert(el);		if(menutab.className==k_el){		menutab.style.top="3px";		menutab.style.background='url(images/button_on.gif) no-repeat';			}else{		menutab.style.top="2px";		menutab.style.background='url(images/button_of.gif) no-repeat';		}				});				Cookie.set('k_el', k_el, {duration: 2}); // save this for 1 day		new Ajax('onlineservice.php', {method: 'post', update: 'menu_kcontent', data: "f="+k_el}).request();						}});function send_contact(){$('contactForm').addEvent('submit', function(e) {	/**	 * Prevent the submit event	 */	new Event(e).stop();	 el='reciever';	 //$(el).innerHTML="<div id=\"menu_kcontent\"><img src='images/loading.gif' align='absmiddle' border='0'> laadt</div>";	 ctvrede.scrolltoEl(0)	/**	 * This empties the log and shows the spinning indicator	 */		//var log = $('log_res').empty().addClass('ajax-loading'); 	/**	 * send takes care of encoding and returns the Ajax instance.	 * onComplete removes the spinner from the log.	 */		this.send({		update: 'reciever',		onComplete: function() {		el='reciever';		$('contactForm').reset();		}	});	/**/});		}           routeBeschrijving= new Class({	initialize: function() {		this.locaties=new Array(1, 2);				if (GBrowserIsCompatible()) {		document.title=titel+" | Routebeschrijving";		this.themap	= $('map'); 			this.kdiv	= this.themap.parentNode;		this.map 	= new GMap2(this.themap);		this.menutabs	= $$('#menu_k div#menutab_k') 		this.zaandam	= new GLatLng(52.41841060923914, 4.853339195251465)		this.amsterdam= new GLatLng(52.39858287512429, 4.8145222663879395)		if(locatie=="zaandam"){		this.map.setCenter(new GLatLng(52.41841060923914, 4.853339195251465), 17);		}else{		this.map.setCenter(new GLatLng(52.40007541943159, 4.814736843109131), 15);			}				this.map.addControl(new GLargeMapControl());		this.map.addControl(new GMapTypeControl());		this.map.setMapType(G_HYBRID_MAP);		}		var markers=new Array();		var point=new GLatLng(52.41841060923914, 4.853339195251465);		this.createMarker();//point, 'naam', 'http://maps.google.com/mapfiles/kml/pal5/icon4.png', 'http://maps.google.com/mapfiles/kml/pal5/icon4s.png',  'http://maps.google.com/mapfiles/kml/pal5/icon4s.png', 1, 52.40007541943159, 4.814736843109131, 220, 220, 'test', 'txt'				},				set: function(l){		locatie=l;			Cookie.set('l', l, {duration: 2}); // save this for 1 day				if(l=='zaandam'){		this.map.setCenter(new GLatLng(52.41841060923914, 4.853339195251465), 17);		}else{		this.map.setCenter(new GLatLng(52.40007541943159, 4.814736843109131), 15);			}				},		createMarker: function(){//point, naam, img_k, img_ks, img, border, lat, lng, breedte, hoogte, titel, tekst		// Create our "tiny" marker iconthis.icon 			= new GIcon();this.icon.image 		= "http://maps.google.com/mapfiles/kml/pal3/icon43.png";this.icon.shadow 		= "http://maps.google.com/mapfiles/kml/pal3/icon43s.png";this.icon.iconAnchor 	= new GPoint(16, 16);this.icon.infoWindowAnchor= new GPoint(5, 1);		this.style	= "style='text-align:left;border:1px solid #fafafa;width:305px;height:80px'";this.naam	= "naamtest";this.tekst	= "txttest";this.titel1	= "route naar Sluispolderweg 53, Zaandam";this.point1	= new GLatLng(52.41841060923914, 4.853339195251465);var marker1 	= new GMarker(this.point1, {icon:this.icon,  title: this.titel1});this.titel2	= "route naar Corsicaweg 8, Amsterdam";this.point2	= new GLatLng(52.40007541943159, 4.814736843109131);var marker2 	= new GMarker(this.point2, {icon:this.icon,  title: this.titel2});this.map.addOverlay(marker1);this.map.addOverlay(marker2);this.but	="<input id='adress1'  size='34' type='text' style='color:#a2a2a2;font-size:10px;font-style:italic' onclick='change(this)' name='adres' value='bijv. schoolstraat 23, 9099 ws, leeuwarden'> ";var html1 = "<div "+this.style+">"html1 += "<span id='subtitel'>Vul uw adres in om de route naar Sluispolderweg 53 te laten zien:</span><br>"html1 += "<p align='left' id='infowindow'><input id='adress1' size='34' type='text' style='color:#a2a2a2;font-size:10px;font-style:italic' onclick='change(this)' name='adres' value='bijv. schoolstraat 23, 9099 ws, leeuwarden'> <button onclick='openroute(1)'  style='font-size:11px;font-family:arial;color: #074F89;height:16px;border:1px solid #074F89'>bekijk route</button></span></div>"; var html2 = "<div "+this.style+">"html2 += "<span id='subtitel'>Vul uw adres in om de route naar Corsicaweg 8 te laten zien:</span><br>"html2 += "<p align='left' id='infowindow'><input id='adress2'  size='34' type='text' style='color:#a2a2a2;font-size:10px;font-style:italic' onclick='change(this)' name='adres' value='bijv. schoolstraat 23, 9099 ws, leeuwarden'>  <button onclick='openroute(2)' style='font-size:11px;font-family:arial;color: #074F89;height:16px;border:1px solid #074F89'>bekijk route</button></span></div>";    GEvent.addListener(marker1 , 'click', function() {marker1.openInfoWindowHtml(html1);	});GEvent.addListener(marker2 , 'click', function() {marker2.openInfoWindowHtml(html2);	});}				    });function openroute(loc){if(loc==1){var vanadres=$('adress1').value;var naaradres="Sluispolderweg+53,+1505+Zaandam,+Zaanstad";}else{var vanadres=$('adress2').value;var naaradres="Corsicaweg+8,+amsterdam";}var routepagina="http://maps.google.nl/maps?f=d&hl=nl&saddr="+vanadres+"&daddr="+naaradres;window.open(routepagina,'routebeschrijving', 'width=1024,height=768,scrollbars=no,toolbar=no,location=no')}function change(fe){fe.style.fontStyle="normal";	fe.style.color="red";	fe.value='';}function getserie(sid){$('tabbaan').setStyle('height', '6px');var busy = false, timer, loadedImages = [], gallery = $('gallery'), progress = $('progress'), bar = $E('#progress .bar'); var path = 'http://localhost/ctvrede.nl/images/fotos/';var images = [	path + 'blusser.jpg',	path + 'boot.jpg', 	path + 'gebouw.jpg', 	path + 'gebouw3.jpg', 	path + 'liftdeur.jpg'];gallery.setStyles({'opacity': 0, 'display': 'none'});progress.setStyle('visibility', 'hidden');$('clear').setStyle('visibility', 'hidden'); $('start').addEvent('click', function(e) {	e = new Event(e).stop();	$('start').setStyle('visibility', 'hidden');	$('clear').setStyle('visibility', 'hidden');	if (!busy) { 		var galleryImgs = $$('#gallery img');		if (galleryImgs.length > 0) galleryImgs.each(function(image) {	image.remove();	}); 		busy = true;		progress.setStyle('visibility', 'visible');		gallery.setStyle('display', 'block');		new Asset.images(images, {			onProgress: function(i) {				this.setStyles({					'position': 'absolute',					'opacity': 0,					'left': (gallery.getCoordinates().width / 2) - (this.width / 2),					'top': (gallery.getCoordinates().height / 2) - (this.height / 2)				});				loadedImages[i] = this;				var percent = ((i + 1) * progress.getStyle('width').toInt()) / images.length;				bar.setStyle('width', percent).setHTML(i + 1 + ' / ' + images.length);			},			onComplete: function() {				progress.setStyle('visibility', 'hidden');				var fx = $('gallery').effect('opacity').start(1);				timer = 0;				loadedImages.each(function(image, i) {					//timer += 2500;					timer = timer+2500;					image.inject(gallery);					fx = function() {						var imgEffect = image.effect('opacity', {duration: 2500});						imgEffect.start(1).chain(function() {							if (i < loadedImages.length - 1) {								this.start(0).chain(function() {									image.remove();								});							} else {								busy = false;								$('clear').setStyle('visibility', 'visible');								$('start').setStyle('visibility', 'hidden');							}						}); 					}.delay(timer);				});			}		});	}}); $('clear').addEvent('click', function(e) {	e = new Event(e).stop();	if (!busy) {		$$('#gallery img').each(function(image) {			image.remove();		});		var fx = new Fx.Style(gallery, 'opacity', {			onComplete: function() {				gallery.setStyle('display', 'none');			}		});		fx.start(0);	}	$('clear').setStyle('visibility', 'hidden');	$('start').setStyle('visibility', 'visible');});		$('clear').setStyle('visibility', 'visible');	}function change_anders(fe){fe.style.color='#074f89';fe.style.fontStyle='normal';fe.value='';	}function transform(fe){checkfields=new Array('herkomst', 'bestemming');if($('herkomst').value==$('bestemming').value && $('herkomst').value!=""){alert("Herkomst en bestemming zijn hetzelfde!\nVul of een andere herkomst of bestemming in.");	fe.options[0].selected=true;}if(fe.value=="anders"){$(fe.id+"_anders").style.display='inline';	$(fe.id+"_anders").disabled=false;}else{$(fe.id+"_anders").style.display='none';		$(fe.id+"_anders").disabled=true;}}var aanvraag= "";var stappen	= new Array();var cstap	= 0;var Ajaxform= new Class( { ////bij opstarten alle blokken automatisch een mouseover geven met de coordinaten naar centeredinitialize: function(formid, options){	this.options = Object.extend({		update_id: 0,		to_Hide: 0		}, options || {});		this.formulier=$(formid);		this.to_Update	= $(this.options.update_id);				//alert('s');		//$('floatwindow').setStyle("opacity","0");			stappen.extend([this]);	this.formulier.addEvent('submit', function(e) {		new Event(e).stop();	});	},	checkFields: function(stap){var velden=this.formulier.elements;//var velden = $ES('input','aanvraagformulier') //get all the anchor tags within$('myElement')var velden = $$('#aanvraagformulier select', '#aanvraagformulier input') //an array of all anchor tags with theclass "myClass"//alert(velden);//	velden.each(function(field){for(i=0; i<velden.length; i++){            var field = velden[i];	 var isReq = (field.name.charAt(0)=="R") ? true : false	 if(isReq && field.value==""){           	var veldnaam = field.name.substring(1,27);		var veldnaam = veldnaam.replace(/_/, " ");           	alert("U bent vergeten '"+veldnaam+"' in te vullen.");		field.focus();		break;		return false;		}		if(field.name=="Remail"){	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;        	if (!filter.test(field.value)){        	alert("Het door u ingevulde emailadres is onjuist");        	return false;        	}				}	};return true;	},		Verzend: function(stap){	cstap	=stap;		if(this.checkFields()){		if($('savedata').checked==true){	gegevens=$('bedrijfsnaam').value+":"+$('adres').value+":"+$('adresnummer').value+":"+$('postcode').value+":"+$('vestigingsplaats').value+":"+$('contactpersoon').value+":"+$('telefoon').value+":"+$('fax').value+":"+$('email').value	Cookie.set('gegevens', gegevens, {duration: 12}); // save this for 12 days		}else{	Cookie.remove('gegevens');		}		this.formulier.send({		update: stappen[0].to_Update,		evalScripts: true		//,onComplete: this.OK	});		}		}});var wfxfunction showPopup(w, h, bgtrans){wfx 		= new Fx.Styles('floatwindow', {duration:500, wait:false});var ttop	= (window.getHeight()/2)-(h/2);var lleft	= (window.getWidth()/2)-(w/2);//alert(lleft+" // "+w);$('floatwindow').style.display='block';	wfx.start({				'height': h+'px',	'width': w+'px',	'top': ttop+'px',	'left': lleft+'px',	'opacity': '1'	});					if(bgtrans>0){	var ww=window.getScrollWidth();	var wh=window.getScrollHeight();	$('bgdiv').setStyles({   	opacity: bgtrans,   	width: ww,   	height: wh	});			}	}function closePopup(reset){	wfx.start({				'height': 1+'px',	'width': 1+'px',	'top': 1+'px',	'left': 1+'px',	'opacity': '0'	});				$('bgdiv').setStyles({   	opacity: 0,   	width: 0,   	height: 0	});	if(reset!=''){$(reset).reset();	}$('floatwindow').innerHTML='';}
