/* * translator ready * addnews ready * mail ready */ //Javascript Generic DOM //By Eric Stevens // function fetchDOM(filename){ var xmldom; if (document.implementation && document.implementation.createDocument){ //Mozilla style browsers xmldom = document.implementation.createDocument("", "", null); } else if (window.ActiveXObject) { //IE style browsers xmldom = new ActiveXObject("Microsoft.XMLDOM"); } xmldom.async=false; try { xmldom.load(filename); } catch(e){ xmldom.parseXML("Failed to load "+filename+""); } return xmldom; } if (document.implementation && document.implementation.createDocument){ var dom = document.implementation.createDocument("","",null); }else{ var dom = new ActiveXObject("Microsoft.XMLDOM"); } function fetchDOMasync(filename,args,theCode){ var xmldom; try { xmldom = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmldom = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmldom = false; } } if (!xmldom && typeof XMLHttpRequest!='undefined') { xmldom = new XMLHttpRequest(); } xmldom.onreadystatechange = function(){ if (xmldom.readyState == 4) { theCode(); } }; xmldom.open("POST",filename,true); xmldom.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); xmldom.send(args); return xmldom; } function createXML(node){ if (!node) return "You cannot pass null to createXML"; if (node.xml) return node.xml; var out = ""; if (node.nodeType==1){ var x=0; out = "<" + node.nodeName; for (x=0; x < node.attributes.length; x++){ out = out + " " + node.attributes[x].name + "=\"" + HTMLencode(node.attributes[x].nodeValue) + "\""; } out = out + ">"; for (x=0; x < node.childNodes.length; x++){ out = out + createXML(node.childNodes[x]); } out = out + ""; }else if(node.nodeType==3){ out = out + HTMLencode(node.nodeValue); } return out; } function selectSingleNode(node,name){ var nextName = ""; if (name.indexOf("/") > 0){ nextName = name.substring(name.indexOf("/")+1); name = name.substring(0,name.indexOf("/")); } for (var x=0; x/g,">"); } } function HTMLdecode(input){ if (input == null){ return ""; }else{ return input.replace(/>/g,">").replace(/</g,"<").replace(/"/g,'"').replace(/&/g,"&"); } }