function openwindow2(filerec) {
	 window.open (filerec,"InfoPhp","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no");}

var col_nw = "#ffffff";	//colore sfondo

function thumb3(Pmaxi,Img) {
	 document.write('<A HREF="javascript:Maxi(\''+Pmaxi+'/'+Img+'\')"><IMG SRC="'+Pmaxi+'/thumbs/'+Img+'" HSPACE=0 VSPACE=0  ALT="Clicca qui per ingrandire la foto"></A>');}

function thumb(Fmaxi,Frid) {
	 document.write('<A HREF="javascript:Maxi(\''+Fmaxi+'\')"><IMG SRC="'+Frid+'" HSPACE=0 VSPACE=0  ALT="Clicca qui per ingrandire la foto"></A>');}

function Maxi(Fmaxi) {
	i1 = new Image;
	i1.src = Fmaxi;
	Fhtml = '<HTML>\n<HEAD>\n<TITLE>Foto</TITLE>\n<LINK REL="shortcut icon" HREF="'+window.location.protocol+'//'+window.location.hostname+'/riservacesine/img/favicon.ico" TYPE="image/x-icon">\n</HEAD>\n<BODY >\n<CENTER><a href="javascript:self.close()"><IMG SRC="'+Fmaxi+'" BORDER=0 NAME=foto onLoad="window.resizeTo(document.foto.width+50,document.foto.height+80)" alt=""></a></CENTER>\n</BODY>\n</HTML>';
	features = "toolbar=0, location=0, directories=0, menuBar=0, scrollbars=1, resizable=1, top=10, left=10";

	NW = window.open('','_blank',features);
	NW.document.open();

	NW.document.write(Fhtml);
	NW.document.close()
}


function formatText(el,tag){
	var selectedText = document.selection?document.selection.createRange().text:el.value.substring(el.selectionStart,el.selectionEnd);

	if(selectedText!=''){
		switch (tag){
			case 'a':
			        var newText='<a href=\"http://'+selectedText+'\">'+selectedText+'</a>'; 
			break;

			case 'b':
			        var newText='<span class=\"grassetto\">'+selectedText+'</span>'; 
			break;

			case 'i':
			        var newText='<'+tag+'>'+selectedText+'</'+tag+'>';
			break

			case 'u':
			        var newText='<'+tag+'>'+selectedText+'</'+tag+'>'; 
			break;

			case 'r':
			        var newText='<span class=\"rosso\">'+selectedText+'</span>'; 
			break;

			case 't':
			        var newText='<!-- Allineati e centrati -->\n<table border=\"0\" width=\"90%\" align=\"center\"><tr><td align=\"center\">\n<!-- testo a sinistra -->\n'+selectedText+'\n</td><td align=\"center\">\n<!-- testo a destra -->\n'+selectedText+'\n</td></tr></table>';
			break;

			case 'sx':
			        var newText='<div class=\"txsinistra\">'+selectedText+'</div>';
			break;

			case 'c':
			        var newText='<div class=\"center\">'+selectedText+'</div>'; 
			break;

			case 'dx':
			        var newText='<div class=\"txdestra\">'+selectedText+'</div>'; 
			break;

			case 'j':
			        var newText='<div class=\"txjust\">'+selectedText+'</div>'; 
			break;

		}
		el.value=el.value.replace(selectedText,newText)
	}
}

// protocol//host:port/pathname#hash?search.
function ricaricaG(n0pzione) {
//	var link=window.location.protocol+'//'+window.location.hostname+'/index.php?ModificaGr='+n0pzione; 
	var link='http://localhost/riservacesine/index.php?ModificaGr='+n0pzione; 
	window.open(link,'_self','');
}

function ricaricaA(n0pzione) {
		if(n0pzione!=''){
//		var link= window.location.protocol+'//'+window.location.hostname+'/pagine.php?m0d=Riservato&area='+n0pzione;  
		var link='http://localhost/riservacesine/pagine.php?m0d=Riservato&area='+n0pzione;  
		window.open(link,'_self','');
	}

}


