////////////////////////////////////////////////////////////////////////////
// POPUP ///////////////////////////////////////////////////////////////////
var selectnowobj_sempre;
var framew;
var frameh;

var framew_now = "";
var frameh_now = "";

var framew_lvl2;
var frameh_lvl2;

var framew_now_lvl2 = "";
var frameh_now_lvl2 = "";

 
function invio(){
	document.getElementById("invio").click();
};

function autoResizeWord(id,id2){
    var newheight;
    var newwidth;

	if(document.getElementById){
      /*  document.getElementById(id).height= "0px";
		document.getElementById(id2).style.height = "0px";*/
		
		
		newheight=document.frames[id].document.body.scrollHeight;
        newwidth =document.getElementById(id2).scrollHeight;
		
		//alert("\nid: "+id+"\nid2: "+id2+"\nnewwheigth"+newheight+"\nnewwidth"+newwidth)
		
		document.getElementById(id).height= newheight+"px";
		document.getElementById(id2).style.height = newwidth+ "px";
    
	};
   
	//document.getElementById(id).width= (newwidth) + "px";
};



// RESTITUISCE LA DATA IN MILLESECONDI...
function getXHTML(data){
	return new Html2Xhtml(data).parse();
};

// LA RICOSTRUISCE COME DATA OPPURE VUOTA
function Html2Xhtml(data){
	this.data=data||'';
};

Html2Xhtml.prototype.setHTML=function(data){
	this.data=data||this.data;
};

// FUNZIONE CHE RICOSTRUISCE IL CODICE IN XHTML SOLO NEI TAG
Html2Xhtml.prototype.parse=function(){
	
	var state=0;
	var xhtml='';
	var p=0;
	var unget=false;
	var tagname='';
	var attrname='';
	var attrval='';
	var quot='';
	var data=this.data;
	var len=data.length;
	var phpval='';
	var tagtype=0;
	var insidepre=false;
	
	while(1){
		if(p>=len&&!unget){
			return xhtml;
		}
		if(unget){
			unget=false;
		}else{
			var c=data.substr(p++,1);
		}
		switch(state){
			
			// CASE 0 APERTURA TAG <
			case 0:if(c=='<'){
						state=1;
						break;
					};
					var cc=c.charCodeAt();
					if(Html2Xhtml.charEntities[cc]){
								xhtml+='&'+Html2Xhtml.charEntities[cc]+';'
					}else{
								xhtml+=c;
					};
					break;
			
			// CASE 1 CARATTERI ALFABETICI W IL TIPO DI APERTURA DEL TAG
			case 1:if(/[a-zA-Z]/.test(c)){
						state=2;
						tagtype=1;
						tagname=c.toLowerCase();
						break;
					};
					if(c=='/'){
						state=2;
						tagtype=-1;
						break;
					};
					if(c=='!'){
						if(data.substr(p,2)=='--'){
							xhtml+='<!--';
							p+=2;
							state=9;
							break;
						};
						xhtml+='<!';
						state=10;
						break;
					};
					if(c=='?'){
						state=11;
						xhtml+='<'+'?';
						break;
					};
					xhtml+='&lt;';
					unget=true;
					state=0;
					break;
			
			// CASE2 CONTROLLA IL TIPO DI TAG SELEZZIONATO E LO RIINSERISCE CORRETTO
			case 2:if(Html2Xhtml.isSpaceChar[c]){
						xhtml+=(!insidepre&&tagtype>0&&Html2Xhtml.hasNLBefore[tagname]&&xhtml.length&&xhtml.substr(xhtml.length-1,1)!='\n'?'\n':'')+(tagtype>0?'<':'</')+tagname;
						state=3;
						break;
					};
					if(c=='/'){
						xhtml+=(!insidepre&&tagtype>0&&Html2Xhtml.hasNLBefore[tagname]&&xhtml.length&&xhtml.substr(xhtml.length-1,1)!='\n'?'\n':'')+(tagtype>0?'<':'</')+tagname;
						if(data.substr(p,1)!='>'){
							state=3;
							break;
						}
						state=4;
						break;
					};
					if(c=='>'){
						xhtml+=(!insidepre&&tagtype>0&&Html2Xhtml.hasNLBefore[tagname]&&xhtml.length&&xhtml.substr(xhtml.length-1,1)!='\n'?'\n':'')+(tagtype>0?'<':'</')+tagname;
						unget=true;
						state=4;
						break;
					};
					tagname+=c.toLowerCase();
					break;
			
			// CASE 3 CONTROLLA LA CHIUSURA DEL TAG SE AD ESEMPIO UN <IMG/>
			case 3:if(Html2Xhtml.isSpaceChar[c]){
						break;
					};
					if(c=='/'){
						if(data.substr(p,1)!='>'){
							break
						}
						state=4;
						break;
					};
					if(c=='>'){
						unget=true;
						state=4;
						break;
					};
					attrname=c.toLowerCase();
					attrval='';
					state=5;
					break;
			
			// CASE4 CONTROLLA IL TAG NAME
			case 4:xhtml+=(Html2Xhtml.isEmptyTag[tagname]?' />':'>')+(!insidepre&&tagtype<0&&Html2Xhtml.hasNLAfter[tagname]&&p<len&&data.substr(p,1)!='\n'?'\n':'');
					if(tagtype>0&&Html2Xhtml.dontAnalyzeContent[tagname]){
						state=13;
						attrname=attrval=quot='';
						tagtype=0;
						break;
					};
					if(tagname=='pre'){
						insidepre=!insidepre
					};
					state=0;
					tagname=attrname=attrval=quot='';
					tagtype=0;
					break;
			
			// CASE5 CONTROLLA L'ATRIBUTO DEL TAG
			case 5:if(Html2Xhtml.isSpaceChar[c]){
						xhtml+=' '+attrname;
						if(Html2Xhtml.isEmptyAttr[attrname]){
							xhtml+='="'+attrname+'"';
						};
						state=3;
						break;
					};
					if(c=='/'){
						xhtml+=' '+attrname;
						if(Html2Xhtml.isEmptyAttr[attrname]){
							xhtml+='="'+attrname+'"';
						};
						if(data.substr(p,1)!='>'){
							state=3;
							break;
						};
						state=4;
						break;
					};
					if(c=='>'){
						xhtml+=' '+attrname;
						if(Html2Xhtml.isEmptyAttr[attrname]){
							xhtml+='="'+attrname+'"';
						};
						unget=true;
						state=4;
						break;
					};
					if(c=='='){
						xhtml+=' '+attrname+'=';
						state=6;
						break;
					};
					if(c=='"'||c=="'"){
						attrname+='?';
					}else{
						attrname+=c.toLowerCase();
					};
					break;
			
			// CASE6
			case 6:if(Html2Xhtml.isSpaceChar[c]){
						xhtml+=(Html2Xhtml.isEmptyAttr[attrname]?'"'+attrname+'"':'""');
						state=3;break;
					};
					if(c=='>'){
						xhtml+=(Html2Xhtml.isEmptyAttr[attrname]?'"'+attrname+'"':'""');
						unget=true;
						state=4;
						break;
					};
					if(c=='/'&&data.substr(p,1)=='>'){
						xhtml+=(Html2Xhtml.isEmptyAttr[attrname]?'"'+attrname+'"':'""');
						state=4;
						break;
					}if(c=='"'||c=="'"){
						quot=c;
						state=8;
						break;
					};
					attrval=c;
					state=7;
					break;
			
			// CASE7
			case 7:if(Html2Xhtml.isSpaceChar[c]){
						xhtml+='"'+Html2Xhtml.escapeQuot(attrval,'"')+'"';
						state=3;
						break;
					};
					if(c=='/'&&data.substr(p,1)=='>'){
						xhtml+='"'+Html2Xhtml.escapeQuot(attrval,'"')+'"';
						state=4;
						break;
					};
					if(c=='>'){
						unget=true;
						xhtml+='"'+Html2Xhtml.escapeQuot(attrval,'"')+'"';
						state=4;
						break;
					};
					attrval+=c;
					break;
			
			// CASE8
			case 8:if(c==quot){
						xhtml+='"'+Html2Xhtml.escapeQuot(attrval,'"')+'"';state=3;
						break;
					};
					attrval+=c;
					break;
			
			// CASE9
			case 9:if(c=='-'&&data.substr(p,2)=='->'){
						p+=2;xhtml+='-->';
						state=0;
						break
					};
					xhtml+=c;
					break;
			
			// CASE10
			case 10:if(c=='>'){s
						tate=0;
					};
					xhtml+=c;
					break;
			
			// CASE11
			case 11:if(c=="'"||c=='"'){
						quot=c;
						state=12;
						break;
					};
					if(c=='?'&&data.substr(p,1)=='>'){
						state=0;
						xhtml+='?'+'>';
						p++;
						break;
					};
					xhtml+=c;
					break;
			
			// CASE12
			case 12:if(c==quot){
						state=11;
						xhtml+=quot+Html2Xhtml.escapeQuot(phpval,quot)+quot;
						phpval=quot='';
						break;
					};
					phpval+=c;
					break;
			
			// CASE13
			case 13:if(c=='<'&&data.substr(p,tagname.length+1).toLowerCase()=='/'+tagname){
						unget=true;
						state=0;
						tagname='';
						break;
					};
					if(tagname=='textarea'){
						xhtml+=Html2Xhtml.escapeHTMLChar(c);
					}else{
						xhtml+=c;
					};
					break;
				};
		};
		return xhtml;
};

