/*** Funzioni di base per firefox (e browser compatibili) ***/ function GetElementById(id) { return document.getElementById(id); } function ButtonSubmitClick(src, value) { return 1; } /* AJAX */ function GetXmlHttpObject() { var objXmlHttp = new XMLHttpRequest() //objXmlHttp.onload=handler //objXmlHttp.onerror=handler return objXmlHttp } /* Fine AJAX */ /* Interazione DOM */ function DelInnerHTML(el) { while (el.hasChildNodes()) el.removeChild(el.lastChild); } function MakeHtmlFrag(el, content) { rng = document.createRange(); rng.setStartBefore(el); htmlFrag = rng.createContextualFragment(content); return htmlFrag; } function AddInnerHTMLFrag(el, htmlFrag) { el.appendChild(htmlFrag); } function AddInnerHTML(el, content) { htmlFrag = MakeHtmlFrag(el.lastChild, content); AddInnerHTMLFrag(el, htmlFrag); } function AddHTMLRow(tbody, htmlrow) { return AddInnerHTML(tbody, htmlrow); } function SetInnerHTMLFrag(el, htmlFrag) { DelInnerHTML(el); AddInnerHTMLFrag(el, htmlFrag); } function SetInnerHTML(el, content) { htmlFrag = MakeHtmlFrag(el, content) SetInnerHTMLFrag(el, htmlFrag); } function AddEventListener(el, type, listener, useCapture) { el.addEventListener(type, listener, useCapture); } /* Fine interazione DOM */ /* Informazioni varie browser */ function GetFiringObj(e) { if (!e) var e = window.event; //window.event is not supported since FF 2.0 return e.target; } function StopPropagation(e) { return e.stopPropagation(); } function GetInnerWidth(win) { if (win) return win.innerWidth; else return window.innerWidth; } function GetInnerHeight(win) { if (win) return win.innerHeight; else return window.innerHeight; } function GetLeft(win) { if (win) return win.screenX; else return window.screenX; } function GetTop(win) { if (win) return win.screenY; else return window.screenY; } function GetClientXPosition(e) { if (!e) var e = window.event; return e.clientX; } function GetClientYPosition(e) { if (!e) var e = window.event; return e.clientY; } function GetScrollXPosition() { return window.pageXOffset; } function GetScrollYPosition() { return window.pageYOffset; } /* Fine informazioni varie browser */ /*** Fine funzioni di base per firefox ***/