
	oldImage = 1;

	function showImage(afbeelding, obj, sClass) {
		
		normalClass = 'thumbnail';
		hoverClass = 'thumbnail-selected';
			
		if (sClass != '' ) {
			normalClass = 'pthumbnail';
			hoverClass = 'pthumbnail-selected';
		}
		
		if (window['oldImage']) {
			document.getElementById('photobooth' + oldImage).style.display = 'none';
			document.getElementById('thumb' + oldImage).className = normalClass;
		}
	
		document.getElementById('photobooth' + afbeelding).style.display = 'block';
		document.getElementById('thumb' + afbeelding).className = hoverClass;
		oldImage = parseFloat(afbeelding);
		
	}
	
	function switchClass(obj) {
		
		if (obj.className == 'menu-item') {
			obj.className = 'menu-selected';		
		} else {
			obj.className = 'menu-item';		
		}
	}
	
	function scrollNextImage(sClass) {
	
		normalClass = 'thumbnail';
		hoverClass = 'thumbnail-selected';
			
		if (sClass != '' ) {
			normalClass = 'pthumbnail';
			hoverClass = 'pthumbnail-selected';
		}
		
		nextImage = parseFloat(oldImage) + 1;

		if (document.getElementById('photobooth' + nextImage) != null) {
		
			document.getElementById('photobooth' + oldImage).style.display = 'none';
			document.getElementById('photobooth' + nextImage).style.display = 'block';
			
			document.getElementById('thumb' + oldImage).className = normalClass;
			document.getElementById('thumb' + nextImage).className = hoverClass;
			
			oldImage = nextImage;
		}
		
	}
	
	function scrollPreviousImage(sClass) {
	
		normalClass = 'thumbnail';
		hoverClass = 'thumbnail-selected';
			
		if (sClass != '' ) {
			normalClass = 'pthumbnail';
			hoverClass = 'pthumbnail-selected';
		}
		
		previousImage = parseFloat(oldImage) - 1;
		
		if (document.getElementById('photobooth' + previousImage) != null) {
		
			document.getElementById('photobooth' + oldImage).style.display = 'none';
			document.getElementById('photobooth' + previousImage).style.display = 'block';
			
			document.getElementById('thumb' + oldImage).className = normalClass;
			document.getElementById('thumb' + previousImage).className = hoverClass;
			
			oldImage = previousImage;
		}

	}
	
	function displayHarmonica(harmonicaId) {
	
		harmonicaObject = document.getElementById('harmonica' + harmonicaId);
		harmonicaPijl = document.getElementById('harmonicapijl' + harmonicaId);
		
		if (harmonicaObject.style.display == 'none') {
			harmonicaObject.style.display = 'block';
			harmonicaPijl.src = '/img/pijlbeneden.gif';
		} else {
			harmonicaObject.style.display = 'none';
			harmonicaPijl.src = '/img/pijlrechts.gif';
		}
	
	}
	
	function displayHotelHarmonica(harmonicaId) {
	
		harmonicaObject = document.getElementById('hotel-harmonica' + harmonicaId);
		harmonicaSpacer = document.getElementById('hotel-spacer' + harmonicaId);
		harmonicaPijl = document.getElementById('hotel-harmonicapijl' + harmonicaId);
		
		if (harmonicaObject.style.display == 'none') {
			harmonicaObject.style.display = 'block';
			harmonicaSpacer.style.display = 'none';
			harmonicaPijl.src = '/img/pijlbeneden.gif';
		} else {
			harmonicaObject.style.display = 'none';
			harmonicaSpacer.style.display = 'block';
			harmonicaPijl.src = '/img/pijlrechts.gif';
		}
	
	}
	

	
	function verwijderArtikel(articleId) {
	
		doXmlRequest("/xml/verwijder_product.php?articleid=" + articleId, function() {

			returnAmount = parseFloat(globalXmlData);
			//totalAmount = parseFloat();

			document.getElementById('totalAmount').innerHTML = '&nbsp;&euro;&nbsp;' + returnAmount.toFixed(2);
			//= '&nbsp;&euro;&nbsp;' + globalVars['totaal'].toFixed(2);
			
			cnode = document.getElementById('product' + articleId);
			pnode = document.getElementById('product' + articleId).parentNode;
			
			pnode.removeChild(cnode);
		});
	
		
	}
	
	function init() {
		
		if (document.getElementById('scrollphoto')) {
			
			oldObject = 1;
		}
		
		if (document.getElementById('promotiebalk')) {
		
		
		
		}
		
	}

	
	
	
	function highlightHarmonica(harmonicaId, bool) {
	
		
		
		if (bool) {
		
			obj = document.getElementById('xid' + harmonicaId);
			obj.oClass = obj.className;
						
			document.getElementById('xid' + harmonicaId).style.backgroundImage = 'url(/img/hh-pijl-select.gif)';
			document.getElementById('xid' + harmonicaId).style.backgroundColor = '#c6a973';
			document.getElementById('xid' + harmonicaId).style.color = '#000';
			document.getElementById('t' + harmonicaId).style.color = '#000';
			document.getElementById('href' + harmonicaId).style.color = '#000';
			
		} else {
			
			document.getElementById('t' + harmonicaId).style.color = '#fff';
			document.getElementById('href' + harmonicaId).style.color = '#fff';
			
			if (obj.oClass == 'scrollitemLight') {
				obj.style.backgroundImage = "url(/img/hh-pijl-licht.gif)";
				obj.style.backgroundColor = '#ac8035';
			} else {
				obj.style.backgroundImage = "url(/img/hh-pijl-donker.gif)";
				obj.style.backgroundColor = '#a27224';
			}
		
		}
				
	}

	function preSubmit(form) {
		
		remove = false;

		

		switch (form.name) {
			
			case "bevestigform":
			
				required = Array(
					
					'gender', 
					'achternaam', 
					'initials',
					'straat', 
					'huisnr',
					'postcode', 
					'plaats', 
					'phone',
					'email'
		
				);

				remove = true;

				if (document.getElementsByName('alternatief_huisnr1')[0].value != '') {
					remove = false;
				}

				if (document.getElementsByName('alternatief_straat1')[0].value != '') {
					remove = false;
				}

				if (document.getElementsByName('alternatief_postcode1')[0].value != '') {
					remove = false;
				}

				if (document.getElementsByName('alternatief_plaats1')[0].value != '') {
					remove = false;
				}

				



			break;

			case "contactform":
				required = Array(
	
					'achternaam', 
					'initials',
					'phone',
					'email',
					'opmerkingen'
		
				);
						
			break;

			case "tellfriendform":
				required = Array(
	
					'achternaam', 
					'initials',
					'email',
					'tellafriend_naam0',
					'tellafriend_email0'
				);
		
			break;

		}
		
		doContinue = true;

		for (i in required) {

			if (typeof required[i] == 'function') {
				continue;
			}

			var obj = document.getElementById('lbl_' + required[i]);
			var val = document.getElementsByName(required[i])[0].value;

			
			obj.style.color = '#fff';

			if (val == '') {
				doContinue = false;
				obj.style.color = '#ff0000';
			}

		}

		re = new RegExp("[a-zA-Z0-9\.-_]+?(@[a-zA-Z0-9-_]+?)\\.{1}", 'gi');
		e = document.getElementsByName('email')[0].value;
		m = e.match(re);

		if (m == null) {
			document.getElementById('lbl_email').style.color = '#ff0000';
			doContinue = false;
		}

		number_fields = Array('huisnr', 'telefoon');

		for (i in number_fields) {
			
			if (!document.getElementsByName(number_fields[i])[0]) {
				continue;			
			}
			
			obj = document.getElementById('lbl_' + number_fields[i]);
			val = document.getElementsByName(number_fields[i])[0].value;

			re = new RegExp("[0-9\\+\\(\\)\\-]+?", "gi");
			m = val.match(re);

			if (m == null) {
				obj.style.color = '#ff0000';
				doContinue = false;
			}

		}

		if (!doContinue) {
			alert('Niet alle verplichte velden zijn ingevuld.' + "\nVerplichte velden zijn gemarkeerd met een *");
			return false;
		}
		
		if (document.getElementById('akkoord_voorwaarden')) {
			if (!document.getElementById('akkoord_voorwaarden').checked) {
				alert('U moet akkoord gaan met de algemene voorwaarden');
				return false;
			}
		}

		if (remove) {
		//	document.getElementById('alternatief').innerHTML = '';
		}

		form.submit();
		//return doContinue;

	}


	function checkForm(form) {

		required = Array(
		
			'achternaam',
			'telefoon',
			'email'

		);

		doContinue = true;

		for (i in required) {

			obj = document.getElementById('lbl_' + required[i]);
			val = document.getElementsByName(required[i])[0].value;
			obj.style.color = '#fff';

			if (val == '') {
				doContinue = false;
				obj.style.color = '#ff0000';
			}

		}

		re = new RegExp("[a-zA-Z0-9\.-_]+?(@[a-zA-Z0-9-_]+?)\\.{1}", 'gi');
		e = document.getElementsByName('email')[0].value;
		m = e.match(re);

		if (m == null) {
			document.getElementById('lbl_email').style.color = '#ff0000';
			doContinue = false;
		}

		number_fields = Array('telefoon');

		for (i in number_fields) {
			
			obj = document.getElementById('lbl_' + number_fields[i]);
			val = document.getElementsByName(number_fields[i])[0].value;

			re = new RegExp("[0-9\\+\\(\\)\\-]+?", "gi");
			m = val.match(re);

			if (m == null) {
				obj.style.color = '#ff0000';
				doContinue = false;
			}

		}

		if (!doContinue) {
			alert('Not all the required fields are filled.' + "\nRequired fields are marked with *");
		}


		return doContinue;

	}

	function totals(f) {

		doXmlRequest('/xml/totals.php', function() {
			total = parseFloat(globalXmlData);	

			if (isNaN(total)) {
				return false;
			}

			if (total > 0) {
				f.submit();
			}
		});
		
		return false;

	}