
var cont_foot
var email_foot
var div_now

function WordOpen(Att,sett_config,classe){
	
	setVarEdit(sett_config)
	
	div_now = ""
	//alert(Att)
	
	if(set_open_close != ""){
		var error_str = "Devi prima Salvare o Annullare l'operazione di modifica precedente"
		SVopenWin('include_App/varie/error_str.asp?erro='+error_str,320,205,false,true);
	}else{
	
		//document.getElementById("WordCont-"+Att).className = "wordmod_open";
		document.getElementById("MenuCont-"+Att).className = "";
		document.getElementById("MenuCont-"+Att).style.position = "relative"
		document.getElementById("WordCmd-"+Att).className = "menumod_open";
		document.getElementById("WordCmd-"+Att).innerHTML = '';
		
		document.getElementById("selectionSet"+Att+"1").style.background="#ffffff url('include_app/include_img/Jcrop.gif')"
		document.getElementById("selectionSet"+Att+"2").style.background="#ffffff url('include_app/include_img/Jcrop.gif')"
		document.getElementById("selectionSet"+Att+"3").style.background="#ffffff url('include_app/include_img/Jcrop.gif')"
		document.getElementById("selectionSet"+Att+"4").style.background="#ffffff url('include_app/include_img/Jcrop.gif')"
		
		var id01,id02,maxtab
		id01= ""
		id02= ""
		maxtab = ""
		
		counter2 = document.getElementById("WordCont-"+Att).parentNode.id

		
		var obj_now_indiv = document.getElementById("Word-"+Att).innerHTML
		var SVisPreloadContent = document.getElementById("Word-"+Att).getElementsByTagName('div')[0].innerHTML
		
		div_now = obj_now_indiv.replace(SVisPreloadContent,"")
		div_now = div_now.replace("</div>","")
		div_now = div_now.replace("</DIV>","")
		//alert(SVisPreloadContent)
		
		memo_dat = SVisPreloadContent;
		
		//alert(Att)
		// at[area di testo] tt[tutto testo] ti[testo immagine] all[tutto quanto] ii[inserimento immagini]
		//var limitazioni = Att.split("-")
		initSVis(Att,SVisPreloadContent,id01,id02,maxtab,sett_config,false,classe)
		
		set_open_close = Att

	}
}

<!--

//-->

//<IFRAME SRC="usagelogs/default.aspx" width="100%" height="200px" id="iframe1" marginheight="0" frameborder="0" onLoad="autoResize('iframe1');"></iframe>

function WordClose(Att,save,sett_config,classe){
	
	set_open_close = "";
	
	setVarEdit("xxx")
	document.getElementById("MenuCont-"+Att).style.position = ""
	document.getElementById("MenuCont-"+Att).className = "menumod";
	//document.getElementById("FooterCmd-"+Att).className = "menumod_comand";
	if(Att.indexOf("wordii")>-1){
		document.getElementById("WordCmd-"+Att).innerHTML ='<ul><li><a unselectable="on" href="javascript:WordOpen(\&quot;'+Att+'\&quot;,\&quot;'+sett_config+'\&quot;,\&quot;'+classe+'\&quot;)" >Modifica</a></li></ul>';
	}else{
		document.getElementById("WordCmd-"+Att).innerHTML ='<ul><li><a unselectable="on" href="javascript:WordOpen(\&quot;'+Att+'\&quot;,\&quot;'+sett_config+'\&quot;,\&quot;'+classe+'\&quot;)" >Modifica</a></li></ul>';
	}
	
	document.getElementById("WordCmd-"+Att).className =  "menumod_comand"
	
	document.getElementById("selectionSet"+Att+"1").style.background="#444444"
	document.getElementById("selectionSet"+Att+"2").style.background="#444444"
	document.getElementById("selectionSet"+Att+"3").style.background="#444444"
	document.getElementById("selectionSet"+Att+"4").style.background="#444444"
	
	document.getElementById("MenuCont-"+Att).className = "menumod"
	
	if(!save){
		document.getElementById("stylvword").disabled = "true";
		document.getElementById("Word-"+Att).innerHTML= getXHTML(trim_SV(div_now+memo_dat+'</div>'));
	}
	parent.milkbox.reloadGalleries();
}


