var DomainName = "http://www.bpm.it";

function showPage(win_name,url, pos_x, pos_y, win_width, win_height) {
	
	if (pos_x == -1) {
		pos_x = parseInt(screen.width / 2.0) - (win_width / 2.0);
	}
	if (pos_y == -1 ) {
		pos_y = parseInt(screen.height / 2.0) - (win_height / 2.0);
	}
		
	var win = window.open (url, win_name, "width=" + win_width + ",height=" + win_height + ",toolbar=yes,location=yes,status=yes,menubar=yes,scrollbar=yes,resizable=yes,left=" + pos_x + ",top=" + pos_y);
	
	// Move the window
	if( parseFloat(navigator.appVersion) >= 4.0) {
		// win.moveTo( pos_x, pos_y );
	}
	
	// Netscape 4.x fix
	if (navigator.appName.indexOf("Netscape") != -1) {
		win.focus();
	}
}


function GoToUrl(page){
  window.location.href = page;
}


function CallServlet(Target,ServletAction,IdUtente,IdAttrinuto){
	var TargetForm = Target;
	var ServletAction = ServletAction;
	var IdUtente = IdUtente;	
	var IdAttrinuto =IdAttrinuto;

	document.NavBar.action = Target;
	document.NavBar.IDBPMIT.value = ServletAction;
	document.NavBar.id_utente_ricerca.value = IdUtente; 
	document.NavBar.id_attributo_search.value = IdAttrinuto; 
	document.NavBar.submit();
}

function CallServletValore(Target,ServletAction,IdUtente,IdAttrinuto,IdValore){
	var TargetForm = Target;
	var ServletAction = ServletAction;
	var IdUtente = IdUtente;	
	var IdAttrinuto =IdAttrinuto;
	var IdValore = IdValore;

	document.NavBar.action = Target;
	document.NavBar.IDBPMIT.value = ServletAction;
	document.NavBar.id_utente_ricerca.value = IdUtente; 
	document.NavBar.id_attributo_search.value = IdAttrinuto; 

	if(IdUtente == 3 && ServletAction == "ListaMicroBisogniPiccoleImpreseAction"){
		document.NavBar.valore_piccole_imprese.value = IdValore;
	}
		

	if (IdUtente == 3 && ServletAction == "ListaMicroBisogniAction"){
		document.NavBar.valore_medie_aziende.value = IdValore;
		}

	document.NavBar.submit();
}
function openNews(page){
	var pageToOpen = "/homepage/include/news/" + page;
	window.open(pageToOpen, 'main','width=410,height=288,top=295,left=188,status=yes,toolbar=no,menubar=no,resizable=no,scrollbars=yes'); 
}
