	function SetDisplay(elementid,displayvalue,imgsrc){
		if (document.getElementById('i' + elementid) !=null) document.getElementById('i' + elementid).src=imgsrc;
		document.getElementById('l' + elementid).style.display=displayvalue;
	}

	function ToogleDisplay(elementid){
		//alert(document.getElementById(elementid).style.display);
		if (document.getElementById('l' + elementid).style.display=='none'){ //it is contracted
			SetDisplay(elementid,'','/trentino/images/old_t.gif');
		}
		else{
			SetDisplay(elementid,'none','/trentino/images/old_t.gif');
		}
	}


function insertsmilie(smilieface){

	window.opener.document.PostTopic.Message.value+=smilieface;
}

function openWindow(url) {
  popupWin = window.open(url, 'new_page', 'width=460,height=400')
}

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 openWindow(url) {
  popupWin = window.open(url, 'NuovaPagina', 'scrollbars=yes,width=460,height=400')
  if (popupWin.opener == null)
		popupWin.opener =window;
}

function inssmilie(smilieface){
	window.opener.document.PostTopic.Message.value+=smilieface;
}

function insertsmilie(smilieface){

	PostTopic.Message.value+=smilieface;

	
}

function submitproc() {
	if (window.submitted) return false;
	window.submitted = true;
	return true;
}

function storeCaret(text) { 
	if (text.createTextRange) text.caretPos = document.selection.createRange().duplicate();
}

function AddText(text) {
	if (document.PostNew.articolo.caretPos) document.PostNew.articolo.caretPos.text=text;
	else document.PostNew.articolo.value+=text;
	document.PostNew.articolo.focus();
}

function AddSelText(bbopen, bbclose) {
	if (document.PostNew.articolo.caretPos) document.PostNew.articolo.caretPos.text = bbopen + document.PostNew.articolo.caretPos.text + bbclose;
	else document.PostNew.articolo.value += bbopen + bbclose;
	document.PostNew.articolo.focus()
}
function AddLinkText(bbopen1, bbopen2, bbclose) {
	if (document.PostNew.articolo.caretPos) document.PostNew.articolo.caretPos.text = bbopen1 + document.PostNew.articolo.caretPos.text + bbopen2 + document.PostNew.articolo.caretPos.text + bbclose;
	else document.PostNew.articolo.value += bbopen1 + "[indirizzo]" + bbopen2 + bbclose;
	document.PostNew.articolo.focus()
}function hr() {
	AddText("<hr width=40% align=left size=1>");
}

function right() {
	AddSelText("<DIV CLASS='normR'>","</DIV>");
}

function left() {
	AddSelText("<DIV CLASS='normL'>","</DIV>");
}

function superscript() {
	AddSelText("<sup>","</sup>");
}

function subscript() {
	AddSelText("<sub>","</sub>");
}

function pre() {
	AddSelText("<pre>","</pre>");
}

function tcol() {
	AddSelText("<td>","</td>");
}

function trow() {
	AddSelText("<tr><td>","</td></tr>");
}

function table() {
	AddSelText("<table border=1><tr><td>", "</td></tr></table>");
}

function underline() {
	AddSelText("<u>","</u>");
}

function emai1() {
	AddLinkText("<a href='mailto:","' TARGET='_blank'>","</A>");
}

function bold() {
	AddSelText("<b>","</b>");
}

function italicize() {
	AddSelText("<i>","</i>");
}

function quote() {
	AddSelText("<BLOCKQUOTE><font size=1 face=arial>Citazione:<hr height=1 noshade>","<hr height=1 noshade></BLOCKQUOTE></font>");
}
  
function center() {
	AddSelText("<DIV CLASS='normC'>","</DIV>");
}

function hyperlink() {
	AddLinkText("<A HREF='","' TARGET='_blank'>","</A>");
}

function list() {
	AddSelText("<UL><LI>", "</UL>");
}
function br() {
	AddText("<BR>");
}function justif() {
	AddSelText("<DIV class='norm'>","</DIV>");
}function paragr1() {
	AddSelText("<DIV class='conbord'>","</DIV>");
}function paragr2() {
	AddSelText("<DIV class='obliqgras'>","</DIV>");
}function paragr3() {
	AddSelText("<DIV class='unorid'>","</DIV>");
}function paragr4() {
	AddSelText("<DIV class='obliq_CG'>","</DIV>");
}function paragr5() {
	AddSelText("<DIV class='numeri'>","</DIV>");
}function paragr6() {
	AddSelText("<DIV class='tabnorm4'>","</DIV>");
}
function tit1() {
	AddSelText("<H1>","</H1>");
}function tit2() {
	AddSelText("<H2>","</H2>");
}function tit3() {
	AddSelText("<H3>","</H3>");
}function showcolor(color) {
if (color == "Black")		{AddSelText("<FONT COLOR='#000000'>","</FONT>");}
if (color == "Red")			{AddSelText("<FONT COLOR='#FF0000'>","</FONT>");}
if (color == "Yellow")		{AddSelText("<FONT COLOR='#FFFF00'>","</FONT>");}
if (color == "Pink")		{AddSelText("<FONT COLOR='#FFC8CB'>","</FONT>");}
if (color == "Green")		{AddSelText("<FONT COLOR='#00FF00'>","</FONT>");}
if (color == "Orange")		{AddSelText("<FONT COLOR='#FFA500'>","</FONT>");}
if (color == "Purple")		{AddSelText("<FONT COLOR='#800080'>","</FONT>");}
if (color == "Blue")		{AddSelText("<FONT COLOR='#0000FF'>","</FONT>");}
if (color == "Beige")		{AddSelText("<FONT COLOR='#F5F5DC'>","</FONT>");}if (color == "Brown")		{AddSelText("<FONT COLOR='#A52A2A'>","</FONT>");}if (color == "Teal")		{AddSelText("<FONT COLOR='#008080'>","</FONT>");}if (color == "Navy")		{AddSelText("<FONT COLOR='#000080'>","</FONT>");}if (color == "Maroon")		{AddSelText("<FONT COLOR='#800000'>","</FONT>");}if (color == "LimeGreen")	{AddSelText("<FONT COLOR='#32CD32'>","</FONT>");}
}
/* Functions that finds /trentino/forum/images. */
function MM_findObj(n, d) { //v3.0
  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); return x;
}
/* Functions that swaps /trentino/forum/images. */
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];}
}
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;
}

if (document.images) {
  pulsar_r1_c1_f2 = new Image(26 ,26); pulsar_r1_c1_f2.src = "/trentino/forum/images/pulsar_r1_c1_f2.gif";
  pulsar_r1_c1_f1 = new Image(26 ,26); pulsar_r1_c1_f1.src = "/trentino/forum/images/pulsar_r1_c1.gif";
  pulsar_r1_c3_f2 = new Image(26 ,26); pulsar_r1_c3_f2.src = "/trentino/forum/images/pulsar_r1_c3_f2.gif";
  pulsar_r1_c3_f1 = new Image(26 ,26); pulsar_r1_c3_f1.src = "/trentino/forum/images/pulsar_r1_c3.gif";
  }
  
