var launcher, defaultFont, defaultFontSize; function removeFormat(r, name) { var cmd = [ "Bold", "Italic", "Underline", "Strikethrough", "FontName", "FontSize", "ForeColor", "BackColor" ]; var on = new Array(cmd.length); for (var i = 0; i < cmd.length; i++) { on[i] = name == cmd[i] ? null : r.queryCommandValue(cmd[i]); } r.execCommand('RemoveFormat'); for (var i = 0; i < cmd.length; i++) { if (on[i]) r.execCommand(cmd[i], false, on[i]); } } function formatHTML() { rules = document.styleSheets[0].rules; /*for (i=0; i < rules.length; i++) { alert (rules[i].selectorText); } */ f = document.all[arguments[0]]; f.focus(); var sel = document.selection.createRange(); if (arguments[1] == 'InsertImage') { launcher = f; window.open('/w4b/_upload/index','resources','width=400,height=400,scrollbars=yes,menubar=yes,status=yes,resizable=yes'); } else if (arguments[1].toLowerCase().indexOf("color")!= -1) { theVal = document.queryCommandValue(arguments[1]); if (theVal == null) { removeFormat(document,arguments[1]); document.execCommand(arguments[1],arguments[2],arguments[3]); } else if (theVal.toString() == '16777215') { document.execCommand(arguments[1],arguments[2],arguments[3]); } else { document.execCommand(arguments[1],false,null); } } else { document.execCommand(arguments[1],arguments[2],arguments[3]); } } // hover(): Handles mouse hovering over toolbar buttons function hover(on) { var el = window.event.srcElement; if (el && !el.disabled && el.nodeName == "IMG" && el.className != "spacer") { if (on) { el.className = "hover"; } else { el.className = el.defaultState ? el.defaultState : null; } } } // hover(): Handles mouse clicks on toolbar buttons function press(on) { var el = window.event.srcElement; if (el && !el.disabled && el.nodeName == "IMG" && el.className != "spacer") { if (on) { el.className = "down"; } else { el.className = el.className == "down" ? "hover" : el.defaultState ? el.defaultState : null; } } } function editHTML(theHTMLField) { launcher = theHTMLField; sCSSURL = document.styleSheets(0).href; if (sCSSURL.substr(0,7).toLowerCase() == 'http://') { // sCSSURL e' assoluta: lascia invariato } else { if (sCSSURL.substr(0,1) == '/') { sCSSURL = 'http://' + location.host + sCSSURL; } else { sCSSURL = location.href.substr(0,location.href.lastIndexOf('/')+1) + sCSSURL; } } defaultFont = 'Tahoma'; defaultFontSize = 11; richeditOptions = 'font=off;source=off'; window.open('/w4b/_htmledit/htmledit.htm','upload','width=500,height=500,scrollbars=yes,resizable=yes,status=yes'); // ?css=' + sCSSURL } function validateField(theField, theCaption, theValidation) { theVal = theField.value; //occhio con campi di altri tipi if (theValidation.indexOf('nonempty') != -1) { if (theVal == '') { alert ("Il campo \"" + theCaption + "\" e' obbligatorio"); theField.focus(); return (false); } } if (theValidation.indexOf('date') != -1) { if (theVal != '') { if ((theVal.length != 10) || (theVal.substr(2,1)!='/') || (theVal.substr(5,1)!='/')) { alert ("Specificare la data del campo \"" + theCaption + "\" nel formato gg/mm/aaaa."); theField.focus(); return(false); } } } if (theValidation.indexOf('number') != -1) { if (theVal != '') { sCheck = theVal.replace(/\./gi,""); sCheck = sCheck.replace(/,/gi,"."); if (isNaN(sCheck)) { alert ("Specificare un numero nel campo \"" + theCaption + "\".\nI decimali devono essere specificati con la virgola."); theField.focus(); return; } if (sCheck.indexOf(".") != -1) { dec = sCheck.substr(sCheck.indexOf(".")+1); if (dec.length > 2) { alert ("Nel campo \"" + theCaption + "\" e' possibile specificare al massimo 2 cifre decimali."); f.focus(); return; } } } } return (true); } function saveSame(theFormName) { // salva valori precedenti sTarget = document.forms[theFormName].target; sRedirect = document.forms[theFormName].elements["_w4b_sys_redirect"].value; status = "Salvataggio rapido in corso..."; var w = window.open('#','dest','width=400,height=200,status=yes,menubar=yes'); document.forms[theFormName].target = 'dest'; document.forms[theFormName].elements["_w4b_sys_redirect"].value = 'conferma.html'; document.forms[theFormName].submit(); window.focus(); //ripristina valori precedenti document.forms[theFormName].target = sTarget; document.forms[theFormName].elements["_w4b_sys_redirect"].value = sRedirect; } document.write(""); document.write("
"); document.write(""); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write("   "); document.write(" "); document.write(""); document.write(" "); document.write("   "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write("   "); document.write(" "); document.write(" "); document.write("   "); document.write(" "); document.write(" "); document.write("   "); document.write(" "); document.write(" "); document.write(" "); document.write("   "); document.write(" "); document.write(" "); document.write("
");