function cmsConfirmAct(strDESC, strPage) {
//Chiede la conferma prima di eseguire un'azione, se confermato redirect su pagina strPAGE
	if (confirm(strDESC)) {
		window.location.href = strPage;		
		//window.location.href= strPage;
	}
}

function cmsCheckEmail(objForm){
		var strMsg = "";
		if(objForm.EML_UTE.value==""){
			alert("ATTENZIONE! INSERIRE INDIRIZZO EMAIL");
			strMsg ="errore";
			return false;
		}
	
		if(!cmsControllaEMAIL(objForm.EML_UTE.value)){
			alert("ATTENZIONE! INSERIRE INDIRIZZO EMAIL VALIDO");
			strMsg ="errore";
			return false;
		}
	}
	
function cmsOpenWindowFeatures(sUrl, sName, sFeatures){
	newwindow=window.open(sUrl,sName,sFeatures);
}


function cmsOpenWindow(sUrl, width, height){
	// *************************************************************
	//  Apre una finestra senza alcun pulsante
	// *************************************************************
	newwindow=window.open(sUrl,"newWindow","scrollbars=yes,menubar=no,resizable=no, width=" + width + ", height="+ height);
}

function cmsOpenWindowNoBar(sUrl, width, height){
	// *************************************************************
	//  Apre una finestra senza alcun pulsante
	// *************************************************************
	newwindow=window.open(sUrl,"newWindow","scrollbars=no,menubar=no,resizable=no, width=" + width + ", height="+ height);
}

function cmsOpenWindowName(sUrl, sName, width, height){
	// *************************************************************
	//  Apre una finestra senza alcun pulsante, con il nome
	// *************************************************************
	newwindow=window.open(sUrl,sName,"scrollbars=yes,menubar=no,resizable=no, width=" + width + ", height="+ height);
}

function cmsConfirmDelete(strDESC, strPage) {
//Chiede la conferma prima di eliminare, se confermato redirect su pagina strPAGE
	if (confirm(strDESC)) {
		window.location.href = strPage;		
		//window.location.href= strPage;
	}
}


function cmsControllaEMAIL(indirizzo) {
  if (window.RegExp) {
    var nonvalido = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
    var valido = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$";
    var regnv = new RegExp(nonvalido);
    var regv = new RegExp(valido);
    if (!regnv.test(indirizzo) && regv.test(indirizzo))
      return true;
    return false;
	}
  else {
    if(indirizzo.indexOf("@") >= 0)
      return true;
    return false;
  	}
}

