// JavaScript Document
function myError(error) {
	myAlert('U heeft één of meerdere velden niet juist ingevuld.\nHieronder volgt een specificatie:\n\n' + error);
}
			
function myAlert(message) {
	alert('Banketbakkerij Jullens © 2006\n\n' + message);
}

function trim(string) {
	return string.replace(/(^\s*)|(\s*$)/g, '');
}

function openWindow(url,name,width,height)
{	
	if(width == null) width=600;
	if(height == null) height=500;
	
	var win = window.open(url,name,getWindowProperties(width,height));
}

function getWindowProperties(width, height)
{
	x = (screen.width	- width ) / 2 ;
	y = (screen.height	- height) / 2 ;

	prop =  'location=no' ;	
	prop += ',status=no' ;
	prop += ',directories=no' ;
	prop += ',toolbar=no' ;
	prop += ',resizable=no' ;
	prop += ',scrollbars=no' ;
	prop += ',width='+width ;
	prop += ',height='+height ;
	prop += ',screenX='+x ;
	prop += ',screenY='+y ;
	prop += ',left='+x ;
	prop += ',top='+y ;	
	
	return prop ;
}

function showPicture(pic) {
	openWindow('/images/products/'+pic, 'picture', 788, 532);
}