function WordSave(id,save,sett_config,calsse){
	
	
	
	var SVisName = document.getElementById("iframe_word_SV").value
	
	var contObjBody = document.getElementById(SVisName).contentWindow.document.body;
	
	var contObj = getXHTML(trim_SV(contObjBody.innerHTML));
	
	contObj = div_now+contObj+'</div>'
	
	var contObj = getXHTML(trim_SV(contObj));
	
	var len_url = url_p.split("-")[1]
	
	var id_word = id.split("-")[1]
	
	while(id_word.indexOf("_")>-1){
		id_word = id_word.replace("_","/")
	}
	
	
	
	if(id_word.indexOf("/")>0){
		var url_word = id_word;
	}else{
		var url_word = "VS_"+lingua_+id_word
	}
	
	xmlHttp_set=GetXmlHttpObject();
	if (xmlHttp_set==null)
	  {
	  //alert ("il tuo browser non supporta ajax!");
	  var error_str = "Il tuo browser non supporta ajax!"
	  SVopenWin_lvl2('include_App/varie/error_str.asp?erro='+error_str,320,205,false,true);
	  return;
	  } 
	 
	var url_s='include_App/Administrator/word_edit.asp';
	
	
	
	var parameters = contObj+"<url>"+url_word;
	 // alert(url_word)
	//alert(url_word);
	
	xmlHttp_set.open('POST', url_s, true);
	xmlHttp_set.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
	xmlHttp_set.setRequestHeader("Content-length", parameters.length);
	xmlHttp_set.setRequestHeader("Connection", "close");
	xmlHttp_set.send(parameters);
	
	xmlHttp_set.onreadystatechange=function()
	{
		if(xmlHttp_set.readyState==4){
			
			var response = xmlHttp_set.responseText
			//alert(response)
		}
	}
	
	document.getElementById("stylvword").disabled = "true";
	
	document.getElementById("Word-"+id).innerHTML= contObj;
	
	WordClose(id,true,sett_config,calsse);
	
	
	
}


function DeletArt(obj){
	SVopenWin('include_App/mod_screen/askDell.asp?obj='+obj,320,205,false,true);
}

function DeletArtConfirm(obj){
	
	var nohtml = obj.substr(obj.lastIndexOf("."),obj.length)
	nohtml = obj.replace(nohtml,"")
		
	/*var articolo = nohtml.substr(nohtml.lastIndexOf("_")+1,nohtml.length)
	nohtml = nohtml.replace("_"+articolo,"/")
	
	var pagina = nohtml.substr(nohtml.lastIndexOf("_")+1,nohtml.length)
	*/
	nohtml
	while(nohtml.indexOf("_")>-1){
		nohtml = nohtml.replace("_","/")
	}
	
	var pagina = nohtml.replace(nohtml.substr(0,nohtml.indexOf("-")+1)+"content/","")
	
	arr_nomi = "../../CONTENT/"+pagina+".HTML"
	
	arr_fold = "../../PUBLIC/PHOTO.VS"
	
	objdel = document.getElementById("WordCont-"+obj).parentNode.id
	document.getElementById("content"+objdel).parentNode.removeChild(document.getElementById("content"+objdel))
	
	var url_s='include_app/multiupload/delet_file.asp';
	
	xmlHttp2=GetXmlHttpObject();
	if (xmlHttp2==null){
	 // alert ("il tuo browser non supporta ajax!");
	  var error_str = "Il tuo browser non supporta ajax!"
	  parent.SVopenWin_lvl2('include_App/varie/error_str.asp?erro='+error_str,320,205,false,true);
	  return;
	  
	  } 
		
	var parameters = arr_nomi
	xmlHttp2.open('POST', url_s, true);
	xmlHttp2.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
	xmlHttp2.setRequestHeader("Content-length", parameters.length);
	xmlHttp2.setRequestHeader("Connection", "close");
	
	xmlHttp2.onreadystatechange=function()
	{if(xmlHttp2.readyState==4){
			deletFold(arr_fold,obj);					
	}}
	
	xmlHttp2.send(parameters);

}

function deletFold(arr_fold,obj){
	
	var url_s='include_app/multiupload/delet_fold.asp';
	
	xmlHttp2=GetXmlHttpObject();
	if (xmlHttp2==null){
	 // alert ("il tuo browser non supporta ajax!");
	  var error_str = "Il tuo browser non supporta ajax!"
	  parent.SVopenWin_lvl2('include_App/varie/error_str.asp?erro='+error_str,320,205,false,true);
	  return;
	  
	  } 
		
	var parameters = arr_fold
	xmlHttp2.open('POST', url_s, true);
	xmlHttp2.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
	xmlHttp2.setRequestHeader("Content-length", parameters.length);
	xmlHttp2.setRequestHeader("Connection", "close");
	
	xmlHttp2.send(parameters);
	
}

