// JavaScript Document
function apri(){
	//params  = 'width='+screen.width;
	//params += ', height='+screen.height;
	//params  = 'width=1000px';
	//params += ', height=800px';
	//params += ', top=0, left=0'
	//params += ', fullscreen=yes';
	
	//newwin=window.open("foto.html","", params);
	//if (window.focus) {newwin.focus()}

		//window.open("foto.html" , "" , "left=20,top=20, width=1000px, height=600px, toolbar=no, resizable=no, scroolbar=no, menubar=no, location=no, status=no, directories=no");
		
		//window.open("foto.html" , "" , "left=20,top=20, width=1000px, height=650px, toolbar=no, resizable=yes, scroolbar=no, menubar=no, location=no, status=no, directories=no");
		window.open("foto_underCos.html" , "" , "left=20,top=20, width=1000px, height=650px, toolbar=no, resizable=yes, scroolbar=no, menubar=no, location=no, status=no, directories=no");
	}
	
	
// Funzione che elimina gli spazi (dx,sx)
function Trim(stringa) {
   var regExpr=/\s+$|^\s+/g;
   return stringa.replace(regExpr,"");
}

// Funzione che elimina tutti gli spazi
function TrimAll(stringa){
   var regExpr=/\s/g;
   return stringa.replace(regExpr,"");
}

// Funzione di controllo numerico (con virgola)
function checkNumber(valore) {
    var regExpr= /^-{0,1}\d*\.{0,1}\d+$/;

    return regExpr.test(Trim(valore)); 
}


//Funzione di controllo mail
function checkEmail(valore) {
	var regExpr = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,3}$/;
	return regExpr.test(Trim(valore));
}

// Funzione di notifica messaggio
function msgAlert(msg,campo) {
    alert(msg);
    selectText(campo);
}

// Funzione di selezione testo
function selectText(campo) {
    campo.focus();
    campo.select();
}
