 /**
 * @author screamge
 */


var Leaders = function (){
	this.http = this.getHTTPObject ();
}

Leaders.prototype = {
	getHTTPObject: function () {
	
	if (window.XMLHttpRequest) {
	     var xmlhttp = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
	     var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}	 
	return xmlhttp;
	},
	
	loaddata: function (type, obj){
    this.object = obj;
	if (type != '') {
		this.types = type;
	}

    $("#leader").remove();
    $("#leadtb").append("<tr bgcolor='#FFFFFF' id='leader'><td align='center' colspan='5'><img src='images/getimage.gif'></td></tr>");
	
	this.r = Math.random ();
	var mes = 'lead_js.php?r=' + this.r + '&type=' + this.types;
	
	this.http.open("GET", mes, true);
	this.http.onreadystatechange = this.delegate (this, this.onloadform);
	this.http.send(null);
	}, 
	
	
	onloadform: function (){
	if (this.http.readyState == 4) {
		var text = this.http.responseText;
		$("#leader").remove()
                $("#leadtb").append(text);
	}
	}, 
	
	
	delegate: function (obj, method ) {
    return function() { return method.call(obj); }
  	}
} 




