function NewWindow(mypage,myname,w,h,scroll) {
  var win = null;
  LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
  win = window.open(mypage,myname,settings)
  if(win.window.focus){win.window.focus();}
}

function createAjaxLoader() {
	ajaxLoader=null;
	ajaxLoader=document.createElement("div");
	ajaxLoader.id="ajaxLoader";
	ajaxLoader.innerHTML='<img src="../images_web/ajax/progb1.gif" alt="caricamento...">';
	return ajaxLoader;
}

function createAjaxErrMsg() {
	ajaxErrMsg=null;
	ajaxErrMsg=document.createElement("div");
	ajaxErrMsg.id="ajaxErrMsg";
	ajaxErrMsg.innerHTML='siamo spiacenti, le informazioni richieste non sono momentaneamente diponibili.';
	return ajaxErrMsg;
}

function showFloatingBanner() {
    if($('absloute_posbnr')) {
   	 var floatingBanner=$('absloute_posbnr');
     floatingBanner.style.display='block';
    }
}

function disableFloatingBanner(index) {	
     $('absloute_posbnr').style.display='none';
     req.open('GET','disable_fbanner.php?index='+index);
     req.send(null);
}

function switch_order() {
	if($("ord_c"))
		document.forms["results_pages"].ord_c.value=$("ord_c").options[$("ord_c").selectedIndex].value;
	if($("n_cxp"))		
		document.forms["results_pages"].n_cxp.value=$("n_cxp").options[$("n_cxp").selectedIndex].value;
	document.forms["results_pages"].submit();
}

function SSearchAddONSubmit() {	
	if(document.forms['site_search']) {
		document.forms['site_search'].onsubmit=function() {
			var site_search_inputs=document.forms['site_search'].elements;
			var tot_obsj=site_search_inputs.length;
			for(var i=0;i<tot_obsj;i++) {
				if(site_search_inputs[i].type=="text" && site_search_inputs[i].value==site_search_inputs[i].getAttribute("defvalue"))
					site_search_inputs[i].value="";
			}
		}
	}
}

function PPSubmit() {
	document.forms['_xclick'].submit();
}

addLoadEvent(function() {
	SSearchAddONSubmit();
	TargetBlank();		
	setTimeout("showFloatingBanner()", 1500);
	
	// angoli arrotondati
	if(NiftyCheck()) {
		Rounded("div#titrovi3","tr bl","#FFFFFF","#EFEFEF","border #E0E0E0");
	}
});

function mostraLingue(menuCorrente) {
			if (document.getElementById) {
				questoMenu = document.getElementById(menuCorrente).style
				if (questoMenu.display == "block") {
					questoMenu.display = "none"
				}
				else {
					questoMenu.display = "block"
				}
				return false
			}
			else {
				return true
			}
}
