// JScript source code
var curbrowser=document.all;
if(typeof(curbrowser)=="object"){
	var redirectMe="http://www.rssphere.com";
}
else{
	
	//var redirectMe="options.asp?demoid=0&browser=ni";
	var redirectMe="http://www.rssphere.com";
}


var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
function importXML()
{
	if(is_chrome){
		
		var xmlhttp = new window.XMLHttpRequest();
		xmlhttp.open("GET","products/newsforhost.xml",false);
		xmlhttp.send(null);
		xmlDoc = xmlhttp.responseXML.documentElement;
		createTable();	
			
		
		
	}
	else{
		if (document.implementation && document.implementation.createDocument)
		{
			xmlDoc = document.implementation.createDocument("", "", null);
			xmlDoc.onload = createTable;
		}
		else if (window.ActiveXObject)
		{
			xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
			xmlDoc.onreadystatechange = function () {
				if (xmlDoc.readyState == 4) createTable()
			};
 		}
		else
		{
			alert('Your browser can\'t handle this script');
			return;
		}
		xmlDoc.load("products/newsforhost.xml");
	}
	
	
	
	
	
	
}



var demopages=new Array();
function createTable()
{
	
	allItems = xmlDoc.getElementsByTagName("newsitem");
	pagecount=Math.ceil(allItems.length/eachPageItems);
	
	document.getElementById("pageall").innerHTML=Math.ceil(pagecount);
	document.getElementById("pageall1").innerHTML=Math.ceil(pagecount);
	sp=0;
		if(allItems.length<eachPageItems){
			ep=allItems.length;
		}
		else{
			ep=eachPageItems;
		}
		
	
	var myhtml="";
	
	
	
	for(i=sp;i<ep;i++){
		
		var itemElm = allItems[i];
		var dateElm = itemElm.getElementsByTagName("date").item(0).firstChild.nodeValue;
		var titleElm = itemElm.getElementsByTagName("title").item(0).firstChild.nodeValue;
		var descElm = itemElm.getElementsByTagName("description").item(0).firstChild.nodeValue;
		//myhtml+="<table style='font-family:arial;font-size:13px' background='images/boxtitle2_bg.gif' cellpadding=2 cellspacing=1 border=0 width=415px><tr align=right><td align=left width=200 style='color:#586D8B'><b>" + titleElm + "</b></td><td> <a href=" + redirectMe + "?demoid=" + i + " title='Launch Demo' style='color:#8C043E'><b>Demo</b></a></td></tr></table>";
		
		myhtml+="<table style='font-family:arial;font-size:13px' background='images/boxtitle2_bg.gif' cellpadding=2 cellspacing=1 border=0 width=415px><tr align=right><td align=left width=200 style='color:#586D8B'><b>" + titleElm + "</b></td><td> <a href=" + redirectMe + " title='Launch Demo' style='color:#8C043E'><b>Demo</b></a></td></tr></table>";
		
		myhtml+="<table style='font-family:arial;font-size:13px' bgcolor=#E3E4E7 cellpadding=4 cellspacing=1 border=0 width=400px><tr bgcolor='white'><td width=390 style='color:#586D8B'>" + descElm + "</td></tr></table>";
		//myhtml+="<tr bgcolor='white'><td>" + descElm + "</td></tr></table><br>";
		
	}
	if(pagecount>1){
		document.getElementById("nav").style.display="block";
		document.getElementById("nav1").style.display="block";
	}
	document.getElementById("cont").innerHTML=myhtml;
	
}
	

function openDemo(prog){
	if(prog==0){
		location.href="frameset.htm";
	}

}

	
	
