function popUp(url, Hsize, Vsize){
	var newWindow;
    newWindow = window.open(url, 'new','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' + Hsize + ',height=' + Vsize);
    if (newWindow.opener == null) 
		newWindow.opener = window;
    }

function return_value(value, target_name){
	var target, form_name, field_name;
	form_name = target_name.substr(0, target_name.indexOf("."));
	field_name = target_name.substr(target_name.indexOf(".") +1);
	target = eval('window.opener.document.forms["' + form_name + '"].'+ field_name);
	target.value = value;
}

function showmenu(menu) {
	// [20070413 giovanni]
	// modificato per renderlo standard
	// document.all(menu).style.visibility = "visible"; 
	document.getElementById(menu).style.visibility = "visible";
	
}

function hidemenu(menu) {
	// [20070413 giovanni]
	// modificato per renderlo standard
	//	document.all(menu).style.visibility = "hidden";
	document.getElementById(menu).style.visibility = "hidden"; 
}


        var TotSmiles=500;
	var Browser=1;
	
	
	if (navigator.appVersion.indexOf("MSIE")==-1) {
		Browser=0;
	}
	if (navigator.appVersion.indexOf("Windows ")==-1) {
		Browser=0;
	}

	function Fuoco() {document.Post.contenuto.focus();}

	function InsFFZCode(Opz,tgSx,tgDx,tgDx2) 
	{
		Fuoco();
		var TR=document.selection.createRange();
		if(TR!=null)
		{
			var str=new String(TR.text);
			if(Opz!=2) {
				if(Opz==1 && str.length<1) return(2);
				if(tgDx2!="") 		TR.text=tgSx+TR.text+tgDx+TR.text+tgDx2;
				else if(tgDx!="") 	TR.text=tgSx+TR.text+tgDx;
				else 			TR.text=tgSx+TR.text;
			}
			if(Opz==2)	{
				TR.text=tgSx;
			}
			return(0);
		} 
		return(1);
	}
	

	function InsTag(tag)
	{
		var x=0;
		if(Browser==1) {
       Fuoco();
			var TR=document.selection.createRange();
			if(TR!=null)
			{
				var str=new String(TR.text);
				str=str.replace(/\[b\]/,"");
				str=str.replace(/\[\/b\]/,"");
				str=str.replace(/\[i\]/,"");
				str=str.replace(/\[\/i\]/,"");
				str=str.replace(/\[u\]/,"");
				str=str.replace(/\[\/u\]/,"");
				str=str.replace(/\[s\]/,"");
				str=str.replace(/\[\/s\]/,"");
				str=str.replace(/\[tit1\]/,"");
				str=str.replace(/\[\/tit1\]/,"");
				str=str.replace(/\[tit2\]/,"");
				str=str.replace(/\[\/tit2\]/,"");
				TR.text=str;
			}
			x=InsFFZCode(3,"["+tag+"]","[/"+tag+"]","");
		}

		if(x!=0 || Browser!=1) {
			document.Post.contenuto.value=document.Post.contenuto.value+"["+tag+"][/"+tag+"]";
			Fuoco();
		}
	}	


