 function JimetAjaxObj() { 
  	this.req = null;
	this.url = null;
	this.method = 'GET';
	this.async = true;
	this.status = null;
	this.statusText = '';
	this.postData = null;
	this.readyState = null;
	this.responseText = null;
	this.responseXML = null;
	this.handleResp = null;
	this.handleErr = null;
	this.responseFormat = 'text', // 'text', 'xml', or 'object'
	this.mimeType = null; 
	
	this.init = function(){
		 if (!this.req)
		 {
		 	try{
		 		 this.req = new XMLHttpRequest();
		 	}
		 	catch(e){
			 	try{
			 		 this.req = new ActiveXObject('MSXML2.XMLHTTP');
			 	}
			 	catch(e){
				 	try{
				 		 this.req = new ActiveXObject('Microsoft.XMLHTTP');
				 	}
				 	catch(e){ return false; }			 	
			 	}		 	
		 	} 			 			 	
		 }
		 return this.req;
	};
	
	this.doReq = function(){
		if (!this.init()){
 			alert('Could not create XMLHttpRequest object.');
			return; 	 	 
	 	}
	 	this.req.open(this.method, this.url, this.async); 
 		if (this.mimeType) {
 			try {
   				req.overrideMimeType(this.mimeType);
 			}
 			catch (e) {
   				// couldn't override MIME type  --  IE6 or Opera?
 			} 	
 		} 	
	 	var self = this;
	 	this.req.onreadystatechange = function() { 
	 		 if (self.req.readyState == 4){
    			switch (self.responseFormat) {
     				case 'text':
			       		resp = self.req.responseText;
			       		break;
     				case 'xml':
						// code for IE
						if (window.ActiveXObject)
						{
							var resp=new ActiveXObject("Microsoft.XMLDOM");
						  	resp.async="false";
						  	resp.loadXML(self.req.responseText);
						}
						// code for Mozilla, Firefox, Opera, etc.
						else
						{
						  	var parser=new DOMParser();
						  	var resp=parser.parseFromString(self.req.responseText,"text/xml");
						}     					
       					break;
     				case 'object':
       					resp = req;
       					break;
   				}
    			if (self.req.status >= 200 && self.req.status <= 299) {
    				//alert ("RESPONSE : " + self.responseFormat + " : " + resp);
     				self.handleResp(resp);
   				}	
   				else {
   					alert("HATA : " + resp);
     				self.handleErr(resp);
   				}    				 	 		 
	 		 }	 		 
	 	};
      	this.req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      	this.req.setRequestHeader("Content-length", this.postData.length);
      	this.req.setRequestHeader("Connection", "close");	 	
	 	//alert ("POSTDATA : " +this.url + this.postData);
	 	this.req.send(this.postData);
	};
	
	
	this.setMimeType = function(mimeType) {
 		this.mimeType = mimeType;
	};
	
	this.setPostData = function(postData) {
 		this.postData = postData;
	};
		
	this.handleErr = function() {
 		var errorWin;
 		try {
   			//errorWin = window.open('', 'errorWin');
   			//errorWin.document.body.innerHTML = this.responseText;
 			//alert(this.responseText);
 		}
 		catch (e) {
	   		alert('An error occurred, but the error message cannot be '
		     + 'displayed. This is probably because of your browser\'s '
		     + 'pop-up blocker.\n'
		     + 'Please allow pop-ups from this web site if you want to '
		     + 'see the full error messages.\n'
		     + '\n'
		     + 'Status Code: ' + this.req.status + '\n'
		     + 'Status Description: ' + this.req.statusText);
 		}
	};	 	
	
 	this.doGet = function(url, hand, format) {
 		this.url = url;
 		this.handleResp = hand;
 		this.responseFormat = format || 'text';
 		this.doReq();
	};	

 	this.doPost = function(url, hand, format) {
 		this.method = 'POST';
 		this.url = url;
 		//alert(this.url);
 		this.handleResp = hand;
 		this.responseFormat = format || 'text';
 		this.doReq();
	};	
 }
 