function moveNext(){
	
	curPage++;
	if(curPage<pagecount){
		
			sp=curPage * eachPageItems - eachPageItems;
			ep=sp + eachPageItems;
		
		
	}
	else{
		curPage=pagecount;
		sp=curPage * eachPageItems - eachPageItems;
		ep=allItems.length;
		document.getElementById("tf").style.visibility="hidden";
		document.getElementById("bf").style.visibility="hidden";
	}
	var myhtml1="";
	for(r=sp;r<ep;r++){
		
		var itemElm1 = allItems[r];
		var dateElm1 = itemElm1.getElementsByTagName("date").item(0).firstChild.nodeValue;
		var titleElm1 = itemElm1.getElementsByTagName("title").item(0).firstChild.nodeValue;
		
		var descElm1 = itemElm1.getElementsByTagName("description").item(0).firstChild.nodeValue;
		//myhtml1+="<table style='font-family:arial;font-size:13px' bgcolor=#E3E4E7 cellpadding=2 cellspacing=1 border=0 width=400px><tr bgcolor='#E3E4E7'><td style='color:#586D8B'><b>" + titleElm1 + "</b></td></tr>";
		//myhtml1+="<tr bgcolor=white><td>" + descElm1 + "</td></tr></table><br>";
		if(curPage==1){
			var cred="http://www.rssphere.com";
		}
		else if(curPage==2){
			var cred=redirectMe;
		}
		else if(curPage==3){
			var cred="detectDemo.asp?demoid=0";
		}
		
		else if(curPage==4){
			var cred="http://www.softxml.com/products/shoppingcart/";
		}
		
		else if(curPage==5){
			var cred="http://www.shareit.com/product.html?cart=1&productid=135554&languageid=1&backlink=http%3A%2F%2Fwww.softxml.com%2Fproducts.asp&cookies=1&affiliateid=200021316";
		}
		
		
		
		else if(curPage==6){
			var cred="http://www.shareit.com/product.html?cart=1&productid=158008&languageid=1&backlink=http%3A%2F%2Fwww.softxml.com%2Fproducts.asp&cookies=1&affiliateid=200021316";
		}
		
		else if(curPage==7){
			var cred="http://www.shareit.com/product.html?cart=1&productid=300011039&languageid=1&backlink=http%3A%2F%2Fwww.softxml.com%2Fproducts.asp&cookies=1&affiliateid=200021316";
		}
		else if(curPage==8){
			var cred="http://www.shareit.com/product.html?cart=1&productid=300023967&languageid=1&backlink=http%3A%2F%2Fwww.softxml.com%2Fproducts.asp&cookies=1&affiliateid=200021316";
		}
		else if(curPage==9){
			var cred="http://www.beansoftware.com/Demo_Search_Control.aspx";
		}
		else if(curPage==10){
			var cred="http://www.shareit.com/product.html?cart=1&productid=164984&languageid=1&backlink=http//www.softxml.com/products.asp&cookies=1&affiliateid=200021316";
		}
		else if(curPage==11){
			var cred="http://www.oxygenxml.com/demo/dockableViews/dockableViews.html";
		}
		else if(curPage==12){
			var cred="http://www.xmlfox.com/";
		}
		else if(curPage==13){
			var cred="context.htm";
		}
		else if(curPage==14){
			var cred="http://www.gregorym.net/products/mysqldemo/connectionOption.asp";
		}
		//alert(cred);
		myhtml1+="<table style='font-family:arial;font-size:13px' background='images/boxtitle2_bg.gif' cellpadding=2 cellspacing=1 border=0 width=415px><tr align=right><td align=left width=200 style='color:#586D8B'><b>" + titleElm1 + "</b></td><td> <a href=" + cred + " title='Launch Demo' style='color:#8C043E'><b>Demo</b></a></td></tr></table>";
		myhtml1+="<table style='font-family:arial;font-size:13px' bgcolor=#E3E4E7 cellpadding=4 cellspacing=1 border=0 width=400px><tr bgcolor='white'><td width=390 style='color:#586D8B'>" + descElm1 + "</td></tr></table>";
		
	}
	document.getElementById("tb").style.visibility="visible";
	document.getElementById("bb").style.visibility="visible";
	
	
	document.getElementById("pagestart").innerHTML=Math.ceil(curPage);
	document.getElementById("pagestart1").innerHTML=Math.ceil(curPage);
	document.getElementById("cont").innerHTML=myhtml1;
}



