function ajx(){
    var el;
    var txt_arr;
    var fl;
    var find_div = '';
    var hide_div = 1; // whether to hide or not hide dive that has no data
    var el_type;
    var ret = 0;
    var mode = '';
	var debug = 0;
    var div_center_start = '<table width="100%" height="100%" align="center" valign="center"><tr><td width="100%"  class="design" height="100%" align="center" valign="center" style="padding-left:5px; padding-right:3px;">';
    var div_center_end = '</td></tr></table>';
    
    this.add_element = function(el){
        this.el =  el;
        return ;
    };
    
    this.remove_element = function(){
        this.el =  null;
        return ;
    };
	this.set_mode = function(text){
        this.mode =  text;
        return ;
    };
    
    this.unset_mode = function(){
        this.mode =  null;
        return ;
    };
    
    this.debug_on = function(){
        this.debug = 1;
    };
    
    this.debug_off = function(){
        this.debug = 0;
    };
    
    this.set_return = function(){
        this.ret = 1;
        return;
    };
    
    this.unset_return = function(){
        this.ret = 0;
        return;
    };
    
    
    this.set_imgpath = function(path){
        this.img_path = path;
        return;
    };
    
    this.set_hide_div = function(v){
        this.hide_div = v;
        return;
    }
    
    this.add_type = function(type){
        this.el_type = type;
        return;
    };
    
    this.remove_type = function(){
        this.el_type = null;
        return;
    };
    
    this.set_find_div = function(id){
        this.find_div = id;
		return;
    }
    
    this.get_div_center_start= function(){
        return div_center_start;
    }
    
    this.get_div_center_end= function(){
        return div_center_end;
    }
    
    this.ajaxRead = function(file){
        this.fl = file; 
        this.show_error(" link :: "+file);
      var xmlObj = null;
      if(window.XMLHttpRequest){
          xmlObj = new XMLHttpRequest();
      } else if(window.ActiveXObject){
          xmlObj = new ActiveXObject("Microsoft.XMLHTTP");
      } else {
          return;
      }
       xmlObj.onreadystatechange = function(){
        if(xmlObj.readyState == 4){
          ajx.show_error(" text received : " + xmlObj.responseText);
		  ajx.processXML(xmlObj.responseText);
		}
      }
      
      xmlObj.open ('POST', file, true);
      xmlObj.send ('');
    };
    
    
    this.processXML = function(obj){
        this.show_error(" XML object :: "+this.$(this.el));
        switch(this.mode)
		{
			case "price" :
				this.$(this.el).innerHTML = "$" + obj;
			break;
			default:
            	this.$(this.el).innerHTML = obj;
			break;
		}
		
		if(!this.el || this.el == (''|| null ) || this.el_type == ('' || null) || !this.$(this.el))
            return;
    };
    
    this.$ = function(id){
        if(!id)
        return null;
        if(document.getElementById(id)){
            var tmp = document.getElementById(id);
            return tmp;
        }
        return false;
    };
    
    this.echo = function(vl){
        alert(vl);
        return true;
    };
    
    this.show_error = function(vl){
        if(this.debug)
            alert(vl);
        return true;
    };

   
}



