function ajaxHandler(load, loadhtml, cont, method, url, values) 
{ 

	var tagScript = '(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)'; 
	String.prototype.evalScript = function() { 
	    return (this.match(new RegExp(tagScript, 'img')) || []).evalScript(); 
	}; 
	String.prototype.stripScript = function() { 
	    return this.replace(new RegExp(tagScript, 'img'), ''); 
	}; 
	String.prototype.extractScript = function() { 
	    var matchAll = new RegExp(tagScript, 'img'); 
	    return (this.match(matchAll) || []); 
	}; 
	Array.prototype.evalScript = function(extracted) { 
	    var s = this.map(function(sr) { 
	    	setTimeout(((sr.match(new RegExp(tagScript, 'im')) || ['', ''])[1]),0); 
	    }); 
	    return true; 
	}; 
	Array.prototype.map = function(fun) { 
		if (typeof fun !== "function") {return false;} 
	    var i = 0, l = this.length; 
	    for(i = 0; i < l; i++) { 
	    	fun(this[i]); 
	    } 
	    return true; 
	}; 
	
		
	this.handler = false;
	
	var objetus = false;
    try { 
        objetus = new ActiveXObject("Msxml2.XMLHTTP"); 
    } 
    catch(e) {
      	try { 
            objetus = new ActiveXObject("Microsoft.XMLHTTP"); 
        } 
        catch(e) {
        	try {objetus = new ActiveXObject("Msxml2.XMLHTTP.3.0");}
        	catch(e) {
        		try {objetus = new ActiveXObject("Msxml2.XMLHTTP.4.0");}
        		catch(e) {
        			try {objetus = new ActiveXObject("Msxml2.XMLHTTP.5.0");}
        			catch(e) { objetus = false; }
        		}
        	}
        }
        	
    } 
    if (!objetus && typeof XMLHttpRequest != 'undefined') {    	
        objetus = new XMLHttpRequest(); 
    } 
    
    this.handler = objetus; 

	
    var obj = this.handler;
    var send;

    if(method.toUpperCase() == "POST") {
    	send = values;
    }
	else if(method.toUpperCase() == "GET") {
		url += '?'+values; 
		send = null;
	}
	
   	obj.open(method, url, true);
    		
    obj.onreadystatechange = function() { 
    	if (obj.readyState != 4) {
    		if (load != "") {
 		   		//alert('');		
				document.getElementById(load).innerHTML = loadhtml;
    		}
    	}
        else {
            //if(obj.readyState == 4) { 
            	if(obj.status == 200) {
            		if(load != cont) 
						if (load != "")
							document.getElementById(load).innerHTML = "";

					var scs = obj.responseText.extractScript();
        			if(cont != "")
            			document.getElementById(cont).innerHTML = obj.responseText; 		
        			scs.evalScript();

            	}
            	else
            		alert('Error '+obj.status);
            //}
    	} 
    } 
    obj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    obj.send(send); 

} 




/**************************************************************************
***************************************************************************
***************************************************************************/
var tagScript = '(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)'; 
String.prototype.evalScript = function() { 
    return (this.match(new RegExp(tagScript, 'img')) || []).evalScript(); 
}; 
String.prototype.stripScript = function() { 
    return this.replace(new RegExp(tagScript, 'img'), ''); 
}; 
String.prototype.extractScript = function() { 
    var matchAll = new RegExp(tagScript, 'img'); 
    return (this.match(matchAll) || []); 
}; 
Array.prototype.evalScript = function(extracted) { 
    var s = this.map(function(sr) { 
    	setTimeout(((sr.match(new RegExp(tagScript, 'im')) || ['', ''])[1]),0); 
    }); 
    return true; 
}; 
Array.prototype.map = function(fun) { 
	if (typeof fun !== "function") {return false;} 
    var i = 0, l = this.length; 
    for(i = 0; i < l; i++) { 
    	fun(this[i]); 
    } 
    return true; 
};  


function objetus() { 
	var objetus = false;
    try { 
        objetus = new ActiveXObject("Msxml2.XMLHTTP"); 
    } 
    catch(e) {
      	try { 
            objetus = new ActiveXObject("Microsoft.XMLHTTP"); 
        } 
        catch(e) {
        	try {objetus = new ActiveXObject("Msxml2.XMLHTTP.3.0");}
        	catch(e) {
        		try {objetus = new ActiveXObject("Msxml2.XMLHTTP.4.0");}
        		catch(e) {
        			try {objetus = new ActiveXObject("Msxml2.XMLHTTP.5.0");}
        			catch(e) { objetus = false; }
        		}
        	}
        }
        	
    } 
    if(!objetus && typeof XMLHttpRequest != 'undefined') {    	
        objetus = new XMLHttpRequest(); 
    } 
    return objetus; 
} 



function getResults(load, loadhtml, cont, method, url, values) { 
    var obj = objetus();
    var send;

    if(method.toUpperCase() == "POST") {
    	send = values;
    }
	else if(method.toUpperCase() == "GET") {
		url += '?'+values; 
		send = null;
	}
	
   	obj.open(method, url, true);
    		
    obj.onreadystatechange = function() { 
    	if (obj.readyState != 4) {
    		if (load != "")
				document.getElementById(load).innerHTML = loadhtml;
    	}
        else {
            //if (obj.readyState == 4) { 
            	if (obj.status == 200) {
            		if (load != cont) 
						if (load != "")
							document.getElementById(load).innerHTML = "";
            		var scs = obj.responseText.extractScript();
        			if(cont != "")
            			document.getElementById(cont).innerHTML = obj.responseText; 		
        			scs.evalScript();

            	}
            	else
            		alert('Error '+obj.status);
            //}
    	} 
    } 
    obj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    obj.send(send); 
	
    return;
}