// global request and XML document objects var req; var isIE = false; // retrieve XML document (reusable generic function); // parameter is URL string (relative or complete) to // an .xml file whose Content-Type is a valid XML // type, such as text/xml; XML source must be from // same domain as HTML file function loadXMLDoc(url) { // branch for native XMLHttpRequest object if (window.XMLHttpRequest) { req = new XMLHttpRequest(); req.onreadystatechange = processReqChange; req.open("GET", url, true); req.send(null); // branch for IE/Windows ActiveX version } else if (window.ActiveXObject) { isIE = true; req = new ActiveXObject("Microsoft.XMLHTTP"); if (req) { req.onreadystatechange = processReqChange; req.open("GET", url, true); req.send(); } } } // handle onreadystatechange event of req object function processReqChange() { // only if req shows "loaded" try { if (req.readyState == 4) { // only if "OK" if (req.status == 200) { parseXML(); } else { parseXML(); } } } catch(e) { parseXML(); } } // retrieve text of an XML document element, including // elements using namespaces function getElementTextNS(prefix, local, parentElem, index) { var result = "",text=""; if (prefix && isIE) { // IE/Windows way of handling namespaces result = parentElem.getElementsByTagName(prefix + ":" + local)[index]; } else { // the namespace versions of this method // (getElementsByTagNameNS()) operate // differently in Safari and Mozilla, but both // return value with just local name, provided // there aren't conflicts with non-namespace element // names result = parentElem.getElementsByTagName(local)[index]; } if (result) { // get text, accounting for possible // whitespace (carriage return) text nodes // Firefox splits the reply into several nodes if it is extemely long for(var i=0;i n.length) { for (var i=0; i < (totalDigits-n.length); i++) { pd += '0'; } } return pd + n.toString(); } function isDigit(c) { var test = "" + c; if (test == "0" || test == "1" || test == "2" || test == "3" || test == "4" || test == "5" || test == "6" || test == "7" || test == "8" || test == "9") { return true; } return false; } function Round(val,Digits) { var str,pos,rnd=0; if (val < 0.995) rnd = 1; // for old Netscape browsers str = escape (val*1.0 + 0.005001 + rnd); // float, round, escape pos = str.indexOf ("."); // should be one, but OK if not if (pos > 0) str = str.substring (rnd, pos + 1 + Digits); return str; // return valid string } function multiplyColor(Color,Adjustment) { var r,g,b; r=parseInt(Adjustment*(parseInt(Color[0], 16)*16+parseInt(Color[1], 16))); g=parseInt(Adjustment*(parseInt(Color[2], 16)*16+parseInt(Color[3], 16))); b=parseInt(Adjustment*(parseInt(Color[4], 16)*16+parseInt(Color[5], 16))); if(r>255) r=255; if(g>255) g=255; if(b>255) b=255; Color=(r<<16)+(g<<8)+b; return Color.toString(16); }