/* parse the entered query String */
function parseSearchQuery(theForm, message) {
	var queryValue = theForm.elements["query2"].value;
	var testValue = queryValue.replace(/ /g, "");
	if (testValue.length < 3) {
		alert(message);
		return (false);
	}
	queryValue = queryValue.replace(/\+/g, "%2b");
	queryValue = queryValue.replace(/\-/g, "%2d");
	theForm.elements["query"].value = queryValue;
	return (true);
}

/* open the print version popup window */
function openPrintVersion() {
	var params = "print=true";
	if (document.location.search != "") {
		params = document.location.search + "&" + params;		
	} else {
		params = "?" + params;
	}
	window.open(document.location.pathname + params, "print", "width=670,height=750,dependent=yes,status=no,toolbar=no,location=no,scrollbars=yes");
}

/* open the imprint popup window */
function openImprint(imprintUri, pageUri, theLocale, site) {
	pageUri = encodeURIComponent(pageUri); 
	pageUri = "?__locale=" + theLocale + "&uri=" + pageUri + "&site=" + site;
	window.open(imprintUri + pageUri, "imprint", "width=670,height=550,dependent=yes,status=no,toolbar=no,location=no,scrollbars=yes,resizable=yes");
}

/* open the recommend page form popup window */
function openRecommendForm(recommendUri, pageUri, theLocale, site) {	
	if (window.location.search != "") {
		pageUri += window.location.search;		
	}
	pageUri = encodeURIComponent(pageUri); 
	pageUri = "?__locale=" + theLocale + "&uri=" + pageUri + "&site=" + site;
	window.open(recommendUri + pageUri, "recommend", "width=670,height=700,dependent=yes,status=no,toolbar=no,location=no,scrollbars=yes,resizable=yes");
}

/* open the recommend page form popup window */
function openLetterForm(letterUri, pageUri, theLocale, site) {	
	if (window.location.search != "") {
		pageUri += window.location.search;		
	}
	pageUri = encodeURIComponent(pageUri); 
	pageUri = "?__locale=" + theLocale + "&uri=" + pageUri + "&site=" + site;
	window.open(letterUri + pageUri, "contact", "width=670,height=700,dependent=yes,status=no,toolbar=no,location=no,scrollbars=yes,resizable=yes");
}

function cambia_action(numero) {
	document.getElementById('myFormName').action = numero;
}

function getByID(id){
	if (document.getElementById){
		return document.getElementById(id);
	}
}
// open close app;
var w=0;
var isOpen = false;
function FAQ_manage(){
	target = getByID("flashFAQ");			
	target.style.width = (!isOpen) ? '550px' : '185px';
	target.style.border = (!isOpen) ? "solid 1px #F90" : "solid 1px #FFF";
	isOpen = (isOpen) ? false : true;
}		

function displayFAQ(){
	target = getByID("flashFAQ");
	target.style.width = '185px';	
	target.style.visibility = "visible";
}

function openwindow(){
	window.open('http://www.area.trieste.it/newslettersoap/','','width=550,height=400,scrollbars, false');
}

function MM_showHideLayers() {
var i,p,v,obj,args=MM_showHideLayers.arguments; 
for (i=0; i<(args.length-2); i+=3) 
	if ((obj=MM_findObj(args[i]))!=null) { 
		v=args[i+2]; 
		if (obj.style) { 
			obj=obj.style; 
			v=(v=='show')?'visible':(v=='hide')?'hidden':v; 
		} 
		obj.visibility=v; 
	} 
}

function mostraMenu() {
	document.getElementById('flash').style.zIndex = 100;
	document.getElementById('noflash').style.zIndex = 0;		
	document.getElementById('flash').style.height = "400px";
}	

function nascondiMenu() {
	document.getElementById('flash').style.zIndex = 0;
	document.getElementById('noflash').style.zIndex = 100;		
	document.getElementById('flash').style.height = "180px";	
}