function valCC(intLngID,varOrdNr,strUn){
	location.href='valCCpayment.asp?langID='+intLngID+'&onr='+varOrdNr+'&strUnique='+strUn;
}

function popupform(myform, windowname)
{
if (! window.focus)return true;
window.open('', windowname, 'height=600,width=550,scrollbars,status');
myform.target=windowname;
return true;
}

function TrackCount(fieldObj,countFieldName,maxChars){
  var countField = eval("fieldObj.form."+countFieldName);
  var diff = maxChars - fieldObj.value.length;

  // Need to check & enforce limit here also in case user pastes data
  if (diff < 0)
  {
    fieldObj.value = fieldObj.value.substring(0,maxChars);
    diff = maxChars - fieldObj.value.length;
  }
  countField.value = diff;
}

function LimitText(fieldObj,maxChars){
  var result = true;
  if (fieldObj.value.length >= maxChars)
    result = false;
  
  if (window.event)
    window.event.returnValue = result;
  return result;
}

function disableForm(theform){
	if(document.all || document.getElementById){
		for(i = 0; i < theform.length; i++){
			var tempobj = theform.elements[i];
			if(tempobj.type.toLowerCase() == 'submit'){
				tempobj.disabled = true;
				break;
			}
		}
	}
}

function emptyBag(strRedirURL,lng_id){
	
	if(lng_id == 1){
		strConf = 'Er du sikker på at du vil fjerne\nalle varer fra indkøbskurven?';
	}else{
		strConf = 'Are you sure you want to remove\nall items from your shoppingbag?';
	}
	
	if(confirm(strConf)){
		document.location.replace(strRedirURL);
	}
	
}

function toggleUnPw(){

	if (document.getElementById('saveProfile').checked == true){
	
		document.getElementById('saveUserUN').disabled = false;
		document.getElementById('saveUserPW').disabled = false;
		document.addNewCustomer.saveUserUN.focus();
			
	}else{
	
		document.getElementById('saveUserUN').disabled = true;
		document.getElementById('saveUserPW').disabled = true;
		document.getElementById('saveProfile').checked = false;
		
	}

}

function vNewsLetter(valFormName,spID){

	var bVEmail = true;
	
	if (spID == 1){
	
		var strNVEmail = 'Du har ikke udfyldt en gyldig email.';
		var strConfirmHTML = 'Vores nyhedsbreve bliver udsendt i HTML-format.\nHvis du er sikker på at dit emailprogram understøtter mails i HTML-format, vælg OK.\nEllers vælg Annuller.';
		
	}else{

		strNVEmail = 'You haven´t entered a valid email.';
		var strConfirmHTML = 'Our newsletters are sent in HTML-format.\nIf your are sure that your email-client supports HTML-format, choose OK.\nOtherwise choose Cancel.';
	
	}

	if (document.getElementById('newsLetter').checked == true){
			
		vEmail = valFormName.email.value;
			
		if (vEmail != ''){
			
			if (vEmail.length < 6){
			
				bVEmail = false;
					
			}else{
			
				intCount = 1;
				
				boolFound = 0;
			
				for (i=0;i<vEmail.length;i++){
					
					if (vEmail.charAt(i) == "@"){
						
						boolFound = 1
					
					}
					
					if (vEmail.length == intCount && boolFound != 1){
				
						bVEmail = false;
						break;
					
					}
				
					intCount = intCount + 1
								
				}
				
			}

		}else{
			
			bVEmail = false;
	
		}

	}else{
	
		document.getElementById('newsLetter').checked = false;
		
	}
	
	if (bVEmail != true){
	
		alert(strNVEmail);
		document.getElementById('newsLetter').checked = false;
		valFormName.email.focus();
				
	}else{
	
		if (document.getElementById('newsLetter').checked == true){
		
			if (confirm(strConfirmHTML) == false){
	
				document.getElementById('newsLetter').checked = false;
				
			}
	
		}
	
	}

}

function chkField(vField){
	var validChar = "abcdefghijklmnopqrstuvwxyz0123456789_-";
	var chkOK = 1;
	var tmp;
	for (var i=0; i<vField.value.length; i++) {
		tmp = '' + vField.value.substring(i, i+1);
	}
	if (validChar.indexOf(tmp) == '-1'){
		chkOK = 0;
	}
	if (chkOK == 0){
		return false;
	}else{
		return true;
	}
	chkOK = '';
	tmp = '';
	vField = '';
}

