﻿// JScript File

var xhttp;

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}

// function display_news for direct pages
function display_news()
{
//document.write("Its Working");
xhttp=GetXmlHttpObject();

if (xhttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
  
xhttp.open("GET","news/cd_catalog.xml",false);
xhttp.send("");
xmlDoc=xhttp.responseXML; 
document.write("<table cellspacing=0 cellpadding=0>");
document.write("<tr><td class='header_band'>Headlines</td></tr>");
document.write("<tr><td class='display_cell'>");
document.write("<table border='0' cellspacing=0 cellpadding=0>");
var x=xmlDoc.getElementsByTagName("CD");

for (i=0;i<7;i++)
  { 
  document.write("<tr>");
  document.write("<td class='bullets'></td>");
  document.write("<td width=5></td>");
  document.write("<td><a traget='_top' href='templates/more_news.aspx?fid=" + x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue + "'>" +x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue +"</a></td>");
  document.write("</tr>");
  }
document.write("</table>");
document.write("</td></tr>");
document.write("</table>");

}


// display_new function for folder files
function display_news1()
{
document.write("Its Working");
xhttp=GetXmlHttpObject();

if (xhttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
  
xhttp.open("GET","../news/cd_catalog.xml",false);
xhttp.send("");
xmlDoc=xhttp.responseXML; 

document.write("<table border='1' cellspa>");
var x=xmlDoc.getElementsByTagName("CD");
for (i=0;i<x.length;i++)
  { 
  document.write("<tr><td>");
  document.write(x[i].getElementsByTagName("ARTIST")[0].childNodes[0].nodeValue);
  document.write("</td>");
  document.write("<td><a traget='_top' href='../templates/more_news.aspx?fid=" + x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue + "'>" +x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue +"</a></td>");
  document.write("<td>");
  document.write(x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue);
  document.write("</td></tr>");
  }
document.write("</table>");

}
