// Javascript per la generazione delle finestre di popUp
var pop_width = 750;
var pop_height = 700;

// Imposta il link alla pagina di pop-up
function imposta_pop(admin){
	input = location.search.substring(1)
	if (input){
		if (admin) pop_page = "'pop.php?" + location.search.slice(1) + "'";
//		else pop_page = "'" + location.href + "&amp;pop=1'";
		else pop_page = "'" + location.href + "&pop=1'";
		}
	else {
		if (admin) pop_page = "'" + location.pathname + "'";
		else pop_page = "'" + location.href + "?pop=1'";
		}
	//document.writeln(pop_page)
	}

// apre la finestra di pop-up
function open_pop(theURL,features){
	if (features != null){
		switch (features) {
			case '1':
				str_feat = "'width=" + (pop_width + 18) + ",height=" + pop_height + ",scrollbars=yes'";
			break;
			case '2':
				str_feat = "'width=" + (pop_width + 18) + ",height=" + pop_height + ",scrollbars=yes'";
			break;
		}
	}
	else {
		str_feat = "''";
	}
	winName = '1';
	eval( "window.open('" + theURL + "','" + winName + "'," + str_feat + ")" )
	}

// apre la finestra di stampa
function open_print(admin){
	imposta_pop(admin)
	eval( "open_pop(" + pop_page + ",'1')" )
	}

// apre la finestra di dialogo per la stampa
function stampa_pop(){
	setTimeout("window.print()",600)
	//window.print()
	setTimeout("window.close()",800)
	}
	
// apre una mail precompilata
function make_mail( nome,  dominio, soggetto, testo ){
	if (soggetto == null) { soggetto='' }
	if (testo == null) { testo='' }
	eval( "window.open('mailto:" + nome + "@" + dominio + "?Subject=" + soggetto + "&Body=" + testo + "')" )
	}