function InsTagEdit(tag) {
		var x=0;
		if(Browser==1) {
			Fuoco();
			var TR=document.selection.createRange();
			if(TR!=null)
			{
				var str=new String(TR.text);
				str=str.replace(/\[center\]/,"");
				str=str.replace(/\[\/center\]/,"");
				str=str.replace(/\[right\]/,"");
				str=str.replace(/\[\/right\]/,"");
				str=str.replace(/\[justify\]/,"");
				str=str.replace(/\[\/justify\]/,"");
				TR.text=str;
			}
			if(tag=="left")	return;
			x=InsFFZCode(3,"["+tag+"]","[/"+tag+"]","");
		}
		if(tag=="left")	return;
		if(x!=0 || Browser!=1) {
			document.PostMessaggi.Testo.value=document.PostMessaggi.Testo.value+"["+tag+"][/"+tag+"]";
			Fuoco();
		}
	}

	function Inslistn()
	{
		var x=0;
		if(Browser==1) 	x=InsFFZCode(3,"[list=1][*]","[/*][/list=1]","");
		
		if(x!=0 || Browser!=1) {
			document.Post.contenuto.value=document.Post.contenuto.value+"[list=1][*][/*][/list=1]";
			Fuoco();
		}
	}	

	function Inslistp()
	{
		var x=0;
		if(Browser==1)  x=InsFFZCode(3,"[list][*]","[/*][/list]","");

		if(x!=0 || Browser!=1) {
			document.Post.contenuto.value=document.Post.contenuto.value+"[list][*][/*][/list]";
			Fuoco();
		}
	}	


        function InsImgup()
	{
		var x=0;
		if(Browser==1) x=InsFFZCode(1,"[img news allegata]","[/img","]");
		if(x!=0 || Browser!=1) {
			var a=window.prompt("Inserire l'ID dell`immagine allegata: ", "");
			if(a==null) { Fuoco(); return; }
			var b=window.prompt("Inserire l'allineamento (libero,sinistra,destra): ","")
			if(b==null) { Fuoco(); return; }
			if(b=="libero")  b="";
			if(b=="sinistra")  b="=left";
			if(b=="destra")  b="=right";
			if(Browser==1)			x=InsFFZCode(2,"[img news allegata]"+a+"[/img"+b+"]");
			if(x==1 || Browser!=1)	document.Post.contenuto.value=document.Post.contenuto.value+"[img page allegata]"+a+"[/img"+b+"]";
		}
		Fuoco();
	}

	function InsImgpgup()
	{
		var x=0;
		if(Browser==1) x=InsFFZCode(1,"[img page allegata]","[/img","]");
		if(x!=0 || Browser!=1) {
			var a=window.prompt("Inserire l'ID dell`immagine allegata: ", "");
			if(a==null) { Fuoco(); return; }
			var b=window.prompt("Inserire l'allineamento (libero,sinistra,destra): ","")
			if(b==null) { Fuoco(); return; }
			if(b=="libero")  b="";
			if(b=="sinistra")  b="=left";
			if(b=="destra")  b="=right";
			if(Browser==1)			x=InsFFZCode(2,"[img page allegata]"+a+"[/img"+b+"]");
			if(x==1 || Browser!=1)	document.Post.contenuto.value=document.Post.contenuto.value+"[img page allegata]"+a+"[/img"+b+"]";
		}
		Fuoco();
	}
	
	function InsImgweb()
	{
		var x=0;
		if(Browser==1) x=InsFFZCode(1,"[img da web]","[/img","]");
		if(x!=0 || Browser!=1) {
			var a=window.prompt("Inserire l`indirizzo dell`immagine", "http://");
			if(a==null) { Fuoco(); return; }
			var b=window.prompt("Inserire l'allineamento (libero,sinistra,destra): ","")
			if(b==null) { Fuoco(); return; }
			if(b=="libero")  b="";
			if(b=="sinistra")  b="=left";
			if(b=="destra")  b="=right";
			if(Browser==1)			x=InsFFZCode(2,"[img da web]"+a+"[/img"+b+"]");
			if(x==1 || Browser!=1)	document.Post.contenuto.value=document.Post.contenuto.value+"[img da web]"+a+"[/img"+b+"]";
		}
		Fuoco();
	}
	
	function InsLinkint()
	{
		var x=0;
		if(Browser==1) x=InsFFZCode(1,"[linkinterno][url]","[/url]","[/link]");
		if(x!=0 || Browser!=1) {
			var a=window.prompt("Inserire l`indirizzo per il link: ","http://");
			if(a==null) { Fuoco(); return; }
			var b=window.prompt("Inserire la descrizione del link: "+a,"");
			if(b==null) { Fuoco(); return; }
			if(a.search(/^www\./g)!=-1)  a="http://"+a;
			if(Browser==1)			x=InsFFZCode(2,"[linkinterno][url]"+a+"[/url]"+b+"[/link]");
			if(x==1 || Browser!=1)	document.Post.contenuto.value=document.Post.contenuto.value+"[linkinterno][url]"+a+"[/url]"+b+"[/link]";
		}
		Fuoco();
	}
	
	function InsLinkest()
	{
		var x=0;
		if(Browser==1) x=InsFFZCode(1,"[linkesterno][url]","[/url]","[/link]");
		if(x!=0 || Browser!=1) {
			var a=window.prompt("Inserire l`indirizzo per il link: ","http://");
			if(a==null) { Fuoco(); return; }
			var b=window.prompt("Inserire la descrizione del link: "+a,"");
			if(b==null) { Fuoco(); return; }
			if(a.search(/^www\./g)!=-1)  a="http://"+a;
			if(Browser==1)			x=InsFFZCode(2,"[linkesterno][url]"+a+"[/url]"+b+"[/link]");
			if(x==1 || Browser!=1)	document.Post.contenuto.value=document.Post.contenuto.value+"[linkesterno][url]"+a+"[/url]"+b+"[/link]";
		}
		Fuoco();
	}	
	
	function InsLinkp()
	{
		var x=0;
		if(Browser==1) x=InsFFZCode(1,"[linkpagina][id]","[/id]","[/linkpagina]");
		if(x!=0 || Browser!=1) {
			var a=window.prompt("Inserire l`id della pagina per il link: ","");
			if(a==null) { Fuoco(); return; }
			var b=window.prompt("Inserire la descrizione del link: "+a,"");
			if(b==null) { Fuoco(); return; }
			if(Browser==1)			x=InsFFZCode(2,"[linkpagina][id]"+a+"[/id]"+b+"[/linkpagina]");
			if(x==1 || Browser!=1)	document.Post.contenuto.value=document.Post.contenuto.value+"[linkpagina][id]"+a+"[/id]"+b+"[/linkpagina]";
		}
		Fuoco();
	}	
	
	function InsLinkn()
	{
		var x=0;
		if(Browser==1) x=InsFFZCode(1,"[linknotizia][id]","[/id]","[/linknotizia]");
		if(x!=0 || Browser!=1) {
			var a=window.prompt("Inserire l`id della notizia per il link: ","");
			if(a==null) { Fuoco(); return; }
			var b=window.prompt("Inserire la descrizione del link: "+a,"");
			if(b==null) { Fuoco(); return; }
			if(Browser==1)			x=InsFFZCode(2,"[linknotizia][id]"+a+"[/id]"+b+"[/linknotizia]");
			if(x==1 || Browser!=1)	document.Post.contenuto.value=document.Post.contenuto.value+"[linknotizia][id]"+a+"[/id]"+b+"[/linknotizia]";
		}
		Fuoco();
	}	

	function Insdown()
	{
		var x=0;
		if(Browser==1) x=InsFFZCode(1,"[download][file]","[/file]","[/download]");
		if(x!=0 || Browser!=1) {
			var a=window.prompt("Inserire in nome completo del file", "");
			if(a==null) { Fuoco(); return; }
			var b=window.prompt("Inserire la descrizione del download: "+a,"")
			if(b==null) { Fuoco(); return; }
			if(Browser==1)			x=InsFFZCode(2,"[download][file]"+a+"[/file]"+b+"[/download]");
			if(x==1 || Browser!=1)	document.Post.contenuto.value=document.Post.contenuto.value+"[download][file]"+a+"[/file]"+b+"[/download]";
		}
		Fuoco();
	}
	