function movePrev(){
	curPage--;
	if(curPage==1){
			var cred=redirectMe;
		}
		else if(curPage==2){
			var cred="detectDemo.asp?demoid=0";
		}
		else if(curPage==3){
			var cred="http://www.softxml.com/products/shoppingcart/";
		}
		else if(curPage==4){
			var cred="http://www.shareit.com/product.html?cart=1&productid=135554&languageid=1&backlink=http%3A%2F%2Fwww.softxml.com%2Fproducts.asp&cookies=1&affiliateid=200021316";
		}
		else if(curPage==5){
			var cred="http://www.shareit.com/product.html?cart=1&productid=158008&languageid=1&backlink=http%3A%2F%2Fwww.softxml.com%2Fproducts.asp&cookies=1&affiliateid=200021316";
		}
		else if(curPage==6){
			var cred="http://www.shareit.com/product.html?cart=1&productid=300011039&languageid=1&backlink=http%3A%2F%2Fwww.softxml.com%2Fproducts.asp&cookies=1&affiliateid=200021316";
		}
		else if(curPage==7){
			var cred="http://www.shareit.com/product.html?cart=1&productid=300023967&languageid=1&backlink=http%3A%2F%2Fwww.softxml.com%2Fproducts.asp&cookies=1&affiliateid=200021316";
		}
		else if(curPage==8){
			var cred="http://www.beansoftware.com/Demo_Search_Control.aspx";
		}
		else if(curPage==9){
			var cred="http://www.shareit.com/product.html?cart=1&productid=164984&languageid=1&backlink=http//www.softxml.com/products.asp&cookies=1&affiliateid=200021316";
		}
		else if(curPage==10){
			var cred="http://www.oxygenxml.com/demo/dockableViews/dockableViews.html";
		}
		else if(curPage==11){
			var cred="http://www.xmlfox.com/";
		}
		else if(curPage==12){
			var cred="context.htm";
		}
		else if(curPage==13){
			var cred="http://www.gregorym.net/products/mysqldemo/connectionOption.asp";
		}
	
	
	if(curPage>=1){
		if(curPage==1){
			document.getElementById("tb").style.visibility="hidden";
			document.getElementById("bb").style.visibility="hidden";
		}
		sp=Math.ceil(curPage * eachPageItems - eachPageItems);
		ep=sp + eachPageItems;
	}
	else{
		curPage=1;
		sp=curPage * eachPageItems - eachPageItems;
		ep=eachPageItems;
	}
	var myhtml1="";
	for(r=sp;r<ep;r++){
		
		var itemElm1 = allItems[r];
		var dateElm1 = itemElm1.getElementsByTagName("date").item(0).firstChild.nodeValue;
		var titleElm1 = itemElm1.getElementsByTagName("title").item(0).firstChild.nodeValue;
		var descElm1 = itemElm1.getElementsByTagName("description").item(0).firstChild.nodeValue;
		//myhtml1+="<table style='font-family:arial;font-size:13px' cellpadding=2 cellspacing=1 bgcolor=#E3E4E7 border=0 width=400px><tr bgcolor='#E3E4E7'><td style='color:#586D8B'><b>" + titleElm1 + "</b></td></tr>";
		//myhtml1+="<tr bgcolor=white><td>" + descElm1 + "</td></tr></table><br>";
		
		
		myhtml1+="<table style='font-family:arial;font-size:13px' background='images/boxtitle2_bg.gif' cellpadding=2 cellspacing=1 border=0 width=415px><tr align=right><td align=left width=200 style='color:#586D8B'><b>" + titleElm1 + "</b></td><td> <a href=" + cred + " title='Launch Demo' style='color:#8C043E'><b>Demo</b></a></td></tr></table>";
		myhtml1+="<table style='font-family:arial;font-size:13px' bgcolor=#E3E4E7 cellpadding=4 cellspacing=1 border=0 width=400px><tr bgcolor='white'><td width=390 style='color:#586D8B'>" + descElm1 + "</td></tr></table>";
	}
	document.getElementById("tf").style.visibility="visible";
	document.getElementById("bf").style.visibility="visible";
	
	document.getElementById("pagestart").innerHTML=Math.ceil(curPage);
	document.getElementById("pagestart1").innerHTML=Math.ceil(curPage);
	document.getElementById("cont").innerHTML=myhtml1;

}
