function eNews(){
	url='/opencms/opencms/proel/utils/enews-signin.jsp';
	opzioni='height=400,width=500,status=no,toolbar=no,location=no,menubar=no,directories=no,resizable=yes,scrollbars=yes';
	popOpen(url, opzioni);
}

function anteprima(url_ant, url_img){
	opzioni='width=200,height=200,left=0,top=0,toolbar=no,directories=no,menubar=no,status=no,scrollbars=no,resizable=yes';

	// devo fare l'encoding di url_img
	popOpen(url_ant+encodeURIComponent(url_img), opzioni);
}

function popOpen(url, opzioni){
	window.open (url, "PopWin", opzioni);
}

function switchLan(newLan) {
	document.slForm.actL.value = newLan;
	document.slForm.submit();
}

function openNewsImg(url) {
	window.open (url,"_img","history=no,resizable=yes,status=no,scrollbars=auto,menubar=no,width=500,height=400");
}
//-----------------------------------
var labels = {
		"en": {"label.ricerca": "Warn! No search criteria set."},
		"it": {"label.ricerca": "Attenzione! Non e' stato specificato nessun criterio di ricerca!"}
};

function checkSearch(lang) {
	if(checkRicerca(lang)) {
		document.getElementById('proelSearch').submit();
	} else {
		return false;
	}
}

function checkRicerca(lang){
	var theF = document.getElementById('proelSearch');
	if(theF){
		if(theF.query.value=="" || theF.orig.value == theF.query.value){
			alert(labels[lang]['label.ricerca']);
			return false;
		} else {
			return true;
		}

	} else {
		return false;
	}
}

