DECMD_BOLD =                      5000
DECMD_COPY =                      5002
DECMD_CUT =                       5003
DECMD_DELETE =                    5004
DECMD_DELETECELLS =               5005
DECMD_DELETECOLS =                5006
DECMD_DELETEROWS =                5007
DECMD_FINDTEXT =                  5008
DECMD_FONT =                      5009
DECMD_GETBACKCOLOR =              5010
DECMD_GETBLOCKFMT =               5011
DECMD_GETBLOCKFMTNAMES =          5012
DECMD_GETFONTNAME =               5013
DECMD_GETFONTSIZE =               5014
DECMD_GETFORECOLOR =              5015
DECMD_HYPERLINK =                 5016
DECMD_IMAGE =                     5017
DECMD_INDENT =                    5018
DECMD_INSERTCELL =                5019
DECMD_INSERTCOL =                 5020
DECMD_INSERTROW =                 5021
DECMD_INSERTTABLE =               5022
DECMD_ITALIC =                    5023
DECMD_JUSTIFYCENTER =             5024
DECMD_JUSTIFYLEFT =               5025
DECMD_JUSTIFYRIGHT =              5026
DECMD_LOCK_ELEMENT =              5027
DECMD_MAKE_ABSOLUTE =             5028
DECMD_MERGECELLS =                5029
DECMD_ORDERLIST =                 5030
DECMD_OUTDENT =                   5031
DECMD_PASTE =                     5032
DECMD_REDO =                      5033
DECMD_REMOVEFORMAT =              5034
DECMD_SELECTALL =                 5035
DECMD_SEND_BACKWARD =             5036
DECMD_BRING_FORWARD =             5037
DECMD_SEND_BELOW_TEXT =           5038
DECMD_BRING_ABOVE_TEXT =          5039
DECMD_SEND_TO_BACK =              5040
DECMD_BRING_TO_FRONT =            5041
DECMD_SETBACKCOLOR =              5042
DECMD_SETBLOCKFMT =               5043
DECMD_SETFONTNAME =               5044
DECMD_SETFONTSIZE =               5045
DECMD_SETFORECOLOR =              5046
DECMD_SPLITCELL =                 5047
DECMD_UNDERLINE =                 5048
DECMD_UNDO =                      5049
DECMD_UNLINK =                    5050
DECMD_UNORDERLIST =               5051
DECMD_PROPERTIES =                5052
OLECMDEXECOPT_DODEFAULT =         0
OLECMDEXECOPT_PROMPTUSER =        1
OLECMDEXECOPT_DONTPROMPTUSER =    2
DECMDF_NOTSUPPORTED =             0
DECMDF_DISABLED =                 1
DECMDF_ENABLED =                  3
DECMDF_LATCHED =                  7
DECMDF_NINCHED =                  11
DEAPPEARANCE_FLAT =               0
DEAPPEARANCE_3D =                 1
OLE_TRISTATE_UNCHECKED =          0
OLE_TRISTATE_CHECKED =            1
OLE_TRISTATE_GRAY =               2
S_OK =                            3
S_DISABLED =                      1
var obj_editor = 0 ;
function canvi_imatge(nom_img,graf){
document.images[nom_img].src = graf;
return true;
}
function MakeArray(n)
{
this.length=n;
for(var j=1; j<=n; j++){
this[n]=0;
}
return this;
}
colors= new MakeArray(140);
colors[0]='aliceblue';
colors[1]='antiquewhite';
colors[2]='aqua';
colors[3]='aquamarine';
colors[4]='azure';
colors[5]='beige';
colors[6]='bisque';
colors[7]='black';
colors[8]='blanchedalmond';
colors[9]='blue';
colors[10]='blueviolet';
colors[11]='brown';
colors[12]='burlywood';
colors[13]='cadetblue';
colors[14]='chartreuse';
colors[15]='chocolate';
colors[16]='coral';
colors[17]='cornflower';
colors[18]='cornsilk';
colors[19]='crimson';
colors[20]='cyan';
colors[21]='darkblue';
colors[22]='darkcyan';
colors[23]='darkgoldenrod';
colors[24]='darkgray';
colors[25]='darkgreen';
colors[26]='darkkhaki';
colors[27]='darkmagenta';
colors[28]='darkolivegreen';
colors[29]='darkorange';
colors[30]='darkorchid';
colors[31]='darkred';
colors[32]='darksalmon';
colors[33]='darkseagreen';
colors[34]='darkslateblue';
colors[35]='darkslategray';
colors[36]='darkturquoise';
colors[37]='darkviolet';
colors[38]='deeppink';
colors[39]='deepskyblue';
colors[40]='dimgray';
colors[41]='dodgerblue';
colors[42]='firebrick';
colors[43]='floralwhite';
colors[44]='forestgreen';
colors[45]='fuchia';
colors[46]='gainsboro';
colors[47]='ghostwhite';
colors[48]='gold';
colors[49]='goldenrod';
colors[50]='gray';
colors[51]='green';
colors[52]='greenyellow';
colors[53]='honeydew';
colors[54]='hotpink';
colors[55]='indianred';
colors[56]='indigo';
colors[57]='ivory';
colors[58]='khaki';
colors[59]='lavender';
colors[60]='lavenderblush';
colors[61]='lawngreen';
colors[62]='lemonchiffon';
colors[63]='lightblue';
colors[64]='lightcoral';
colors[65]='lightcyan';
colors[66]='lightgoldenrodyellow';
colors[67]='lightgreen';
colors[68]='lightgrey';
colors[69]='lightpink';
colors[70]='lightsalmon';
colors[71]='lightseagreen';
colors[72]='lightskyblue';
colors[73]='lightslategray';
colors[74]='lightsteelblue';
colors[75]='lightyellow';
colors[76]='lime';
colors[77]='limegreen';
colors[78]='linen';
colors[79]='magenta';
colors[80]='maroon';
colors[81]='mediumaquamarine';
colors[82]='mediumblue';
colors[83]='mediumorchid';
colors[84]='mediumpurple';
colors[85]='mediumseagreen';
colors[86]='mediumslateblue';
colors[87]='mediumspringgreen';
colors[88]='mediumturquoise';
colors[89]='mediumvioletred';
colors[90]='midnightblue';
colors[91]='mintcream';
colors[92]='mistyrose';
colors[93]='moccasin';
colors[94]='navajowhite';
colors[95]='navy';
colors[96]='oldlace';
colors[97]='olive';
colors[98]='olivedrab';
colors[99]='orange';
colors[100]='orangered';
colors[101]='orchid';
colors[102]='palegoldenrod';
colors[103]='palegreen';
colors[104]='paleturquoise';
colors[105]='palevioletred';
colors[106]='papayawhip';
colors[107]='peachpuff';
colors[108]='peru';
colors[109]='pink';
colors[110]='plum';
colors[111]='powderblue';
colors[112]='purple';
colors[113]='red';
colors[114]='rosybrown';
colors[115]='royalblue';
colors[116]='saddlebrown';
colors[117]='salmon';
colors[118]='sandybrown';
colors[119]='seagreen';
colors[120]='seashell';
colors[121]='sienna';
colors[122]='silver';
colors[123]='skyblue';
colors[124]='slateblue';
colors[125]='slategray';
colors[126]='snow';
colors[127]='springgreen';
colors[128]='steelblue';
colors[129]='tan';
colors[130]='teal';
colors[131]='thistle';
colors[132]='tomato';
colors[133]='turquoise';
colors[134]='violet';
colors[135]='wheat';
colors[136]='white';
colors[137]='whitesmoke';
colors[138]='yellow';
colors[139]='yellowgreen';
function contingut_html(nom_editor) {
var obj_ed = eval("document." + nom_editor);
var cont = obj_ed.DocumentHTML;
var texto = "" + cont
var complet = eval(nom_editor + '_doc_complet');
if(!complet){
texto = strip_body(texto);
}
return texto
}
function posa_contingut_html(nom_editor,contingut) {
var obj_ed = eval("document." + nom_editor);
obj_ed.DocumentHTML = contingut;
}
function strip_body(cont) {
var  ini_cos = cont.search(/<BODY/i);
if( ini_cos == -1 ){
return cont;
}
var  lon = cont.length;
var  fi = false;
var prob = false;
var  i = ini_cos + 5;
while( !fi ){
car = cont.charAt(i);
if( car == '>' ){
ini_cos = i + 1;
fi = true;
}
if( car == '"' || car == "'" ){
fi_com = false;
i++
if( i >= lon ){
fi = true;
prob = true;
fi_com = true;
}
while( !fi_com ){
car_aux = cont.charAt(i);
if( car_aux == car ){
fi_com = true;
}
else
{
i++;
}
if( i >= lon ){
fi = true;
prob = true;
fi_com = true;
}
}
}
i++;
if( i >= lon ){
fi = true;
prob = true;
}
}
if( prob == true ){
alert('Impossibile eseguire l\'operazione: il codice HTML della pagina contiene errori o tag non standard.');
}
else
{
var fi_cos = cont.search(/<\/BODY/i);
var aux = cont.substring(ini_cos,fi_cos);
cont = aux;
}
return cont;
}
function nou_doc(){
if( confirm('Aprendo un nuovo documento vengono perse tutte le modifiche non salvate.\nVuoi continuare?') && confirm('Sei sicuro di voler aprire un documento vuoto e di perdere le modifiche non salvate del documento corrente?') ){
obj_editor.NewDocument();
}
}
function teststatus( cmd_test, displmsg ) {
var successo = false;
if ( displmsg == null ) {
displmsg = true;
}
if ( obj_editor.QueryStatus( cmd_test ) != S_DISABLED ) {
successo = true;
}
if ( !successo && displmsg ) {
alert( "Comando non disponibile per l'ogetto selezionato" );
}
return successo;
}
function updateFontName() {
if ( teststatus ( DECMD_GETFONTNAME, false ) ) {
var indexvalue = 0;
var curfont = obj_editor.ExecCommand( DECMD_GETFONTNAME );
switch ( curfont ) {
case 'Verdana' :
indexvalue = 1;
break;
case 'Arial' :
indexvalue = 2;
break;
case 'Tahoma' :
indexvalue = 3;
break;
case 'Courier New' :
indexvalue = 4;
break;
case 'Times New Roman' :
indexvalue = 5;
break;
case 'Wingdings' :
indexvalue = 6;
break;
}
thisForm.Ed1_FontName.selectedIndex = indexvalue;
}
}
function updateFontSize() {
if ( teststatus ( DECMD_GETFONTSIZE, false ) ) {
var indexvalue = 0;
var cursize = obj_editor.ExecCommand( DECMD_GETFONTSIZE );
switch ( cursize ) {
case 1 :
indexvalue = 1;
break;
case 2 :
indexvalue = 2;
break;
case 3 :
indexvalue = 3;
break;
case 4 :
indexvalue = 4;
break;
case 5 :
indexvalue = 5;
break;
case 6 :
indexvalue = 6;
break;
case 7 :
indexvalue = 7;
break;
}
thisForm.Ed1_FontSize.selectedIndex = indexvalue;
}
}
function cortar() {
if ( teststatus( DECMD_CUT ) ) {
obj_editor.ExecCommand(DECMD_CUT,OLECMDEXECOPT_DODEFAULT);
}
}
function copiar() {
if ( teststatus( DECMD_COPY ) ) {
obj_editor.ExecCommand(DECMD_COPY,OLECMDEXECOPT_DODEFAULT);
}
}
function pegar(){
if ( teststatus( DECMD_PASTE ) ) {
obj_editor.ExecCommand(DECMD_PASTE,OLECMDEXECOPT_DODEFAULT);
}
}
function desfer() {
if ( teststatus( DECMD_UNDO ) ) {
obj_editor.ExecCommand(DECMD_UNDO,OLECMDEXECOPT_DODEFAULT);
}
}
function refer() {
if ( teststatus( DECMD_REDO ) ) {
obj_editor.ExecCommand(DECMD_REDO,OLECMDEXECOPT_DODEFAULT);
}
}
function cercar() {
if ( teststatus( DECMD_FINDTEXT ) ) {
obj_editor.ExecCommand(DECMD_FINDTEXT,OLECMDEXECOPT_PROMPTUSER);
}
}
function fer_link() {
if ( teststatus( DECMD_HYPERLINK ) ) {
obj_editor.ExecCommand(DECMD_HYPERLINK,OLECMDEXECOPT_PROMPTUSER);
var tmphtml = obj_editor.DocumentHTML;
Ed1_setcontigut2( tmphtml );
}
}
function mostra_pal_doc_bgcolor(){
paleta_colors('opener.doc_bgcolor_posa');
return true;
}
function doc_bgcolor_posa(hexa_color) {
var content = obj_editor.DocumentHTML;
var codi, noucodi, lon, loc, k, car, car_aux, a, codi_result;
codi = new String(content);
lon = codi.length
loc = codi.search(/<BODY/i);
fi = false;
prob = false;
i = loc + 5;
loc_bg = i;
loc_bg_fi = i;
while( !fi ){
car = codi.charAt(i);
if( car == '>' ){
loc_bg = i;
loc_bg_fi = i;
fi = true;
}
if( codi.substr(i,8) == 'BGCOLOR=' ){
loc_bg = i + 8;
while( codi.charAt(i) != ' ' ){
i++;
}
loc_bg_fi = i;
fi = true;
}
if( codi.substr(i,8) == 'bgcolor=' ){
loc_bg = i + 8;
fi = true;
}
if( car == '"' || car == "'" ){
fi_com = false;
i++;
if( i >= lon ){
fi = true;
prob = true;
fi_com = true;
}
while( !fi_com ){
car_aux = codi.charAt(i);
if( car_aux == car ){
fi_com = true;
}
else
{
i++;
}
if( i >= lon ){
fi = true;
prob = true;
fi_com = true;
}
}
}
i++;
if( i >= lon ){
fi = true;
prob = true;
}
}
if( prob == true ){
alert('Impossibile eseguire l\'operazione: il codice HTML della pagina contiene errori o tag non standard.');
}
else
{
codi_result = "" + codi.substring(0,loc_bg)
if( loc_bg == loc_bg_fi ){
codi_result += ' BGCOLOR="' + hexa_color + '" ';
}
else
{
codi_result += '"' + hexa_color + '" ';
}
codi_result += codi.substring(loc_bg_fi,lon);
obj_editor.DocumentHTML = codi_result;
}
return true;
}
function mostra_insert_table(Style) {
if ( !teststatus( DECMD_INSERTTABLE ) ) {
return false;
}
var pVar = document.ObjTableInfo;
var NR = pVar.NumRows;
var NC = pVar.NumCols;
var TA = pVar.TableAttrs;
var CA = pVar.CellAttrs;
var funct = 'opener.inserta_table';
var par_tab, k, tc;
par_tab=window.open("","param_tables","screenX=80,screenY=80,width=370,height=230")
par_tab.document.open();
k=par_tab.document;
k.writeln('<HTML><HEAD><TITLE>Table</TITLE>')
k.writeln('<LINK  href="'+ Style +'" type=text/css rel=stylesheet>')
k.writeln("<scr"+"ipt> function comprova_valors() { ")
k.writeln("           var nf, nc, at, ac, tit, cellpadding, cellspacing, border, bordercolor, nerr=0 , avis")
k.writeln("           avis = '\\nLa tabella non può essere creata:' ")
k.writeln("           nf = document.info_table.NumRows.value")
k.writeln("           nc = document.info_table.NumCols.value")
k.writeln("           at = document.info_table.TableAttrs.value")
k.writeln("           ac = document.info_table.CellAttrs.value")
k.writeln("           tit = document.info_table.Caption.value")
k.writeln("           if( nf != parseInt(nf) || nf < 0 ){ ")
k.writeln("               nerr++")
k.writeln("               avis += '\\n\\n-Il numero delle righe deve essere un intero positivo.'")
k.writeln("           }")
k.writeln("           if( nc != parseInt(nc) || nc < 0 ){ ")
k.writeln("               nerr++")
k.writeln("               avis += '\\n\\n-Il numero delle colonne deve essere un intero positivo.'")
k.writeln("           }")
k.writeln("           if( nerr == 0){ ")
k.writeln("               "+funct+"(nf,nc,at,ac,tit) ")
k.writeln("               window.close(); ")
k.writeln("           }")
k.writeln("           else")
k.writeln("           {")
k.writeln("             alert(avis)")
k.writeln("           }")
k.writeln("           return true ")
k.writeln("         }</"+"script>")
k.writeln('</HEAD><body ><center>')
k.writeln('<form name="info_table" id="info_table" onsubmit="comprova_valors();" ><input type="hidden" name="PHPSESSID" value="a364ffeb4bcf50829a9f8b37cb631770" />');
k.writeln('<TABLE CELLSPACING=2><TR><TD valign=absmiddle >Righe :&nbsp;&nbsp;&nbsp;<INPUT TYPE="TEXT" SIZE="3"  maxlength="2" NAME="NumRows" value='+NR+' ></TD>')
k.writeln('<TD valign=absmiddle >Colonne :&nbsp;&nbsp;&nbsp;<INPUT TYPE="TEXT" SIZE="3" maxlength="2" NAME="NumCols" value='+NC+'></TD></TR>')
k.writeln('<TR><TD>Attributi della tabella :</TD><TD valign=absmiddle ><INPUT TYPE="TEXT" SIZE="40" NAME="TableAttrs" maxlength="120" value="border=0 cellpadding=1 cellspacing=1 width=100%"></TD></TR>')
k.writeln('<TR><TD>Attributi delle celle :</TD><TD><INPUT TYPE="TEXT" SIZE="40" NAME="CellAttrs" value='+CA+'></TD></TR>')
k.writeln('<TR><TD>Titolo della tabella :</TD><TD><INPUT TYPE="TEXT" SIZE="20" NAME="Caption" ></TD></TR></TABLE>')
k.writeln('<TR><TD valign=absmiddle colspan=2 align=center ><INPUT TYPE="BUTTON" NAME="OK" VALUE="OK" onclick="comprova_valors()" ></TD></TR></TABLE></form>')
k.writeln('</center></BODY></HTML>')
k.close()
par_tab.focus()
return true
}
function inserta_table(nf,nc,at,ac,tit) {
if ( teststatus( DECMD_INSERTTABLE ) ) {
var pVar = document.ObjTableInfo;
pVar.NumRows = nf;
pVar.NumCols = nc;
pVar.TableAttrs = at;
pVar.CellAttrs = ac;
obj_editor.ExecCommand(DECMD_INSERTTABLE,OLECMDEXECOPT_DODEFAULT, pVar);
return true;
}
else {
return false;
}
}
function insert_fila_table() {
if ( teststatus( DECMD_INSERTROW ) ) {
obj_editor.ExecCommand(DECMD_INSERTROW,OLECMDEXECOPT_DODEFAULT);
}
}
function elim_fila_table() {
if ( teststatus( DECMD_DELETEROWS ) ) {
obj_editor.ExecCommand(DECMD_DELETEROWS,OLECMDEXECOPT_DODEFAULT);
}
}
function insert_col_table() {
if ( teststatus( DECMD_INSERTCOL ) ) {
obj_editor.ExecCommand(DECMD_INSERTCOL,OLECMDEXECOPT_DODEFAULT);
}
}
function elim_col_table() {
if ( teststatus( DECMD_DELETECOLS ) ) {
obj_editor.ExecCommand(DECMD_DELETECOLS,OLECMDEXECOPT_DODEFAULT);
}
}
function insert_celda_table() {
if ( teststatus( DECMD_INSERTCELL ) ) {
obj_editor.ExecCommand(DECMD_INSERTCELL,OLECMDEXECOPT_DODEFAULT);
}
}
function elim_celda_table() {
if ( teststatus( DECMD_DELETECELLS ) ) {
obj_editor.ExecCommand(DECMD_DELETECELLS,OLECMDEXECOPT_DODEFAULT);
}
}
function combinar_celdas_table() {
if ( teststatus( DECMD_MERGECELLS ) ) {
obj_editor.ExecCommand(DECMD_MERGECELLS,OLECMDEXECOPT_DODEFAULT);
}
}
function split_celdas_table() {
if ( teststatus( DECMD_SPLITCELL ) ) {
obj_editor.ExecCommand(DECMD_SPLITCELL,OLECMDEXECOPT_DODEFAULT);
}
}
function FontName_onchange(sel_obj) {
var ty = sel_obj.options[sel_obj.selectedIndex].value;
if( ty != 0 && teststatus( DECMD_SETFONTNAME ) ){
obj_editor.ExecCommand(DECMD_SETFONTNAME, OLECMDEXECOPT_DODEFAULT, ty);
}
sel_obj.options[sel_obj.selectedIndex].selected = true
}
function FontSize_onchange(sel_obj) {
var sz = sel_obj.options[sel_obj.selectedIndex].value;
if( sz != 0  && teststatus( DECMD_SETFONTSIZE ) ){
obj_editor.ExecCommand(DECMD_SETFONTSIZE, OLECMDEXECOPT_DODEFAULT, sz);
}
sel_obj.options[0].selected = true
}
function negreta(){
if ( teststatus( DECMD_BOLD ) ) {
obj_editor.ExecCommand(DECMD_BOLD,OLECMDEXECOPT_DODEFAULT);
}
return false;
}
function cursiva() {
if ( teststatus( DECMD_ITALIC ) ) {
obj_editor.ExecCommand(DECMD_ITALIC,OLECMDEXECOPT_DODEFAULT);
}
}
function subry() {
if ( teststatus( DECMD_UNDERLINE ) ) {
obj_editor.ExecCommand(DECMD_UNDERLINE,OLECMDEXECOPT_DODEFAULT);
}
}
function alin_dreta() {
if ( teststatus( DECMD_JUSTIFYRIGHT ) ) {
obj_editor.ExecCommand(DECMD_JUSTIFYRIGHT,OLECMDEXECOPT_DODEFAULT);
}
}
function centrat() {
if ( teststatus( DECMD_JUSTIFYCENTER ) ) {
obj_editor.ExecCommand(DECMD_JUSTIFYCENTER,OLECMDEXECOPT_DODEFAULT);
}
}
function alin_esq() {
if ( teststatus( DECMD_JUSTIFYLEFT ) ) {
obj_editor.ExecCommand(DECMD_JUSTIFYLEFT,OLECMDEXECOPT_DODEFAULT);
}
}
function Esegui_Op(obj,Codice)
{
obj.ExecCommand (Codice,0)
obj.focus()
}
function llista_numerada() {
if ( teststatus( DECMD_ORDERLIST ) ) {
obj_editor.ExecCommand(DECMD_ORDERLIST,OLECMDEXECOPT_DODEFAULT);
}
}
function llista_no_num() {
if ( teststatus( DECMD_UNORDERLIST ) ) {
obj_editor.ExecCommand(DECMD_UNORDERLIST,OLECMDEXECOPT_DODEFAULT);
}
}
function indentat() {
if ( teststatus( DECMD_INDENT ) ) {
obj_editor.ExecCommand(DECMD_INDENT,OLECMDEXECOPT_DODEFAULT);
}
}
function deindentat() {
if ( teststatus( DECMD_OUTDENT ) ) {
obj_editor.ExecCommand(DECMD_OUTDENT,OLECMDEXECOPT_DODEFAULT);
}
}
function Bordi_Oggetti() {
obj_editor.ShowBorders=!obj_editor.ShowBorders;
}
function Intesta_Paragrafo() {
obj_editor.ShowDetails=!obj_editor.ShowDetails;
}
function GetElement(oElement,sTag)
{
/*Utility function; Goes up the DOM from the element oElement, till
a parent element with the tag that matches sTag
is found. Returns that parent element.*/
while (oElement!=null && oElement.tagName!=sTag){
oElement = oElement.parentElement;
}
return oElement;
}
var Ed1_doc_complet = 1;
function InsertHTML(obj,testo)
{
obj.DocumentHTML = ''+testo+''
}
function FiltraHTML(obj)
{
pezzo = obj.DocumentHTML
return pezzo
while (pezzo.indexOf("&nbsp;")>-1)
{
pezzo = pezzo.replace("&nbsp;"," ")
}
while (pezzo.indexOf("\r")>-1)
{
pezzo = pezzo.replace("\r","")
}
while (pezzo.indexOf("\n")>-1)
{
pezzo = pezzo.replace("\n","")
}
while (pezzo.indexOf("\f")>-1)
{
pezzo = pezzo.replace("\f","")
}
testo=""
pezzo=pezzo.substring(30,pezzo.length-20)  // tolgo i tag che inserisce INSERT
while (pezzo.length>0)
{
p1 = pezzo.indexOf("<")
if (p1<0) break		//	se non ci sono altri tag esco
tmp=pezzo.substr(p1+1)	//	prossimo tag se esiste da pos+1
p2=tmp.indexOf("<")		//	questi indici sono inferiori di una unità
p3=tmp.indexOf(">")
if(p3<0) break	//	se il tag non è chiuso esco
if (p2 == -1) p2=p3+1	// se non ci sono altri tag oltre a questo
if (p3 < p2)
{	tag = pezzo.substring(p1,p3+p1+2)
cmd = tag.toUpperCase()
r = cmd.indexOf(" ")
if (r<0) cmd = cmd.substring(1,cmd.indexOf(">"))
else cmd = cmd.substring(1,cmd.indexOf(" "))
switch (cmd)
{
case "DIV":
tag=""
break;
case "/DIV":
tag="<BR>"
break;
case "P":
tag="<BR>"
break;
case "/P":
tag=""
break;
case "STRONG":
tag="<B>"
break;
case "/STRONG":
tag="</B>"
break;
case "EM":
tag="<I>"
break;
case "/EM":
tag="</I>"
break;
case "A":
anc = tag.toUpperCase()
if (anc.indexOf("TARGET")<0)
{
tag=tag.substring(0,tag.length-1)+">"
}
else
{
tag=tag.substring(0,tag.length-1)+" >"
}
if (anc.indexOf("CLASS")<0)
{
tag=tag.substring(0,tag.length-1)+" class='links'>"
}
break;
case "/A":
break;
case "BR":
break;
case "B":
break;
case "/B":
break;
case "I":
break;
case "/I":
break;
case "U":
break;
case "/U":
break;
case "LI":
break;
case "UL":
break;
case "/UL":
break;
case "TABLE":
break;
case "/TABLE":
break;
case "TR":
break;
case "/TR":
break;
case "TD":
break;
case "/TD":
break;
case "FONT":
break;
case "/FONT":
break;
case "SPAN":
break;
case "/SPAN":
break;
case "H1":
break;
case "/H1":
break;
case "H2":
break;
case "/H2":
break;
case "H3":
break;
case "/H3":
break;
default:
break;
}
testo = testo + pezzo.substring(0,p1) + tag
pezzo = pezzo.substr(p1+p3+2)
}
else {
testo = testo + pezzo.substr(0,p2+1)
pezzo = pezzo.substr(p2+1)
}
}
testo = testo+pezzo
return testo
}
function Guida()
{
var FX = 518
var FY = 600
var X =(Math.round(screen.width/2))-(Math.round(FX/2))
var Y =(Math.round(screen.height/2))-(Math.round(FY/2))
win=window.open("guida1.asp","guida","width="+ FX +",height=" + FY + ",status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=no,top="+Y+",left="+X);
win.focus()
}
function Normale_onclick(obj)
{
obj.ExecCommand (5034)
obj.focus()
}
function Refresh()
{
}
function colore(k)
{
}
function WordCleanF() {
if (confirm('Procedere con la pulizia parziale di tutto il documento? (NON SARA PIU\'POSSIBILE RIPRISTINARE O EFFETTUARE AZIONI DI UNDO)')==true) {
var text = obj_editor.DocumentHTML;
text=text.replace(/FONT-SIZE:[^>]*;/g,' ');
text=text.replace(/FONT-SIZE:[^>]*"/g,'"');
text=text.replace(/FONT-FAMILY:[^>]*;/g,' ');
text=text.replace(/FONT-FAMILY:[^>]*"/g,'"');
text=text.replace(/COLOR:[^>]*;/g,' ');
text=text.replace(/COLOR:[^>]*"/g,' ');
text=text.replace(/mso-fareast-font-family:[^>]*;/g,' ');
text=text.replace(/mso-fareast-font-family:[^>]*"/g,'"');
text=text.replace(/mso-ansi-language:[^>]*;/g,' ');
text=text.replace(/mso-ansi-language:[^>]*"/g,'"');
text=text.replace(/mso-fareast-language:[^>]*;/g,' ');
text=text.replace(/mso-fareast-language:[^>]*"/g,'"');
text=text.replace(/mso-bidi-language:[^>]*;/g,' ');
text=text.replace(/mso-bidi-language:[^>]*"/g,'"');
text=text.replace(/mso-bidi-font-family:[^>]*;/g,' ');
text=text.replace(/mso-bidi-font-family:[^>]*"/g,' ');
text=text.replace(/COLOR:[^>]*;/g,' ');
text=text.replace(/COLOR:[^>]*"/g,' ');
text=text.replace(/COLOR:[^>]*;/g,' ');
text=text.replace(/COLOR:[^>]*"/g,' ');
text=text.replace(/COLOR:[^>]*;/g,' ');
text=text.replace(/COLOR:[^>]*"/g,' ');
text=text.replace(/COLOR:[^>]*;/g,' ');
text=text.replace(/COLOR:[^>]*"/g,' ');
text=text.replace(/COLOR:[^>]*;/g,' ');
text=text.replace(/COLOR:[^>]*"/g,' ');
text=text.replace(/STYLE=" "/g,' ');
text=text.replace(/<FONT[^>]*>/gi,'<FONT>');
text=text.replace(/<P[^>]*>/gi,'<P>');
text=text.replace(/<LI[^>]*>/gi,'<LI>');
text=text.replace(/<OL[^>]*>/gi,'<OL>');
text=text.replace(/<SPAN[^>]*>/gi,'<SPAN>');
text=text.replace(/<FONT[^>]*>/gi,'');
text=text.replace(/<\/FONT>/gi,'');
text=text.replace(/<SPAN[^>]*>/gi,'');
text=text.replace(/<\/SPAN>/gi,'');
text=text.replace(/<O:P[^>]*>/gi,'');
text=text.replace(/<\/O:P>/gi,'');
obj_editor.DocumentHTML = text;
}
}

