function showpopup(url)
{
   window.open(url,'','width=650,height=400,addressbar=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes');
}

function opretmedlem(url)
{
   window.open(url,'golfopretmedlemwin','width=350,height=415,addressbar=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes');
}

function copenchild(url,cwindow,cwidth,cheight)
{
   window.open(url,cwindow,'width='+cwidth+',height='+cheight+',addressbar=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes');
}

function updateparent() 
{
   opener.document.forms[0].submit();
   self.close();
}

function isnumeric(x)
{
  var re=/^(([0-9]\d*\.?\d*)|(0?\.\d*)|0)$/;

  if(!re.test(x)) { return false; } else { return true; }
}

function validateconfigform()
{
   var name = document.getElementById('name').value;
   var config = document.getElementById('config').value;
   if(name=='') { alert('Navn skal udfyldes'); document.getElementById('name').focus(); return false; }
   if(config=='') { alert('Konfiguration skal udfyldes'); document.getElementById('config').focus(); return false; }
   document.getElementById('formvalidated').value='1';
   self.document.forms[0].submit();
}

function validateconfigfieldsform()
{
   var name = document.getElementById('name').value;
   var pattern = document.getElementById('pattern').value;
   if(name=='') { alert('Navn skal udfyldes'); document.getElementById('name').focus(); return false; }
   if(config=='') { alert('Mønster skal udfyldes'); document.getElementById('pattern').focus(); return false; }
   document.getElementById('formvalidated').value='1';
   self.document.forms[0].submit();
}

function istime (time) {
 var orgtime=time;
 time = time.split(":");
 var hours = time[0];
 var minutes = time[1];
 var checktime = hours+':'+minutes;

 return (parseInt(hours) < 24 && parseInt(hours) >= 0 && isnumeric(hours)
  && parseInt(minutes) < 60 && parseInt(minutes) >= 0 && isnumeric(minutes) && checktime==orgtime);
}
