function DoConfirm(message, url) {
	if(confirm(message)) location.href = url;
}

function WhichClicked(ww) {
	window.document.Preview.waction.value = ww;
}

function submitonce(theform) {
	// if IE 4+ or NS 6+
	if (document.all || document.getElementById) {
		// hunt down "submit" and "reset"
		for (i=0;i<theform.length;i++) {
			var tempobj=theform.elements[i];
			if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset") {
				//disable it
				tempobj.disabled=true;
			}
		}
	}
}

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

function AddText(text) {
	if (document.Preview.Content.createTextRange && document.Preview.Content.caretPos) {      
		var caretPos = document.Preview.Content.caretPos;      
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ?
		text + ' ' : text;
	}
	else document.Preview.Content.value += text;
	document.Preview.Content.focus(caretPos)
}

function hr() {
	AddTxt="<hr>";
	AddText(AddTxt);
}
function img1() {
	AddTxt="<img src=http://www.pointovu.com/images.d/leggi.gif alt=_ border=0>";
	AddText(AddTxt);
}
function img2() {
	AddTxt="<img src=http://www.pointovu.com/images.d/leggi_2.gif alt=_ border=0>";
	AddText(AddTxt);
}
function img3() {
	AddTxt="<img src=http://www.pointovu.com/images.d/leggi_3.gif alt=_ border=0>";
	AddText(AddTxt);
}
function br() {
	AddTxt="<br>";
	AddText(AddTxt);
}

function dimensione(dim) {
	AddTxt="<font size="+dim+"></font>";
	AddText(AddTxt);
}

function tt() {
	AddTxt="<tt></tt>";
	AddText(AddTxt);
}

function destra() {
	AddTxt="<div align=right></div>";
	AddText(AddTxt);
}

function sinistra() {
	AddTxt="<div align=left></left>";
	AddText(AddTxt);
}

function apice() {
	AddTxt="<sup></sup>";
	AddText(AddTxt);
}

function pedice() {
	AddTxt="<sub></sub>";
	AddText(AddTxt);
}

function immagine() {
	AddTxt="<img border=0 alt=NOMEIMMAGNE src=http://www.pointovu.com/archivio/NOMEFILE.XXX>";
	AddText(AddTxt);
}

function immagine_esterno() {
	AddTxt="<img border=0 alt=NOMEIMMAGNE src=http://www.dominio.xxx/NOMEFILE.XXX>";
	AddText(AddTxt);
}

function ftp() {
	AddTxt="[ftp][/ftp]";
	AddText(AddTxt);
}

function pre() {
	AddTxt="<pre> </pre>";
	AddText(AddTxt);
}

function tcol() {
	AddTxt="<td> </td>";
	AddText(AddTxt);
}

function trow() {
	AddTxt="<tr> </tr>";
	AddText(AddTxt);
}

function table_1x3() {
	AddTxt="<table><tr><td>PRIMA_CASELLA</td><td>SECONDA_CASELLA</td><td>TERZA_CASELLA</td></tr></table>";
	AddText(AddTxt);
}

function table_2x3() {
	AddTxt="<table><tr><td>PRIMA_CASELLA</td><td>SECONDA_CASELLA</td><td>TERZA_CASELLA</td></tr><tr><td>QUARTA_CASELLA</td><td>QUINTA_CASELLA</td><td>SESTA_CASELLA</td></tr></table>";
	AddText(AddTxt);
}

function table_3x3() {
	AddTxt="<table><tr><td>PRIMA_CASELLA</td><td>SECONDA_CASELLA</td><td>TERZA_CASELLA</td></tr><tr><td>QUARTA_CASELLA</td><td>QUINTA_CASELLA</td><td>SESTA_CASELLA</td></tr><tr><td>SETTIMA_CASELLA</td><td>OTTAVA_CASELLA</td><td>NONA_CASELLA</td></tr></table>";
	AddText(AddTxt);
}
function table_2x1() {
	AddTxt="<table><tr><td>PRIMA_CASELLA</td><td>SECONDA_CASELLA</td></tr></table>";
	AddText(AddTxt);
}
function table_2_2x1() {
	AddTxt="<table><tr><td><table><tr><td>PRIMA_CASELLA</td><td>TERZA_CASELLA></td></tr></table></td><td>SECONDA_CASELLA</td></tr></table>";
	AddText(AddTxt);
}

function barrato() {
	AddTxt="<s> </s>";
	AddText(AddTxt);
}

function sottolineato() {
	AddTxt="<u> </u>";
	AddText(AddTxt);
}

function email() {
	AddTxt="<a href=mailto:NOME@PROVIDER.XXX>EMAIL</a>";
	AddText(AddTxt);
}

function grassetto() {
	AddTxt="<b> </b>";
	AddText(AddTxt);
}

function corsivo() {
	AddTxt="<i> </i>";
	AddText(AddTxt);
}

function quote() {
	AddTxt="[quote][/quote]";
	AddText(AddTxt);
}

function centro() {
	AddTxt="<div align=center> </div>";
	AddText(AddTxt);
}

function link() {
	AddTxt="<a class=sommario href=URL>NOMEURL</a>";
	AddText(AddTxt);
}

function link_esterno() {
	AddTxt="<a class=sommario target=_blank href=URL>NOMEURL</a>";
	AddText(AddTxt);
}
function link2() {
	AddTxt="<a class=titolosommario href=URL>NOMEURL</a>";
	AddText(AddTxt);
}

function link_esterno2() {
	AddTxt="<a class=titolosommario target=_blank href=URL>NOMEURL</a>";
	AddText(AddTxt);
}
function lista() {
	AddTxt="<list><*> <*> <*> </list>";
	AddText(AddTxt);
}

function colore(colore) {
	AddTxt="<font color="+colore+"> </font>";
	AddText(AddTxt);
}

function smiley() {
	AddTxt=" :)";
	AddText(AddTxt);
}

function wink() {
	AddTxt=" ;)";
	AddText(AddTxt);
}

function cheesy() {
	AddTxt=" :D";
	AddText(AddTxt);
}

function grin() {
	AddTxt=" ;D";
	AddText(AddTxt);
}

function angry() {
	AddTxt=" >:(";
	AddText(AddTxt);
}

function sad() {
	AddTxt=" :(";
	AddText(AddTxt);
}

function shocked() {
	AddTxt=" :o";
	AddText(AddTxt);
}

function cool() {
	AddTxt=" 8)";
	AddText(AddTxt);
}

function huh() {
	AddTxt=" ???";
	AddText(AddTxt);
}

function rolleyes() {
	AddTxt=" ::)";
	AddText(AddTxt);
}

function tongue() {
	AddTxt=" :P";
	AddText(AddTxt);
}

function lipsrsealed() {
	AddTxt=" :-X";
	AddText(AddTxt);
}

function embarassed() {
	AddTxt=" :-[";
	AddText(AddTxt);
}

function undecided() {
	AddTxt=" :-\\";
	AddText(AddTxt);
}

function kiss() {
	AddTxt=" :-*";
	AddText(AddTxt);
}

function cry() {
	AddTxt=" :'(";
	AddText(AddTxt);
}
