
function PopUp(textKeyBody,textKeyTitle,width,height) {
   win=window.open('/pan/helpTextServlet?helpText='+textKeyBody+'&helpTextTitle='+textKeyTitle+'&helpTextWidth='+width+'&helpTextHeight='+height,'wnd','toolbar=no,location=no,menu=no,scrollbars=yes,directories=no,resizable=yes,width='+width+',height='+height+',screenX=0,screenY=0,top=0,left=0');
   win.focus();
}

function HelpWindow(src) {
    win=window.open('/pan/helpTextServlet?helpText=' + src,'wnd','toolbar=no,location=no,menu=no,scrollbars=yes,directories=no,resizable=yes,width=300,height=300,screenX=0,screenY=0,top=0,left=0');
    win.focus();
}


/*function isEmailAddress(str_) {
    var str = new String;
    var valid = true;

    str = str_;
    if (str.indexOf("@", 0) == -1)
        valid = false;
    else
        if (str.indexOf(".", str.indexOf("@", 0)) == -1)
            valid = false;

    return valid;
}*/

function isEmailAddress(str_) {
	var result = false
	var theStr = new String(str_)
	var index = theStr.indexOf("@");
	if (index > 0)
	{
		var pindex = theStr.indexOf(".",index);
		if ((pindex > index+1) && (theStr.length > pindex+1))
		{
		result = true;
		return result;
		}
		else
		{
		result=false;
		return result;
		}
	}
}
function checkLoginEmailAddress(email, errorMessage) {
		if (!(isEmailAddress(email)))
		{
			alert(errorMessage);
			return false;
		} else {
			alert("registrazione effettuata con successo.");
			return true;
			
		}
	}

function getById(id) {
    return document.getElementById?document.getElementById(id):(document.all?document.all(id):null);
}

function gotoUrl(url) {
	this.location.href=url;
}