// JavaScript Document
//---------------------------------- 
//this retrieves an RSS feed and places it inside the rssOutput Div Tag
// it can be placed as an external file, or at header of page
// example use is to call the function onLoad
//----------------------------------

function showResult(str){
	if (str.length==0){
  		document.getElementById("twitterOutput").innerHTML='<img src="images/preloader.gif" />';
  		return;
  	}
  	document.getElementById("twitterOutput").innerHTML='<div id="prelaoder"><img src="images/preloader.gif" /></div>';
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
  		xmlhttp=new XMLHttpRequest();
  	} else {// code for IE6, IE5
  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  	}
	xmlhttp.onreadystatechange=function() {
	 	if (xmlhttp.readyState==4 && xmlhttp.status==200)	{
			document.getElementById("twitterOutput").innerHTML=xmlhttp.responseText;
		}
  	}
	// you can customise the calling script here and any parameters you want to pass in
	xmlhttp.open("GET","scripts/getrss.php?q="+str,true);
	xmlhttp.send();
}
