var url; var links; var xml_response; function loadLinks() { var xmlHttp = null; try { // Mozilla, Opera, Safari sowie Internet Explorer (ab v7) xmlHttp = new XMLHttpRequest(); } catch(e) { try { // MS Internet Explorer (ab v6) xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { try { // MS Internet Explorer (ab v5) xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { xmlHttp = null; } } } if (xmlHttp) { xmlHttp.open('GET', '/resources.xml', true); xmlHttp.onreadystatechange = function () { if (xmlHttp.readyState == 4) { xml_response = xmlHttp.responseXML; links = xml_response.getElementsByTagName('link'); } }; xmlHttp.send(null); } return true; } function writeURLs() { links = xmlDoc.getElementsByTagName('link'); } function getUrl(named){ for (i=0; i < links.length; i++){ if (links[i].getAttributeNode('name').value == named){ return links[i].getAttributeNode('url').value.replace("%26","&"); } } } loadLinks();