function CreateBookmarkLink(url,title) {
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title);
	} else if(window.opera && window.print) { // Opera Hotlist
		return true;
	}
}

function CreatePopupWindow(img,width,height) {
	window.open(img,'_new','width='+width+',height='+height+',status=no,scrollbars=yes,toolbar=no,location=no,menubar=no,directories=no,resizable=no');
	return;
}

function CheckContactForm()
{
	allok = true;
	
	// get relevant elements
	e_email = document.getElementById("email_error");
	e_achternaam = document.getElementById("achternaam_error");
	e_bedrijfsnaam = document.getElementById("bedrijfsnaam_error");
	
	email = document.getElementsByName("contact[email]")[0];
	achternaam = document.getElementsByName("contact[achternaam]")[0];
	bedrijfsnaam = document.getElementsByName("contact[bedrijfsnaam]")[0];
	
	// reset all error messages
	e_email.innerHTML='';
	e_achternaam.innerHTML='';
	e_bedrijfsnaam.innerHTML='';
	
	// reset all border colours
	email.style.borderColor='';
	achternaam.style.borderColor='';
	bedrijfsnaam.style.borderColor='';
	
	if (email.value == "")
	{
		e_email.innerHTML='Vul aub uw email adres in.';
		email.focus();
		email.style.borderColor='red';
		allok = false;
		
	}
	else if (!email.value.match(/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i))
	{
		e_email.innerHTML='Vul aub een correct email adres in.';
		email.focus();
		email.style.borderColor='red';
		allok = false;
	}
	if (achternaam.value == "")
	{
		e_achternaam.innerHTML='Vul aub uw achternaam in.';
		achternaam.focus();
		achternaam.style.borderColor='red';
		allok = false;
	}
	if (bedrijfsnaam.value == "")
	{
		e_bedrijfsnaam.innerHTML='Vul aub uw bedrijfsnaam in.';
		bedrijfsnaam.focus();
		bedrijfsnaam.style.borderColor='red';
		allok = false;
	}
	
	return allok;
}

