	
	//--------------------------------------------------
    // Charset
    //--------------------------------------------------

	try
	{
		if( !charset )
		{
			var charset = "";
		}
	}
	catch(e)
	{}		
	
	//--------------------------------------------------
    // Object
    //--------------------------------------------------
	
	function ajax()
	{
		this.allowUse 		= false;
		this.handler 		= null;
		this.errorString 	= "";
		this.loading 		= false;
		this.loadingDiv 	= null;
	}
	
	//--------------------------------------------------
    // Init
    //--------------------------------------------------
	
	ajax.prototype.init = function()
	{
		try
		{
			this.handler 	= new XMLHttpRequest();
			this.allowUse 	= true;
			return true;
		}
		catch(e)
		{
			try
			{
				this.handler 	= new ActiveXObject( 'Microsoft.XMLHTTP' );
				this.allowUse 	= true;
				return true;
			}
			catch(e)
			{
				return false;
			}
		}
	}
	
	//--------------------------------------------------
    // Get process
    //--------------------------------------------------
	
	ajax.prototype.process = function( url, type, post )
	{		
		type = type == "POST" ? "POST" : "GET";
		
		if( !this.handler )
		{
			this.init();
		}
		
		if( !this.notReady() )
		{
			this.handler.open( type, url, true );
			
			if( type == "GET" )
			{
				this.handler.send( null );
			}
			else
			{
				var postVals = this.postFormat( post );
				
				if ( typeof( this.handler.setRequestHeader ) != "undefined" )
				{
					this.handler.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded; charset=' + charset );
				}
				this.handler.send( postVals );
			}

			if( this.handler.readyState == 4 && this.handler.status == 200 )
			{
				return true;
			}
		}
		
		return false;
	}
	
	//--------------------------------------------------
    // Not ready yet
    //--------------------------------------------------
	
	ajax.prototype.notReady = function()
	{
		return ( this.handler.readyState && ( this.handler.readyState < 4 ) );
	}
	
	//--------------------------------------------------
    // Is ready now
    //--------------------------------------------------
	
	ajax.prototype.isReady = function()
	{
		return ( this.handler.readyState == 4 && this.handler.status == 200 ) ? true : false;
	}
	
	//--------------------------------------------------
    // On ready alias
    //--------------------------------------------------
	
	ajax.prototype.onReady = function (event )
	{
		this.onreadystatechange( event );
	}
	
	//--------------------------------------------------
    // Do on ready action
    //--------------------------------------------------
	
	ajax.prototype.onreadystatechange = function( event )
	{
		if( !this.handler )
		{
			this.init();
		}
		
		if( typeof( event ) == 'function' )
		{
			this.handler.onreadystatechange = event;
		}
	}
	
	//--------------------------------------------------
    // Return post format
    //--------------------------------------------------
	
	ajax.prototype.postFormat = function( array )
	{
		var str = "";
		
		try
		{
			for( var i in array )
			{
				str += i + "=" + this.encodeUrl( array[ i ] ) + "&";
			}
		}
		catch(e)
		{}
		
		return str;
	}
	
	//--------------------------------------------------
    // Encode url
    //--------------------------------------------------
	
	ajax.prototype.encodeUrl = function( url )
	{
		return url;
		
		// 
		
		url = url.toString();
	
		var regcheck = url.match( /[\x90-\xFF]/g );
		
		if( regcheck )
		{
			for( var i = 0; i < i.length; i++ )
			{
				url = url.replace( regcheck[ i ], '%u00' + ( regcheck[ i ].charCodeAt( 0 ) & 0xFF ).toString( 16 ).toUpperCase() );
			}
		}
	
		return escape( url ).replace( /\+/g, "%2B" );
	}
	
	//--------------------------------------------------
    // Show loading
    //--------------------------------------------------
	
	ajax.prototype.showLoading = function( message )
	{
		if( !this.loading )
		{
			this.loading = true;
			
			if( message )
			{
				document.getElementById( 'loading-text' ).innerHTML = message;
			}
			
			this.loadingDiv 		= new Div();
			this.loadingDiv.name 	= 'loading';
			this.loadingDiv.init();
			this.loadingDiv.showMe();
			this.loadingDiv.onCenter();
		}
		
		return;
	}
	
	//--------------------------------------------------
    // Hide loading
    //--------------------------------------------------
	
	ajax.prototype.hideLoading = function()
	{
		try
		{
			this.loadingDiv.hideMe();
		}
		catch(e)
		{}
		
		this.loading = false;
		return;
	}
	
	/*
	doRequest = function()
	{	
		if ( ! xmlobj.isReady() )
		{
			xmlobj.showLoading();
			return;
		}
		
		xmlobj.hideLoading();
				
		var text = xmlobj.handler.responseText;
	}
	
	var xmlobj = new ajax();
	xmlobj.onReady( doRequest );
	xmlobj.process( url );
	*/