var AjaxRequest = 
    function( onCompleteFunc ,vargs) 
    { 
        this.onComplete = onCompleteFunc;
        this._isBusy = false;
        this._request = null;
		 this.args = vargs;
    }
AjaxRequest.prototype.submit = 
    function( url, qs ) 
    {
	var _this = this;
	this._request = this._getXMLHTTP();
	if ( !this._request ) return;
	this._isBusy = true;
	this._request.onreadystatechange = function() 
	{ _this._onReadyStateChange() };
	this._request.open( "GET", url + qs, true );
	this._request.send( null );
    }
AjaxRequest.prototype._onReadyStateChange = 
    function() 
    {
        var req = this._request;
	if ( req.readyState == 4 ) 
        {
	   this._isBusy = false;
           if( req.status != 200 ){
			//  alert ( req.statusText ) 
			}else if( this.onComplete ) {
//	   alert(req.responseText)
              this.onComplete ( req.responseText ,this.args)};	   
	}
    }
AjaxRequest.prototype._getXMLHTTP = 
    function() 
    {
       try { 
         return new ActiveXObject( 
           "Msxml2.XMLHTTP" ); 
       } catch(e) {};
       try { 
         return new ActiveXObject( 
           "Microsoft.XMLHTTP" ); 
       } catch(e) {};
       try { 
         return new XMLHttpRequest; 
       } catch(e) {};
       alert( "AJAX is not supported!" );
       return null;
    }
AjaxRequest.prototype.isBusy = 
    function() 
    { 
       return this._isBusy; 
    }
	
	
	
	function getPos(e)
{

	var obj = e;

	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft;
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	
	var obj = e;
	
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop;
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;

	return {x:curleft, y:curtop};
};


      

