var antalsub=0;
function kun_en_gang()
{
	antalsub++;
	if (antalsub>1)
	{
		alert('Vent mens data sendes...');
		return false;
	}
	
	return true;
}

function doSubmit(which) 
{
  errorText = "";

  if (!which.terms.checked) errorText += "Du skal sætte hak for at acceptere de generelle betingelser\n"

  if (errorText != "") 
  { 
    alert(errorText);
    return false; 
  } 
  else 
  { 
    return true; 
  }	
} 

function aabenVin(sti) { 
var losurl = sti;
window.open (losurl, 'MegaPixel', 'height=500, width=750, toolbar=no, menubar=no, scrollbars=no, resizable=yes, location=no, directories=no, status=no');
}

function imagepopup(filNavn) { 

LeftPos = (screen.width) ? (screen.width-130)/2 : 0;
TopPos = (screen.height) ? (screen.height-130)/2 : 0;
settings = 'height=130,width=130,top='+TopPos+',left='+LeftPos+',scrollbars=no,resizable=no';
imageWin=window.open('',"imageWin",settings);
imageWin.document.open(); 
imageWin.document.write( 
'<html>'+ 
'<head>'+ 
'<title>Vis billede</title>'+ 
'<\script language="JavaScript">'+ 
'function myResize() {'+ 
'picW = document.images["pic"].width;'+ 
'picH = document.images["pic"].height;'+ 
'picW = picW+10;'+
'picH = picH+25;'+
'window.resizeTo(picW,picH);'+ 
'}'+ 
'<\/script>'+ 
'</head>'+ 

'<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="myResize();">'+ 
'<a href="#" onclick="self.close();">'+
'<img src="' + filNavn + '" NAME="pic" border="0"></a>'+ 
'</body>'+ 
'</html>' ); 
imageWin.focus();
imageWin.document.close(); 
} 

function vt(tekst) {

	window.status = tekst;

}

function sikker(besked) {

	var result = window.confirm(besked);
    
	if( result ){
    	return true;
    } else {
		return false;
	}
}

function processUpload(form)
{
   var applet = document.FileUpload;
   applet.upload(form.action,navigator.userAgent,document.cookie);
   waitForCompletion();
   return false;
}

function waitForCompletion()
{
  var percent = document.FileUpload.getUploadProgress();
  if (percent == 100)
  {
    displayUploadResponse();
  }
  else
    window.setTimeout('waitForCompletion()',100);
}


function displayUploadResponse()
{
 
   var form = document.forms['results'];
    form.submit();
}


