﻿
var newsHTTP=getreq();

function newsload(strval)
{
    var sPath = window.location.pathname;
    var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
   var time=new Date(); 
    var url="/ajax/ajax-news.aspx";    
       url=url+"?year="+strval+"&time="+time.getMilliseconds();  
        newsHTTP.open('GET',url,false);                               
        newsHTTP.send(null);  
        if(newsHTTP.responseText)
        {	
           strval = newsHTTP.responseText;
           document.location = sPage+'?'+strval;
        }  
}



function getreq()
{ // returns false if exists
	if(window.ActiveXObject)
	 { // if IE
		try
		 {
		    return new ActiveXObject("Msxml2.XMLHTTP");
	    }
	    catch(e)
	    {
		    try
		    {
		        return new ActiveXObject("Microsoft.XMLHTTP");
		    }
		    catch(e)
		    {
		        return;
		    }
		}
	}
	else if(window.XMLHttpRequest)
	{ // if Mozilla, Safari, etc.
		return new XMLHttpRequest();
	}
}