function countdown() {
  iniData= new Date(2011,8,20,0,0,0);
  /*
    Data dell'inizio dell'evento, espressa in: anno, mese, giorno, minuti, secondi, millisecondi
  */
  oggi= new Date();
  milDif=(iniData-oggi);
  giorni=parseInt(milDif/86400000);
  milDif=milDif-(giorni*86400000);
  giorni=giorni - 31 ;
  ore=parseInt(milDif/3600000);
  milDif=milDif-(ore*3600000);
  minuti=parseInt(milDif/60000);
  milDif=milDif-(minuti*60000);
  secondi=parseInt(milDif/1000);
  milDif=milDif-(secondi*1000);
  if (giorni <= "0" && ore <= "0" && minuti <= "0" && secondi <= "0")
    /* se è già arrivata la data scrive che siamo arrivati, altrimenti dice i giorni mancanti */
    testo='Si è concluso il '+' <FONT color=#8DC73D> '+'M'+' </FONT> '+' <FONT color=#02A650> '+'T'+' </FONT> '+' <FONT color=#006442> '+'B'+' </FONT> '+' <FONT color=#F38321> '+'O'+' </FONT> '+' <FONT color=#231F20> '+'WOC'+' </FONT> '+' <FONT color=#EF1C25> '+'2011'+' </FONT> ';
  else
    testo='Si è concluso il '+' <FONT color=#8DC73D> '+'M'+' </FONT> '+' <FONT color=#02A650> '+'T'+' </FONT> '+' <FONT color=#006442> '+'B'+' </FONT> '+' <FONT color=#F38321> '+'O'+' </FONT> '+' <FONT color=#231F20> '+'WOC'+' </FONT> '+' <FONT color=#EF1C25> '+'2011'+' </FONT> ';


    if (document.getElementById)
      document.getElementById("countdown").innerHTML=testo;
    else
      document.all.countdown.innerHTML=testo;
 
setTimeout("countdown()",1000)
}	