function MM_preloadImages() {	 //v3.0
var d=document;
if(d.images){
if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){
d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() {	 //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() {  //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){
document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}




//------------menu


var m_t_si,m_t_lo,m_t_tt,m_t_ts,m_t_la,m_t_ic,m_t_ff,m_t_sks;
var m_t_li=new Object();
var m_t_ib='';
var qp="parentNode";
var qc="className";
var m_t_t=navigator.userAgent;
var m_t_o=m_t_t.indexOf("Opera")+1;
var m_t_s=m_t_t.indexOf("afari")+1;
var m_t_s2=m_t_s&&m_t_t.indexOf("ersion/2")+1;
var m_t_s3=m_t_s&&m_t_t.indexOf("ersion/3")+1;
var m_t_n=m_t_t.indexOf("Netscape")+1;
var m_t_v=parseFloat(navigator.vendorSub);;

function m_t_create(sd,v,ts,th,oc,rl,sh,fl,ft,aux,l){
var w="onmouseover";
var ww=w;
var e="onclick";
if(oc){if(oc.indexOf("all")+1||(oc=="lev2"&&l>=2)){w=e;ts=0;}if(oc.indexOf("all")+1||oc=="main"){ww=e;th=0;}}if(!l){l=1;sd=document.getElementById("m_t_"+sd);if(window.m_t_pure)sd=m_t_pure(sd);sd[w]=function(e){try{m_t_kille(e)}catch(e){}};if(oc!="all-always-open")document[ww]=m_t_bo;if(oc=="main"){m_t_ib+=sd.id;sd[e]=function(event){m_t_ic=true;m_t_oo(new Object(),m_t_la,1);m_t_kille(event)};}sd.style.zoom=1;if(sh)x2("m_t_sh",sd,1);if(!v)sd.ch=1;}else  if(sh)sd.ch=1;if(oc)sd.oc=oc;if(sh)sd.sh=1;if(fl)sd.fl=1;if(ft)sd.ft=1;if(rl)sd.rl=1;sd.th=th;sd.style.zIndex=l+""+1;
var lsp;
var sp=sd.childNodes;for(var i=0;i<sp.length;i++){var b=sp[i];if(b.tagName=="A"){ lsp=b;b[w]=m_t_oo;if(w==e)b.onmouseover=function(event){clearTimeout(m_t_tt);m_t_tt=null;m_t_la=null;m_t_kille(event);};b.m_t_ts=ts;if(l==1&&v){b.style.styleFloat="none";b.style.cssFloat="none";}}else  if(b.tagName=="DIV"){if(window.showHelp&&!window.XMLHttpRequest)sp[i].insertAdjacentHTML("afterBegin","<span class='m_t_clear'>&nbsp;</span>");x2("m_t_box",lsp,1);lsp.cdiv=b;b.idiv=lsp;if(m_t_n&&m_t_v<8&&!b.style.width)b.style.width=b.offsetWidth+"px";new m_t_create(b,null,ts,th,oc,rl,sh,fl,ft,aux,l+1);}}};function m_t_bo(e){e=e||event;if(e.type=="click")m_t_ic=false;m_t_la=null;clearTimeout(m_t_tt);m_t_tt=null;var i;for(i in m_t_li){if(m_t_li[i]&&!((m_t_ib.indexOf(i)+1)&&e.type=="mouseover"))m_t_tt=setTimeout("x0('"+i+"')",m_t_li[i].th);}};function m_t_co(t){var f;for(f in m_t_li){if(f!=t&&m_t_li[f])x0(f);}};function x0(id){var i;var a;var a;if((a=m_t_li[id])&&m_t_li[id].oc!="all-always-open"){do{m_t_uo(a);}while((a=a[qp])&&!m_t_a(a));m_t_li[id]=null;}};function m_t_a(a){if(a[qc].indexOf("m_t_mc")+1)return 1;};function m_t_uo(a,go){if(!go&&a.m_t_tree)return;if(window.m_t_ad&&m_t_ad.bhide)eval(m_t_ad.bhide);a.style.visibility="";x2("m_t_active",a.idiv);};function m_t_oo(e,o,nt){try{if(!o)o=this;if(m_t_la==o&&!nt)return;if(window.m_t_v_a&&!nt)m_t_v_a(o);if(window.m_t_wait){m_t_kille(e);return;}clearTimeout(m_t_tt);m_t_tt=null;m_t_la=o;if(!nt&&o.m_t_ts){m_t_si=o;m_t_tt=setTimeout("m_t_oo(new Object(),m_t_si,1)",o.m_t_ts);return;}var a=o;if(a[qp].isrun){m_t_kille(e);return;}while((a=a[qp])&&!m_t_a(a)){}var d=a.id;a=o;m_t_co(d);if(m_t_ib.indexOf(d)+1&&!m_t_ic)return;var go=true;while((a=a[qp])&&!m_t_a(a)){if(a==m_t_li[d])go=false;}if(m_t_li[d]&&go){a=o;if((!a.cdiv)||(a.cdiv&&a.cdiv!=m_t_li[d]))m_t_uo(m_t_li[d]);a=m_t_li[d];while((a=a[qp])&&!m_t_a(a)){if(a!=o[qp]&&a!=o.cdiv)m_t_uo(a);else break;}}var b=o;var c=o.cdiv;if(b.cdiv){var aw=b.offsetWidth;var ah=b.offsetHeight;var ax=b.offsetLeft;var ay=b.offsetTop;if(c[qp].ch){aw=0;if(c.fl)ax=0;}else {if(c.ft)ay=0;if(c.rl){ax=ax-c.offsetWidth;aw=0;}ah=0;}if(m_t_o){ax-=b[qp].clientLeft;ay-=b[qp].clientTop;}if(m_t_s2&&!m_t_s3){ax-=m_t_gcs(b[qp],"border-left-width","borderLeftWidth");ay-=m_t_gcs(b[qp],"border-top-width","borderTopWidth");}if(!c.ismove){c.style.left=(ax+aw)+"px";c.style.top=(ay+ah)+"px";}x2("m_t_active",o,1);if(window.m_t_ad&&m_t_ad.bvis)eval(m_t_ad.bvis);c.style.visibility="inherit";m_t_li[d]=c;}else  if(!m_t_a(b[qp]))m_t_li[d]=b[qp];else m_t_li[d]=null;m_t_kille(e);}catch(e){};};function m_t_gcs(obj,sname,jname){var v;if(document.defaultView&&document.defaultView.getComputedStyle)v=document.defaultView.getComputedStyle(obj,null).getPropertyValue(sname);else  if(obj.currentStyle)v=obj.currentStyle[jname];if(v&&!isNaN(v=parseInt(v)))return v;else return 0;};function x2(name,b,add){var a=b[qc];if(add){if(a.indexOf(name)==-1)b[qc]+=(a?' ':'')+name;}else {b[qc]=a.replace(" "+name,"");b[qc]=b[qc].replace(name,"");}};function m_t_kille(e){if(!e)e=event;e.cancelBubble=true;if(e.stopPropagation&&!(m_t_s&&e.type=="click"))e.stopPropagation();};;

function qa(a,b){return String.fromCharCode(a.charCodeAt(0)-(b-(parseInt(b/2)*2)));};
function m_t_pure(sd){if(sd.tagName=="UL"){var nd=document.createElement("DIV");nd.m_t_pure=1;var c;if(c=sd.style.cssText)nd.style.cssText=c;m_t_convert(sd,nd);var csp=document.createElement("SPAN");csp.className="m_t_clear";csp.innerHTML="&nbsp;";nd.appendChild(csp);sd=sd[qp].replaceChild(nd,sd);sd=nd;}return sd;};
function m_t_convert(a,bm,l){if(!l)bm[qc]=a[qc];bm.id=a.id;var ch=a.childNodes;for(var i=0;i<ch.length;i++){if(ch[i].tagName=="LI"){var sh=ch[i].childNodes;for(var j=0;j<sh.length;j++){if(sh[j]&&(sh[j].tagName=="A"||sh[j].tagName=="SPAN"))bm.appendChild(ch[i].removeChild(sh[j]));if(sh[j]&&sh[j].tagName=="UL"){var na=document.createElement("DIV");var c;if(c=sh[j].style.cssText)na.style.cssText=c;if(c=sh[j].className)na.className=c;na=bm.appendChild(na);new m_t_convert(sh[j],na,1)}}}}}

