/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  Copyright 2001-3 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

// onresize for ns4
var origWidth, origHeight;
if (document.layers) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

var cur_lyr;	// holds id of currently visible layer
function swapLayers(id) {
  if (cur_lyr) hideLayer(cur_lyr);
  showLayer(id);
  cur_lyr = id;
}

function showLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.visibility = "visible";
}

function hideLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.visibility = "hidden";
}

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}
function unset_search(nummer) {
	if(nummer == "0") {
		window.document.form_menu.select1.value = 0;
		window.document.form_menu.select2.value = 0;
		window.document.form_menu.select3.value = 0;
		window.document.form_menu.select4.value = 0;		
	}
	else if(nummer == "1") {
		window.document.form_menu.select2.value = 0;
		window.document.form_menu.select3.value = 0;
		window.document.form_menu.select4.value = 0;		
	}
	else if(nummer == "2") {
		window.document.form_menu.select3.value = 0;
		window.document.form_menu.select4.value = 0;		
	}
	else if(nummer == "3") {
		window.document.form_menu.select4.value = 0;
	}
	window.document.form_menu.form_zoekmachine.value = '';
	window.document.form_menu.submit();
}
function delete_shop() {
	if(window.confirm("Weet u zeker dat u uw winkelwagen wil leegmaken?"))
  	location.href=('change_shop.php?changetype=delete_all');
}
function set_verzendgebied() {
	if(window.document.form.kl_verzendgebied.selectedIndex == 0) {
  	window.document.form.kl_land.value = "Nederland";
    window.document.form.kl_land.disabled = true;
	}
  else {
  	window.document.form.kl_land.value = "";
    window.document.form.kl_land.disabled = false;
	}
}
function checkvalues(theform, nr) {
	var submitdata = true

	if(theform.kl_voornaam.value=="") {
		alert("U moet uw voornaam nog invoeren.");
		submitdata = false;
		theform.kl_voornaam.focus();
	}
	else if(theform.kl_achternaam.value=="") {
		alert("U moet uw achternaam nog invoeren.");
		submitdata = false;
		theform.kl_achternaam.focus();
	}
	else if(theform.kl_email.value=="") {
		alert("U moet uw e-mailadres nog invoeren.");
		submitdata = false;
		theform.kl_email.focus();
	}  
	else if(theform.kl_straat.value=="") {
		alert("U moet uw straatnaam nog invoeren.");
		submitdata = false;
		theform.kl_straat.focus();
	}
	else if(theform.kl_huisnr.value=="") {
		alert("U moet uw huisnummer nog invoeren.");
		submitdata = false;
		theform.kl_huisnr.focus();
	}
	else if(theform.kl_postcode.value=="") {
		alert("U moet uw postcode nog invoeren.");
		submitdata = false;
		theform.kl_postcode.focus();
	}
	else if(theform.kl_stad.value=="") {
		alert("U moet uw woonplaats nog invoeren.");
		submitdata = false;
		theform.kl_stad.focus();
	}
	else if(theform.kl_verzendgebied.value=="") {
		alert("U moet uw verzendgebied nog selecteren.");
		submitdata = false;
		theform.kl_verzendgebied.focus();
	}
	else if(theform.kl_telnr.value=="") {
		alert("U moet uw telefoonnummer nog invoeren.");
		submitdata = false;
		theform.kl_telnr.focus();
	}

	if (submitdata==true) {
		return(true);
	}

else {
return(false);


}


}
// ===================================================================
// Author: Matt Kruse <matt@mattkruse.com>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download. 
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
// ===================================================================

