function renewData ()
{

this.notowania_imageReturnText='';
this.myXmlObject=null;
this.intervalTime = 4*60*1000;
this.activations=0;

this.getXMLObject=function()
	{
  	var xmlHttp;
  	try	
		{
    		xmlHttp=new XMLHttpRequest(); 
  		} 
	catch(e) 
		{
    
    		try 
		
			{
      			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); 
    		}
	 
		catch(e)
 
			{
	
			try 
				
				{
			        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); 
      			} 
			catch(e) 
				
				{
				    alert("ERROR - Can't create Xml object!");
        			return false;
      			}
    		}
  		}
  	return xmlHttp; 
	};

this.checkData =function() 
	{
	var myString;
      	if (this.readyState == 4) 
		{
         	if (this.status == 0 || this.status == 200) 
			{
          		notowania_imageReturnText = this.responseText; 
          		document.getElementById("notowania_image").innerHTML = notowania_imageReturnText;
         	} 
            else
            {
                myString =" "+this.status;
                alert("ERROR - Page not responding! Error no:"+myString+", error status: "+this.statusText+".");
            }
        }
        else 
        {

        }
   	};

this.activate = function()
    {

    if (this.myXmlObject==null) this.myXmlObject=this.getXMLObject();
    this.myXmlObject.open("GET","http://www.atinwestor.pl/notowania/prepImg.php?activation="+this.activations,true);    
    this.myXmlObject.onreadystatechange = this.checkData;
    this.myXmlObject.setRequestHeader("Content-Type", "text/html"); 
    this.myXmlObject.send();
    }

}

var dataSwapper = new renewData();
window.setInterval("dataSwapper.activate()",dataSwapper.intervalTime);
dataSwapper.activate();