//FUNZIONE PER LA CONVERSIONE DEGLI &QUOT DELLE DOPPIE VIRGOLETTE E DELLE VIRGOLETTE SINGOLE 
Html2Xhtml.escapeQuot=function(str,quot){
	if(!quot){
		quot='"';
	}
	if(quot=='"'){
		return str.replace(/"/ig,'\\"');
	}
	return ;
	str.replace(/'/ig,"\\'");
};


//FUNZIONE PER LA CONVERSINE DELL' & DEL < DEL > 
Html2Xhtml.escapeHTMLChar=function(c){
	if(c=='&'){
		return'&amp;';
	};
	if(c=='<'){
		return'&lt;';
	}if(c=='>'){
		return'&gt;';
	}
	var cc=c.charCodeAt();

	if(Html2Xhtml.charEntities[cc]){
		return'&'+Html2Xhtml.charEntities[cc]+';';
	}else{
		return c;
	}
};


//CONVERSIONE IN UNICODE
Html2Xhtml.isSpaceChar={' ':1,'\r':1,'\n':1,'\t':1};

//IL TAG VUOTO 
Html2Xhtml.isEmptyTag={'area':1,'base':1,'basefont':1,'br':1,'hr':1,'img':1,'input':1,'link':1,'meta':1,'param':1};
//Html2Xhtml.isEmptyTag={'area':1,'base':1,'basefont':1,'br':1,'hr':1,'img':1,'input':1,'link':1,'meta':1,'param':1};

Html2Xhtml.isEmptyAttr={'checked':1,'compact':1,'declare':1,'defer':1,'disabled':1,'ismap':1,'multiple':1,'noresize':1,'nosave':1,'noshade':1,'nowrap':1,'readonly':1,'selected':1};

Html2Xhtml.hasNLBefore={'div':1,'p':1,'table':1,'tbody':1,'tr':1,'td':1,'th':1,'title':1,'head':1,'body':1,'script':1,'comment':1,'li':1,'meta':1,'h1':1,'h2':1,'h3':1,'h4':1,'h5':1,'h6':1,'hr':1,'ul':1,'ol':1,'option':1,'link':1};

Html2Xhtml.hasNLAfter={'html':1,'head':1,'body':1,'p':1,'th':1,'style':1};

Html2Xhtml.dontAnalyzeContent={'textarea':1,'script':1,'style':1};

Html2Xhtml.charEntities={160:'nbsp',161:'iexcl',162:'cent',163:'pound',164:'curren',165:'yen',166:'brvbar',167:'sect',168:'uml',169:'copy',170:'ordf',171:'laquo',172:'not',173:'shy',174:'reg',175:'macr',176:'deg',177:'plusmn',178:'sup2',179:'sup3',180:'acute',181:'micro',182:'para',183:'middot',184:'cedil',185:'sup1',186:'ordm',187:'raquo',188:'frac14',189:'frac12',190:'frac34',191:'iquest',192:'agrave',193:'aacute',194:'acirc',195:'atilde',196:'auml',197:'aring',198:'aelig',199:'ccedil',200:'egrave',201:'eacute',202:'ecirc',203:'euml',204:'igrave',205:'iacute',206:'icirc',207:'iuml',208:'eth',209:'ntilde',210:'ograve',211:'oacute',212:'ocirc',213:'otilde',214:'ouml',215:'times',216:'oslash',217:'ugrave',218:'uacute',219:'ucirc',220:'uuml',221:'yacute',222:'thorn',223:'szlig',224:'agrave',225:'aacute',226:'acirc',227:'atilde',228:'auml',229:'aring',230:'aelig',231:'ccedil',232:'egrave',233:'eacute',234:'ecirc',235:'euml',236:'igrave',237:'iacute',238:'icirc',239:'iuml',240:'eth',241:'ntilde',242:'ograve',243:'oacute',244:'ocirc',245:'otilde',246:'ouml',247:'divide',248:'oslash',249:'ugrave',250:'uacute',251:'ucirc',252:'uuml',253:'yacute',254:'thorn',255:'yuml',338:'oelig',339:'oelig',352:'scaron',353:'scaron',376:'yuml',710:'circ',732:'tilde',8194:'ensp',8195:'emsp',8201:'thinsp',8204:'zwnj',8205:'zwj',8206:'lrm',8207:'rlm',8211:'ndash',8212:'mdash',8216:'lsquo',8217:'rsquo',8218:'sbquo',8220:'ldquo',8221:'rdquo',8222:'bdquo',8224:'dagger',8225:'dagger',8240:'permil',8249:'lsaquo',8250:'rsaquo',8364:'euro',402:'fnof',913:'alpha',914:'beta',915:'gamma',916:'delta',917:'epsilon',918:'zeta',919:'eta',920:'theta',921:'iota',922:'kappa',923:'lambda',924:'mu',925:'nu',926:'xi',927:'omicron',928:'pi',929:'rho',931:'sigma',932:'tau',933:'upsilon',934:'phi',935:'chi',936:'psi',937:'omega',945:'alpha',946:'beta',947:'gamma',948:'delta',949:'epsilon',950:'zeta',951:'eta',952:'theta',953:'iota',954:'kappa',955:'lambda',956:'mu',957:'nu',958:'xi',959:'omicron',960:'pi',961:'rho',962:'sigmaf',963:'sigma',964:'tau',965:'upsilon',966:'phi',967:'chi',968:'psi',969:'omega',977:'thetasym',978:'upsih',982:'piv',8226:'bull',8230:'hellip',8242:'prime',8243:'prime',8254:'oline',8260:'frasl',8472:'weierp',8465:'image',8476:'real',8482:'trade',8501:'alefsym',8592:'larr',8593:'uarr',8594:'rarr',8595:'darr',8596:'harr',8629:'crarr',8656:'larr',8657:'uarr',8658:'rarr',8659:'darr',8660:'harr',8704:'forall',8706:'part',8707:'exist',8709:'empty',8711:'nabla',8712:'isin',8713:'notin',8715:'ni',8719:'prod',8721:'sum',8722:'minus',8727:'lowast',8730:'radic',8733:'prop',8734:'infin',8736:'ang',8743:'and',8744:'or',8745:'cap',8746:'cup',8747:'int',8756:'there4',8764:'sim',8773:'cong',8776:'asymp',8800:'ne',8801:'equiv',8804:'le',8805:'ge',8834:'sub',8835:'sup',8836:'nsub',8838:'sube',8839:'supe',8853:'oplus',8855:'otimes',8869:'perp',8901:'sdot',8968:'lceil',8969:'rceil',8970:'lfloor',8971:'rfloor',9001:'lang',9002:'rang',9426:'copy',9674:'loz',9824:'spades',9827:'clubs',9829:'hearts',9830:'diams'};

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


//SOSTITUISCE I VALORI CON NIENTE

function trim(str) {
	if (typeof str != "string") return str;
	str = str.replace(/^\s+|\s+$/g, "");
	return str;
}

// Formattazione per lo spazio dall'alto
function SVisGetOffsetTop(elm) {
	var mOffsetTop = elm.offsetTop;
	var mOffsetParent = elm.offsetParent;
	while(mOffsetParent) {
		mOffsetTop += mOffsetParent.offsetTop;
		mOffsetParent = mOffsetParent.offsetParent;
	};
	return mOffsetTop;
};

// Formattazione per lo spazio da sinistra
function SVisGetOffsetLeft(elm) {
	var mOffsetLeft = elm.offsetLeft;
	var mOffsetParent = elm.offsetParent;
	while(mOffsetParent) {
		mOffsetLeft += mOffsetParent.offsetLeft;
		mOffsetParent = mOffsetParent.offsetParent;
	};
	return mOffsetLeft;
};

// FUNZIONE CHE CHIUDE LA TENDINA E RIPORTA I COLORI DEI BOTTONI
function SVisHideMenus() {
	SVisMouseOutFormatMenu();
	document.getElementById("format3").style.display = "none";
	SVisMouseOutFontFaceMenu();
	document.getElementById("fontface3").style.display = "none";
	SVisMouseOutFontSizeMenu();
	document.getElementById("fontsize3").style.display = "none";
	SVisMouseOutFontColorMenu();
	document.getElementById("fontcolor3").style.display = "none";
};

// CAMBIA IL COLORE DELLE SELEZIONI NEI MENU A TENDI
function SVisColorClick(hexcolor) {
	SVisHideMenus();
	document.getElementById(SVisName).contentWindow.document.execCommand("forecolor", false, hexcolor);
	document.getElementById("fontcolor4").style.backgroundColor = hexcolor;
};

// CAMBIA LA CLASSE DELL'OGGETTO CLICCATO
function SVisMouseOverMenuFontColorContents() {
	this.className = "SVisdropdown14";
};

// CAMBIA LA CLASSE DELL'OGGETTO CLICCATO
function SVisMouseOutMenuFontColorContents() { 
	this.className = "SVisdropdown13";
}; 

// CAMBIA IL COLORE E LA CLASSE DELL'OGGETTO CLICCATO
function SVisMouseOverMenuContents() {
	//this.style.color = "#FFFFFF";
	this.style.backgroundColor = "#BCEBEA";
	document.getElementById(SVisName).contentWindow.focus();
};

// CAMBIA IL COLORE DELL'OGGETTO CLICCATO
function SVisMouseOutMenuContents() { 
	//this.style.color = "#000000";
	this.style.backgroundColor = "#FFFFFF";
};

// FUNZIONE PER LINSERIMENTO DELL'EDITOR...
function SVisMouseDownMenuContents() {
	
	if (this.innerHTML == "Titolo") {
		document.getElementById(SVisName).contentWindow.document.execCommand("formatblock", true, "<h1>");
		document.getElementById("format1").innerHTML = "Titolo";
	}else if (this.innerHTML == "Testo") {
		document.getElementById(SVisName).contentWindow.document.execCommand("formatblock", false, "<h2>");
		document.getElementById("format1").innerHTML = "Testo";
	} else if (this.innerHTML == "Header 3") {
		document.getElementById(SVisName).contentWindow.document.execCommand("formatblock", false, "<h3>");
		document.getElementById("format1").innerHTML = "Header 3";
	} else if (this.innerHTML == "Header 4") {
		document.getElementById(SVisName).contentWindow.document.execCommand("formatblock", false, "<h4>");
		document.getElementById("format1").innerHTML = "Header 4";
	} else if (this.innerHTML == "Header 5") {
		document.getElementById(SVisName).contentWindow.document.execCommand("formatblock", false, "<h5>");
		document.getElementById("format1").innerHTML = "Header 5";
	} else if (this.innerHTML == "Header 6") {
		document.getElementById(SVisName).contentWindow.document.execCommand("formatblock", false, "<h6>");
		document.getElementById("format1").innerHTML = "Header 6";
	} else if (this.innerHTML == "Sottotesto") {
		document.getElementById(SVisName).contentWindow.document.execCommand("formatblock", false, "<p>");
		document.getElementById("format1").innerHTML = "Sottotesto";
	} else if (this.innerHTML == "Arial") {
		document.getElementById(SVisName).contentWindow.document.execCommand("fontname", false, "arial");
		document.getElementById("fontface1").innerHTML = "Arial";
	} else if (this.innerHTML == "Arial Black") {
		document.getElementById(SVisName).contentWindow.document.execCommand("fontname", false, "arial black");
		document.getElementById("fontface1").innerHTML = "Arial Black";
	} else if (this.innerHTML == "Arial Narrow") {
		document.getElementById(SVisName).contentWindow.document.execCommand("fontname", false, "arial narrow");
		document.getElementById("fontface1").innerHTML = "Arial Narrow";
	} else if (this.innerHTML == "Courier New") {
		document.getElementById(SVisName).contentWindow.document.execCommand("fontname", false, "courier new");
		document.getElementById("fontface1").innerHTML = "Courier New";
	} else if (this.innerHTML == "Century Gothic") {
		document.getElementById(SVisName).contentWindow.document.execCommand("fontname", false, "century gothic");
		document.getElementById("fontface1").innerHTML = "Century Gothic";
	} else if (this.innerHTML == "Comic Sans MS") {
		document.getElementById(SVisName).contentWindow.document.execCommand("fontname", false, "comic sans ms");
		document.getElementById("fontface1").innerHTML = "Comic Sans MS";
	} else if (this.innerHTML == "Impact") {
		document.getElementById(SVisName).contentWindow.document.execCommand("fontname", false, "impact");
		document.getElementById("fontface1").innerHTML = "Impact";
	} else if (this.innerHTML == "Tahoma") {
		document.getElementById(SVisName).contentWindow.document.execCommand("fontname", false, "tahoma");
		document.getElementById("fontface1").innerHTML = "Tahoma";
	} else if (this.innerHTML == "Times New Roman") {
		document.getElementById(SVisName).contentWindow.document.execCommand("fontname", false, "times new roman");
		document.getElementById("fontface1").innerHTML = "Times New Roman";
	} else if (this.innerHTML == "Trebuchet MS") {
		document.getElementById(SVisName).contentWindow.document.execCommand("fontname", false, "trebuchet ms");
		document.getElementById("fontface1").innerHTML = "Trebuchet MS";
	} else if (this.innerHTML == "Verdana") {
		document.getElementById(SVisName).contentWindow.document.execCommand("fontname", false, "verdana");
		document.getElementById("fontface1").innerHTML = "Verdana";
	} else if (this.innerHTML == "1") {
		document.getElementById(SVisName).contentWindow.document.execCommand("fontsize", false, "1");
		document.getElementById("fontsize1").innerHTML = "1";
	} else if (this.innerHTML == "2") {
		document.getElementById(SVisName).contentWindow.document.execCommand("fontsize", false, "2");
		document.getElementById("fontsize1").innerHTML = "2";
	} else if (this.innerHTML == "3") {
		document.getElementById(SVisName).contentWindow.document.execCommand("fontsize", false, "3");
		document.getElementById("fontsize1").innerHTML = "3";
	} else if (this.innerHTML == "4") {
		document.getElementById(SVisName).contentWindow.document.execCommand("fontsize", false, "4");
		document.getElementById("fontsize1").innerHTML = "4";
	} else if (this.innerHTML == "5") {
		document.getElementById(SVisName).contentWindow.document.execCommand("fontsize", false, "5");
		document.getElementById("fontsize1").innerHTML = "5";
	} else if (this.innerHTML == "6") {
		document.getElementById(SVisName).contentWindow.document.execCommand("fontsize", false, "6");
		document.getElementById("fontsize1").innerHTML = "6";
	} else if (this.innerHTML == "7") {
		document.getElementById(SVisName).contentWindow.document.execCommand("fontsize", false, "7");
		document.getElementById("fontsize1").innerHTML = "7";
	};
	
	//this.style.color = "#000000";
	this.style.backgroundColor = "#FFFFFF";
	SVisHideMenus();
	resize_word();
};

// CAMBIA LA CLASSEDELL'OGGETTO SELEZZIONATO
function SVisMouseOverFormatMenu() {
	document.getElementById("format1").className = "SVisdropdown4";
	document.getElementById("format2").className = "SVisdropdown5";
};

// 
function SVisMouseDownFormatMenu() {
	SVisHideMenus();
	document.getElementById("format1").className = "SVisdropdown4";
	document.getElementById("format2").className = "SVisdropdown6";
	document.getElementById("format1").style.left = SVisGetOffsetLeft(document.getElementById("format1"));
	document.getElementById("format1").style.top = SVisGetOffsetTop(document.getElementById("format1")) + document.getElementById("format1").offsetHeight;
	document.getElementById("format3").style.display = (document.getElementById("format3").style.display == "none" ) ? "" : "none";
	var kids = document.getElementsByTagName('DIV');
	for (var i=0; i < kids.length; i++) {
		if (kids[i].id == "format1" || kids[i].id == "format2") {
			kids[i].onmouseout = SVisMouseDownFormatMenu;
		} else if (kids[i].id == "fontface1" || kids[i].id == "fontface2") {
			kids[i].onmouseout = SVisMouseOutFontFaceMenu;
		} else if (kids[i].id == "fontsize1" || kids[i].id == "fontsize2") {
			kids[i].onmouseout = SVisMouseOutFontSizeMenu;
		} else if (kids[i].id == "fontcolor1" || kids[i].id == "fontcolor2") {
			kids[i].onmouseout = SVisMouseOutFontColorMenu;
		};
	};
};

function SVisMouseOutFormatMenu() {
	document.getElementById("format1").className = "SVisdropdown1";
	document.getElementById("format2").className = "SVisdropdown2";
};

function SVisMouseOverFontFaceMenu() {
	document.getElementById("fontface1").className = "SVisdropdown4";
	document.getElementById("fontface2").className = "SVisdropdown5";
};

function SVisMouseDownFontFaceMenu() {
	SVisHideMenus();
	document.getElementById("fontface1").className = "SVisdropdown4";
	document.getElementById("fontface2").className = "SVisdropdown6";
	document.getElementById("fontface1").style.left = SVisGetOffsetLeft(document.getElementById("fontface1"));
	document.getElementById("fontface1").style.top = SVisGetOffsetTop(document.getElementById("fontface1")) + document.getElementById("fontface1").offsetHeight;
	document.getElementById("fontface3").style.display = (document.getElementById("fontface3").style.display == "none" ) ? "" : "none";
	var kids = document.getElementsByTagName('DIV');
	for (var i=0; i < kids.length; i++) {
		if (kids[i].id == "format1" || kids[i].id == "format2") {
			kids[i].onmouseout = SVisMouseOutFormatMenu;
		} else if (kids[i].id == "fontface1" || kids[i].id == "fontface2") {
			kids[i].onmouseout = SVisMouseDownFontFaceMenu;
		} else if (kids[i].id == "fontsize1" || kids[i].id == "fontsize2") {
			kids[i].onmouseout = SVisMouseOutFontSizeMenu;
		} else if (kids[i].id == "fontcolor1" || kids[i].id == "fontcolor2") {
			kids[i].onmouseout = SVisMouseOutFontColorMenu;
		};
	};
};

function SVisMouseOutFontFaceMenu() {
	document.getElementById("fontface1").className = "SVisdropdown1";
	document.getElementById("fontface2").className = "SVisdropdown2";
};

function SVisMouseOverFontSizeMenu() {
	document.getElementById("fontsize1").className = "SVisdropdown4";
	document.getElementById("fontsize2").className = "SVisdropdown5";
};

function SVisMouseDownFontSizeMenu() {
	SVisHideMenus();
	document.getElementById("fontsize1").className = "SVisdropdown4";
	document.getElementById("fontsize2").className = "SVisdropdown6";
	document.getElementById("fontsize1").style.left = SVisGetOffsetLeft(document.getElementById("fontsize1"));
	document.getElementById("fontsize1").style.top = SVisGetOffsetTop(document.getElementById("fontsize1")) + document.getElementById("fontsize1").offsetHeight;
	document.getElementById("fontsize3").style.display = (document.getElementById("fontsize3").style.display == "none" ) ? "" : "none";
	var kids = document.getElementsByTagName('DIV');
	for (var i=0; i < kids.length; i++) {
		if (kids[i].id == "format1" || kids[i].id == "format2") {
			kids[i].onmouseout = SVisMouseOutFormatMenu;
		} else if (kids[i].id == "fontface1" || kids[i].id == "fontface2") {
			kids[i].onmouseout = SVisMouseOutFontFaceMenu;
		} else if (kids[i].id == "fontsize1" || kids[i].id == "fontsize2") {
			kids[i].onmouseout = SVisMouseDownFontSizeMenu;
		} else if (kids[i].id == "fontcolor1" || kids[i].id == "fontcolor2") {
			kids[i].onmouseout = SVisMouseOutFontColorMenu;
		};
	};
};

function SVisMouseOutFontSizeMenu() {
	document.getElementById("fontsize1").className = "SVisdropdown1";
	document.getElementById("fontsize2").className = "SVisdropdown2";
};

function SVisMouseOverFontColorMenu() {
	document.getElementById("fontcolor1").className = "SVisdropdown8";
	document.getElementById("fontcolor2").className = "SVisdropdown5b";
};

function SVisMouseDownFontColorMenu() {
	SVisHideMenus();
	document.getElementById("fontcolor1").className = "SVisdropdown12";
	document.getElementById("fontcolor2").className = "SVisdropdown9b";
	document.getElementById("fontcolor1").style.left = SVisGetOffsetLeft(document.getElementById("fontcolor1"));
	document.getElementById("fontcolor1").style.top = SVisGetOffsetTop(document.getElementById("fontcolor1")) + document.getElementById("fontcolor1").offsetHeight;
	document.getElementById("fontcolor3").style.display = (document.getElementById("fontcolor3").style.display == "none" ) ? "" : "none";
	var kids = document.getElementsByTagName('DIV');
	for (var i=0; i < kids.length; i++) {
		if (kids[i].id == "format1" || kids[i].id == "format2") {
			kids[i].onmouseout = SVisMouseOutFormatMenu;
		} else if (kids[i].id == "fontface1" || kids[i].id == "fontface2") {
			kids[i].onmouseout = SVisMouseOutFontFaceMenu;
		} else if (kids[i].id == "fontsize1" || kids[i].id == "fontsize2") {
			kids[i].onmouseout = SVisMouseOutFontSizeMenu;
		} else if (kids[i].id == "fontcolor1" || kids[i].id == "fontcolor2") {
			kids[i].onmouseout = SVisMouseDownFontColorMenu;
		};
	};
};

function SVisMouseOutFontColorMenu() {
	document.getElementById("fontcolor1").className = "SVisdropdown10";
	document.getElementById("fontcolor2").className = "SVisdropdown11b";
};

function SVisBtnMouseUpBottom() {
	this.className = "SVisbtn9";
};

function SVisBtnMouseOutBottom() {
	this.className = "SVisbtn6";
};

function SVisBtnMouseOutDownBottom() {
	this.className = "SVisbtn9";
};

function SVisBtnMouseOverBottom() {
	this.className = "SVisbtn7";
};

function SVisModeType(id,sett_config,classe) {
	if (id == "SVis_design_mode") {
		SVisFormHandler2();
		document.getElementById(SVisName).contentWindow.document.body.innerHTML = getXHTML(trim_SV(document.getElementById(SVisFormName).value));
		document.getElementById("tb1").style.display = "";
		document.getElementById("tb2").style.display = "";
		document.getElementById("tb3").style.display = "";
		document.getElementById(SVisFormName).style.display = "none";
		document.getElementById(SVisName).style.display = "";
		document.getElementById("preview_" + SVisName).style.display = "none";
		document.getElementById(SVisName).contentWindow.focus();
		//autoResizeWord(SVisName,SVisFormName);
		resize_word();
		return false;
	} else if (id == "SVis_code_mode") {
		SVisFormHandler();
		document.getElementById(SVisFormName).value = getXHTML(trim_SV(document.getElementById(SVisName).contentWindow.document.body.innerHTML));
		document.getElementById("tb1").style.display = "none";
		document.getElementById("tb2").style.display = "none";
		document.getElementById("tb3").style.display = "none";
		document.getElementById(SVisFormName).style.display = "";
		document.getElementById(SVisName).style.display = "none";
		document.getElementById("preview_" + SVisName).style.display = "none";
		//autoResizeWord(SVisName,SVisFormName);
		resize_word();
	} else if (id == "SVis_preview_mode") {
		
		SVisFormHandler();
		html = getXHTML(trim_SV(document.getElementById(SVisFormName).value));
		document.getElementById('preview_' + SVisName).innerHTML=html
		document.getElementById("tb1").style.display = "none";
		document.getElementById("tb2").style.display = "none";
		document.getElementById("tb3").style.display = "none";
		document.getElementById(SVisFormName).style.display = "none";
		document.getElementById(SVisName).style.display = "none";
		document.getElementById('preview_' + SVisName).style.display = "";
		//autoResizeWord(SVisName,SVisFormName);
		resize_word();
		return false;
	}else if (id == "SVis_Chiudi"){
		
		WordClose(set_open_close,false,sett_config,classe);
	}else if (id == "SVis_Salva"){
		
		WordSave(set_open_close,true,sett_config,classe);
	};
	
};


function SVisBtnMouseDownBottom() {
	var kids = document.getElementsByTagName("DIV");
	for (var i=0; i < kids.length; i++) {
		if(kids[i].className == "SVisbtn6" || kids[i].className == "SVisbtn7" || kids[i].className == "SVisbtn8" || kids[i].className == "SVisbtn9"){
			kids[i].className = "SVisbtn6";
			kids[i].onmouseover = SVisBtnMouseOverBottom;
			kids[i].onmouseout = SVisBtnMouseOutBottom;
			kids[i].onmousedown = SVisBtnMouseDownBottom;
			kids[i].onmouseup = SVisBtnMouseUpBottom;
		};
	};
	this.className = "SVisbtn9";
	this.onmouseover = SVisBtnMouseOverBottom;
	this.onmouseout = SVisBtnMouseOutDownBottom;
	this.onmouseup = SVisBtnMouseUpBottom;
};

function SVisBtnMouseDown() {
	var kids = document.getElementsByTagName('DIV');
	for (var i=0; i < kids.length; i++) {
		if (kids[i].className == "SVisbtn2" || kids[i].className == "SVisbtn3" || kids[i].className == "SVisbtn4") {
			kids[i].className = "SVisbtn1";
		}
	}
	SVisSelection();
	this.className = "SVisbtn4";
};

function SVisBtnMouseUp() {
	this.className = "SVisbtn4";
};

function SVisBtnMouseOut() {
	this.className = "SVisbtn1";
};

function SVisBtnMouseOver() {
	this.className = "SVisbtn2";
};

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                            ////////////////////////////////////////////////////////////////////////////////////////////////////////
////  FUNZIONE DI ELABORAZIONE DATI ED INSERIMENTO IN HTML  //////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                            ////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function storeCaret() {
	
	document.getElementById(SVisName).contentWindow.focus();
	
	//var ta = document.getElementById(SVisName).contentWindow;
	//ta.caretPos = ta.document.selection.createRange().duplicate();
	
	//caretPos = CArsUP
	
	var ta = document.getElementById(SVisName).contentWindow;
				
	var doc = ta.document;
	var sel = null;
	
	if(ta.getSelection){
		//alert("OPERA - FIREFOX")
		sel = ta.getSelection();
	}
	else if (doc.getSelection) {
		//alert("BHO")
		sel = doc.getSelection();
	}
	else if (doc.selection) {
		//alert("EXPLORER")
		sel = doc.selection;
		
	}else{
		//alert("ALTRO")
	};
	
	
	
	var range
	if (sel.createRange()){
		
		range = sel.createRange();
		
		try{	
			ta.CArsUP = range.duplicate();			
		}catch(err){
			ta.CArsUP  = range.item(0) ;
		};
		
	}else{
		//alert("OPERA - FIREFOX")
		
		ta.range = sel.getRangeAt(0);
		
		ta.startPos = ta.range.startOffset;
		ta.endPos = ta.range.endOffset;
		
		ta.CApos = ta.range.startOffset;
		ta.CAcont = ta.range.startContainer;
		ta.CArsUP = ta.range.cloneRange();		
	};  	
};

function addText(before, after, overwrite, del) {
	var ta = document.getElementById(SVisName).contentWindow;
	var doc = ta.document;
	var text = '';
	
		if (ta.document.selection){
			
			if (overwrite){
				document.selection.createRange().text = '';
			};
			
			text = document.selection.createRange().text;
			
			//alert(before)
			
			if (text != '') {
				document.selection.createRange().text = before + text + after;
			}else{
				var CArsUP = ta.CArsUP;
				
				//alert("B");
				//alert(ta.CArsUP.text)
				
				if (!CArsUP){
					ta.focus();
					storeCaret();
					CArsUP = ta.CArsUP;
				};
				
				text = before + after;
				var ct = (overwrite)?'':CArsUP.text;
				CArsUP.pasteHTML((CArsUP.text.charAt(CArsUP.text.length-1)==' ') ? text + ct + ' ' : text + ct);
				CArsUP.move('character', -after.length);
				CArsUP.select();
				
			}
			ta.focus();
			
		}else if(ta.getSelection){
			
			
			command = "a";
			
			original = "questo è un testo";
			
			ta.range.deleteContents();
			
			ta.range.insertNode(document.createTextNode("<setu>"));
			
			 ta.document.body.innerHTML = ta.document.body.innerHTML.replace('&lt;setu&gt;',before + text + after);
			//ta.range.pasteHTML("dsds");
			
			
			
	}else{
		
		ta.value = before + after;
		ta.focus();
		
	};
	
	//autoResizeWord(SVisName,SVisFormName);
	resize_word()
};

function getSelText(){
	//alert("getSelText")
	
	var ta = document.getElementById(SVisName).contentWindow;
	if (document.selection){
		//alert("1")
		return ta.document.selection.createRange().text;
	}else if (ta.setSelectionRange){
		//alert("2")
		return ta.document.substring(ta.selectionStart, ta.selectionEnd);
	}else{ 
		//alert("3")
		if(ta.CArsUP){
			return ta.CArsUP;
		}else{
			return ta.CArsUP.parentNode;
			//alert(ta.CArsUP.parentNode)
		};
	};
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////



function SVisBtnPrint() {
	if (document.all) {
		var oFrame = window.frames[SVisName];
		oFrame.focus();
		oFrame.print();
	} else {
		var oFrame = document.getElementById(SVisName).contentWindow;
		oFrame.focus();
		oFrame.window.print();
	};
};


function SVisBtnInsertImage() {
	SVopenWin(SVisHTMLPathInsertImage,520,400,true,true);
};

function SVisBtnEditImg() { 
	SVopenWin(SVisHTMLNonSup,320,180,true,true);
	//SVopenWin(SVisHTMLPathEditImage,500,320,true,true);
};

//EDITAZIONE IMMAGINE NUOVO

function SVisBtnInsertImage2() {
	SVopenWin("include_app/visivamod/html/AAimage_insert.asp",540,400,false,true);
	//"include_app/visivamod/html/edit_image.asp";
	//SVopenWin(SVisHTMLPathInsertImage,520,400,true,true);
};

function SVisBtnEditImg2() { 
	/*
	alert("edit IMG")
	SVopenWin("include_app/visivamod/html/AAimage_edit.asp",520,400,true,true);
	*/
	//SVopenWin(SVisHTMLNonSup,320,180,true,true);
	//SVopenWin(SVisHTMLPathEditImage,500,320,true,true);
};

//EDITAZIONE PDF

function SVisBtnInsertPdf() {
	SVopenWin("include_app/visivamod/html/AApdf_insert.asp",520,400,true,true);
};

function SVisBtnEditPdf() { 
	//alert("edit PDF")
	//SVopenWin(SVisHTMLNonSup,320,180,true,true);
	//SVopenWin(SVisHTMLPathEditImage,500,320,true,true);
};

//EDITAZIONE TESTO

function SVisBtnInsertTxt2() {
	SVopenWin("include_app/visivamod/html/AAword_insert.asp",520,400,true,true);
};

function SVisBtnEditTxt2() { 
	//alert("edit PDF")
	//SVopenWin(SVisHTMLNonSup,320,180,true,true);
	//SVopenWin(SVisHTMLPathEditImage,500,320,true,true);
};

//EDITAZIONE YOU TUBE
function SVisBtnInsertTube(){
	SVopenWin("include_app/visivamod/html/AAtube_insert.asp",520,400,true,true);
}

function SVisBtnEditPdf() { 
	//alert("edit PDF")
	//SVopenWin(SVisHTMLNonSup,320,180,true,true);
	//SVopenWin(SVisHTMLPathEditImage,500,320,true,true);
};

function SVisBtnCreateLink() {
	//window.open(SVisHTMLPathInsertLink, "blank","scrollbars=yes,width=300,height=500");
	SVopenWin(SVisHTMLPathInsertLink,500,485,true,true);
};

function SVisBtnEditLink() { 
	//SVopenWin(SVisHTMLNonSup,320,180,true,true);
	SVopenWin(SVisHTMLPathEditLink,500,485,true,true);
};

function SVisBtnEditTable() {
	//SVopenWin(SVisHTMLNonSup,320,180,true,true);
	SVopenWin(SVisHTMLPathEditTable,320,250,false,true);
};

function SVisBtnInsertForm() {
	SVopenWin(SVisHTMLPathInsertForm,320,180,true,true);
};

function SVisBtnInsertCheckbox() {
	SVopenWin(SVisHTMLPathInsertCheckbox,320,205,true,true);
};

function SVisBtnInsertRadio() {
	SVopenWin(SVisHTMLPathInsertRadiobutton,320,205,true,true);
};

function SVisBtnInsertTextArea() {
	SVopenWin(SVisHTMLPathInsertTextArea ,320,268,true,true);
};

function SVisBtnInsertSubmit() {
	SVopenWin(SVisHTMLPathInsertSubmit ,320,165,true,true);
}; 

function SVisBtnInsertImageSubmit() {
	SVopenWin(SVisHTMLPathInsertImageSubmit ,320,165,true,true);
};

function SVisBtnInsertReset() {
	SVopenWin(SVisHTMLPathInsertReset ,320,165,true,true);
};

function SVisBtnInsertHidden() {
	SVopenWin(SVisHTMLPathInsertHidden ,320,165,true,true);
}; 

function SVisBtnInsertPassword() {
	SVopenWin(SVisHTMLPathInsertPassword ,320,195,true,true);
};

function SVisBtnInsertText() {
	SVopenWin(SVisHTMLPathInsertText ,320,230,true,true);
};

function SVisAbout() {
	SVopenWin(SVisHTMLInfoStudio,320,180,true,true);
};

function SVisBtnInsertTable() {
	SVopenWin(SVisHTMLPathInsertTable,320,290,false,true);
};

function SVisSpellCheck() {
	SVopenWin(SVisHTMLNonSup,320,180,true,true);
};

function SVisBtnInsertTableRowBefore() {
	if (window.getSelection){
		var selected_obj = document.getElementById(SVisName).contentWindow.window.getSelection().focusNode;
	} else if (document.getSelection) {
		var selected_obj = document.getElementById(SVisName).contentWindow.document.getSelection().focusNode;
	} else if (document.selection) {
		var selected_obj = selectnowobj_sempre
		//var selected_obj = document.getElementById(SVisName).contentWindow.document.selection.createRange().parentElement();
	};
	current_tag = selected_obj;
	while(current_tag.tagName != "TABLE"){
		if (current_tag.tagName == "TR") {
			cellTotal = current_tag.cells.length;
			RowIndex = current_tag.rowIndex;
		}
		if (current_tag.parentNode.tagName == "TBODY") {
			var x=current_tag.parentNode.insertRow(RowIndex);
			for (i=0; i < cellTotal; i++) {
				var j=x.insertCell(i);
				j.innerHTML="&nbsp;";
			};
		};
		current_tag = current_tag.parentNode;
	};
};

function SVisBtnInsertTableRowAfter() {
	if (window.getSelection){
		var selected_obj = document.getElementById(SVisName).contentWindow.window.getSelection().focusNode;
	} else if (document.getSelection) {
		var selected_obj = document.getElementById(SVisName).contentWindow.document.getSelection().focusNode;
	} else if (document.selection) {
		var selected_obj = selectnowobj_sempre
//		var selected_obj = document.getElementById(SVisName).contentWindow.document.selection.createRange().parentElement();
	}; 
	current_tag = selected_obj;
	while(current_tag.tagName != "TABLE"){
		if (current_tag.tagName == "TR") {
			cellTotal = current_tag.cells.length;
			RowIndex = current_tag.rowIndex;
		};
		if (current_tag.parentNode.tagName == "TBODY") {
			var x=current_tag.parentNode.insertRow(RowIndex+1);
			for (i=0; i < cellTotal; i++) {
				var j=x.insertCell(i);
				j.innerHTML="&nbsp;";
			};
		};
		current_tag = current_tag.parentNode;
	};
};

function SVisBtnInsertTableColumnBefore() {
	if (window.getSelection){
		var selected_obj = document.getElementById(SVisName).contentWindow.window.getSelection().focusNode;
	} else if (document.getSelection) {
		var selected_obj = document.getElementById(SVisName).contentWindow.document.getSelection().focusNode;
	} else if (document.selection) {
		var selected_obj = selectnowobj_sempre
//		var selected_obj = document.getElementById(SVisName).contentWindow.document.selection.createRange().parentElement();
	};
	current_tag = selected_obj;
	while(current_tag.tagName != "TABLE"){
		if (current_tag.tagName == "TD") {
			cellIndex = current_tag.cellIndex;
		};
		if (current_tag.tagName == "TBODY") {
			RowTotal = current_tag.parentNode.rows.length;
			var x=current_tag.parentNode;
			for (i=0; i < RowTotal; i++){
				var j=x.rows[i].insertCell(cellIndex);
				j.innerHTML="&nbsp;";
			};
		};
		current_tag = current_tag.parentNode;
	};
};

function SVisBtnInsertTableColumnAfter() {
	if (window.getSelection){
		var selected_obj = document.getElementById(SVisName).contentWindow.window.getSelection().focusNode;
	} else if (document.getSelection) {
		var selected_obj = document.getElementById(SVisName).contentWindow.document.getSelection().focusNode;
	} else if (document.selection) {
		var selected_obj = selectnowobj_sempre
//		var selected_obj = document.getElementById(SVisName).contentWindow.document.selection.createRange().parentElement();
	}; 
	current_tag = selected_obj;
	while(current_tag.tagName != "TABLE"){
		if (current_tag.tagName == "TD") {
			cellIndex = current_tag.cellIndex;
		};
		if (current_tag.tagName == "TBODY") {
			RowTotal = current_tag.parentNode.rows.length;
			var x=current_tag.parentNode;
			for (i=0; i < RowTotal; i++) {
				var j=x.rows[i].insertCell(cellIndex+1);
				j.innerHTML="&nbsp;";
			};
		};
		current_tag = current_tag.parentNode;
	};
};

function SVisBtnDeleteTableColumn() { 
	if (window.getSelection){
		var selected_obj = document.getElementById(SVisName).contentWindow.window.getSelection().focusNode;
	} else if (document.getSelection) {
		var selected_obj = document.getElementById(SVisName).contentWindow.document.getSelection().focusNode;
	} else if (document.selection) {
		var selected_obj = selectnowobj_sempre
	//	var selected_obj = document.getElementById(SVisName).contentWindow.document.selection.createRange().parentElement();
	};
	current_tag = selected_obj;
	while(current_tag.tagName != "TABLE"){
		if (current_tag.tagName == "TD") {
			cellIndex = current_tag.cellIndex;
		};
		if (current_tag.tagName == "TBODY") {
			RowTotal = current_tag.parentNode.rows.length;
			var x=current_tag.parentNode;
			for(i=0; i < RowTotal; i++ ) {
				j=x.rows[i].deleteCell(cellIndex);
			};
		};
		current_tag = current_tag.parentNode;
	};
};

function SVisBtnDeleteTableRow() {
	if (window.getSelection) {
		var selected_obj = document.getElementById(SVisName).contentWindow.window.getSelection().focusNode;
	} else if (document.getSelection) { var selected_obj = document.getElementById(SVisName).contentWindow.document.getSelection().focusNode;
	} else if (document.selection) {
		var selected_obj = selectnowobj_sempre
//		var selected_obj = document.getElementById(SVisName).contentWindow.document.selection.createRange().parentElement();
	};
	current_tag = selected_obj;
	while(current_tag.tagName != "TABLE"){
		if (current_tag.tagName == "TR") {
			RowIndex = current_tag.rowIndex;
		};
		if (current_tag.tagName == "TBODY") {
			RowTotal = current_tag.parentNode.rows.length;
			var x=current_tag.parentNode;
			x.deleteRow(RowIndex);
		};
		current_tag = current_tag.parentNode;
	};
}; 


function controllEvent(e){
	
	if(!e) e=window.event;
	code = e.keyCode;
	ctrl = e.ctrlKey;
	//CTRL+V
	
	if (ctrl && code==86){
		
		//selectPasteClear
		//clearPast()
		SVopenWin(SVisHTMLPathSelectPasteClear,320,180,true,true);
		e.returnValue = false;	
	}
	
}

function clearPast(){
	storeCaret();
	document.getElementById("copyControl").contentWindow.document.body.innerHTML = ""
	document.getElementById("copyControl").contentWindow.document.body.focus();
	document.getElementById("copyControl").contentWindow.document.execCommand("paste", false, null);
	var passed = document.getElementById("copyControl").contentWindow.document.body.innerText;
	addText(passed, "",true, true)
	
}
function normalPast(){
	storeCaret();
	document.getElementById("copyControl").contentWindow.document.body.innerHTML = ""
	document.getElementById("copyControl").contentWindow.document.body.focus();
	document.getElementById("copyControl").contentWindow.document.execCommand("paste", false, null);
	var passed = document.getElementById("copyControl").contentWindow.document.body.innerHTML;
	addText(passed, "",true, true)
	
}

function SVisAction(ID) {
	//alert("SVisAction")
	SVisHideMenus();
	storeCaret();
	if (this.id != "editlink" && this.id != "insertflash"&& this.id != "edittable" && this.id != "createlink" && this.id != "insertimage" && this.id != "editimg" && this.id != "inserttable" && this.id != "insertrowbelow" && this.id != "insertrowabove" && this.id != "insertcolumnleft" && this.id != "insertcolumnright" && this.id != "deletecolumn" && this.id != "deleterow" && this.id != "insertform" && this.id != "form_checkbox" && this.id != "form_radio" && this.id != "form_dropdown" && this.id != "form_textarea" && this.id != "form_submit" && this.id != "form_image_submit" && this.id != "form_reset" && this.id != "form_hidden" && this.id != "form_password" && this.id != "form_textfield" && this.id != "spellcheck" && this.id != "printSVis" && this.id != "aboutSVis" && this.id != "insertpdf" && this.id != "insertTube" && this.id != "inserttxt") { 
		
		if(this.id != "paste"){
			document.getElementById(SVisName).contentWindow.document.execCommand(this.id, false, null);
			document.getElementById(this.id).className = "SVisbtn4";
			document.getElementById(this.id).onmouseout = SVisBtnMouseDown;
			document.getElementById(SVisName).contentWindow.focus();
		}else{
			//selectPasteClear
			//clearPast()
			SVopenWin(SVisHTMLPathSelectPasteClear,320,180,true,true);
		}
		
	}else{
		if (document.getElementById(SVisName).contentWindow.document.body.createTextRange) 
     	document.getElementById(SVisName).contentWindow.document.body.CArsUP = document.selection.createRange().duplicate();
	};
	resize_word()
	
};


function startSVis(SVisPreloadContent,id01,id1,id2,classe) {
	
	var kids = document.getElementsByTagName("FORM");
	for (var i=0; i < kids.length; i++) {
		kids[i].onsubmit = SVisFormHandler;
	};
	for (var x=0; x < SVisPreloadContent.length; x++) {
	SVisPreloadContent = SVisPreloadContent.replace("&#146;","'");
	};
	
	document.getElementById('copyControl').contentWindow.document.designMode = "on";
	document.getElementById('copyControl').contentWindow.document.open();
	document.getElementById('copyControl').contentWindow.document.write('<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body bgcolor="#00FFFF"></body ></html>');
	document.getElementById('copyControl').contentWindow.document.close();
	
	
	document.getElementById(SVisName).contentWindow.document.designMode = "on";
	document.getElementById(SVisFormName).value = SVisPreloadContent;	
	document.getElementById(SVisName).contentWindow.document.open();
	
	//
	
	document.getElementById(SVisName).contentWindow.document.write('<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><link href="'+SVcssStylePath+'" rel="stylesheet" type="text/css" /></head><body class="'+classe+'">'+SVisPreloadContent+'</body></html>');
	document.getElementById(SVisName).contentWindow.document.body.style.background = ""
	document.getElementById(SVisName).contentWindow.document.body.style.backgroundColor ="transparent"
	
	document.getElementById(SVisName).contentWindow.document.close();
	
	
 	if (document.all && !window.opera) {
	
		document.getElementById(SVisName).contentWindow.document.attachEvent("onkeydown", controllEvent);
		document.getElementById(SVisName).contentWindow.document.attachEvent("onclick", SVisSelection);
		document.getElementById(SVisName).contentWindow.document.attachEvent("onmouseup", SVisSelection);
		document.getElementById(SVisName).contentWindow.document.attachEvent("onmousedown", SVisSelection);
		
		document.getElementById(SVisName).contentWindow.document.attachEvent("onselect", SVisSelection);
		document.getElementById(SVisName).contentWindow.document.attachEvent("onkeyup", resize_word);
	} else { 
		document.getElementById(SVisName).contentWindow.document.execCommand("useCSS", false, null);
		//document.getElementById(SVisName).contentWindow.document.addEventListener("keypress", SVisSelection, true);
		document.getElementById(SVisName).contentWindow.document.addEventListener("click", SVisSelection, true);
		document.getElementById(SVisName).contentWindow.document.addEventListener("mouseup", SVisSelection, true);
	};
	
	SVisSelection();
	
	var kids = document.getElementsByTagName("DIV");
	for (var i=0; i < kids.length; i++) {
		if(kids[i].className == "SVisbtn6"){
			kids[i].onmouseover = SVisBtnMouseOverBottom;
			kids[i].onmouseout = SVisBtnMouseOutBottom;
			kids[i].onmousedown = SVisBtnMouseDownBottom;
			kids[i].onmouseup = SVisBtnMouseUpBottom;
		};
	};
	
};

function resize_word(){
	autoResizeWord(SVisName,SVisFormName);
}

function SVisFormHandler() {
	//alert("SVisFromHandler")
	if (document.getElementById(SVisFormName).style.display == "") {
		var newHTML = getXHTML(trim_SV(document.getElementById(SVisFormName).value));
	} else {
		var newHTML = getXHTML(trim_SV(document.getElementById(SVisName).contentWindow.document.body.innerHTML));
	};
	pattern = /<div[^>]*border: 1px dotted red[^>]*>.*<\/form><\/div>/gi;
	matchesArray = newHTML.match(pattern);
	
	if (matchesArray != null) {
		for (i=0; i<matchesArray.length; i++){
			//alert(matchesArray[i])
			pattern2 = /<div[^>]*border: 1px dotted red[^>]*>/gi;
			pattern3 = /<\/div>/gi; replacement = matchesArray[i];
			replacement = replacement.replace(pattern2, "");
			replacement = replacement.replace(pattern3, "");
			if (document.getElementById(SVisFormName).style.display == "") {
				newHTML = document.getElementById(SVisFormName).value.replace(matchesArray[i], replacement);
			} else {
				newHTML = document.getElementById(SVisName).contentWindow.document.body.innerHTML.replace(matchesArray[i], replacement);
			};
		};
	};
	pattern = /<table[^>]*class=\"SVis_tbl\"[^>]*>/gi;
	matchesArray = newHTML.match(pattern);
	if (matchesArray != null){
		for (i=0; i<matchesArray.length; i++){
			pattern2 = /class=\"SVis_tbl\"/gi;
			replacement = matchesArray[i];
			replacement = replacement.replace(pattern2, "");
			newHTML = newHTML.replace(matchesArray[i], replacement);
		};
	};
	document.getElementById(SVisFormName).value = newHTML;
	//alert(newHTML)
	document.getElementById(SVisName).contentWindow.document.body.innerHTML = newHTML;
};

function SVisFormHandler2() {
	if (document.getElementById(SVisFormName).style.display == "") {
		var newHTML = document.getElementById(SVisFormName).value;
	} else {
		var newHTML = document.getElementById(SVisName).contentWindow.document.body.innerHTML;
	};
	pattern = /<form[^>]*>[^<]*<\/form>/gi;
	matchesArray = newHTML.match(pattern);
	if (matchesArray != null) {
		for (i=0; i<matchesArray.length; i++){ 
			replacement = matchesArray[i];
			replacement = replacement.replace(matchesArray[i], "<div style=\"border: 1px dotted red;\">" + matchesArray[i] + "</div>");
				if (document.getElementById(SVisFormName).style.display == "") {
					newHTML = document.getElementById(SVisFormName).value.replace(matchesArray[i], replacement);
				} else {
					newHTML = document.getElementById(SVisName).contentWindow.document.body.innerHTML.replace(matchesArray[i], replacement
);
				};
		};
	};
	pattern = /<table[^>]*border=\"0\"[^>]*>/gi;
	matchesArray = newHTML.match(pattern);
	if (matchesArray != null) {
		for (i=0; i<matchesArray.length; i++){
			pattern2 = /border=\"0\"/gi;
			replacement = matchesArray[i];
			replacement = replacement.replace(pattern2, "border=\"0\" class=\"SVis_tbl\"");
			newHTML = newHTML.replace(matchesArray[i], replacement);
		}; 
	};
	if (document.getElementById(SVisFormName).style.display == "") {
		document.getElementById(SVisFormName).value = newHTML;
	} else { document.getElementById(SVisName).contentWindow.document.body.innerHTML = newHTML;
	};
};

function SVisSelection(e) {
	
	SVisHideMenus();
	
	if(!e){e = window.event;}
	if(e){
		if(e.button == 2){
		alert("Il tasto destro è stato bloccato per mantenere l'integrità del sito web")
		return false;
		}
	}
	
	if (document.getElementById("SVis_code_mode").className == "SVisbtn9"){
	
		document.getElementById("tb1").style.display = "none";
		document.getElementById("tb2").style.display = "none";
		document.getElementById("tb3").style.display = "none";
	} else {
	
		//salvataggio della selezione
		storeCaret();
	
		document.getElementById("format1").innerHTML = "Sottotesto";
		document.getElementById("fontface1").innerHTML = "Verdana";
		document.getElementById("fontsize1").innerHTML = "2";
		var kids = document.getElementsByTagName('DIV');
		for (var i=0; i < kids.length; i++) {
			
			switch(kids[i].className)
			
			// CASE SVisBTN1
			{ 
			case "SVisbtn1":
				if (kids[i].onmouseover != SVisBtnMouseOver){
						kids[i].onmouseover = SVisBtnMouseOver;
				};
				if (kids[i].onclick != SVisAction){
					kids[i].onclick = SVisAction;
				};
				if (kids[i].className == "SVisbtn4") {
					if (kids[i].onmouseout != SVisBtnMouseDown){
						kids[i].onmouseout = SVisBtnMouseDown;
					};
				} else {
					if (kids[i].onmouseout != SVisBtnMouseOut){
						kids[i].onmouseout = SVisBtnMouseOut;
					};
				};
				if (kids[i].onmousedown != SVisBtnMouseDown) {
					kids[i].onmousedown = SVisBtnMouseDown;
				};
				if (kids[i].onmouseup != SVisBtnMouseUp) {
					kids[i].onmouseup = SVisBtnMouseUp;
				};
			break;
			
			// CASE SVisBTN2
			case "SVisbtn2":
				kids[i].className = "SVisbtn1";
				if (kids[i].onmouseover != SVisBtnMouseOver){
					kids[i].onmouseover = SVisBtnMouseOver;
				};
				if (kids[i].onclick != SVisAction){
					kids[i].onclick = SVisAction;
				};
				if (kids[i].className == "SVisbtn4") {
					if (kids[i].onmouseout = SVisBtnMouseDown){
						kids[i].onmouseout = SVisBtnMouseDown;
					};
				} else { 
					if (kids[i].onmouseout != SVisBtnMouseOut){
						kids[i].onmouseout = SVisBtnMouseOut;
					};
				};
				if (kids[i].onmousedown != SVisBtnMouseDown){
					kids[i].onmousedown = SVisBtnMouseDown;
				};
				if (kids[i].onmouseup != SVisBtnMouseUp){
					kids[i].onmouseup = SVisBtnMouseUp;
				};
			break;
			
			// CASE SVisBTN3
			case "SVisbtn3":
				kids[i].className = "SVisbtn1";
				if (kids[i].onmouseover != SVisBtnMouseOver){
					kids[i].onmouseover = SVisBtnMouseOver;
				};
				if (kids[i].onclick != SVisAction){
					kids[i].onclick = SVisAction;
				};
				if (kids[i].className == "SVisbtn4") {
					if (kids[i].onmouseout != SVisBtnMouseDown){
						kids[i].onmouseout = SVisBtnMouseDown;
					};
				} else {
					if (kids[i].onmouseout != SVisBtnMouseOut){
						kids[i].onmouseout = SVisBtnMouseOut;
					};
				};
				if (kids[i].onmousedown != SVisBtnMouseDown){
					kids[i].onmousedown = SVisBtnMouseDown;
				};
				if (kids[i].onmouseup != SVisBtnMouseUp){
					kids[i].onmouseup = SVisBtnMouseUp;
				};
			break;
			
			// CASE SVisBTN4
			case "SVisbtn4":
				kids[i].className = "SVisbtn1";
				if (kids[i].onmouseover != SVisBtnMouseOver){
					kids[i].onmouseover = SVisBtnMouseOver;
				};
				if (kids[i].onclick != SVisAction){
					kids[i].onclick = SVisAction;
				};
				if (kids[i].onmouseout != SVisBtnMouseOut){
					kids[i].onmouseout = SVisBtnMouseOut;
				};
				if (kids[i].onmousedown != SVisBtnMouseDown){
					kids[i].onmousedown = SVisBtnMouseDown;
				};
				if (kids[i].onmouseup != SVisBtnMouseUp){
					kids[i].onmouseup = SVisBtnMouseUp;
				};
			break;
			};
	
			switch(kids[i].id)
			{
		
			// CASE FORMAT1
			case "format1":
				if (kids[i].onmouseover != SVisMouseOverFormatMenu) {
						kids[i].onmouseover = SVisMouseOverFormatMenu;
				};
				if (kids[i].onmousedown != SVisMouseDownFormatMenu){
					kids[i].onmousedown = SVisMouseDownFormatMenu;
				};
				if (kids[i].onmouseout != SVisMouseOutFormatMenu){
					kids[i].onmouseout = SVisMouseOutFormatMenu;
				};
				if (kids[i].className == "SVisdropdown6") {
					if (kids[i].onmouseout != SVisMouseDownFormatMenu){
						kids[i].onmouseout = SVisMouseDownFormatMenu;
					};
				} else {
					if (kids[i].onmouseout != SVisMouseOutFormatMenu){
						kids[i].onmouseout = SVisMouseOutFormatMenu;
					};
				};
			break;
			
			// CASE FORMAT2
			case "format2":
				if (kids[i].onmouseover != SVisMouseOverFormatMenu){
					kids[i].onmouseover = SVisMouseOverFormatMenu;
				};
				if (kids[i].onmousedown != SVisMouseDownFormatMenu){
					kids[i].onmousedown = SVisMouseDownFormatMenu;
				};
				if (kids[i].onmouseout != SVisMouseOutFormatMenu){
					kids[i].onmouseout = SVisMouseOutFormatMenu;
				};
				if (kids[i].className == "SVisdropdown6") {
					kids[i].onmouseout = SVisMouseDownFormatMenu;
				} else {
					kids[i].onmouseout = SVisMouseOutFormatMenu;
				};
			break;
			
			// CASE FONTFACE1
			case "fontface1":
				if (kids[i].onmouseover != SVisMouseOverFontFaceMenu){
					kids[i].onmouseover = SVisMouseOverFontFaceMenu;
				};
				if (kids[i].onmousedown != SVisMouseDownFontFaceMenu){
					kids[i].onmousedown = SVisMouseDownFontFaceMenu;
				};
				if (kids[i].onmouseout != SVisMouseOutFontFaceMenu){
					kids[i].onmouseout = SVisMouseOutFontFaceMenu;
				};
				if (kids[i].className == "SVisdropdown6") {
					if (kids[i].onmouseout != SVisMouseDownFontFaceMenu){
						kids[i].onmouseout = SVisMouseDownFontFaceMenu;
					};
				} else {
					if (kids[i].onmouseout != SVisMouseOutFontFaceMenu){
						kids[i].onmouseout = SVisMouseOutFontFaceMenu;
					};
				};	
			break;
		
			// CASE FONTFACE2
			case "fontface2":
				if (kids[i].onmouseover != SVisMouseOverFontFaceMenu){
					kids[i].onmouseover = SVisMouseOverFontFaceMenu;
				};
				if (kids[i].onmousedown != SVisMouseDownFontFaceMenu){
					kids[i].onmousedown = SVisMouseDownFontFaceMenu;
				};
				if (kids[i].onmouseout != SVisMouseOutFontFaceMenu){
					kids[i].onmouseout = SVisMouseOutFontFaceMenu;
				};
				if (kids[i].className == "SVisdropdown6") {
					if (kids[i].onmouseout != SVisMouseDownFontFaceMenu){
						kids[i].onmouseout = SVisMouseDownFontFaceMenu;
					};
				} else {
					if (kids[i].onmouseout != SVisMouseOutFontFaceMenu){
						kids[i].onmouseout = SVisMouseOutFontFaceMenu;
					};
				};
			break;
			
		
			// CASE FONTSIZE1
			case "fontsize1":
				if (kids[i].onmouseover != SVisMouseOverFontSizeMenu){
					kids[i].onmouseover = SVisMouseOverFontSizeMenu;
				};
				if (kids[i].onmousedown != SVisMouseDownFontSizeMenu){
					kids[i].onmousedown = SVisMouseDownFontSizeMenu;
				};
				if (kids[i].onmouseout != SVisMouseOutFontSizeMenu){
					kids[i].onmouseout = SVisMouseOutFontSizeMenu;
				};
				if (kids[i].className == "SVisdropdown6") {
					if (kids[i].onmouseout != SVisMouseDownFontSizeMenu){
						kids[i].onmouseout = SVisMouseDownFontSizeMenu;
					};
					} else {
					if (kids[i].onmouseout != SVisMouseOutFontSizeMenu){
						kids[i].onmouseout = SVisMouseOutFontSizeMenu;
					};
				};
			break;
				
			// CASE FONTSIZE2
			case "fontsize2":
				if (kids[i].onmouseover != SVisMouseOverFontSizeMenu){
					kids[i].onmouseover = SVisMouseOverFontSizeMenu;
				};
				if (kids[i].onmousedown != SVisMouseDownFontSizeMenu){
					kids[i].onmousedown = SVisMouseDownFontSizeMenu;	
				};
				if (kids[i].onmouseout != SVisMouseOutFontSizeMenu){
					kids[i].onmouseout = SVisMouseOutFontSizeMenu;
				};
				if (kids[i].className == "SVisdropdown6") {
					if (kids[i].onmouseout != SVisMouseDownFontSizeMenu){
						kids[i].onmouseout = SVisMouseDownFontSizeMenu;
					};
				} else {
					if (kids[i].onmouseout != SVisMouseOutFontSizeMenu){
						kids[i].onmouseout = SVisMouseOutFontSizeMenu;
					};
				};
			break;
					
			// CASE FONTCOLOR1
			case "fontcolor1":
				if (kids[i].onmouseover != SVisMouseOverFontColorMenu){
					kids[i].onmouseover = SVisMouseOverFontColorMenu;
				};
				if (kids[i].onmousedown != SVisMouseDownFontColorMenu){
					kids[i].onmousedown = SVisMouseDownFontColorMenu;
				};
				if (kids[i].onmouseout != SVisMouseOutFontColorMenu){
					kids[i].onmouseout = SVisMouseOutFontColorMenu;
				};
				if (kids[i].className == "SVisdropdown9") {
						if (kids[i].onmouseout != SVisMouseDownFontColorMenu){
						kids[i].onmouseout = SVisMouseDownFontColorMenu;
					};
				} else {
					if (kids[i].onmouseout != SVisMouseOutFontColorMenu){
						kids[i].onmouseout = SVisMouseOutFontColorMenu;
					};
				};
			break;
				
			// CASE FONTCOLOR2
			case "fontcolor2":
				if (kids[i].onmouseover != SVisMouseOverFontColorMenu){
					kids[i].onmouseover = SVisMouseOverFontColorMenu;
				};
				if (kids[i].onmousedown != SVisMouseDownFontColorMenu){
					kids[i].onmousedown = SVisMouseDownFontColorMenu;
				};
				if (kids[i].onmouseout != SVisMouseOutFontColorMenu){
					kids[i].onmouseout = SVisMouseOutFontColorMenu;
				};
				if (kids[i].className == "SVisdropdown9") {
					if (kids[i].onmouseout != SVisMouseDownFontColorMenu){
						kids[i].onmouseout = SVisMouseDownFontColorMenu;
					};
				} else {
					if (kids[i].onmouseout != SVisMouseOutFontColorMenu){
						kids[i].onmouseout = SVisMouseOutFontColorMenu;
					};
				};
			break;
			
			// CASE FORMATBLOK
			case "formatblock":
				if (kids[i].onmouseover != SVisMouseOverMenuContents){
					kids[i].onmouseover = SVisMouseOverMenuContents;
				};
				if (kids[i].onmouseout != SVisMouseOutMenuContents){
					kids[i].onmouseout = SVisMouseOutMenuContents;
				};
				if (kids[i].onmousedown != SVisMouseDownMenuContents){
					kids[i].onmousedown = SVisMouseDownMenuContents;
				};
			break;
				
			// case fontface
			case "fontface":
				if (kids[i].onmouseover != SVisMouseOverMenuContents){
					kids[i].onmouseover = SVisMouseOverMenuContents;
				};
				if (kids[i].onmouseout != SVisMouseOutMenuContents){
					kids[i].onmouseout = SVisMouseOutMenuContents;
				};
				if (kids[i].onmousedown != SVisMouseDownMenuContents){
					kids[i].onmousedown = SVisMouseDownMenuContents;
				};
			break;
				
			// CASE FONTSIZE
			case "fontsize":
				if (kids[i].onmouseover != SVisMouseOverMenuContents){
					kids[i].onmouseover = SVisMouseOverMenuContents;
				};
				if (kids[i].onmouseout != SVisMouseOutMenuContents){
					kids[i].onmouseout = SVisMouseOutMenuContents;
				};
				if (kids[i].onmousedown != SVisMouseDownMenuContents){
					kids[i].onmousedown = SVisMouseDownMenuContents;
				};
			break;
			
			// CASE FONTCOLOR
			case "fontcolor":
				if (kids[i].onmouseover != SVisMouseOverMenuFontColorContents){
					kids[i].onmouseover = SVisMouseOverMenuFontColorContents;
				};
				if (kids[i].onmouseout != SVisMouseOutMenuFontColorContents){
					kids[i].onmouseout = SVisMouseOutMenuFontColorContents;
				};
			break;
			};
			
		};
		
		
		
		var tbl = false;
		var in_list = false;
		if (window.getSelection){
			
			var range = document.getElementById(SVisName).contentWindow.window.getSelection().getRangeAt(0);
			
			var node = range.startContainer;	
			var pos = range.startOffset;
			if(node.nodeType != 3) { node = node.childNodes[pos]; };
			
			if(node.nodeName && node.nodeName.search(/#/) != -1) {
				selected_obj = node.parentNode;
			}else{
				selected_obj = node;
			};
			
		} else if (document.getSelection) {
			
			var selected_obj = document.getElementById(SVisName).contentWindow.document.getSelection().focusNode;
		}else if (document.selection) {
			var range = document.getElementById(SVisName).contentWindow.document.selection.createRange();
			if(range.length > 0) {
				selected_obj = range.item(0);
			}else if(range.parentElement()) {
				selected_obj = range.parentElement();
			};
			
		};
		var is_link = false;
		var is_table = false;
		var is_img = false;
		var current_tag = selected_obj;
		
		if (current_tag != null){
			var previous_tagName = selected_obj.tagName;
			var tagSelectObj = selected_obj
		}else{
			var previous_tagName = "HTML";
		} 
		
		var textcolor = "";
		document.getElementById("fontcolor4").style.backgroundColor = "#000000";
		
		
		
		while(previous_tagName != "HTML"){
			
			//alert("/nid:"+tagSelectObj.innerHTML)
			
			if(previous_tagName == "IMG"){
				if(SVisImages){
					is_img = true;
					document.getElementById("editimg").className = "SVisbtn4";
					document.getElementById("editimg").onmouseout = SVisBtnMouseDown;
				}
			};
			
			if(previous_tagName == "B" || previous_tagName == "STRONG"){
				document.getElementById("bold").className = "SVisbtn4";
				document.getElementById("bold").onmouseout = SVisBtnMouseDown;
			};
			if (previous_tagName == "LI") {
				in_list = true;
			};
			
			if (previous_tagName == "TD" && !is_table) {
				is_table = true;
				selectnowobj_sempre = document.getElementById(SVisName).contentWindow.document.selection.createRange().parentElement()
			};

			if (previous_tagName == "TABLE" && !is_table) {
				is_table = true;
				selectnowobj_sempre = document.getElementById(SVisName).contentWindow.document.selection.createRange().item(0)

			};
			
			if(previous_tagName == "I" || previous_tagName == "EM"){
				document.getElementById("italic").className = "SVisbtn4";
				document.getElementById("italic").onmouseout = SVisBtnMouseDown;
			};
			if(previous_tagName == "U"){
				document.getElementById("underline").className = "SVisbtn4";
				document.getElementById("underline").onmouseout = SVisBtnMouseDown;
			};
			if(previous_tagName == "STRIKE"){
				document.getElementById("strikethrough").className = "SVisbtn4";
				document.getElementById("strikethrough").onmouseout = SVisBtnMouseDown;
			};
			if(previous_tagName == "A"){
				if(selected_obj.tagName != "IMG"){
					if(selected_obj.tagName == "FONT"){selected_obj = selected_obj.parentNode()}
					
					var selected_obj_ext = selected_obj.href
					var selected_obj_href =selected_obj_ext.toLowerCase();
					if( selected_obj_href.indexOf(".gif")>-1 || selected_obj_href.indexOf(".bmp")>-1 || selected_obj_href.indexOf(".rle")>-1 || selected_obj_href.indexOf(".dib")>-1 || selected_obj_href.indexOf(".png")>-1 ||	selected_obj_href.indexOf(".jpg")>-1 || selected_obj_href.indexOf(".jpeg")>-1 || selected_obj_href.indexOf(".jpe")>-1 ||	selected_obj_href.indexOf(".tif")>-1 || selected_obj_href.indexOf(".tiff")>-1 || selected_obj_href.indexOf(".img")>-1 || selected_obj_href.indexOf(".pdf")>-1 ||	selected_obj_href.indexOf(".pdp")>-1 || selected_obj_href.indexOf(".doc")>-1 || selected_obj_href.indexOf(".txt")>-1 || selected_obj_href.indexOf(".rtf")>-1 ||	selected_obj_href.indexOf(".swf")>-1 || selected_obj_href.indexOf(".swf")>-1 || selected_obj_href.indexOf(".zip")>-1 || selected_obj_href.indexOf(".rar")>-1 ||	selected_obj_href.indexOf(".xls")>-1 || selected_obj_href.indexOf(".xml")>-1 || selected_obj_href.indexOf(".txt")>-1 || selected_obj_href.indexOf(".flv")>-1 ||	selected_obj_href.indexOf(".mov")>-1){
						
						is_img = true;
						document.getElementById("editimg").className = "SVisbtn4";
						document.getElementById("editimg").onmouseout = SVisBtnMouseDown;
						
					}else{
						is_link = true;
						document.getElementById("editlink").className = "SVisbtn4";
						document.getElementById("editlink").onmouseout = SVisBtnMouseDown;
						selectnowobj_sempre = document.getElementById(SVisName).contentWindow.document.selection.createRange().parentElement()
					}
				}
			};
			if(previous_tagName == "UL"){
				document.getElementById("insertunorderedlist").className = "SVisbtn4";
				document.getElementById("insertunorderedlist").onmouseout = SVisBtnMouseDown;
			};
			if(previous_tagName == "OL"){
				document.getElementById("insertorderedlist").className = "SVisbtn4";
				document.getElementById("insertorderedlist").onmouseout = SVisBtnMouseDown;
			};
			if(previous_tagName == "SUB"){
				document.getElementById("subscript").className = "SVisbtn4";
				document.getElementById("subscript").onmouseout = SVisBtnMouseDown;
			};
			if(previous_tagName == "SUP"){
				document.getElementById("superscript").className = "SVisbtn4";
				document.getElementById("superscript").onmouseout = SVisBtnMouseDown;
			};
			if(previous_tagName == "H1"){
				document.getElementById("format1").innerHTML = "Titolo";
			};
			if(previous_tagName == "H2"){
				document.getElementById("format1").innerHTML = "Testo";
			};
			if(previous_tagName == "H3"){
				document.getElementById("format1").innerHTML = "Header 3";
			};
			if(previous_tagName == "H4"){
				document.getElementById("format1").innerHTML = "Header 4";
			};
			if(previous_tagName == "H5"){
				document.getElementById("format1").innerHTML = "Header 5";
			};
			if(previous_tagName == "H6"){
				document.getElementById("format1").innerHTML = "Header 6";
			};
			if(previous_tagName == "BLOCKQUOTE"){
				document.getElementById("indent").className = "SVisbtn4";
				document.getElementById("indent").onmouseout = SVisBtnMouseDown;
			};
			if (is_table) {
				document.getElementById("table_options_on").style.display = "";
				document.getElementById("table_options_off").style.display = "none";
			} else {
				document.getElementById("table_options_on").style.display = "none";
				document.getElementById("table_options_off").style.display = "";
			};
			if (current_tag.align == "left") {
				document.getElementById("justifyleft").className = "SVisbtn4";
				document.getElementById("justifyleft").onmouseout = SVisBtnMouseDown;
			} else if (current_tag.align == "center") {
				document.getElementById("justifycenter").className = "SVisbtn4";
				document.getElementById("justifycenter").onmouseout = SVisBtnMouseDown;
			} else if (current_tag.align == "right") {
				document.getElementById("justifyright").className = "SVisbtn4";
				document.getElementById("justifyright").onmouseout = SVisBtnMouseDown;
			} else if (current_tag.align == "justify") {
				document.getElementById("justifyfull").className = "SVisbtn4";
				document.getElementById("justifyfull").onmouseout = SVisBtnMouseDown;
			} else if (current_tag.align == "") {
				document.getElementById("justifyleft").className = "SVisbtn1";
			} else { };
			if (current_tag.face == "arial") {
				document.getElementById("fontface1").innerHTML = "Arial";
			} else if (current_tag.face == "arial black") {
				document.getElementById("fontface1").innerHTML = "Arial Black";
			} else if (current_tag.face == "arial narrow") {
				document.getElementById("fontface1").innerHTML = "Arial Narrow";
			} else if (current_tag.face == "courier new") {
				document.getElementById("fontface1").innerHTML = "Courier New";
			} else if (current_tag.face == "century gothic") {
				document.getElementById("fontface1").innerHTML = "Century Gothic";
			} else if (current_tag.face == "comic sans ms") {
				document.getElementById("fontface1").innerHTML = "Comic Sans MS";
			} else if (current_tag.face == "impact") {
				document.getElementById("fontface1").innerHTML = "Impact";
			} else if (current_tag.face == "tahoma") {
				document.getElementById("fontface1").innerHTML = "Tahoma";
			} else if (current_tag.face == "times new roman") {
				document.getElementById("fontface1").innerHTML = "Times New Roman";
			} else if (current_tag.face == "trebuchet ms") {
				document.getElementById("fontface1").innerHTML = "Trebuchet MS";
			} else if (current_tag.face == "verdana") {
				document.getElementById("fontface1").innerHTML = "Verdana";
			};
			if (current_tag.size == "1") {
				document.getElementById("fontsize1").innerHTML = "1";
			} else if (current_tag.size == "2") {
				document.getElementById("fontsize1").innerHTML = "2";
			} else if (current_tag.size == "3") {
				document.getElementById("fontsize1").innerHTML = "3";
			} else if (current_tag.size == "4") {
				document.getElementById("fontsize1").innerHTML = "4";
			} else if (current_tag.size == "5") {
				document.getElementById("fontsize1").innerHTML = "5";
			} else if (current_tag.size == "6") {
				document.getElementById("fontsize1").innerHTML = "6";
			} else if (current_tag.size == "7") {
				document.getElementById("fontsize1").innerHTML = "7";
			} else { };
			
			if (current_tag.color != null) {
				textcolor = current_tag.color;
			};
			current_tag = current_tag.parentNode;
			previous_tagName = current_tag.tagName;
			
			
		};
		
		if (in_list){};
	};
		
	
	
	if (textcolor == "") {
		textcolor = "#000000";
	};
	if (is_table){
		document.getElementById("edittable").className = "SVisbtn4";
		document.getElementById("edittable").onmouseout = SVisBtnMouseDown;
		document.getElementById("inserttable").style.display = "none";
		document.getElementById("edittable").style.display = "";
	} else {
		document.getElementById("edittable").className = "SVisbtn1";
		document.getElementById("edittable").onmouseout = SVisBtnMouseOut;
		document.getElementById("inserttable").style.display = "";
		document.getElementById("edittable").style.display = "none";
	}
	document.getElementById("fontcolor4").style.backgroundColor = textcolor;
	
	if (is_link){
		document.getElementById("createlink").style.display = "none";
		document.getElementById("editlink").style.display = "";
	} else {
		document.getElementById("createlink").style.display = "";
		document.getElementById("editlink").style.display = "none";
	}; 
	
	if(SVisImages){
		if (is_img){
			document.getElementById("insertimage").style.display = "none";
			document.getElementById("editimg").style.display = "";
		} else {
			document.getElementById("insertimage").style.display = "";
			document.getElementById("editimg").style.display = "none";
			
		}; 
	}
	
	//autoResizeWord(SVisName,SVisFormName);
	resize_word()
};



function menuBuilder() {
	if (SVisFormat) {
		document.getElementById("SVisformat").style.display = "";
	} else {
		document.getElementById("SVisformat").style.display = "none";
	};
	if (SVisFontFace) {
		document.getElementById("SVisfontface").style.display = "";
	} else {
		document.getElementById("SVisfontface").style.display = "none";
	};
	if (SVisFontSize) {
		document.getElementById("SVisfontsize").style.display = "";
	} else {
		document.getElementById("SVisfontsize").style.display = "none";
	};
	if (SVisFontColor) {
		document.getElementById("SVisfontcolor").style.display = "";
	} else {
		document.getElementById("SVisfontcolor").style.display = "none";
	};
	if (SVisBold) {
		document.getElementById("bold").style.display = "";
	} else {
		document.getElementById("bold").style.display = "none";
	};
	if (SVisItalic) {
		document.getElementById("italic").style.display = "";
	} else {
		document.getElementById("italic").style.display = "none";
	};
	if (SVisUnderline) {
		document.getElementById("underline").style.display = "";
	} else {
		document.getElementById("underline").style.display = "none";
	};
	if (SVisStrikeThrough) {
		document.getElementById("strikethrough").style.display = "";
	} else {
		document.getElementById("strikethrough").style.display = "none";
	};
	if (SVisLeftAlign) {
		document.getElementById("justifyleft").style.display = "";
	} else {
		document.getElementById("justifyleft").style.display = "none";
	};
	if (SVisCenterAlign) {
		document.getElementById("justifycenter").style.display = "";
	} else {
		document.getElementById("justifycenter").style.display = "none";
	};
	if (SVisRightAlign) {
		document.getElementById("justifyright").style.display = "";
	} else {
		document.getElementById("justifyright").style.display = "none";
	};
	if (SVisFullAlign) {
		document.getElementById("justifyfull").style.display = "";
	} else {
		document.getElementById("justifyfull").style.display = "none";
	};
	if (SVisHorizontalRule) {
		document.getElementById("inserthorizontalrule").style.display = "";
	} else {
		document.getElementById("inserthorizontalrule").style.display = "none";
	};
	if (SVisSubscript) {
		document.getElementById("subscript").style.display = "";
	} else {
		document.getElementById("subscript").style.display = "none";
	};	
	if (SVisSuperscript) {
		document.getElementById("superscript").style.display = "";
	} else {
		document.getElementById("superscript").style.display = "none";
	};
	if (SVisLink) {
		document.getElementById("createlink").style.display = "";
	} else {
		document.getElementById("createlink").style.display = "none";
	};
	if (SVisUnlink) {
		document.getElementById("unlink").style.display = "";
	} else {
		document.getElementById("unlink").style.display = "none";
	};
	
	if (SVisImages) {
		document.getElementById("insertimage").style.display = "";
		
		
		document.getElementById("insertpdf").style.display = "";
		document.getElementById("insertTube").style.display = "";
		
	} else {
		document.getElementById("insertimage").style.display = "none";
		
		document.getElementById("insertpdf").style.display = "none";
		document.getElementById("insertTube").style.display = "none";
		
	};
	
	if (SVisImages) {
		document.getElementById("editimg").style.display = "";
	} else {
		document.getElementById("editimg").style.display = "none";
	};
	
	if (SVisRemoveFormat) {
		document.getElementById("RemoveFormat").style.display = "";
	} else {
		document.getElementById("RemoveFormat").style.display = "none";
	};
	if (SVisTables) {
		document.getElementById("tables").style.display = "";
	} else {
		document.getElementById("tables").style.display = "none";
	};
	if (SVisOrderedList) {
		document.getElementById("insertorderedlist").style.display = "";
	} else {
		document.getElementById("insertorderedlist").style.display = "none";
	};
	if (SVisUnorderedList) {
		document.getElementById("insertunorderedlist").style.display = "";
	} else {
		document.getElementById("insertunorderedlist").style.display = "none";
	};
	if (SVisIndent) {
		document.getElementById("indent").style.display = "";
	} else {
		document.getElementById("indent").style.display = "none";
	};
	if (SVisOutdent) {
		document.getElementById("outdent").style.display = "";
	} else {
		document.getElementById("outdent").style.display = "none";
	};
	if (SVisCutCopyPaste) {
		document.getElementById("cutcopypaste").style.display = "";
	} else {
		document.getElementById("cutcopypaste").style.display = "none";
	};
	if (SVisInsertForm) {
		document.getElementById("insertform").style.display = "";
	} else {
		document.getElementById("insertform").style.display = "none";
	};
	if (SVisInsertCheckbox) {
		document.getElementById("form_checkbox").style.display = "";
	} else {
		document.getElementById("form_checkbox").style.display = "none";
	};
	if (SVisInsertRadio) {
		document.getElementById("form_radio").style.display = "";
	} else {
		document.getElementById("form_radio").style.display = "none";
	};
	if (SVisInsertTextArea) {
		document.getElementById("form_textarea").style.display = "";
	} else { 
		document.getElementById("form_textarea").style.display = "none";
	};
	if (SVisInsertSubmit) {
		document.getElementById("form_submit").style.display = "";
	} else { 
		document.getElementById("form_submit").style.display = "none";
	};
	if (SVisInsertImageSubmit) {
		document.getElementById("form_image_submit").style.display = "";
	} else {
		document.getElementById("form_image_submit").style.display = "none";
	};
	if (SVisInsertReset) {
		document.getElementById("form_reset").style.display = "";
	} else {
		document.getElementById("form_reset").style.display = "none";
	};
	if (SVisInsertHidden) {
		document.getElementById("form_hidden").style.display = "";
	} else {
		document.getElementById("form_hidden").style.display = "none";
	};
	if (SVisInsertPassword) {
		document.getElementById("form_password").style.display = "";
	} else {
		document.getElementById("form_password").style.display = "none";
	};
	if (SVisInsertTextField) {
		document.getElementById("form_textfield").style.display = "";
	} else {
		document.getElementById("form_textfield").style.display = "none";
	};
	if (SVisPrint) {
		document.getElementById("printSVis").style.display = "";
	} else {
		document.getElementById("printSVis").style.display = "none";
	};
	if (SVisSelectAll) {
		document.getElementById("selectall").style.display = "";
	} else {
		document.getElementById("selectall").style.display = "none";
	};
	if (SVisSpellCheck) {
		document.getElementById("spellcheck").style.display = "";
	} else {
		document.getElementById("spellcheck").style.display = "none";
	};
	
	
	if (!SVisFormat && !SVisFontFace && !SVisFontSize && !SVisFontColor) {
		document.getElementById("SVissep1").style.display = "none"; document.getElementById("SVissep2").style.display = "none";
	};
	if (!SVisBold && !SVisItalic && !SVisUnderline && !SVisStrikeThrough) {
		document.getElementById("SVissep3").style.display = "none";
	};
	if (!SVisLeftAlign && !SVisCenterAlign && !SVisRightAlign && !SVisFullAlign && !SVisHorizontalRule) {
		document.getElementById("SVissep4").style.display = "none";
	};
	if (!SVisFormat && !SVisFontFace && !SVisFontSize && !SVisBold && !SVisItalic && !SVisUnderline && !SVisStrikeThrough && !SVisLeftAlign && !SVisCenterAlign && !SVisRightAlign && !SVisFullAlign && !SVisHorizontalRule && !SVisSuperscript && !SVisSubscript) {
		document.getElementById("tb1").style.display = "none";
	};
	if (!SVisLink && !SVisUnlink && !SVisImages && !SVisRemoveFormat && !SVisTables && !SVisOrderedList && !SVisUnorderedList && !SVisIndent && !SVisOutdent && !SVisUndo && !SVisRedo && !SVisCutCopyPaste) {
		document.getElementById("tb2").style.display = "none";
	};
	if (!SVisLink && !SVisUnlink) {
		document.getElementById("SVissep5").style.display = "none";
	};
	if (!SVisImages && !SVisRemoveFormat) {
		document.getElementById("SVissep6").style.display = "none";
	};
	if (!SVisTables) {
		document.getElementById("SVissep7").style.display = "none";
	};
	if (!SVisOrderedList && !SVisUnorderedList && !SVisIndent && !SVisOutdent) {
		//document.getElementById("SVissep8").style.display = "none";
	};
	if (!SVisUndo && !SVisRedo) {
		//document.getElementById("SVissep9").style.display = "none";
	};
	if (!SVisInsertForm && !SVisInsertCheckbox && !SVisInsertRadio && !SVisInsertTextArea && !SVisInsertSubmit && !SVisInsertImageSubmit && !SVisInsertReset && !SVisInsertHidden && !SVisInsertPassword && !SVisInsertTextField) {
		document.getElementById("SVissep10").style.display = "none";
	};
	if (!SVisPrint && !SVisSelectAll && !SVisSpellCheck) {
		//document.getElementById("SVissep11").style.display = "none";
	};
}; 

var AttSet = ""; 

function initSVis(Att,SVisPreloadContent,id01,id02,maxtab,sett_config,staticMod,classe,startPosition) {
	
	AttSet = Att
	
	var word_edit_insert="";
	
	var word_edit_insert_style="";
	
	
	if (!document.designMode) {
		
		//// CONDIZIONE SE NON E' IN MODALITA' DISEGNO
		word_edit_insert+='<textarea id="' + SVisFormName + '" name="' + SVisFormName + '" style="width:' + SVisWidth + ';height:' + SVisHeight + ';"></textarea>';
	
	} else {
		
		//// CREAZIONE STYLE
		word_edit_insert_style+='<style type="text/css" id="stylvword">';
		
		word_edit_insert_style+='.SVisbg{background-image:url(' + SVisImagePath + 'bg.gif);	font-family:Arial, Helvetica, sans-serif;	font-size:10px;}';
		
		/*
		//// H1
		word_edit_insert_style+='h1{'+SVParagraph1+'}';
		//// H2
		word_edit_insert_style+='h2{'+SVParagraph2+'}';
		//// H3
		word_edit_insert_style+='h3{'+SVParagraph3+'}';
		//// H4
		word_edit_insert_style+='h4{'+SVParagraph4+'}';
		//// H5
		word_edit_insert_style+='h5{'+SVParagraph5+'}';
		//// H5
		word_edit_insert_style+='h6{'+SVParagraph6+'}';
		//// p
		word_edit_insert_style+='p{'+SVParagraphp+'}';
		//// a
		word_edit_insert_style+='a{'+SVParagrapha+'}';
		//// a
		word_edit_insert_style+='a:hover{'+SVParagraphah+'}';
		//// a
		word_edit_insert_style+='img{'+SVParagraphimg+'}';
		*/
		
		
		//// .SVisdropdown1
		word_edit_insert_style+='.SVisdropdown1 {height:20px;font-family:Arial, Helvetica, sans-serif;padding-left:3px;padding-right:3px;font-size:11px;border:1px solid #CCCCCC;cursor:default;}';
		
		//// .SVisdropdown2
		word_edit_insert_style+='.SVisdropdown2 {width:11px;background-image:url(' + SVisImagePath + 'bg.gif);border-top:1px solid #CCCCCC;border-right:1px solid #CCCCCC;border-bottom:1px solid #CCCCCC;cursor:default;';
		if (document.all && !window.opera){
			word_edit_insert_style+='	height:20px;';
		} else {
			word_edit_insert_style+='	height:20px;';
		};
		word_edit_insert_style+='}';
		
		//// .SVisdropdown4
		word_edit_insert_style+='.SVisdropdown4 {font-family:Arial, Helvetica, sans-serif;padding-left:3px;padding-right:3px;font-size:11px;border:1px solid #002D96;cursor:default;';
		if (document.all && !window.opera) {
			word_edit_insert_style+='	height:20px;';
		} else {
			word_edit_insert_style+='	height:20px;';
		};
		word_edit_insert_style+='}';
		
		//// .SVisdropdown5
		word_edit_insert_style+='.SVisdropdown5 {background-image:url(' + SVisImagePath + 'bgover.gif);border-top:1px solid #CCCCCC;border-right:1px solid #CCCCCC;border-bottom:1px solid #CCCCCC;cursor:default;';
		if (document.all && !window.opera) {
			word_edit_insert_style+='	height:20px;';
		} else {
			word_edit_insert_style+='	height:20px;';
		};
		word_edit_insert_style+='}';
		
		//// .SVisdropdown5b
		word_edit_insert_style+='.SVisdropdown5b {background-image:url(' + SVisImagePath + 'bgover.gif);border-top:1px solid #CCCCCC;border-right:1px solid #CCCCCC;border-bottom:1px solid #CCCCCC;cursor:default;';
		if (document.all && !window.opera) {
			word_edit_insert_style+='	height:20px;';
		} else {
			word_edit_insert_style+='	height:20px;';
		} 
		word_edit_insert_style+='}';
		
		//// .SVisdropdown6
		word_edit_insert_style+='.SVisdropdown6 {width:11px;background-image:url(' + SVisImagePath + 'bgdown.gif);border-top:1px solid #CCCCCC;border-right:1px solid #CCCCCC;border-bottom:1px solid #CCCCCC;cursor:default;';
		if (document.all && !window.opera) {
			word_edit_insert_style+='	height:20px;';
		} else {
			word_edit_insert_style+='	height:20px;';
		}
		word_edit_insert_style+='}';
		
		//// .SVisdropdown7
		word_edit_insert_style+='.SVisdropdown7 {border:1px #CCCCCC solid ;background-color:#FFFFFF;cursor:default;}';
		
		//// .SVisdropdown8
		word_edit_insert_style+='.SVisdropdown8 {background-image:url(' + SVisImagePath + 'bgover.gif); height:19px; border:1px solid #CCCCCC;cursor:default;}';
		
		//// .SVisdropdown9
		word_edit_insert_style+='.SVisdropdown9 {background-image:url(' + SVisImagePath + 'bgdown.gif);border-top:1px solid #CCCCCC;border-right:1px solid #CCCCCC;border-bottom:1px solid #CCCCCC;cursor:default;}';
		
		/// .SVisdropdown9b
		word_edit_insert_style+='.SVisdropdown9b {background-image:url(' + SVisImagePath + 'bgdown.gif);border-top:1px solid #CCCCCC;border-right:1px solid #CCCCCC;border-bottom:1px solid #CCCCCC;cursor:default;';
		if (document.all && !window.opera) {
			word_edit_insert_style+='	height:20px;';
		} else {
			word_edit_insert_style+='	height:20px;';
		}; 
		word_edit_insert_style+='}';
		
		//// .SVisdropdown10
		word_edit_insert_style+='.SVisdropdown10 {height:19px; width:21px; border:1px solid #CCCCCC;cursor:default;}';
		
		//// .SVisdropdown11
		word_edit_insert_style+='.SVisdropdown11 {border-top:0px solid transparent;border-right:0px solid transparent;border-bottom:0px solid transparent;cursor:default;}';
		
		//// .SVisdropdown11b
		word_edit_insert_style+='.SVisdropdown11b {border-top:1px #CCCCCC solid;border-right:1px #cccccc solid; border-bottom:1px #cccccc solid ;cursor:default;height:20px;}';
		
		//// .SVisdropdown12
		word_edit_insert_style+='.SVisdropdown12 {background-image:url(' + SVisImagePath + 'bgdown.gif);border:1px solid #CCCCCC;cursor:default;}'; 
		//// .SVisdropdown13
		word_edit_insert_style+='.SVisdropdown13 {padding:1px;border:1px solid #FFFFFF;background-color:#FFFFFF;}';
		
		//// .SVisdropdown14
		word_edit_insert_style+='.SVisdropdown14 {padding:1px;border:1px solid #CCCCCC;background-color:#AFFEF4;}';
		
		//// .SVisbtn1
		word_edit_insert_style+='.SVisbtn1 {border:1px #CCCCCC solid; display:block;width:21px;height:20px;background-image:url(' + SVisImagePath + 'bg.gif);}';
		
		//// .SVisbtn2
		word_edit_insert_style+='.SVisbtn2 {display:block;width:21px;height:20px;border:1px solid #CCCCCC;background-image:url(' + SVisImagePath + 'bgover.gif);}';
		
		//// .SVisbtn3
		word_edit_insert_style+='.SVisbtn3 {display:block;width:21px;height:20px;border:1px solid #CCCCCC;background-image:url(' + SVisImagePath + 'bgselect.gif);}';
		
		//// .SVisbtn4
		word_edit_insert_style+='.SVisbtn4 {display:block; width:21px;height:20px;border:1px solid #CCCCCC;background-image:url(' + SVisImagePath + 'bgdown.gif);}';
		
		//// .SVisbtn5
		word_edit_insert_style+='.SVisbtn5 {display:block; border:1px solid #CCCCCC; width:20px;height:20px;background-image:url(' + SVisImagePath + 'bg.gif);}';
		
		//// .SVisbtn6
		word_edit_insert_style+='.SVisbtn6 {width:70px;display:block; border:1px solid #CCCCCC; padding: 2px;cursor:default;}';
		
		//// .SVisbtn7
		word_edit_insert_style+='.SVisbtn7 {width:70px;display:block;border:1px solid #CCCCCC;background-image:url(' + SVisImagePath + 'bgover.gif);cursor:default;padding: 2px;}';
		
		//// .SVisbtn8
		word_edit_insert_style+='.SVisbtn8 {width:70px;display:block;border:1px solid #CCCCCC;background-image:url(' + SVisImagePath + 'bgselect.gif);cursor:default;padding: 2px;}';
		
		//// .SVisbtn9
		word_edit_insert_style+='.SVisbtn9 {width:70px;display:block;border:1px solid #CCCCCC;background-image:url(' + SVisImagePath + 'bgdown.gif);cursor:default;padding: 2px;}';
		
		//// CHIUSURA STYLE
		word_edit_insert_style+='</style>';
		

		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		
		//// IMPUT FORM
		
		//// VARIABILI (CSS - NOME I FRAME )
		word_edit_insert+='<input type="hidden" name="input_'+Att+'" id="iframe_word_SV" value="' + SVisName + '"/>';
		
		//// CAMPO DI CONTROLLO COPY CNTROL-V
		word_edit_insert+='<iframe  name="copyControl" id="copyControl" border="0" style="height:0px;"></iframe>'
		
		
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		if(staticMod){
			if(startPosition){
				word_edit_insert+='<div id="root" style="position:fixed; width:625px;top:-63px; left:-11px;" unselectable="on">';
				//word_edit_insert+='<div id="root" style="left:-11px; top:-63px; width:625px " unselectable="on">';
			}else{
				word_edit_insert+='<div id="root" style="position:relative; width:100%;" unselectable="on">';
			}
		}else{
			word_edit_insert+='<div id="root" class="visivaword" style="left:20px; top:20px; " unselectable="on">';
		}
		word_edit_insert+='<table border="0" cellpadding="0" cellspacing="0" unselectable="on"  width="'+ SVisWidth +'">';
		word_edit_insert+='	<tr>';
		word_edit_insert+='		<td width="15" height="16"><img src="include_app/visivamod/images/popup_01.gif" width="15" height="16" /></td>'
		word_edit_insert+='		<td height="16" background="include_app/visivamod/images/popup_02.gif"></td>';
		word_edit_insert+='		<td width="15" height="16"><img src="include_app/visivamod/images/popup_03.gif" width="15" height="16" /></td>';
		word_edit_insert+='	</tr><tr>';
		word_edit_insert+='		<td><img src="include_app/visivamod/images/popup_04.gif" width="15" height="32" /></td>';
		word_edit_insert+='		<td background="include_app/visivamod/images/popup_06.gif">';
		
		if(staticMod){
			word_edit_insert+='	<div unselectable="on" style="margin-top:4px;"><font color="#fffffff">VISIVA</font><font style="font-family:\'Times New Roman\', Times, serif" color="#c8dc00">WORD</font></div>';
		}else{
			word_edit_insert+='	<div id="handle"><img src="include_app/include_img/drag.gif"/></div><div unselectable="on" style="margin-top:4px;"><font color="#fffffff">VISIVA</font><font style="font-family:\'Times New Roman\', Times, serif" color="#c8dc00">WORD</font></div>';
		}
		
		word_edit_insert+='		</td><td><img src="include_app/visivamod/images/popup_07.gif" width="15" height="32" /></td>';
		word_edit_insert+='	</tr><tr>';
		word_edit_insert+='		<td rowspan="2" background="include_app/visivamod/images/popup_08.gif" ></td>';
		word_edit_insert+='		<td height="5px" background="include_app/visivamod/images/popup_09.gif"></td>';
		word_edit_insert+='		<td rowspan="2" background="include_app/visivamod/images/popup_10.gif" ></td>';
		word_edit_insert+='	</tr><tr>';
		word_edit_insert+='		<td height="10px" background="include_app/visivamod/images/popup_12.gif"></td>';
		word_edit_insert+=' 	</tr><tr>';
		word_edit_insert+='		<td background="include_app/visivamod/images/popup_13.gif"></td>';
		word_edit_insert+='		<td bgcolor="#FFFFFF">';
		
		word_edit_insert+='<table bgcolor="'+SVmenuColoreSfondo+'" cellpadding="0" cellspacing="0" border="'+SVmenucBordoSpessore+'" bordercolor="'+SVmenuColoreBordo+'" ><tr><td>';
		//// APERTURA TABELLA CONTENITORE BOTTONI
		word_edit_insert+='<table width="'+ SVisWidth +'" >';
		word_edit_insert+='  <tr>';
		word_edit_insert+='    <td>';
		
		word_edit_insert+='    	<table  cellpadding="0" cellspacing="0" id="tb1" unselectable="on" onmousedown="return false;">';
		word_edit_insert+='      		<tr>';
		
		//// Img vuota
		word_edit_insert+='        		<td class="SVisbg" id="SVissep1"><img src="' + SVisImagePath + 'blank.gif"></td>';
		
		//// COMANDI
		word_edit_insert+='        		<td background="' + SVisImagePath + 'bg.gif" id="SVisformat">';
		
		//// PARAGRAFO
		word_edit_insert+='					<table width="100%" cellpadding="0" cellspacing="0" id="format4" bgcolor="#FFFFFF" title="Style">';
		word_edit_insert+='          				<tr>';
		word_edit_insert+='            				<td nowrap><div unselectable="on" id="format1" class="SVisdropdown1" style="width:58px;font-family:arial;font-size:11px;color:#000000;">Sottotesto</div></td>';
		word_edit_insert+='            				<td><div unselectable="on" id="format2" class="SVisdropdown2"><img src="' + SVisImagePath + 'arrow.gif" width="11" height="16"></div></td>';
		word_edit_insert+='          				</tr>';
		word_edit_insert+='        			</table>';
		word_edit_insert+='					<div id="format3" class="SVisdropdown7" style="position:absolute;display:none;">';
		word_edit_insert+='						<h1><div unselectable="on" id="formatblock" style="padding:10px;" nowrap>Titolo</div></h1>';
		word_edit_insert+='						<h2><div unselectable="on" id="formatblock" style="padding:10px;" nowrap>Testo</div></h2>';
		//word_edit_insert+='						<h3><div unselectable="on" id="formatblock" style="padding:10px;" nowrap>Header 3</div></h3>';
		//word_edit_insert+='						<h4><div unselectable="on" id="formatblock" style="padding:10px;" nowrap>Header 4</div></h4>';
		//word_edit_insert+='						<h5><div unselectable="on" id="formatblock" style="padding:10px;" nowrap>Header 5</div></h5>';
		//word_edit_insert+='						<h6><div unselectable="on" id="formatblock" style="padding:10px;" nowrap>Header 6</div></h6>';
		word_edit_insert+='						<p><div unselectable="on" id="formatblock" style="padding:10px;" nowrap>Sottotesto</div></p>';
		word_edit_insert+='					</div>';
		word_edit_insert+='        		</td>';
		word_edit_insert+='        		<td class="SVisbg"><img src="' + SVisImagePath + 'blank.gif"></td>';
		word_edit_insert+='        		<td background="' + SVisImagePath + 'bg.gif" id="SVisfontface">';
		
		//// FONT
		word_edit_insert+='					<table style="width:110px;" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" title="Font">';
		word_edit_insert+='          				<tr>';
		word_edit_insert+='            				<td nowrap><div unselectable="on" id="fontface1" class="SVisdropdown1" style="width:98px;font-family:arial;font-size:11px;color:#000000;">Verdana</div></td>';
		word_edit_insert+='            <td><div unselectable="on" id="fontface2" class="SVisdropdown2"><img src="' + SVisImagePath + 'arrow.gif" width="11" height="16"></div></td>';
		word_edit_insert+='          				</tr>';
		word_edit_insert+='        			</table>';
		word_edit_insert+='					<div id="fontface3" class="SVisdropdown7" style="position:absolute;display:none;">';
		word_edit_insert+='						<div unselectable="on" id="fontface" style="color:#000000;font-family:arial;padding:5px;" nowrap>Arial</div>';
		word_edit_insert+='						<div unselectable="on" id="fontface" style="color:#000000;font-family:arial black;padding:5px;" nowrap>Arial Black</div>';
		word_edit_insert+='						<div unselectable="on" id="fontface" style="color:#000000;font-family:arial narrow;padding:5px;" nowrap>Arial Narrow</div>';
		word_edit_insert+='						<div unselectable="on" id="fontface" style="color:#000000;font-family:courier new;padding:5px;" nowrap>Courier New</div>';
		word_edit_insert+='						<div unselectable="on" id="fontface" style="color:#000000;font-family:century gothic;padding:5px;" nowrap>Century Gothic</div>';
		word_edit_insert+='						<div unselectable="on" id="fontface" style="color:#000000;font-family:comic sans ms;padding:5px;" nowrap>Comic Sans MS</div>';
		word_edit_insert+='						<div unselectable="on" id="fontface" style="color:#000000;font-family:impact;padding:5px;" nowrap>Impact</div>';
		word_edit_insert+='						<div unselectable="on" id="fontface" style="color:#000000;font-family:tahoma;padding:5px;" nowrap>Tahoma</div>';
		word_edit_insert+='						<div unselectable="on" id="fontface" style="color:#000000;font-family:times new roman;padding:5px;" nowrap>Times New Roman</div>';
		word_edit_insert+='						<div unselectable="on" id="fontface" style="color:#000000;font-family:trebuchet ms;padding:5px;" nowrap>Trebuchet MS</div>';
		word_edit_insert+='						<div unselectable="on" id="fontface" style="color:#000000;font-family:verdana;padding:5px;" nowrap>Verdana</div>';
		word_edit_insert+='					</div>';
		word_edit_insert+='        		</td>';
		word_edit_insert+='        		<td class="SVisbg"><img src="' + SVisImagePath + 'blank.gif"></td>';
		word_edit_insert+='       			 <td background="' + SVisImagePath + 'bg.gif" id="SVisfontsize">';
		
		//// DIMENSIONI
		word_edit_insert+='					<table width="100%" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" title="Dimensioni Font">';
		word_edit_insert+='          				<tr>';
		word_edit_insert+='            				<td><div unselectable="on" id="fontsize1" class="SVisdropdown1" style="font-family:arial;font-size:11px;color:#000000;">2</div></td>';
		word_edit_insert+='            				<td><div unselectable="on" id="fontsize2" class="SVisdropdown2"><img src="' + SVisImagePath + 'arrow.gif" width="11" height="16"></div></td>';
		word_edit_insert+='          				</tr>';
		word_edit_insert+='        			</table>';
		word_edit_insert+='					<div id="fontsize3" class="SVisdropdown7" style="position:absolute;display:none;">';
		word_edit_insert+='						<div unselectable="on" id="fontface" style="font-family:arial;color:#000000;font-size:7px;padding:5px;">1</div>';
		word_edit_insert+='						<div unselectable="on" id="fontface" style="font-family:arial;color:#000000;font-size:10px;padding:5px;">2</div>';
		word_edit_insert+='						<div unselectable="on" id="fontface" style="font-family:arial;color:#000000;font-size:12px;padding:5px;">3</div>';
		word_edit_insert+='						<div unselectable="on" id="fontface" style="font-family:arial;color:#000000;font-size:13px;padding:5px;">4</div>';
		word_edit_insert+='						<div unselectable="on" id="fontface" style="font-family:arial;color:#000000;font-size:17px;padding:5px;">5</div>';
		word_edit_insert+='						<div unselectable="on" id="fontface" style="font-family:arial;color:#000000;font-size:23px;padding:5px;">6</div>';
		word_edit_insert+='						<div unselectable="on" id="fontface" style="font-family:arial;color:#000000;font-size:35px;padding:5px;">7</div>';
		word_edit_insert+='					</div>';
		word_edit_insert+='        		</td>';
		word_edit_insert+='        		<td class="SVisbg"><img src="' + SVisImagePath + 'blank.gif"></td>';
		word_edit_insert+='        		<td class="SVisbg" id="SVisfontcolor" title="Font Color">';
		
		//// COLORE FONT
		word_edit_insert+='        			<table style="width:35px;" border="0" cellspacing="0" cellpadding="0">';
		word_edit_insert+='        				<tr>';
		if (!document.all || window.opera){
			word_edit_insert+='        				<td><div unselectable="on" id="fontcolor1" align="center" class="SVisdropdown5" style="padding-bottom:1px;"><img src="' + SVisImagePath + 'fontcolor.gif"><br><img id="fontcolor4" src="' + SVisImagePath + 'fontcolor2.gif" style="background-color:#FF0000;"></div></td>';
			word_edit_insert+='        				<td><div unselectable="on" align="center" id="fontcolor2" class="SVisdropdown8"><img src="' + SVisImagePath + 'arrow.gif" height="16"></div></td>';
		} else {
			word_edit_insert+='        				<td><div unselectable="on" id="fontcolor1" align="center" class="SVisdropdown5" style="padding-bottom:1px;"><img src="' + SVisImagePath + 'fontcolor.gif"><br><img id="fontcolor4" src="' + SVisImagePath + 'fontcolor2.gif" style="background-color:#FF0000;"></div></td>';
			word_edit_insert+='        				<td><div unselectable="on" align="center" id="fontcolor2" class="SVisdropdown8"><img src="' + SVisImagePath + 'arrow.gif" height="16"></div></td>';
		};
		word_edit_insert+='        				</tr>';
		word_edit_insert+='        			</table>';
		
		word_edit_insert+='					<div unselectable="on" id="fontcolor3" class="SVisdropdown7" style="position:absolute;display:none;padding:4px;border:1px solid #002D96;">';
		
		word_edit_insert+='						<table border="0" cellspacing="1" cellpadding="0">';
		word_edit_insert+='							<tr>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_1+';" onClick="SVisColorClick(\''+SVcolor_1+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_2+';" onClick="SVisColorClick(\''+SVcolor_2+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_3+';" onClick="SVisColorClick(\''+SVcolor_3+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_4+';" onClick="SVisColorClick(\''+SVcolor_4+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_5+';" onClick="SVisColorClick(\''+SVcolor_5+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_6+';" onClick="SVisColorClick(\''+SVcolor_6+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_7+';" onClick="SVisColorClick(\''+SVcolor_7+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_8+';" onClick="SVisColorClick(\''+SVcolor_8+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_9+';" onClick="SVisColorClick(\''+SVcolor_9+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_10+';" onClick="SVisColorClick(\''+SVcolor_10+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_11+';" onClick="SVisColorClick(\''+SVcolor_11+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_12+';" onClick="SVisColorClick(\''+SVcolor_12+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_13+';" onClick="SVisColorClick(\''+SVcolor_13+'\');"></div></td>';
		word_edit_insert+='							</tr>';
		word_edit_insert+='							<tr>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_14+';" onClick="SVisColorClick(\''+SVcolor_14+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_15+';" onClick="SVisColorClick(\''+SVcolor_15+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_16+';" onClick="SVisColorClick(\''+SVcolor_16+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_17+';" onClick="SVisColorClick(\''+SVcolor_17+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_18+';" onClick="SVisColorClick(\''+SVcolor_18+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_19+';" onClick="SVisColorClick(\''+SVcolor_19+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_20+';" onClick="SVisColorClick(\''+SVcolor_20+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_21+';" onClick="SVisColorClick(\''+SVcolor_21+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_22+';" onClick="SVisColorClick(\''+SVcolor_22+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_23+';" onClick="SVisColorClick(\''+SVcolor_23+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_24+';" onClick="SVisColorClick(\''+SVcolor_24+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_25+';" onClick="SVisColorClick(\''+SVcolor_25+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_26+';" onClick="SVisColorClick(\''+SVcolor_26+'\');"></div></td>';
		word_edit_insert+='							</tr>';
		word_edit_insert+='							<tr>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_27+';" onClick="SVisColorClick(\''+SVcolor_27+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_28+';" onClick="SVisColorClick(\''+SVcolor_28+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_29+';" onClick="SVisColorClick(\''+SVcolor_29+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_30+';" onClick="SVisColorClick(\''+SVcolor_30+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_31+';" onClick="SVisColorClick(\''+SVcolor_31+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_32+';" onClick="SVisColorClick(\''+SVcolor_32+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_33+';" onClick="SVisColorClick(\''+SVcolor_33+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_34+';" onClick="SVisColorClick(\''+SVcolor_34+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_35+';" onClick="SVisColorClick(\''+SVcolor_35+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_36+';" onClick="SVisColorClick(\''+SVcolor_36+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_37+';" onClick="SVisColorClick(\''+SVcolor_37+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_38+';" onClick="SVisColorClick(\''+SVcolor_38+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_39+';" onClick="SVisColorClick(\''+SVcolor_39+'\');"></div></td>';
		word_edit_insert+='							</tr>';
		
		word_edit_insert+='							<tr>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_40+';" onClick="SVisColorClick(\''+SVcolor_40+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_41+';" onClick="SVisColorClick(\''+SVcolor_41+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_42+';" onClick="SVisColorClick(\''+SVcolor_42+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_43+';" onClick="SVisColorClick(\''+SVcolor_43+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_44+';" onClick="SVisColorClick(\''+SVcolor_44+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_45+';" onClick="SVisColorClick(\''+SVcolor_45+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_46+';" onClick="SVisColorClick(\''+SVcolor_46+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_47+';" onClick="SVisColorClick(\''+SVcolor_47+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_48+';" onClick="SVisColorClick(\''+SVcolor_48+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_49+';" onClick="SVisColorClick(\''+SVcolor_49+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_50+';" onClick="SVisColorClick(\''+SVcolor_50+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_51+';" onClick="SVisColorClick(\''+SVcolor_51+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_52+';" onClick="SVisColorClick(\''+SVcolor_52+'\');"></div></td>';
		word_edit_insert+='							</tr>';
		
		word_edit_insert+='							<tr>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_53+';" onClick="SVisColorClick(\''+SVcolor_53+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_54+';" onClick="SVisColorClick(\''+SVcolor_54+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_55+';" onClick="SVisColorClick(\''+SVcolor_55+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_56+';" onClick="SVisColorClick(\''+SVcolor_56+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_57+';" onClick="SVisColorClick(\''+SVcolor_57+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_58+';" onClick="SVisColorClick(\''+SVcolor_58+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_59+';" onClick="SVisColorClick(\''+SVcolor_59+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_60+';" onClick="SVisColorClick(\''+SVcolor_60+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_61+';" onClick="SVisColorClick(\''+SVcolor_61+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_62+';" onClick="SVisColorClick(\''+SVcolor_62+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_63+';" onClick="SVisColorClick(\''+SVcolor_63+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_64+';" onClick="SVisColorClick(\''+SVcolor_64+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_65+';" onClick="SVisColorClick(\''+SVcolor_65+'\');"></div></td>';
		word_edit_insert+='							</tr>';
		
		word_edit_insert+='							<tr><td colspan="13" bgcolor="#cccccc" height="1px"></td></tr>';
		word_edit_insert+='							<tr>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_66+';" onClick="SVisColorClick(\''+SVcolor_66+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_67+';" onClick="SVisColorClick(\''+SVcolor_67+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_68+';" onClick="SVisColorClick(\''+SVcolor_68+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_69+';" onClick="SVisColorClick(\''+SVcolor_69+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_70+';" onClick="SVisColorClick(\''+SVcolor_70+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_71+';" onClick="SVisColorClick(\''+SVcolor_71+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_72+';" onClick="SVisColorClick(\''+SVcolor_72+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_73+';" onClick="SVisColorClick(\''+SVcolor_73+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_74+';" onClick="SVisColorClick(\''+SVcolor_74+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_75+';" onClick="SVisColorClick(\''+SVcolor_75+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_76+';" onClick="SVisColorClick(\''+SVcolor_76+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_77+';" onClick="SVisColorClick(\''+SVcolor_77+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_78+';" onClick="SVisColorClick(\''+SVcolor_78+'\');"></div></td>';
		word_edit_insert+='							</tr>';
		word_edit_insert+='							<tr><td colspan="13" bgcolor="#cccccc" height="1px"></td></tr>';
		
		word_edit_insert+='							<tr>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_79+';" onClick="SVisColorClick(\''+SVcolor_79+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_80+';" onClick="SVisColorClick(\''+SVcolor_80+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_81+';" onClick="SVisColorClick(\''+SVcolor_81+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_82+';" onClick="SVisColorClick(\''+SVcolor_82+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_83+';" onClick="SVisColorClick(\''+SVcolor_83+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_84+';" onClick="SVisColorClick(\''+SVcolor_84+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_85+';" onClick="SVisColorClick(\''+SVcolor_85+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_86+';" onClick="SVisColorClick(\''+SVcolor_86+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_87+';" onClick="SVisColorClick(\''+SVcolor_87+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_88+';" onClick="SVisColorClick(\''+SVcolor_88+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_89+';" onClick="SVisColorClick(\''+SVcolor_89+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_90+';" onClick="SVisColorClick(\''+SVcolor_90+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_91+';" onClick="SVisColorClick(\''+SVcolor_91+'\');"></div></td>';
		word_edit_insert+='							</tr>';
		
		word_edit_insert+='							<tr>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_92+';" onClick="SVisColorClick(\''+SVcolor_92+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_93+';" onClick="SVisColorClick(\''+SVcolor_93+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_94+';" onClick="SVisColorClick(\''+SVcolor_94+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_95+';" onClick="SVisColorClick(\''+SVcolor_95+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_96+';" onClick="SVisColorClick(\''+SVcolor_96+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_97+';" onClick="SVisColorClick(\''+SVcolor_97+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_98+';" onClick="SVisColorClick(\''+SVcolor_98+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_99+';" onClick="SVisColorClick(\''+SVcolor_99+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_100+';" onClick="SVisColorClick(\''+SVcolor_100+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_101+';" onClick="SVisColorClick(\''+SVcolor_101+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_102+';" onClick="SVisColorClick(\''+SVcolor_102+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_103+';" onClick="SVisColorClick(\''+SVcolor_103+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_104+';" onClick="SVisColorClick(\''+SVcolor_104+'\');"></div></td>';
		word_edit_insert+='							</tr>';
		
		word_edit_insert+='							<tr>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_105+';" onClick="SVisColorClick(\''+SVcolor_105+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_106+';" onClick="SVisColorClick(\''+SVcolor_106+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_107+';" onClick="SVisColorClick(\''+SVcolor_107+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_108+';" onClick="SVisColorClick(\''+SVcolor_108+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_109+';" onClick="SVisColorClick(\''+SVcolor_109+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_110+';" onClick="SVisColorClick(\''+SVcolor_110+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_111+';" onClick="SVisColorClick(\''+SVcolor_111+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_112+';" onClick="SVisColorClick(\''+SVcolor_112+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_113+';" onClick="SVisColorClick(\''+SVcolor_113+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_114+';" onClick="SVisColorClick(\''+SVcolor_114+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_115+';" onClick="SVisColorClick(\''+SVcolor_115+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_116+';" onClick="SVisColorClick(\''+SVcolor_116+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_117+';" onClick="SVisColorClick(\''+SVcolor_117+'\');"></div></td>';
		word_edit_insert+='							</tr>';
		
		word_edit_insert+='							<tr>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_118+';" onClick="SVisColorClick(\''+SVcolor_118+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_119+';" onClick="SVisColorClick(\''+SVcolor_119+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_120+';" onClick="SVisColorClick(\''+SVcolor_120+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_121+';" onClick="SVisColorClick(\''+SVcolor_121+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_122+';" onClick="SVisColorClick(\''+SVcolor_122+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_123+';" onClick="SVisColorClick(\''+SVcolor_123+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_124+';" onClick="SVisColorClick(\''+SVcolor_124+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_125+';" onClick="SVisColorClick(\''+SVcolor_125+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_126+';" onClick="SVisColorClick(\''+SVcolor_126+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_127+';" onClick="SVisColorClick(\''+SVcolor_127+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_128+';" onClick="SVisColorClick(\''+SVcolor_128+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_129+';" onClick="SVisColorClick(\''+SVcolor_129+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_130+';" onClick="SVisColorClick(\''+SVcolor_130+'\');"></div></td>';
		word_edit_insert+='							</tr>';
		
		word_edit_insert+='							<tr>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_131+';" onClick="SVisColorClick(\''+SVcolor_131+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_132+';" onClick="SVisColorClick(\''+SVcolor_132+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_133+';" onClick="SVisColorClick(\''+SVcolor_133+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_134+';" onClick="SVisColorClick(\''+SVcolor_134+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_135+';" onClick="SVisColorClick(\''+SVcolor_135+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_136+';" onClick="SVisColorClick(\''+SVcolor_136+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_137+';" onClick="SVisColorClick(\''+SVcolor_137+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_138+';" onClick="SVisColorClick(\''+SVcolor_138+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_139+';" onClick="SVisColorClick(\''+SVcolor_139+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_140+';" onClick="SVisColorClick(\''+SVcolor_140+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_141+';" onClick="SVisColorClick(\''+SVcolor_141+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_142+';" onClick="SVisColorClick(\''+SVcolor_142+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_143+';" onClick="SVisColorClick(\''+SVcolor_143+'\');"></div></td>';
		word_edit_insert+='							</tr>';
		
		word_edit_insert+='							<tr>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_144+';" onClick="SVisColorClick(\''+SVcolor_144+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_145+';" onClick="SVisColorClick(\''+SVcolor_145+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_146+';" onClick="SVisColorClick(\''+SVcolor_146+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_147+';" onClick="SVisColorClick(\''+SVcolor_147+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_148+';" onClick="SVisColorClick(\''+SVcolor_148+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_149+';" onClick="SVisColorClick(\''+SVcolor_149+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_150+';" onClick="SVisColorClick(\''+SVcolor_150+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_151+';" onClick="SVisColorClick(\''+SVcolor_151+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_152+';" onClick="SVisColorClick(\''+SVcolor_152+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_153+';" onClick="SVisColorClick(\''+SVcolor_153+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_154+';" onClick="SVisColorClick(\''+SVcolor_154+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_155+';" onClick="SVisColorClick(\''+SVcolor_155+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_156+';" onClick="SVisColorClick(\''+SVcolor_156+'\');"></div></td>';
		word_edit_insert+='							</tr>';
		
		
		
		word_edit_insert+='							<tr>';
		word_edit_insert+='								<td colspan="13">Set colori consigliati</td>'
		word_edit_insert+='							</tr>';
		word_edit_insert+='							<tr>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_157+';" onClick="SVisColorClick(\''+SVcolor_157+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_158+';" onClick="SVisColorClick(\''+SVcolor_158+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_159+';" onClick="SVisColorClick(\''+SVcolor_159+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_160+';" onClick="SVisColorClick(\''+SVcolor_160+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_161+';" onClick="SVisColorClick(\''+SVcolor_161+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_162+';" onClick="SVisColorClick(\''+SVcolor_162+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_163+';" onClick="SVisColorClick(\''+SVcolor_163+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_164+';" onClick="SVisColorClick(\''+SVcolor_164+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_165+';" onClick="SVisColorClick(\''+SVcolor_165+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_166+';" onClick="SVisColorClick(\''+SVcolor_166+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_167+';" onClick="SVisColorClick(\''+SVcolor_167+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_168+';" onClick="SVisColorClick(\''+SVcolor_168+'\');"></div></td>';
		word_edit_insert+='								<td><div unselectable="on" id="fontcolor" class="SVisdropdown13"><img src="' + SVisImagePath + 'fontcolor3.gif" style="background-color:'+SVcolor_169+';" onClick="SVisColorClick(\''+SVcolor_169+'\');"></div></td>';
		word_edit_insert+='							</tr>';
		word_edit_insert+='						</table>';
		
		
		word_edit_insert+='					</div>';
		word_edit_insert+=' 			     </td>';
		word_edit_insert+='        		 <td class="SVisbg" id="SVissep2"><img src="' + SVisImagePath + 'seperator.gif"></td>';
 		
		//// GRASSETTO
		word_edit_insert+='        		<td class="SVisbg" title="Grassetto"><div unselectable="on" id="bold" class="SVisbtn1"><img src="' + SVisImagePath + 'bold.gif"></div></td>';
		
		//// ITALICO
		 word_edit_insert+='        		<td class="SVisbg" title="Italico"><div unselectable="on" id="italic" class="SVisbtn1"><img src="' + SVisImagePath + 'italic.gif"></div></td>';
		 
		 //// SOTTOLINEATO
		 word_edit_insert+='        		<td class="SVisbg" title="Sottolineato"><div unselectable="on" id="underline" class="SVisbtn1"><img src="' + SVisImagePath + 'underline.gif"></div></td>';
		 
		 //// BARRATO
		 word_edit_insert+='        		<td class="SVisbg" title="Barrato"><div unselectable="on" id="strikethrough" class="SVisbtn1"><img src="' + SVisImagePath + 'strikethrough.gif"></div></td>';
		 
		 word_edit_insert+='        		<td class="SVisbg" id="SVissep3"><img src="' + SVisImagePath + 'seperator.gif"></td>';
		 
		 //// ALLINEA SINISTRA
		 word_edit_insert+='        		<td class="SVisbg" title="Allineamento Sinistra"><div unselectable="on" id="justifyleft" class="SVisbtn1"><img src="' + SVisImagePath + 'leftalign.gif" width="21" height="20"></div></td>';
		 
		 //// CENTRATO
		 word_edit_insert+='        		<td class="SVisbg" title="Centrato"><div unselectable="on" id="justifycenter" class="SVisbtn1"><img src="' + SVisImagePath + 'centeralign.gif"></div></td>';
		 
		 //// ALLINEA DESTRA
		 word_edit_insert+='     		   	<td class="SVisbg" title="Allineamento Destra"><div unselectable="on" id="justifyright" class="SVisbtn1"><img src="' + SVisImagePath + 'rightalign.gif"></div></td>';
		 
		 //// GIUSTIFICATO
		 word_edit_insert+='        		<td class="SVisbg" title="Giustificato"><div unselectable="on" id="justifyfull" class="SVisbtn1"><img src="' + SVisImagePath + 'fullalign.gif"></div></td>';
		 
		 //// LINEA ORIZZONTALE
		 word_edit_insert+='       		 <td class="SVisbg" title="Linea Orizzontale"><div unselectable="on" id="inserthorizontalrule" class="SVisbtn1"><img src="' + SVisImagePath + 'hr.gif"></div></td>';
		 
		 word_edit_insert+='        		<td class="SVisbg" id="SVissep4"><img src="' + SVisImagePath + 'seperator.gif"></td>';
		 
		 //// APICE
		 word_edit_insert+='        		<td class="SVisbg" title="Apice"><div unselectable="on" id="superscript" class="SVisbtn1"><img src="' + SVisImagePath + 'superscript.gif"></div></td>';
		 
		 //// PEDICE
		 word_edit_insert+=' 		       <td class="SVisbg" title="Pedice"><div unselectable="on" id="subscript" class="SVisbtn1"><img src="' + SVisImagePath + 'subscript.gif"></div></td>';
		 
		 //word_edit_insert+='       		<td width="14"><img src="' + SVisImagePath + 'finish.gif" width="14" height="25"></td>';
		 word_edit_insert+='				<td width="100%"></td>';
		 word_edit_insert+='      		</tr>';
		 word_edit_insert+='    </table>';
		 word_edit_insert+='  </td>';
		 word_edit_insert+='</tr>';
		 word_edit_insert+='<tr>';
		 word_edit_insert+='  <td>';
		
		 //// SECONDA TABELLA
		 word_edit_insert+='		<table class="SVisbg" cellpadding="0" cellspacing="0" id="tb2" onmousedown="return false;">';
		 word_edit_insert+='      		<tr>';
		// word_edit_insert+='        		<td width="7"><img src="' + SVisImagePath + 'start.gif" width="7" height="25" ></td>';
		 word_edit_insert+='        		<td class="SVisbg"><img src="' + SVisImagePath + 'blank.gif"></td>';
		 
		 //// LINK
		 word_edit_insert+='        		<td class="SVisbg"><div unselectable="on" id="createlink" class="SVisbtn1" title="Inserisci Link"><a  href="javascript:SVisBtnCreateLink();" style="cursor:default;"><img src="' + SVisImagePath + 'insertlink.gif" border="0"></a></div>';
		
		 word_edit_insert+='				<div unselectable="on"  style="display:none;" id="editlink" class="SVisbtn1" title="Modifica Link"><a href="javascript:SVisBtnEditLink();" style="cursor:default;"><img src="' + SVisImagePath + 'insertlink.gif"border="0"></a></div></td>';
		
		//// CANCELLA LINK
		 word_edit_insert+='        <td class="SVisbg" title="Rimuovi Link"><div unselectable="on" id="unlink" class="SVisbtn1"><img src="' + SVisImagePath + 'unlink.gif"></div></td>';
		 
		 word_edit_insert+='        <td class="SVisbg" id="SVissep5"><img src="' + SVisImagePath + 'seperator.gif"></td>';

		 //// INSERISCI IMMAGINE
		 word_edit_insert+='        <td class="SVisbg" title="Inserisci Immagine"><div unselectable="on" id="insertimage" class="SVisbtn1"><a href="javascript:SVisBtnInsertImage2();" style="cursor:default;"><img src="' + SVisImagePath + 'insertimage.gif" border="0"></a></div>';
		
		word_edit_insert+='<div unselectable="on"  style="display:none;" id="editimg" class="SVisbtn1" title="Modifica Immagine"><a href="javascript:SVisBtnEditImg2();" style="cursor:default;"><img src="' + SVisImagePath + 'insertimage.gif"border="0"></a></div></td>';
		
		//// INSERISCI PDF
		 word_edit_insert+='        <td class="SVisbg" title="Inserisci Pdf"><div unselectable="on" id="insertpdf" class="SVisbtn1"><a href="javascript:SVisBtnInsertPdf();" style="cursor:default;"><img src="' + SVisImagePath + 'insertpdf.gif" border="0"></a></div>';
		
		word_edit_insert+='<div unselectable="on"  style="display:none;" id="editpdf" class="SVisbtn1" title="Modifica Pdf"><a href="javascript:SVisBtnEditPdf();" style="cursor:default;"><img src="' + SVisImagePath + 'insertpdf.gif"border="0"></a></div></td>';
		
		//// INSERISCI TXT
		word_edit_insert+='        <td class="SVisbg" title="Inserisci Testo"><div unselectable="on" id="inserttxt" class="SVisbtn1"><a href="javascript:SVisBtnInsertTxt2();" style="cursor:default;"><img src="' + SVisImagePath + 'insertword.gif" border="0"></a></div>';
		
		word_edit_insert+='		  <div unselectable="on"  style="display:none;" id="edittxt" class="SVisbtn1" title="Modifica Testo"><a href="javascript:SVisBtnEditTxt2();" style="cursor:default;"><img src="' + SVisImagePath + 'insertword.gif"border="0"></a></div></td>';
		
		//// INSERISCI YOUTUBE
		 word_edit_insert+='        <td class="SVisbg" title="Inserisci Filmato YouTube"><div unselectable="on" id="insertTube" class="SVisbtn1"><a href="javascript:SVisBtnInsertTube();" style="cursor:default;"><img src="' + SVisImagePath + 'yutube.gif" border="0"></a></div>';
		
		word_edit_insert+='<div unselectable="on"  style="display:none;" id="edittube" class="SVisbtn1" title="Inserisci Link you tube"><a href="javascript:SVisBtnEditTube();" style="cursor:default;"><img src="' + SVisImagePath + 'yutube.gif"border="0"></a></div></td>';
		
		 //// RIMUOVI FORMATTAZIONE
		 word_edit_insert+='        <td class="SVisbg" title="Rimuovi Formattazione"><div unselectable="on" id="RemoveFormat" class="SVisbtn1"><img src="' + SVisImagePath + 'format.gif"></div></td>';
		 
		 word_edit_insert+='        <td class="SVisbg" id="SVissep6"><img src="' + SVisImagePath + 'seperator.gif"></td>';
		 
		 /////  QUANDO L'OGGETTO E' SELEZIONATO
		 //// INSERISCI TABELLA
		 word_edit_insert+='        <td class="SVisbg" id="tables">';
		 word_edit_insert+='		<table border="0" width="0" cellspacing="0" cellpadding="0" id="table_options_on" style="display:none;">';
		 word_edit_insert+='		<tr>';
		 word_edit_insert+='        <td><div unselectable="on" id="inserttable" class="SVisbtn1" title="Inserisci Tabella"><a href="javascript:SVisBtnInsertTable();" style="cursor:default;"><img src="' + SVisImagePath + 'inserttable.gif" border="0"></a></div><div unselectable="on" id="edittable" class="SVisbtn1" title="Modifica Proprietà Tabella"><a href="javascript:SVisBtnEditTable();" style="cursor:default;"><img src="' + SVisImagePath + 'inserttable.gif" border="0"></a></div></td>';
		 
		 //// INSERISCI COLONNA A SINISTRA
		 word_edit_insert+='        <td><div unselectable="on" id="insertcolumnleft" class="SVisbtn1" title="Inserisci Colonna a Sinistra"><img src="' + SVisImagePath + 'insertcolumnleft.gif" onClick="SVisBtnInsertTableColumnBefore();"></div></td>';
		 
		 //// INSERISCI COLONNA A DESTRA
		 word_edit_insert+='        <td><div unselectable="on" id="insertcolumnright" class="SVisbtn1" title="Inserisci Colonna a Destra"><img src="' + SVisImagePath + 'insertcolumnright.gif" onClick="SVisBtnInsertTableColumnAfter();"></div></td>';
		 
		 //// INSERISCI RIGA IN BASSO
		 word_edit_insert+='        <td><div unselectable="on" id="insertrowabove" class="SVisbtn1" title="Inserisci Riga in Alto"><img src="' + SVisImagePath + 'insertrowabove.gif" onClick="SVisBtnInsertTableRowBefore();"></div></td>';
		 
		 //// INSERISCI RIGA IN ALTO
		 word_edit_insert+='        <td><div unselectable="on" id="insertrowbelow" class="SVisbtn1" title="Inserisci Riga in Basso"><img src="' + SVisImagePath + 'insertrowbelow.gif" onClick="SVisBtnInsertTableRowAfter();"></div></td>';
		 
		 //// CANCELLA COLONNA
		 word_edit_insert+='        <td><div unselectable="on" id="deletecolumn" class="SVisbtn1" title="Cancella la Colonna"><img src="' + SVisImagePath + 'deletecolumn.gif" onClick="SVisBtnDeleteTableColumn();"></div></td>';
		 
		 //// CANCELLA RIGA
		 word_edit_insert+='        <td><div unselectable="on" id="deleterow" class="SVisbtn1" title="Cancella la Riga"><img src="' + SVisImagePath + 'deleterow.gif" onClick="SVisBtnDeleteTableRow();"></div></td>';
		 
		 word_edit_insert+='        </tr>';
		 word_edit_insert+='		</table>';
		 word_edit_insert+='		<table class="SVisbg" border="0" width="0" cellspacing="0" cellpadding="0" id="table_options_off">';
		 word_edit_insert+='		<tr>';
		 ////////////////////////////////////// ELEMENTO DI BASE
		 //// INSERISCI TABELLA
		 word_edit_insert+='        <td><div unselectable="on" id="inserttable" class="SVisbtn1" title="Inserisci tabella"><a href="javascript:SVisBtnInsertTable();" style="cursor:default;"><img src="' + SVisImagePath + 'inserttable.gif" border="0"></div></a></td>';
		 
		 //// INSERISCI COLONNA A SINISTRA
		 word_edit_insert+='        <td><div unselectable="on" class="SVisbtn5" title="Inserisci Colonna a Sinistra"><img src="' + SVisImagePath + 'insertcolumnleftgrey.gif"></div></td>';
		 
		 //// INSERISCI COLONNA A DESTRA
		 word_edit_insert+='        <td><div unselectable="on" class="SVisbtn5" title="Inserisci Colonna a Destra"><img src="' + SVisImagePath + 'insertcolumnrightgrey.gif"></div></td>';
		 
		 //// INSERISCI RIGA IN BASSO
		 word_edit_insert+='        <td><div unselectable="on" class="SVisbtn5" title="Inserisci Riga in Alto"><img src="' + SVisImagePath + 'insertrowabovegrey.gif"></div></td>';
		 
		 //// INSERISCI RIGA IN ALTO
		 word_edit_insert+='        <td><div unselectable="on" class="SVisbtn5" title="Inserisci Riga in Basso"><img src="' + SVisImagePath + 'insertrowbelowgrey.gif"></div></td>';
		 
		 //// CANCELLA COLONNA
		 word_edit_insert+='        <td><div unselectable="on" class="SVisbtn5" title="Cancella la Colonna"><img src="' + SVisImagePath + 'deletecolumngrey.gif"></div></td>';
		 		 
		 
		 //// CANCELLA RIGA
		 word_edit_insert+='        <td><div unselectable="on" class="SVisbtn5" title="Cancella la Riga"><img src="' + SVisImagePath + 'deleterowgrey.gif"></div></td>';
		 word_edit_insert+='        </tr>';
		 word_edit_insert+='		</table>';
		 word_edit_insert+='		</td>';
		 word_edit_insert+='        <td class="SVisbg" id="SVissep7"><img src="' + SVisImagePath + 'seperator.gif"></td>';
		 
		 //// LISTA NUMERICA
		 word_edit_insert+='        <td class="SVisbg" title="Lista Numerata"><div unselectable="on" id="insertorderedlist" class="SVisbtn1"><img src="' + SVisImagePath + 'orderedlist.gif"></div></td>';
		 
		 //// LISTA A PUNTI
		 word_edit_insert+='        <td class="SVisbg" title="Lista Puntata"><div unselectable="on" id="insertunorderedlist" class="SVisbtn1"><img src="' + SVisImagePath + 'unorderedlist.gif"></div></td>';
		 
		 //// DIMINUISCI RIENTRO
		 word_edit_insert+='        <td class="SVisbg" title="Diminuisci Rientro"><div unselectable="on" id="outdent" class="SVisbtn1"><img src="' + SVisImagePath + 'decreaseindent.gif"></div></td>';
		 
		 //// AUMENTA RIENTRO
		 word_edit_insert+='        <td class="SVisbg" title="Aumenta Rientro"><div unselectable="on" id="indent" class="SVisbtn1"><img src="' + SVisImagePath + 'increaseindent.gif"></div></td>';
		 
		 ///// TAGLIA - COPIA - INCOLLA
		 word_edit_insert+='		<td class="SVisbg" id="cutcopypaste">';
		 word_edit_insert+='		<table class="SVisbg" border="0" width="0" cellspacing="0" cellpadding="0">';
		 word_edit_insert+='		<tr>';
		 if (!document.all || window.opera){
			 word_edit_insert+='        <td title="Taglia"><div unselectable="on" class="SVisbtn5"><img src="' + SVisImagePath + 'cutgrey.gif"></div></td>'; 
			 word_edit_insert+='        <td title="Copia"><div unselectable="on" class="SVisbtn5"><img src="' + SVisImagePath + 'copygrey.gif"></div></td>'; 
			 word_edit_insert+='        <td title="Incolla"><div unselectable="on" class="SVisbtn5"><img src="' + SVisImagePath + 'pastegrey.gif"></div></td>';
		} else {
			word_edit_insert+='        <td title="Taglia"><div unselectable="on" id="cut" class="SVisbtn1"><img src="' + SVisImagePath + 'cut.gif"></div></td>'; 	
			word_edit_insert+='        <td title="Copia"><div unselectable="on" id="copy" class="SVisbtn1"><img src="' + SVisImagePath + 'copy.gif"></div></td>';
			word_edit_insert+='        <td title="Incolla"><div unselectable="on" id="paste" class="SVisbtn1"><img src="' + SVisImagePath + 'paste.gif"></div></td>';
		};
		word_edit_insert+='		</tr>';
		 word_edit_insert+='		</table>';
		 
		 word_edit_insert+='		</td>';
		 word_edit_insert+='							<td class="SVisbg" width="100%"></td>';
		 //word_edit_insert+='        <td width="14"><img src="' + SVisImagePath + 'finish.gif" width="14" height="25" ></td>');
		 
		 word_edit_insert+='      </tr>';
		 word_edit_insert+='    </table></td>';
		 word_edit_insert+='  </tr>';
		 word_edit_insert+='  <tr>';
		 word_edit_insert+='    <td>';
		 
		 //////////////////////////////////////////////
		 ///// ULTIMA TABELLA
		 
		 word_edit_insert+='	<table class="SVisbg" cellpadding="0" cellspacing="0" id="tb3" onmousedown="return false;">';
		 word_edit_insert+='      <tr>';
		// word_edit_insert+='        <td width="7"><img src="' + SVisImagePath + 'start.gif" width="7" height="25" ></td>';
		 
		 
		//// INSERIMENTO FORM
		 word_edit_insert+='        <td class="SVisbg" title="Form"><div unselectable="on" id="insertform" class="SVisbtn1"><a href="javascript:SVisBtnInsertForm();" style="cursor:default;"><img src="' + SVisImagePath + 'form.gif" border="0"></a></div></td>';
		 
		 //// INSERIMENTO check box
		 word_edit_insert+='        <td class="SVisbg" title="Casella di Controllo"><div unselectable="on" id="form_checkbox" class="SVisbtn1"><a href="javascript:SVisBtnInsertCheckbox();" style="cursor:default;"><img src="' + SVisImagePath + 'checkbox.gif" border="0"></a></div></td>';
		 
		 //// INSERIMENTO RADIO BUTTON
		 word_edit_insert+='        <td class="SVisbg" title="Pulsante di Scelta"><div unselectable="on" id="form_radio" class="SVisbtn1"><a href="javascript:SVisBtnInsertRadio();" style="cursor:default;"><img src="' + SVisImagePath + 'radio.gif" border="0"></a></div></td>';
		 
		 //// INSERIMENTO TEXT AREA
		 word_edit_insert+='        <td class="SVisbg" title="Area di Testo"><div unselectable="on" id="form_textarea" class="SVisbtn1"><a href="javascript:SVisBtnInsertTextArea();" style="cursor:default;"><img src="' + SVisImagePath + 'textarea.gif" border="0"></a></div></td>';
		 
		 //// BOTTONE DI INVIO
		 word_edit_insert+='        <td class="SVisbg" title="Bottone di Invio"><div unselectable="on" id="form_submit" class="SVisbtn1"><a href="javascript:SVisBtnInsertSubmit();" style="cursor:default;"><img src="' + SVisImagePath + 'submit.gif" border="0"></a></div></td>';
		 
		 //// IMMAGINE BOTTONE
		 word_edit_insert+='        <td class="SVisbg" title="Immagine Bottone"><div unselectable="on" id="form_image_submit" class="SVisbtn1"><a href="javascript:SVisBtnInsertImageSubmit();" style="cursor:default;"><img src="' + SVisImagePath + 'imagesubmit.gif" border="0"></a></div></td>';
		 
		 ///// RESTTA BOTTONE
		 word_edit_insert+='        <td class="SVisbg" title="Bottone Resetta"><div unselectable="on" id="form_reset" class="SVisbtn1"><a href="javascript:SVisBtnInsertReset();" style="cursor:default;"><img src="' + SVisImagePath + 'reset.gif" border="0"></a></div></td>';
		 
		//// VALORE INVISIBILE  
		 word_edit_insert+='        <td class="SVisbg" title="Valore invisibile"><div unselectable="on" id="form_hidden" class="SVisbtn1"><a href="javascript:SVisBtnInsertHidden();" style="cursor:default;"><img src="' + SVisImagePath + 'hidden.gif" border="0"></a></div></td>';
		 
		//// CAMPO PASSWORD
		 word_edit_insert+='        <td class="SVisbg" title="Campo Password"><div unselectable="on" id="form_password" class="SVisbtn1"><a href="javascript:SVisBtnInsertPassword();" style="cursor:default;"><img src="' + SVisImagePath + 'password.gif" border="0"></a></div></td>';
		 
		 //// TESTO VALORE
		 word_edit_insert+='        <td class="SVisbg" title="Testo Valore"><div unselectable="on" id="form_textfield" class="SVisbtn1"><a href="javascript:SVisBtnInsertText();" style="cursor:default;"><img src="' + SVisImagePath + 'textfield.gif" border="0"></a></div></td>';
		 word_edit_insert+='        <td class="SVisbg" id="SVissep10"><img src="' + SVisImagePath + 'seperator.gif"></td>';
		 
		 //// STAMPA PAGIANA
		 word_edit_insert+='        <td class="SVisbg" title="Stampa pagina"><div unselectable="on" id="printSVis" class="SVisbtn1"><img src="' + SVisImagePath + 'print.gif" onClick="SVisBtnPrint();"></div></td>';
		 
		 //// SELEZIONA TUTTO
		 word_edit_insert+='        <td class="SVisbg" title="Seleziona Tutto"><div unselectable="on" id="selectall" class="SVisbtn1"><img src="' + SVisImagePath + 'selectall.gif"></div></td>';
		 
		 //// CONTOLLO ORTOGRAFICO
		 if (!document.all || window.opera) {
			 word_edit_insert+='        <td  class="SVisbg" title="Controllo Ortografico"><div unselectable="on" id="spellcheck" class="SVisbtn1"><a href="javascript:SVisSpellCheck();" style="cursor:default;"><img src="' + SVisImagePath + 'spellcheck.gif"></a></div></td>';
		} else {
			word_edit_insert+='        <td class="SVisbg" title="Controllo Ortografico"><div unselectable="on" id="spellcheck" class="SVisbtn1"><a href="javascript:SVisSpellCheck();" style="cursor:default;"><img src="' + SVisImagePath + 'spellcheck.gif"></a></div></td>';
		};
		
		word_edit_insert+='        <td class="SVisbg" id="SVissep11"><img src="' + SVisImagePath + 'seperator.gif"></td>';
		
		///// ? ABOUT ?
		word_edit_insert+='        <td class="SVisbg" title="Versione Editor Studio Visiva"></td>';
		 
      	 word_edit_insert+='        <td class="SVisbg" id="SVissep11"><img src="' + SVisImagePath + 'seperator.gif"></td>';
		 word_edit_insert+='							<td class="SVisbg" width="100%"></td>';
		 //word_edit_insert+='        <td width="14"><img src="' + SVisImagePath + 'finish.gif" width="14" height="25" ></td>');
		 word_edit_insert+='	  </tr>';
		 word_edit_insert+='    </table>';
		 word_edit_insert+='    </td>';
		 word_edit_insert+='  </tr>';
		
		 word_edit_insert+='			<tr>';
		 word_edit_insert+='				<td>';
		 word_edit_insert+='					<table class="SVisbg" width="570px" cellspacing="0" cellpadding="0" border="0">';
		 word_edit_insert+='						<tr>';
		 
		 
		// word_edit_insert+='							<td ><div unselectable="on"><img src="' + SVisImagePath + 'start.gif"></div></td>');
		 
		 //// DESIGN MODE
		 if (SVisDesignMode) {
			 word_edit_insert+='							<td id="Design" class="SVisbg" title="Modalità Disegno"><div unselectable="on" class="SVisbtn9" id="SVis_design_mode" onclick="SVisModeType(\'SVis_design_mode\');"><img src="' + SVisImagePath + 'design.gif">&nbsp;Design</div></td>';
		} else {
			word_edit_insert+='							<td id="Design" class="SVisbg" title="Modalità Disegno"><div  style="visibility:hidden;" unselectable="on" class="SVisbtn9" id="SVis_design_mode"><img src="' + SVisImagePath + 'design.gif">&nbsp;Design</div></td>';
		};
		
		//word_edit_insert+='        <td class="SVisbg" id="SVissep11"><img src="' + SVisImagePath + 'seperator.gif"></td>');
		
		//// MODALITA' CODICE
		if (SVisCodeMode) {
			word_edit_insert+='							<td id="Design" class="SVisbg" title="Modalità Codice"><div unselectable="on" class="SVisbtn6" id="SVis_code_mode" onclick="SVisModeType(\'SVis_code_mode\');"><img src="' + SVisImagePath + 'code.gif">&nbsp;Codice</div></td>';
		} else {
			word_edit_insert+='							<td id="Design" class="SVisbg" title="Modalità Codice"><div style="visibility:hidden;" unselectable="on" class="SVisbtn6" id="SVis_code_mode"><img src="' + SVisImagePath + 'code.gif">&nbsp;Codice</div></td>';
		};
		
		//word_edit_insert+='        <td class="SVisbg" id="SVissep11"><img src="' + SVisImagePath + 'seperator.gif"></td>');
		
		//// MODALITA' PREVIEW
		if (SVisPreviewMode) { 
			word_edit_insert+='							<td id="Design" class="SVisbg" title="Modalità Anteprima"><div unselectable="on" class="SVisbtn6" id="SVis_preview_mode" onclick="SVisModeType(\'SVis_preview_mode\');"><img src="' + SVisImagePath + 'preview.gif">&nbsp;Anteprima</div></td>';
		} else {
			word_edit_insert+='							<td id="Design" class="SVisbg" title="Modalità Anteprima"><div  style="visibility:hidden;"unselectable="on" class="SVisbtn6" id="SVis_preview_mode"><img src="' + SVisImagePath + 'preview.gif">&nbsp;Anteprima</div></td>';
		};
		
		
		word_edit_insert+='        <td class="SVisbg" id="SVissep11"><img src="' + SVisImagePath + 'seperator.gif"></td>';
		
		word_edit_insert+='							<td class="SVisbg" width="100%"></td>';
		word_edit_insert+='        <td class="SVisbg" id="SVissep11"><img src="' + SVisImagePath + 'seperator.gif"></td>';
		
		
		word_edit_insert+='        <td class="SVisbg" id="SVissep11"><img src="' + SVisImagePath + 'seperator.gif"></td>';
		
		if(set_open_close ==""){
		///// ? ABOUT ?
		word_edit_insert+='        <td class="SVisbg" title="Versione Editor Studio Visiva"><div unselectable="on" id="aboutSVis" class="SVisbtn1"><a href="javascript:SVisAbout();" style="cursor:default;"><img src="' + SVisImagePath + 'about.gif" border="0"></a></div></td>';
		}
		 
      	 word_edit_insert+='        <td class="SVisbg" id="SVissep11"><img src="' + SVisImagePath + 'seperator.gif"></td>';
		
		if(set_open_close ==""){
		//// Salva
		word_edit_insert+='							<td id="Design" class="SVisbg" title="Chiudi"><div unselectable="on" class="SVisbtn6" id="SVis_Salva" onclick="SVisModeType(\'SVis_Chiudi\',\''+sett_config+'\',\''+classe+'\');"><img src="' + SVisImagePath + 'Chiudi.gif">&nbsp;Chiudi</div></td>';
		}//// Salva
		word_edit_insert+='							<td id="Design" class="SVisbg" title="Salva"><div unselectable="on" class="SVisbtn6" id="SVis_Salva" onclick="SVisModeType(\'SVis_Salva\',\''+sett_config+'\',\''+classe+'\');"><img src="' + SVisImagePath + 'salva.gif">&nbsp;Salva</div></td>';
		
		
		//word_edit_insert+='							<td ><div unselectable="on"><img src="' + SVisImagePath + 'finish.gif"></div></td>');
		word_edit_insert+='							</div></td>';
		word_edit_insert+='						</tr>';
		word_edit_insert+='					</table>';
		word_edit_insert+='				</td>';
		word_edit_insert+='			</tr>';
		 
		 word_edit_insert+='</table>';
		
		word_edit_insert+='</td></tr></table>';
		
		
		
		word_edit_insert+='</td>';
		word_edit_insert+='<td background="include_app/visivamod/images/popup_15.gif">&nbsp;</td>';
		word_edit_insert+='</tr><tr>';
		word_edit_insert+='<td width="15" height="15"><img src="include_app/visivamod/images/popup_16.gif" width="15" height="15" /></td>';
		word_edit_insert+='<td background="include_app/visivamod/images/popup_17.gif"></td>';
		word_edit_insert+='<td width="15" height="15"><img src="include_app/visivamod/images/popup_18.gif" width="15" height="15" /></td>';
		word_edit_insert+='</tr></table>';
		
		word_edit_insert+='</div>';
		
		//// IFRAME PER VISUALIZZAZIONE
		var word_edit_insert_set = "";
		
		if(staticMod){
			word_edit_insert_set+='		<iframe  name="' + SVisName + '" id="'+ SVisName +'" style="position:relative; width:'+VSwidth+'; height:' + SVHeight + '; background-color: transparent;" frameBorder="1" ALLOWTRANSPARENCY="true" scrolling="auto" ></iframe>';
		}else{
			word_edit_insert_set+='		<iframe  name="' + SVisName + '" id="'+ SVisName +'" style="position:relative; width:'+VSwidth+'; height:' + SVHeight + '; background-color: transparent;" frameBorder="0" ALLOWTRANSPARENCY="true" scrolling="no" ></iframe>';
		}
		word_edit_insert_set+='		<textarea name="' + SVisFormName + '" id="' + SVisFormName + '" style="display:none;width:'+VSwidth+'; height:' + SVHeight + '; background-color:#FFFFFF; font-family:courier new; font-size:12px; color:#000000; border:1px; "></textarea>';
		word_edit_insert_set+='<div id="preview_' + SVisName + '" style="width:'+VSwidth+';clear:both;" ></div><div class="clear"></div>';
		
		if(document.getElementById("stylvword")){
			if(!(document.getElementById("stylvword").disabled)){
				document.getElementById("stylvword").disabled = "true";
			}else{
				document.getElementById("stylvword").disabled = "";
			};
		}else{
			document.body.innerHTML +=  word_edit_insert_style;
		};
		
		
		document.getElementById("Word-"+Att).innerHTML = word_edit_insert_set;
		
		if(staticMod){
			document.getElementById("Word-"+Att+"-static").innerHTML = word_edit_insert;
			document.getElementById(SVisName).scrolling = "auto"
		}else{
			document.getElementById("Word-"+Att).innerHTML += word_edit_insert;	
		}
		
		
		
		document.getElementById(SVisName).contentWindow.focus();
		menuBuilder();
		
		
		startSVis(SVisPreloadContent,id01,SVisName,SVisFormName,classe);
		
		if(staticMod){}else{
			var theHandle = document.getElementById("handle");
			var theRoot   = document.getElementById("root");
			Drag.init(theHandle, theRoot);
		}
	};
		//autoResizeWord(SVisName,SVisFormName);
		resize_word();
};
