		var changed = 0;
		var lantal = 0
		
		function checkKeyPress(e)
		{
			if(!e)e = window.event;
			var key = (typeof e.which == 'number')?e.which:e.keyCode;
			if((key == 13) && (changed != 0)) handleKP();
		}
		document.onkeypress = checkKeyPress

		if (document.layers)
		{
			document.captureEvents(Event.KEYPRESS);
		}

		if (! document.all && document.getElementById)
		{
			document.addEventListener("keypress", checkKeyPress, true);
		}

		function handleKP()
		{
			validateantal(changed, lantal);
			changed = 0;
			lantal = 0;
			return;
		}

		function nytvindue(theURL,winName,features)
		{
			window.open(theURL,winName,features);
			return false;
		}
		
function validateEmail(email)
{
	 return (email.indexOf(".") > 2) && (email.indexOf("@") > 0);
}

function showdiv(id,bool) 
{
	var showtype = 'block';
	if (!bool)
	{
		showtype = 'none';
	}
	if (document.getElementById) {
		document.getElementById(id).style.display = showtype;
	}
	else {
		if (document.layers) {
			document.id.display = showtype;
		}
		else {
			document.all.id.style.display = showtype;
		}
	}
}


function toggleDiv( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}



/* getRadioValue(document.theForm.Radiobutton) 
* returns selected Radiobutton value
*/
function getRadioValue(radioObj)
{
 if(!radioObj)
 {return "";
 }
 var radioLength = radioObj.length;
 if(radioLength == undefined)
 {
  if(radioObj.checked)
  {	
   return radioObj.value;
  }
  else
  {return "";
  }
 }
 for(var i = 0; i < radioLength; i++) 
 {
  if(radioObj[i].checked) 
  {
    return radioObj[i].value;
  }
 }
 return "";
}
