
function openPage(url) {
     var openpage = window.open(url,"pageWin","width="+(screen.width-10)+",height="+(screen.height-100)+" status=yes,location=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes,top=0,left=0");
}

function openPage1(url) {
     var openpage = window.open(url,"pageWin","width="+(screen.width-10)+",height="+(screen.height-100)+" status=yes,location=yes,resizable=yes,toolbar=yes,menubar=no,scrollbars=yes,top=0,left=0");
}	
			
function trim(stringa)
{
	if (stringa ){
		while (stringa.substring(0,1) == ' ')
		{
			stringa = stringa.substring(1, stringa.length);
		}
		
		while (stringa.substring(stringa.length-1, stringa.length) == ' ')
		{
			stringa = stringa.substring(0,stringa.length-1);
		}
	}
	
	return stringa;
}	
				
	
function valida(caller){
  if(trim(caller.value) == '' ){
      alert('I campi Utente e Password devono essere inseriti!');
      return false;	
  }else{
      return true;
  }
}
			
function callValidateUser(form){
	validateUser(document.getElementById(form.elements[0].id));
}

function validateUser(obj){
	if (isNaN(obj.value)){
		obj.value = obj.value.toUpperCase();
	} else {
		if(obj.value.length < 11 || obj.value.length > 11){
			obj.value = Number(obj.value);
		}
		else{
			obj.value;
		}
	}
}