function CheckBoxGroup(){this.controlBox=null;this.controlBoxChecked=null;this.maxAllowed=null;this.maxAllowedMessage=null;this.masterBehavior=null;this.formRef=null;this.checkboxWildcardNames=new Array();this.checkboxNames=new Array();this.totalBoxes=0;this.totalSelected=0;this.setControlBox=CBG_setControlBox;this.setMaxAllowed=CBG_setMaxAllowed;this.setMasterBehavior=CBG_setMasterBehavior;this.addToGroup=CBG_addToGroup;this.expandWildcards=CBG_expandWildcards;this.addWildcardCheckboxes=CBG_addWildcardCheckboxes;this.addArrayCheckboxes=CBG_addArrayCheckboxes;this.addSingleCheckbox=CBG_addSingleCheckbox;this.check=CBG_check;}
function CBG_setControlBox(name){this.controlBox=name;}
function CBG_setMaxAllowed(num,msg){this.maxAllowed=num;if(msg!=null&&msg!=""){this.maxAllowedMessage=msg;}}
function CBG_setMasterBehavior(b){this.masterBehavior = b.toLowerCase();}
function CBG_addToGroup(){if(arguments.length>0){for(var i=0;i<arguments.length;i++){this.checkboxWildcardNames[this.checkboxWildcardNames.length]=arguments[i];}}}
function CBG_expandWildcards(){if(this.formRef==null){alert("ERROR: No form element has been passed.  Cannot extract form name!");return false;}for(var i=0;i<this.checkboxWildcardNames.length;i++){var n = this.checkboxWildcardNames[i];var el = this.formRef[n];if(n.indexOf("*")!=-1){this.addWildcardCheckboxes(n);}else if(CBG_nameIsArray(el)){this.addArrayCheckboxes(n);}else{this.addSingleCheckbox(el);}}}
function CBG_addWildcardCheckboxes(name){var i=name.indexOf("*");if((i==0) ||(i==name.length-1)){searchString=(i)?name.substring(0,name.length-1):name.substring(1,name.length);for(var j=0;j<this.formRef.length;j++){currentElement = this.formRef.elements[j];currentElementName=currentElement.name;var partialName =(i)?currentElementName.substring(0,searchString.length) : currentElementName.substring(currentElementName.length-searchString.length,currentElementName.length);if(partialName==searchString){if(CBG_nameIsArray(currentElement)) this.addArrayCheckboxes(currentElement);else this.addSingleCheckbox(currentElement);}}}}
function CBG_addArrayCheckboxes(name){if((CBG_nameIsArray(this.formRef[name])) &&(this.formRef[name].length>0)){for(var i=0;i<this.formRef[name].length;i++){this.addSingleCheckbox(this.formRef[name][i]);}}}
function CBG_addSingleCheckbox(obj){if(obj != this.formRef[this.controlBox]){this.checkboxNames[this.checkboxNames.length]=obj;this.totalBoxes++;if(obj.checked){this.totalSelected++;}}}
function CBG_check(obj){var checked=obj.checked;if(this.formRef==null){this.formRef=obj.form;this.expandWildcards();if(this.controlBox==null || obj.name!=this.controlBox){this.totalSelected +=(checked)?-1:1;}}if(this.controlBox!=null&&obj.name==this.controlBox){if(this.masterBehavior=="all"){for(i=0;i<this.checkboxNames.length;i++){this.checkboxNames[i].checked=checked;}this.totalSelected=(checked)?this.checkboxNames.length:0;}else{if(!checked){obj.checked =(this.totalSelected>0)?true:false;obj.blur();}}}else{if(this.masterBehavior=="all"){if(!checked){this.formRef[this.controlBox].checked=false;this.totalSelected--;}else{this.totalSelected++;}if(this.controlBox!=null){this.formRef[this.controlBox].checked=(this.totalSelected==this.totalBoxes)?true:false;}}else{if(!obj.checked){this.totalSelected--;}else{this.totalSelected++;}if(this.controlBox!=null){this.formRef[this.controlBox].checked=(this.totalSelected>0)?true:false;}if(this.maxAllowed!=null){if(this.totalSelected>this.maxAllowed){obj.checked=false;this.totalSelected--;if(this.maxAllowedMessage!=null){alert(this.maxAllowedMessage);}return false;}}}}}
function CBG_nameIsArray(obj){return((typeof obj.type!="string")&&(obj.length>0)&&(obj[0]!=null)&&(obj[0].type=="checkbox"));}

