function displayItems(aantal){

	if (aantal > 99){
		document.getElementById('leftvalue').src = 'images/shop/numbers/blank.gif';
		document.getElementById('rightvalue').src = 'images/shop/numbers/blank.gif';
	} else {
		aantal = "" + aantal + "";
		if (aantal.length > 1){
			aAantal = aantal.split('');
			leftValue = aAantal[0];
			rightValue = aAantal[1];
		} else {
			leftValue = '0';
			rightValue = parseInt(aantal)
		}
		if (leftValue >= 0 && leftValue <= 9 && rightValue >= 0 && rightValue <= 9){
			document.getElementById('leftvalue').src	= 'images/shop/numbers/' + leftValue	+ '.gif';
			document.getElementById('rightvalue').src = 'images/shop/numbers/' + rightValue + '.gif';
		} else {
			document.getElementById('leftvalue').src	= 'images/shop/numbers/blank.gif';
			document.getElementById('rightvalue').src = 'images/shop/numbers/blank.gif';
		}
	}
}
	
function popupImage(item, width, height){
    window.open(item,'popup','width='+width+',height='+height+',resizable=no,scrollbars=no,toolbar=no,top='+((screen.availHeight/2)-(270/2))+',left='+((screen.availWidth/2)-(600/2))+'');  
}

function popupProduct(item){
	window.open(item,'popup','width=600,height=270,resizable=no,scrollbars=no,toolbar=no,top='+((screen.availHeight/2)-(270/2))+',left='+((screen.availWidth/2)-(600/2))+'');
}

function popupOfferte(link){
	window.open(link,'popup','width=660,height=500,resizable=no,scrollbars=yes,toolbar=no,top='+((screen.availHeight/2)-(270/2))+',left='+((screen.availWidth/2)-(600/2))+'');
}

function resize(){
	if (document.images[0]) window.resizeTo(document.images[0].width, document.images[0].height + 60);
	var NS=document.all;
	if(!NS){
		self.moveTo((self.screen.width - self.outerWidth) / 2, (self.screen.height - self.outerHeight) / 2);
	} else {
		self.moveTo((self.screen.width-document.body.clientWidth) / 2, (self.screen.height-document.body.clientHeight) / 2);
	}
	self.focus();
}


function EmbedFlash(movie, id, flashvars, width, height){

	html = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
	html += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0"';
	html += 'id="' + id + '" width="' + width + '" height="' + height + '">';
	html += '<param name="movie" value="' + movie + '">';
	html += '<param name="bgcolor" value="#FFFFFF">';
	html += '<param name="quality" value="high">';
	html += '<param name="loop" value="false">';
	html += '<param name="flashvars" value="'+ flashvars + '"';
	html += '<param name="menu" value="false">';
	html += '<param name="wmode" value="transparent">';
	html += '<param name="allowscriptaccess" value="samedomain">';
	if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) {
		html += '<embed name="' + id + '" src="' + movie + '"';
		html += 'quality="high" bgcolor="#FFFFFF" menu="false" swLiveConnect="true" allowScriptAccess="sameDomain"';
		html += 'width="' + width + '" height="' + height + '" wmode="transparent"';
		html += 'type="application/x-shockwave-flash"';
		html += 'flashvars="' + flashvars + '"';
		html += 'pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
	}
	html += '</object>';
	return html;
}

// deze functie zorgt ervoor dat een url met http:// begint
function fixUrl(elementId){
	url = document.getElementById(elementId).value;
	
	//alert('elementId: '+elementId + ' url: ' + url);
	
	// als de url niet leeg is en nog niet begint met http, dan http:// ervoor plakken
	if((url != '') && (url.substring(0,4) != 'http')){
		url = 'http://' + url;
		
		document.getElementById(elementId).value = url;
	}
}

// deze functie format een postcode zodanig dat FormHandler hem goedkeurt
function formatPostcode(elementId){
	postcode = 	document.getElementById(elementId).value;
	
	postcode = postcode.toUpperCase(); // hoofdletters
	postcode = postcode.replace(" ",""); // spaties verwijderen
	
	document.getElementById(elementId).value = postcode;
}