// JavaScript Document

			function refreshtoppers(){
				document.getElementById("refreshlnk").Enabled=false;
				gettoppers();
			}
			
			//Gets the browser specific XmlHttpRequest Object
			function getXmlHttpRequestObject() {
				if (window.XMLHttpRequest) {
					//alert(" XmlHttpRequest object Created ");
					return new XMLHttpRequest(); //Not IE
				} else if(window.ActiveXObject) {
					//alert(" XmlHttpRequest object Created ");
					return new ActiveXObject("Microsoft.XMLHTTP"); //IE
				} else {
					//Display your error message here. 
					//and inform the user they might want to upgrade
					//their browser.
					alert("Your browser doesn't support the XmlHttpRequest object.  Please upgrade");
				}
			}			
			//Get our browser specific XmlHttpRequest object.
			var receiveReq = getXmlHttpRequestObject();		
			//Initiate the asyncronous request.
			function gettoppers() {
				//If our XmlHttpRequest object is not in the middle of a request, start the new asyncronous call.
				var rndnum=Math.floor(Math.random()*1000); //Number between 0 to 1000
				var strqrystr;
				
				strqrystr = 'toppersar.asp?saleid=' + rndnum ;
				//alert(strqrystr);
				if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
					//Setup the connection as a GET call to adSales.asp.
					//True explicity sets the request to asyncronous (default).
					document.getElementById('spantoppers').innerHTML='<img src="images/loader2.gif">';
					receiveReq.open('GET', strqrystr, true);
					//Set the function that will be called when the XmlHttpRequest objects state changes.
					receiveReq.onreadystatechange = showtoppers; 
					//Make the actual request.
					receiveReq.send(null);
				}			
			}
			//Called every time our XmlHttpRequest objects state changes.
			function showtoppers() {
				//Check to see if the XmlHttpRequests state is finished.
				var strrtn='';
				if (receiveReq.readyState == 4 || receiveReq.State == 200 )   {
					//Set the contents of our span element to the result of the asyncronous call.
					strrtn= receiveReq.responseText;
					if (strrtn=='' || strrtn == null)
					{
						strrtn ='Sorry, Please Try Again<br>' ;
						strrtn = strrtn + '<img src="images/Refrest01.gif" style="cursor:hand;" id="refreshlnk" onclick="javascript:refreshtoppers();">';
					}
					document.getElementById('spantoppers').innerHTML =strrtn;
					//document.getElementById('spantoppers').innerHTML = 'Hello';
					//receiveReq.abort();
				}
			}
