// Funzione che apre una pagina nuova con la possibilità di personalizzarne le dimensioni
function NewWindow(mypage,myname,w,h,scroll,centered){

		if (centered == "si") {
	        LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    	    TopPosition = (screen.height) ? (screen.height-h)/2 : 0;	        
		}    	
		
		if (centered == "no") {
	        LeftPosition = 10;
    	    TopPosition = 10;	
		}


		//settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable' 
		settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+'' 		
	    //settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+''
        window.open(mypage,myname,settings)
        
        //window.open(mypage,"","width=398,height=280,left='+LeftPosition+',top='+TopPosition+'")

}
// Funzione che apre una pagina nuova RIDIMENSIONALBILE con la possibilità di personalizzarne le dimensioni
function NewWindow2(mypage,myname,w,h,scroll,centered){

	if (centered == "si") {
		LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    	    	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;	        
	}    	
		
	if (centered == "no") {
		LeftPosition = 10;
    	    	TopPosition = 10;	
	}


	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+', resizable=yes' 			
        window.open(mypage,myname,settings)        

}

function isEmpty(str) {
        var i,L;

        if (str.value=="") {
                return true;
        }

        L=str.value.length;
        if (L<1) {
                return true;
        }

        for(i=0;i<L;i++) {
                if (str.value.charAt(i) != ' ') {
                        return false;
                }
        }

        str.value="";
        return true;
}

function isEmail(fe) {
        if (fe.value.indexOf('@',0)==-1 ||
            fe.value.indexOf('@',0)== 0 ||
        fe.value.indexOf('.',0)==-1 ||
        fe.value.length < 6 ) {
                          return false;
    }
        return true;
}


function isNumeric(str) {

        validi = "0123456789";
        for( i = 0; i < 11; i++ ){
                if( validi.indexOf( str.charAt(i) ) == -1 )
                        return false;
        }
        return true;
}


function closewin() {
        self.close();
}