function valFsub(chkBox,formName,vField1,vField2,lngID) {
	if ((vField1.value.length>0||vField2.value.length>0)){
		if (lngID == 1){
			var strUNerr = 'Fejl. Det valgte brugernavn og/eller kodeord indeholder et eller flere ugyldige tegn.\n\n';
			strUNerr = strUNerr + 'Følgende tegn er gyldige:\n';
			strUNerr = strUNerr + 'bogstaver, tal, _ og -\n\nPrøv venligst igen.';
			var strPWerr = strUNerr;
			var strUN2short = 'Det valgte brugernavn er for kort.\nDet skal bestå af mindst 4 tegn.\n\nPrøv venligst igen.';
			var strPW2short = 'Det valgte kodeord er for kort.\nDet skal bestå af mindst 4 tegn.\n\nPrøv venligst igen.';
		}else{
			var strUNerr = 'Error. The chosen username and/or password contains one or more invalid signs.\n\n';
			strUNerr = strUNerr + 'The following signs are valid:\n';
			strUNerr = strUNerr + 'characters, numbers, _ and -\n\nPlease try again.';
			var strPWerr = strUNerr;
			var strUN2short = 'The chosen username is too short.\nIt must consist of at least 4 signs.\n\nPlease try again.';
			var strPW2short = 'The chosen password is too short.\nIt must consist of at least 4 signs.\n\nPlease try again.';
		}
		if (vField1.value.length >= 4){
			if (chkField(vField1)){
				if (vField2.value.length >= 4){
					if (chkField(vField2)){
						formName.submit();
					}else{
						alert(strPWerr);
						vField2.focus();
					}
				}else{
					alert(strPW2short);
					vField2.focus();
				}
			}else{
				alert(strUNerr);
				vField1.focus();
			}
		}else{
			alert(strUN2short);
			vField1.focus();
		}
	}else{
		formName.submit();
	}
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_setTextOfTextfield(objName,x,newText) { //v3.0
  var obj = MM_findObj(objName); if (obj) obj.value = newText;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function chkDropdwn(intID,strFormName,intLangID,opt){
	if (opt == 1){
		
		for (var i = 0; i < strFormName.length; i++){
			if (strFormName.charAt(i) == "["){
				document.add2bag.stockID.options[0].selected = true;
				document.add2bag.sizeColName.value="";
				myString = new String(strFormName);
				strSCN = myString.slice(0,(i-1));				
				openwin(230,260,'/eWeb/products/stockUpdate.asp?langID='+ intLangID +'&iDs='+ intID +'&strSizeColName='+ strSCN);
				break;				
			}else{
				document.add2bag.sizeColName.value=strFormName;
			}
		}
	}else{
		if (intLangID==1){
			strAlert = 'Det valgte tryk er desværre midlertidigt udsolgt.';
		}else{
			strAlert = 'The chosen print is temporarily sold out.';
		}
		for (var i = 0; i < strFormName.length; i++){
			if (strFormName.charAt(i) == "["){
				document.add2bag.printID.options[0].selected = true;
				alert(strAlert);
				break;
			}
		}
	}
}

function validateForm(strFormName,lngID) {
	var boolOK;
	var num;
	var strErrTxt;
	var strErrSize;
	var strErrQty;
	var strErrQty2;
	
	boolOK=true;
	strErrTxt = '';
	
	if (lngID==1){
		strErrSize = '\nDu skal vælge farve/størrelse.';
		strErrQty = '\nAntal er udfyldt forkert.';
		strErrQty2 = '\nAntal skal være større end 0.';
	}else{
		strErrSize = '\nYou have to choose color/size.';
		strErrQty = '\nQuantity is not valid.';
		strErrQty2 = '\nQuantity must be greater than 0.';
	}	
	
	if (strFormName.stockID.value==0){
		boolOK=false;
		strErrTxt = strErrTxt + strErrSize;
	}
	
	num=parseInt(strFormName.qty.value);
	
	if (isNaN(num)){
		boolOK=false;
		num=1;
		strErrTxt = strErrTxt + strErrQty;
	}else{
		if (num<1){
			boolOK=false;
			strErrTxt = strErrTxt + strErrQty2;
		}
	}
	
	strFormName.qty.value=num;

	if(boolOK==false){
		alert(strErrTxt);
	}
	
	return boolOK;
}
	
function valFormSubmit(formName,langID){
	if (validateForm(formName,langID)){
		formName.submit();
	}
}

function chkPrint(txtBox,intLngID){
	var boolOK;
}

function valSearch(formName,str2val,lngID){
	if (str2val.value != "" && str2val.value != "Søg" && str2val.value != "Search"){
		formName.submit();
	}
}

function YY_checkform() { //v4.71
//copyright (c)1998,2002 Yaromat.com
  var a=YY_checkform.arguments,oo=true,v='',s='',err=false,r,o,at,o1,t,i,j,ma,rx,cd,cm,cy,dte,at;
  for (i=1; i<a.length;i=i+4){
    if (a[i+1].charAt(0)=='#'){r=true; a[i+1]=a[i+1].substring(1);}else{r=false}
    o=MM_findObj(a[i].replace(/\[\d+\]/ig,""));
    o1=MM_findObj(a[i+1].replace(/\[\d+\]/ig,""));
    v=o.value;t=a[i+2];
    if (o.type=='text'||o.type=='password'||o.type=='hidden'){
      if (r&&v.length==0){err=true}
      if (v.length>0)
      if (t==1){ //fromto
        ma=a[i+1].split('_');if(isNaN(v)||v<ma[0]/1||v > ma[1]/1){err=true}
      } else if (t==2){
        rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-zA-Z]{2,4}$");if(!rx.test(v))err=true;
      } else if (t==3){ // date
        ma=a[i+1].split("#");at=v.match(ma[0]);
        if(at){
          cd=(at[ma[1]])?at[ma[1]]:1;cm=at[ma[2]]-1;cy=at[ma[3]];
          dte=new Date(cy,cm,cd);
          if(dte.getFullYear()!=cy||dte.getDate()!=cd||dte.getMonth()!=cm){err=true};
        }else{err=true}
      } else if (t==4){ // time
        ma=a[i+1].split("#");at=v.match(ma[0]);if(!at){err=true}
      } else if (t==5){ // check this 2
            if(o1.length)o1=o1[a[i+1].replace(/(.*\[)|(\].*)/ig,"")];
            if(!o1.checked){err=true}
      } else if (t==6){ // the same
            if(v!=MM_findObj(a[i+1]).value){err=true}
      }
    } else
    if (!o.type&&o.length>0&&o[0].type=='radio'){
          at = a[i].match(/(.*)\[(\d+)\].*/i);
          o2=(o.length>1)?o[at[2]]:o;
      if (t==1&&o2&&o2.checked&&o1&&o1.value.length/1==0){err=true}
      if (t==2){
        oo=false;
        for(j=0;j<o.length;j++){oo=oo||o[j].checked}
        if(!oo){s+='* '+a[i+3]+'\n'}
      }
    } else if (o.type=='checkbox'){
      if((t==1&&o.checked==false)||(t==2&&o.checked&&o1&&o1.value.length/1==0)){err=true}
    } else if (o.type=='select-one'||o.type=='select-multiple'){
      if(t==1&&o.selectedIndex/1==0){err=true}
    }else if (o.type=='textarea'){
      if(v.length<a[i+1]){err=true}
    }
    if (err){s+='- '+a[i+3]+'\n'; err=false}
  }
  if (s!=''){alert(s)}
  document.MM_returnValue = (s=='');
}

// **************************************************************

// begin scripts for opening centered fixed size windows

// to call the popup function: openwin(winwidth,winheight,'URL')

// **************************************************************

// get window height
function getWindowHeight(thisWindow) {
  if(myBrowser == "NN" || myBrowser == "DOM") {
    return(thisWindow.innerHeight);
  } else if(myBrowser == "IE") {
    return(thisWindow.document.body.clientHeight);
  }
}

// get window width
function getWindowWidth(thisWindow) {
  if(myBrowser == "NN" || myBrowser == "DOM") {
    return(thisWindow.innerWidth);
  } else if(myBrowser == "IE") {
    return(thisWindow.document.body.clientWidth);
  }
}

// get window horizontal center
function getCenter(thisWindow) {
  return(Math.floor(getWindowWidth(thisWindow)/2));
}


// browser sniffer
var myBrowser = null;
if(document.all) {
  myBrowser = "IE";
} else if(document.layers) {
  myBrowser = "NN";
} else if(document.getElementById) {
  myBrowser = "DOM";
}


document.popLoaded = false;
document.preLoaded = false;  
var vert_nav_xOffset = -360;
var vert_nav_yOffset = 0;

//pop up Flash

var javascript_version = 1.0;




var newwin;

function launchwin(winurl,winname,winfeatures)
{
	//This launches a new window and then
	//focuses it if window.focus() is supported.
	newwin = window.open(winurl,winname,winfeatures);
	if(javascript_version > 1.0)
	{
		//delay a bit here because IE4 encounters errors
		//when trying to focus a recently opened window
 		setTimeout('newwin.focus();',250);
	}
}
//pop up Flash Control:launchwinflacontrol

var javascript_version = 1.0;

var newwinfla;

function launchwinfla(winurl,winname,winfeatures)
{
	//This launches a new window and then
	//focuses it if window.focus() is supported.
	newwinfla = window.open(winurl,winname,winfeatures);
	if(javascript_version > 1.0)
	{
		//delay a bit here because IE4 encounters errors
		//when trying to focus a recently opened window
 		setTimeout('newwinfla.focus();',250);
	}
}


//pop up win
var win;
function openwin(winwidth,winheight,URL)
{
	win = window.open(URL,'','width='+ winwidth +',height=' + winheight + ',top='+((screen.height/2)-(winheight/2))+',left='+((screen.width/2)-(winwidth/2))+',toolbar=no,scrollbars=no,resizable=no,menubar=no,status=no,directories=no,location=no'); void(0);
}

//non pop up
var newwin;
function launchwinnon(winurl,winheight,winwidth)
{
	newwin = window.open(winurl,'','toolbar=no,height=' + winheight + ',width=' + winwidth + ',directories=no,status=no,scrollbars=no,resize=yes,menubar=no');
}

//non pop up control with popup two pop ups...
var newwincontrol;
function launchwinnoncontrol(winurl,winheight,winwidth,winY,winX)
{
	if (newwin)
		if (newwin.closed == false)
			newwin.close();
			

	if((myBrowser == "NN")||(myBrowser == "DOM")) {
		newwincontrol = window.open(winurl,'','toolbar=no,height=' + winheight + ',width=' + winwidth + ',screenY=' + winY + ',screenX=' + winX + ',directories=no,status=no,scrollbars=no,resize=yes,menubar=no');
	} else if(myBrowser == "IE") {
		newwincontrol = window.open(winurl,'','toolbar=no,height=' + winheight + ',width=' + winwidth + ',top=' + winY + ',left=' + winX + ',directories=no,status=no,scrollbars=no,resize=yes,menubar=no');
	}
}

// convert all characters to lowercase
var agt=navigator.userAgent.toLowerCase(); 
var is_mac = (agt.indexOf("mac")!=-1);


//non pop up control
var newwincontrol;

function launchwinnoncontrol(winurl,winheight,winwidth,winY,winX)
{
if((myBrowser == "NN")||(myBrowser == "DOM")) {
		newwincontrol = window.open(winurl,'','toolbar=no,height=' + winheight + ',width=' + winwidth + ',screenY=' + winY + ',screenX=' + winX + ',directories=no,status=no,scrollbars=no,resize=yes,menubar=no');
} else if(myBrowser == "IE") {
		newwincontrol = window.open(winurl,'','toolbar=no,height=' + winheight + ',width=' + winwidth + ',top=' + winY + ',left=' + winX + ',directories=no,status=no,scrollbars=no,resize=yes,menubar=no');
	}
}

//non pop up control
var nonnewwincontrol;

function launchwinonecontrol(winurl,winheight,winwidth,winY,winX)
{
if((myBrowser == "NN")||(myBrowser == "DOM")) {
	nonnewwincontrol = window.open(winurl,'','toolbar=no,height=' + winheight + ',width=' + winwidth + ',screenY=' + winY + ',screenX=' + winX + ',directories=no,status=no,scrollbars=no,resize=yes,menubar=no');
	} else if(myBrowser == "IE") {
		nonnewwincontrol = window.open(winurl,'','toolbar=no,height=' + winheight + ',width=' + winwidth + ',top=' + winY + ',left=' + winX + ',directories=no,status=no,scrollbars=no,resize=yes,menubar=no');
}
}
// ***************************************************

// end scripts for opening centered fixed size windows

// ***************************************************

function setStatus(varStatus,intOrderNr,redirURL,ttNr,usrEmail,usrID){
	
	var strCnf = 'Er du sikker på at denne ordre skal annulleres?';
	
	if(varStatus == 'print'){
		MM_openBrWindow('printOrder.asp?id='+intOrderNr,'printWin','width=640,height=480,toolbar=yes,scrollbars=yes');
		document.location.replace(redirURL);
	}else if(varStatus == 'reject'){
		if(confirm(strCnf)){
			document.writeln('<HTML>');
			document.writeln('<HEAD>');
			document.writeln('<BODY>');
			document.writeln('<form name="setStat" action="setStatus.asp" method="POST">');
			document.writeln('<input type="hidden" name="id" value="'+intOrderNr+'">');
			document.writeln('<input type="hidden" name="status" value=6>');
			document.writeln('<input type="hidden" name="redirURL" value="'+redirURL+'">');
			document.writeln('</form>');
			document.writeln('</BODY>');
			document.writeln('</HTML>');
			document.writeln('<SCRIPT LANGUAGE="JavaScript">');
			document.writeln('document.setStat.submit();');
			document.writeln('</SCRIPT>');
		}
	}else if(varStatus == 'approve'){
		document.writeln('<HTML>');
		document.writeln('<HEAD>');
		document.writeln('<BODY>');
		document.writeln('<form name="setStat" action="setStatus.asp" method="POST">');
		document.writeln('<input type="hidden" name="id" value="'+intOrderNr+'">');
		document.writeln('<input type="hidden" name="status" value=2>');
		document.writeln('<input type="hidden" name="redirURL" value="'+redirURL+'">');
		document.writeln('</form>');
		document.writeln('</BODY>');
		document.writeln('</HTML>');
		document.writeln('<SCRIPT LANGUAGE="JavaScript">');
		document.writeln('document.setStat.submit();');
		document.writeln('</SCRIPT>');		
	}else if(varStatus == 'send'){
		document.writeln('<HTML>');
		document.writeln('<HEAD>');
		document.writeln('<BODY>');
		document.writeln('<form name="setStat" action="setStatus.asp" method="POST">');
		document.writeln('<input type="hidden" name="id" value="'+intOrderNr+'">');
		document.writeln('<input type="hidden" name="status" value=4>');
		document.writeln('<input type="hidden" name="redirURL" value="'+redirURL+'">');
		if(ttNr.length>0){
			document.writeln('<input type="hidden" name="ttnr" value="'+ttNr+'">');
		}
		if(usrEmail.length>0){
			document.writeln('<input type="hidden" name="email" value="'+usrEmail+'">');
		}
		if(usrID.length>0){
			document.writeln('<input type="hidden" name="userID" value="'+usrID+'">');
		}
		document.writeln('</form>');		
		document.writeln('</BODY>');
		document.writeln('</HTML>');
		document.writeln('<SCRIPT LANGUAGE="JavaScript">');
		document.writeln('document.setStat.submit();');
		document.writeln('</SCRIPT>');
	}
}

//function checkOut(radioName,lngID){	
//
//	action = new Array(4);
//	
//	action[0] = '';
//	action[1] = openwin(360,300,'/eWeb/security/acceptFCTerms.asp?c=1&langID='+lngID+');
//	action[2] = openwin(360,300,'/eWeb/security/doLoginNew.asp?c=1&langID='+lngID+');
//	action[3] = window.location.href = '/eWeb/shop/checkout2new.asp?langID='+lngID;
//	action[4] = window.location.href = '/eWeb/shop/sponsorChkOut.asp?langID='+lngID;
//	
//	var btnChecked = false;
//	
//	for (var i = 0; i < radioName.length; i++) {
//		if (radioName[i].checked) {
//			btnChecked = true;
//			var returnValue = action[i];
//			break;
//		}
//		
//	}
//	
//	if(!btnChecked){
//		alert('No button checked');
//		return false;
//	}else{
//		return returnValue;
//	}
//
//}

function showHideInfo(myItem){

	if(document.getElementById(myItem).style.display=="none"){
		document.getElementById(myItem).style.display = "block";
	}else{
		document.getElementById(myItem).style.display = "none";
	}
		
}

function addToWishlist(wlFormName,wlLangID,wlPrintID,wlOpTxt,wlOpNr,wlGp){
	
	if (validateForm(wlFormName,wlLangID)){
	
		var wlStockID = wlFormName.stockID.value;
		var wlQty = parseInt(wlFormName.qty.value);
		varUEFA = wlFormName.armbadge.value;
		if(varUEFA!=''){
			intUEFA = 1;
		}else{
			intUEFA = 0;
		}
		if (wlPrintID == null || wlPrintID == -1){
			var wlPrint_ID = 0;
		}else{
			var wlPrint_ID = wlPrintID;
		}
		
		document.location.href='/eWeb/shop/wishlist/wishlist.asp?langID='+wlLangID+'&iDs='+wlStockID+'&qty='+wlQty+'&iDprint='+wlPrint_ID+'&opTxt='+wlOpTxt+'&opNr='+wlOpNr+'&intGP='+wlGp+'&intUEFA='+intUEFA;
	}
	
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' skal indeholde en gyldig e-mail adresse.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' skal indeholde et gyldigt tal.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' skal udfyldes.\n'; }
  } if (errors) alert('Følgende fejl opstod:\n'+errors);
  document.MM_returnValue = (errors == '');
}