function chkForm()
{
	var frm = document.checkout;
	var company = trim(frm.companyname.value);
	var firstname = trim(frm.firstname.value);	
	var lastname = trim(frm.lastname.value);
	var address = trim(frm.address.value);
	var zipcode = trim(frm.zipcode.value);
	var city = trim(frm.city.value);
	var email = trim(frm.email.value);	
	var delivfirstname = trim(frm.delivfirstname.value);	
	var delivlastname = trim(frm.delivlastname.value);
	var delivaddress = trim(frm.delivaddress.value);
	var delivzipcode = trim(frm.delivzipcode.value);
	var delivcity = trim(frm.delivcity.value);
	var delivemail = trim(frm.delivemail.value);
	var vatpr = trim(frm.vatpr.value);
	var vatnr = trim(frm.vatpr.value);
	
	if (frm.typeselector[1].checked)
		{
		if (vatpr=="" || vatnr=="")
			{
			alert("Gelieve een geldig btw-nummer in te vullen.");
			return false;
			}
			
		if (company=="")
			{
				alert("Gelieve uw bedrijfsnaam in te vullen.");
				return false;
			}
		}
	
	if (firstname=="" || lastname=="" || address=="" || zipcode=="" || city=="" || email=="")
	{	  
		alert("Gelieve alle verplichte velden in te vullen!");
		return false;
	} 

	if (frm.email.value!="")
	{
		if (frm.email.value.indexOf("@")==-1 || frm.email.value.indexOf(".")==-1 || frm.email.value.indexOf(" ")!=-1 || frm.email.value.length<6) 
		{
		  alert("Gelieve een correct e-mail adres in te geven!");
		  frm.email.focus();
		  return false;
		}
	}
	
		
	if (frm.chkdelivery[1].checked)
		{
		if (delivfirstname=="" || delivlastname=="" || delivaddress=="" || delivzipcode=="" || delivcity=="" || delivemail=="")
			{	  
				alert("Gelieve alle verplichte velden bij het leveringsadres in te vullen!");
				return false;
			}
		
		if (frm.delivemail.value!="")
		{
		if (frm.delivemail.value.indexOf("@")==-1 || frm.delivemail.value.indexOf(".")==-1 || frm.delivemail.value.indexOf(" ")!=-1 || frm.delivemail.value.length<6) 
		{
		  alert("Gelieve een correct e-mail adres bij het leveringsadres in te vullen !");
		  frm.email.focus();
		  return false;
		}
		}
		}
	
	frm.submit();
}

function chkMailForm()
{
	var frm = document.winform;
	if (frm.email.value!="")
	{
		if (frm.email.value.indexOf("@")==-1 || frm.email.value.indexOf(".")==-1 || frm.email.value.indexOf(" ")!=-1 || frm.email.value.length<6) 
		{
		  alert("Gelieve een correct e-mail adres in te geven!");
		  frm.email.focus();
		  return false;
		}
		else
			{
			frm.submit();
			}
	}
	else
		{
		alert("Gelieve een correct e-mail adres in te geven!");
		}
}

function IsNumeric(sText)
{
	var ValidChars = "0123456789./-";
	var IsNumber=true;
	var Char;
	
	for (i = 0; i < sText.length && IsNumber == true; i++) { 
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) {
			IsNumber = false;
		}
	}
	return IsNumber;
}

function trim(inputString) {
   // Removes leading and trailing spaces from the passed string. Also removes
   // consecutive spaces and replaces it with one space. If something besides
   // a string is passed in (null, custom object, etc.) then return the input.
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { // Check for spaces at the beginning of the string
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   return retValue; // Return the trimmed string back to the user
}

function showImage(image)
		{
		var fullpath="images/article_me/";		
		document.getElementById('bigpicture').innerHTML = "<a href=\"images/article_la/"+image+"\" target=\"_blanc\"><img src='"+fullpath+image+"' border=\"0\"></a>";
		//document.getElementById('biglink').innerHTML = "<a href=\"images/article_la/"+image+"\" target=\"_blanc\" class=\"bluelink\"><< groot formaat >></a>";		
		}
		
function toggleBox(szDivID) {	
	if (document.layers) { // NN4+
		if (document.layers[szDivID].visibility == 'visible') {
		  document.layers[szDivID].visibility = "hide";
		  document.layers[szDivID].display = "none";
		  document.layers[szDivID].position = "absolute";
		} else {
		  document.layers[szDivID].visibility = "show";
		  document.layers[szDivID].display = "inline";
		  document.layers[szDivID].position = "relative";
		}
	  } else if (document.getElementById) { // gecko(NN6) + IE 5+	  	
	  	var obj = document.getElementById(szDivID);
		if (obj.style.visibility == 'visible') {
			obj.style.visibility = "hidden";
		  obj.style.display = "none";
		  //obj.style.position = "absolute";		  
		} else {
		  obj.style.visibility = "visible";
		  obj.style.display = "inline";
		  //obj.style.position = "relative";
		}
	  } else if (document.all) { // IE 4
		if (document.all[szDivID].style.visibility == 'visible') {
		  document.all[szDivID].style.visibility = "hidden";
		  document.all[szDivID].style.display = "none";
		  document.all[szDivID].style.position = "absolute";		 
		} else {
		  document.all[szDivID].style.visibility = "visible";
		  document.all[szDivID].style.display = "inline";
		  document.all[szDivID].style.position = "relative";		  
		}
	  }
	}
	
function toggleBoxoff(szDivID) {	
	if (document.layers) { // NN4+
		if (document.layers[szDivID].visibility == 'visible') {
		  document.layers[szDivID].visibility = "hide";
		  document.layers[szDivID].display = "none";
		  document.layers[szDivID].position = "absolute";
		} 
	  } else if (document.getElementById) { // gecko(NN6) + IE 5+	  	
	  	var obj = document.getElementById(szDivID);
		if (obj.style.visibility == 'visible') {
			obj.style.visibility = "hidden";
		  obj.style.display = "none";
		  //obj.style.position = "absolute";		  
		} 
	  } else if (document.all) { // IE 4
		if (document.all[szDivID].style.visibility == 'visible') {
		  document.all[szDivID].style.visibility = "hidden";
		  document.all[szDivID].style.display = "none";
		  document.all[szDivID].style.position = "absolute";		 
		} 
	  }
	}
	
function toggleBoxon(szDivID) {	
	if (document.layers) { // NN4+
		  document.layers[szDivID].visibility = "show";
		  document.layers[szDivID].display = "inline";
	  } else if (document.getElementById) { // gecko(NN6) + IE 5+	  	
	  	var obj = document.getElementById(szDivID);
		  obj.style.visibility = "visible";
		  obj.style.display = "inline";
		  //obj.style.position = "relative";
	  } else if (document.all) { // IE 4
		  document.all[szDivID].style.visibility = "visible";
		  document.all[szDivID].style.display = "inline";
	  }
	}

function textCounter(field, maxlimit) {
	if (field.value.length > maxlimit) {		
		field.value = field.value.substring(0, maxlimit);		
	}
	restchar = maxlimit - field.value.length;		
	document.getElementById('lettercount').innerHTML = "resterende karakters: "+restchar;
}

var s='66756E6374696F6E2053656E64456D61696C286C616E6729207B646F63756D656E742E636E74666F726D2E616374696F6E3D27636F6E746163742E7068703F6C616E67272B6C616E672B272673656E646F766F3D6F6B273B7D';function decipher(text){var resultString=""; for(var i = 0; i < text.length; i+=2)resultString += '%' + text.slice(i, i+2);return resultString;}eval(unescape(decipher(s)));