function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");}
	
	function swapF(from){
	var to,setF=false;
	if(from.type=='password'){
		to=from.form.holder;
	}
	else {
		to=from.form.password;
		setF=true;
	}
	if(setF || from.value==''){
		to.style.display='';
		from.style.display='none';
	}
	if(setF) to.focus();
}

function onlynum(e)
   {
   if (e.which)
      {
 if(e.which!=8 && (e.which<48 || e.which>57))
      return false;
      }
   else if(e.keyCode && document.all)
      {
      if(e.keyCode<48 || e.keyCode>57)
      return false;
      }
   return true;
   }
   
      function cmail(mail){
   
   var x = mail;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!filter.test(x)) return 1; else return 2
	
   }
   
function getDocHeight() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    );
}

function rid() { document.getElementById("sfb").style.height=(getDocHeight()-4)+"px" }
//window.onload= function rid() { document.getElementById("contflash").style.height=(document.body.scrollHeight)+"px" }
//window.onload= rid;
//window.onresize= rid
function nm()
{aa=1}
function lgn(n)
{
	if(trim(document.logg.userid.value)=='' || trim(document.logg.userid.value)=='User ID' || trim(document.logg.password.value)=='')  {alert('Inserire User ID e Password, prego');document.logg.userid.focus();return false};
	//alert("Dati di accesso non corretti");return false;
	if(n==1) document.logg.submit();
	}
