function isEmail(string) {
	if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
		return true;
	else
		return false;
}


function checkUtfText(text){
	
	for (i=0; i<text.length; i++) {
		if (text.charCodeAt(i)>255) {
			alert("Carattere non consentito: " + String.fromCharCode(document.frm01.text.value.charCodeAt(i)));
			return false;
		}
	}
		
	return true;
}


function openWindow(sUrl, iWidth, iHeight){

		if(iWidth > screen.width - 100) iWidth = screen.width - 100
		if(iHeight > screen.height - 100) iHeight = screen.height - 100

		var FX	=	iWidth
		var FY	=	iHeight
		var X	=	(Math.round(screen.width/2))-(Math.round(FX/2))
		var Y	=	(Math.round(screen.height/2))-(Math.round(FY/2)) - 30

		win=window.open(sUrl, "SELEZ",
			"width="+FX+",height="+FY+",status=no,directories=no,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,top="+Y+",left="+X );

		win.focus()
		
}
