function VisStor() {
   theurl = "sestorbillede.asp?billede="+document.images["hovedbilled"].src;
   h = "400";
   w = "460";
   ver = parseInt(navigator.appVersion.substring(0,1));
   newWin=window.open(theurl , "storbillede_pop","width="+w+",height="+h+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,");
     if ((!((navigator.appName == "Netscape")&&(ver==2))) && (!((navigator.appName == "Microsoft Internet Explorer")&&(ver<4)))){
         setTimeout("if (newWin) newWin.focus();",10);
    }
}
function swapImage(storbilled){
  if(document.images) {
    document.images["hovedbilled"].src=storbilled;
  }
}
function getElement(div){
    var n = (document.all && document.all[div]) || (document.getElementById && document.getElementById(div));
    if (n){n = (document.all) ? document.all[div] : document.getElementById(div);}
    return n;
}
function validateGodkendForm(form) {
	if(form.godkendt.checked == false ){ 
		return false; }
	return true;
}
function Vis() {
   theurl = "ordreprint.asp";
   h = "520";
   w = "750";
   ver = parseInt(navigator.appVersion.substring(0,1));
   newWin=window.open(theurl , "storbillede_pop","width="+w+",height="+h+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,");
     if ((!((navigator.appName == "Netscape")&&(ver==2))) && (!((navigator.appName == "Microsoft Internet Explorer")&&(ver<4)))){
         setTimeout("if (newWin) newWin.focus();",10);
    }
}
function toggleSection(obj){
    if (obj){
        if (obj.parentNode.parentNode.parentNode.parentNode.tagName == "DIV"){
            var divBox = obj.parentNode.parentNode.parentNode.parentNode;
            if (divBox.getElementsByTagName("div")[0]){
                var box = divBox.getElementsByTagName("div")[0];
                box.style.display = (box.style.display == "") ? "block" : "";
                obj.src = "design/icon_" + ((box.style.display == "") ? "down" : "up") + ".gif";
            }
        }
    }
}
function validateForm(form) {
	if (form.betalingsform.value == "") {
		return false; 
	}
	return true;
}

var empty = new Image(); empty.src = "fieldempty.gif";
var email = new Image(); email.src = "emailerror.gif";
var zipcd = new Image(); zipcd.src = "ziperror.gif";
var phone = new Image(); phone.src = "phoneerror.gif";
var haveerrors = 0;

function showImage(imagename, imageurl, errors) {
	document[imagename].src = imageurl;
	if (!haveerrors && errors) haveerrors = errors;
}

function validateKundeForm(f) {
	haveerrors = 0;
	(f.navn.value.length < 1) // validate first name length
	? showImage("firstnameerror", "design/fieldempty.gif", true)   // no semi-colon after this line!
	: showImage("firstnameerror", "design/blankimage.gif", false); // true = errors, false = no errors

	(f.adresse.value.length < 1) // validate last name length
	? showImage("lastnameerror", "design/fieldempty.gif", true)
	: showImage("lastnameerror", "design/blankimage.gif", false);

	(f.postnr.value.length != 4) // validate zip code length
	? showImage("ziperror", "design/ziperror.gif", true)
	: showImage("ziperror", "design/blankimage.gif", false);

	(f.email.value.search("@") == -1 || f.email.value.search("[.*]") == -1) // validate email
	? showImage("emailerror", "design/emailerror.gif", true)
	: showImage("emailerror", "design/blankimage.gif", false);
	
	return (!haveerrors);
};