function zoom(link, wName, w, h, scroll) {
	var clientHt = window.screen.height;
	var clientWt = window.screen.width;
	newWin = window.open(link, wName, 'scrollbars='+scroll+', resizable=yes, width='+w+', height='+h+', location=no, toolbar=no, menubar=no');
	newWin.moveTo( (clientWt/2)-(w/2) , (clientHt/2)-(h/2) );
	newWin.resizeTo(w,h);
}

function zoom_pswd(link, wName, scroll)
{
	w = 500;
	h = 350;
	var clientHt = window.screen.height;
	var clientWt = window.screen.width;
	newWin = window.open(link, wName, 'scrollbars='+scroll+', resizable=yes, width=500, height=350, location=no, toolbar=no, menubar=no');
	newWin.moveTo( (clientWt/2)-(w/2) , (clientHt/2)-(h/2) );
	newWin.resizeTo(w,h);
}


function ValidLength(str,number) {
	if (str < number)
		return false;
	return true;
}

function ValidChars(CheckStr,chars) {
	for (i = 0;  i < CheckStr.length;  i++) {
    	ch = CheckStr.charAt(i);
    for (j = 0;  j < chars.length;  j++)
		if (ch == chars.charAt(j))
        	break;
		if (j == chars.length)
		return false;
	}
	return true;
}

function valida_pswd()
{
	var FormEmail = document.forms[0].Email.value
	ValidEmailChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_@.";
	
		if (!ValidLength(FormEmail.length, 5)) {
			alert ("Inserire l'indirizzo E-mail");
			document.forms[0].Email.focus();
			return false;
		}
	dot = FormEmail.indexOf(".");
	afterdot = FormEmail.charAt(dot +1);
	
		if (dot == -1 || afterdot == "") {
			alert("Inserire un indirizzo E-mail valido");
			document.forms[0].Email.focus();
			return false;
		}

	at = FormEmail.indexOf("@");
	afterat = FormEmail.charAt(at +1);

		if (at == -1 || afterat == "") {
			alert("Inserire un indirizzo E-mail valido");
			document.forms[0].Email.focus();
			return false;
		}
		if (!ValidChars(FormEmail, ValidEmailChars)) {
			alert("L'indirizzo E-mail non è valido!");
			document.forms[0].Email.focus();
			return false;
		}

}