
var xmlhttp;
var numberDisplayed;
var heading;

function loadXMLDoc(url, numberD, head)
{
var itemTitle;
var itemTitle_txt;
var itemLink;
var itemLink_txt;
var itemPubDate;
var itemPubDate_txt;
var itemDescription;
var itemDescription_txt;
var itemProduct;
var itemProduct_txt
var txt;
//nl
heading=head;
numberDisplayed=numberD;

xmlhttp=null;
if (window.XMLHttpRequest)
  {// code for IE7, Firefox, Mozilla, etc.
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {// code for IE5, IE6
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
if (xmlhttp!=null)
  {
  xmlhttp.onreadystatechange=onResponse;
  xmlhttp.open("GET",url,true);
  xmlhttp.send(null);
  }
else
  {
  alert("Your browser does not support XMLHTTP.");
  }
}






function onResponse()
{
var txt = "";
var innertxt = "";
if(xmlhttp.readyState!=4) return;
if(xmlhttp.status!=200)
  {

  return;
  }


x=xmlhttp.responseXML.documentElement.getElementsByTagName("item");
for (i=0;i<x.length&&i<numberDisplayed;i++)
  {

  itemTitle=x[i].getElementsByTagName("title");
    {
    try
      {
      itemTitle_txt=itemTitle[0].firstChild.nodeValue+"<br/>";
      }
    catch (er)
      {
      itemTitle_txt="";
      }
    }
  itemLink=x[i].getElementsByTagName("link");
    {
    try
      {
      itemLink_txt=itemLink[0].firstChild.nodeValue;
      }
    catch (er)
      {
      itemLink_txt="";
      }
    }
	itemDescription=x[i].getElementsByTagName("description");
    {
    try
      {
      itemDescription_txt=itemDescription[0].firstChild.nodeValue;
      }
    catch (er)
      {
      itemDescription_txt="";
      }
    }
	itemPubdate=x[i].getElementsByTagName("pubDate");
    {
    try
      {
      itemPubdate_txt=itemPubdate[0].firstChild.nodeValue;
      }
    catch (er)
      {
      itemPubdate_txt="";
      }
    }
	itemProduct=x[i].getElementsByTagName("product");
    {
    try
      {
      itemProduct_txt=itemProduct[0].firstChild.nodeValue;
      }
    catch (er)
      {
      itemProduct_txt="";
      }
    }

	if(i==0){
		document.getElementById('copy').innerHTML+=heading;
	}
	ParentID=200+i;
	OtherID=1000+i;
	switch (itemProduct_txt){
		case "Article":
			innertxt="<div style=\"padding:2px; padding-left:21px; border:1px solid white; margin:0px\" id=\""+ParentID+"\"><div style=\"text-indent:-1.8em; \"><span style=\"font-size:x-small; color:#ef8c20; font-weight: bold \">&gt;&gt; </span><a href=\"#\" onclick=\"collapse('"+OtherID+"','"+ParentID+"'); return false;\" ><span style=\"font-size:12px;font-family:Arial, Helvetica, sans-serif; color:#000000\">"+itemTitle_txt+"</span></a></div></div><div id=\""+OtherID+"\" style=\"display:none\"><div style=\"border-bottom:#ef8c20 1px solid; border-right:#ef8c20 1px solid;border-left:#ef8c20 1px solid;padding:2px; margin:0px; font-size:11px; align=text-align:justify\">"+itemDescription_txt+"<br/><a href=\""+itemLink_txt+"\" target=\"_blank\"><img src=\"/iseek/_ui/images/link-icon.gif\"  border=\"0\" />&nbsp;<span style=\"border-bottom:#ef8c20 2px solid;\">Read more</span></a><br/><br/><span style=\"font-size:xx-small\">Published: "+itemPubdate_txt+"</span></div></div>";break;
		case "ISpeak":
		innertxt="<div style=\"padding:2px; padding-left:21px; border:1px solid white; margin:0px\" id=\""+ParentID+"\"><div style=\"text-indent:-1.8em; \"><span style=\"font-size:x-small;color:#ef8c20; font-weight: bold\">&gt;&gt; </span><a href=\"#\" onclick=\"collapse('"+OtherID+"','"+ParentID+"'); return false;\" ><span style=\"font-size:12px;font-family:Arial, Helvetica, sans-serif; color:#000000;\">"+itemTitle_txt+"</span></a></div></div><div id=\""+OtherID+"\" style=\"display:none\"><div style=\"border-bottom: #ef8c20 1px solid; border-right: #ef8c20 1px solid;border-left: #ef8c20 1px solid;padding:2px;  margin:0px; font-size:11px; align=text-align:justify\">"+itemDescription_txt+"<br/><a href=\""+itemLink_txt+"\"><img src=\"/iseek/_ui/images/blog-icon.gif\"  border=\"0\"/>&nbsp;<span style=\"border-bottom:#ef8c20 2px solid;\">Read more</span></a><br/><br/><span style=\"font-size:xx-small\">Published: "+itemPubdate_txt+"</span></div></div>";break;
		case "Video":
		innertxt="<div style=\"padding:2px; padding-left:21px; border:1px solid white; margin:0px\" id=\""+ParentID+"\"><div style=\"text-indent:-1.8em; \"><span style=\"font-size:x-small;color:#ef8c20; font-weight: bold\">&gt;&gt; </span><a href=\"#\" onclick=\"collapse('"+OtherID+"','"+ParentID+"'); return false;\" ><span style=\"font-size:12px;font-family:Arial, Helvetica, sans-serif; color:#000000; \">"+itemTitle_txt+"</span></a></div></div><div id=\""+OtherID+"\" style=\"display:none\"><div style=\"border-bottom: #ef8c20 1px solid; border-right: #ef8c20 1px solid;border-left: #ef8c20 1px solid;padding:2px; margin:0px; font-size:11px; align=text-align:justify\">"+itemDescription_txt+"<br/><a href=\""+itemLink_txt+"\"><span style=\"border-bottom:#ef8c20 2px solid;\">Play Video</span></a><br/><br/><span style=\"font-size:xx-small\">Published: "+itemPubdate_txt+"</span></div></div>";break;
		case "NewonISEEK":
			innertxt="<div style=\"padding:2px; padding-left:21px; border:1px solid white; margin:0px\" id=\""+ParentID+"\"><div style=\"text-indent:-1.8em; \"><span style=\"font-size:x-small;color:#ef8c20; font-weight: bold\">&gt;&gt; </span><a href=\"#\" onclick=\"collapse('"+OtherID+"','"+ParentID+"'); return false;\" ><span style=\"font-size:12px;font-family:Arial, Helvetica, sans-serif; color:#000000; \">"+itemTitle_txt+"</span></a></div></div><div id=\""+OtherID+"\" style=\"display:none\"><div style=\"border-bottom: #ef8c20 1px solid; border-right: #ef8c20 1px solid;border-left: #ef8c20 1px solid;padding:2px; margin:0px; font-size:11px; align=text-align:justify\">"+itemDescription_txt+"<br/><a href=\""+itemLink_txt+"\"><span style=\"border-bottom:#ef8c20 2px solid;\">Link</span></a><br/><br/><span style=\"font-size:xx-small\">Published: "+itemPubdate_txt+"</span></div></div>";break;
		default: 		
  innertxt="<div style=\"padding:2px; padding-left:21px; border:1px solid white; margin:0px\" id=\""+ParentID+"\"><div style=\"text-indent:-1.8em; \"><span style=\"font-size:x-small;color:#ef8c20; font-weight: bold\">&gt;&gt; </span><a href=\"#\" onclick=\"collapse('"+OtherID+"','"+ParentID+"'); return false;\" ><span style=\"font-size:12px;font-family:Arial, Helvetica, sans-serif; color:#000000; \">"+itemTitle_txt+"</span></a></div></div><div id=\""+OtherID+"\" style=\"display:none\"><div style=\"border-bottom: #ef8c20 1px solid; border-right: #ef8c20 1px solid;border-left: #ef8c20 1px solid;padding:2px; margin:0px; font-size:11px; align=text-align:justify\">"+itemDescription_txt+"<br/><a href=\""+itemLink_txt+"\"><span style=\"border-bottom:#ef8c20 2px solid;\">Read more</span></a><br/><br/><span style=\"font-size:xx-small\">Published: "+itemPubdate_txt+"</span></div></div>"; }
  
  
  writetopage(innertxt);
  }
  
  
txt=innertxt;

}



function writetopage(txt){

	document.getElementById('copy').innerHTML+=txt;
}

function collapse(divid, otherid){
	if (document.getElementById(divid).style.display=="block")
		{

		document.getElementById(divid).style.display ="none";
		document.getElementById(otherid).style.backgroundColor="#FFFFFF";
		document.getElementById(otherid).style.border="1px solid #FFFFFF";
		}
	else 
		{

		document.getElementById(divid).style.display="block";
		document.getElementById(otherid).style.border="1px solid #ef8c20";
		document.getElementById(otherid).style.backgroundColor="#F1F1F1";
		}
}

function Replace(totalValue,oldValue,newValue)
{
	while(totalValue.indexOf(oldValue) > -1)
		totalValue=totalValue.replace(oldValue,newValue);
			return totalValue;
}
