function core_ajax(){

	this.xmlHttp;

	this.core_ajax = function(){  
		try{
			// Firefox, Opera 8.0+, Safari    
			xmlHttp=new XMLHttpRequest();    
		}catch (e){
			// Internet Explorer    
			try{
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
			}catch (e){
				try{
					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
				}catch (e){
					alert('AJAX: Loading Error');
					return false;        
				}      
			}    
		}
	}

	this.ajax_send = function( type, link, async, function_name ){

		if( link != null ){

			xmlHttp.abort();
			
			xmlHttp.onreadystatechange = function(){
				if( xmlHttp.readyState == 4 ){
					return_value = xmlHttp.responseText;
					if( return_value != 'NULL' )
						function_name( return_value );
				}
			}			
		
			xmlHttp.open( type, link, async );
			xmlHttp.send( null );
		}
	}
	
	core_ajax();
			
}

ajax = new core_ajax();
