var ajax; var disp; var disp_img; var disp_info; var disp_name; var disp_author, disp_a; var curr, last, first; function init() { initAjax(); disp=document.getElementById("disp"); disp_a=document.getElementById("disp_a"); disp_name=document.getElementById("disp_name"); disp_author=document.getElementById("disp_author"); disp_img=document.getElementById("disp_img"); disp_info=document.getElementById("disp_info"); if (!document.importNode) { document.importNode = function(node, allChildren) { switch (node.nodeType) { case 1: var newNode = document.createElement(node.nodeName); /*if (node.attributes && node.attributes.length > 0) for (var i = 0; il = node.attributes.length; i < il) newNode.setAttribute(node.attributes[i].nodeName, node.getAttribute(node.attributes[i++].nodeName));*/ //alert("Attr done"); if (allChildren && node.childNodes && node.childNodes.length > 0) { il=node.childNodes.length; for (var i = 0; i < il; i++) newNode.appendChild(document.importNode(node.childNodes[i], allChildren)); } return newNode; break; default: return document.createTextNode(node.nodeValue); break; } }; } if(!disp_name.firstChild) disp_name.appendChild(document.createTextNode(' ')); if(!disp_author.firstChild) disp_author.appendChild(document.createTextNode(' ')); } function initAjax() { try { if (window.XMLHttpRequest) { ajax = new XMLHttpRequest(); ajax.overrideMimeType('text/xml'); } else if (window.ActiveXObject) ajax = new ActiveXObject('Microsoft.XMLHTTP'); else throw 'AJAX Error'; } catch (e) { return false; } if (!ajax) { alert('AJAX Error'); return false; } return true; } function response() { if (ajax.readyState != 4 || ajax.status != 200) return; var xml = ajax.responseXML; while(disp_info.hasChildNodes()) disp_info.removeChild(disp_info.firstChild); elemXML=xml.getElementsByTagName("desc")[0]; if(document.importNode) children=document.importNode(elemXML, true).childNodes; else children=elemXML.childNodes; for(i=0; i