function objetoAjax(){
        var xmlhttp=false;
        try {
               xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
               try {
                  xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
               } catch (E) {
                       xmlhttp = false;
               }
        }

        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
               xmlhttp = new XMLHttpRequest();
        }
        return xmlhttp;
}

function bodyAjax(url,bot){
        var a="document.getElementsByName('name" + bot + "')";
	    v=eval(a);
	    if(v[0]){
     	  v[0].focus();
		  
	    }
	    datos="body2.php?" + url;
		datos=datos.replace("'", "");
		

        ajax=objetoAjax();
        ajax.open("GET", datos);
        ajax.onreadystatechange=function() {
               if (ajax.readyState==4) {
                       param=ajax.responseText;
					  // matriu=new Array();
                      // matriu=param.split("@#-&");
					   document.getElementById('central').innerHTML="";
					   document.getElementById('central').innerHTML=param;
					   window.scroll(0,0);
					  // document.getElementById('central').innerHTML=matriu[0]; 
					  // document.getElementById('central').scrollTop=matriu[1];
					 
					 
					   //style.backgroundImage="url(img/back.png)";
			    }
		}
        ajax.send(null)
		  
}

function catAjax2(s,c,id){
	    datos="oper/catAjax2.php?s=" + s + "&c=" + c + "&id=" + id;
	    document.forms[0].action="oper/catAjax2.php?s=" + s + "&c=" + c + "&id=" + id;
        ajax=objetoAjax();
        ajax.open("GET", datos);
        ajax.onreadystatechange=function() {
               if (ajax.readyState==4) {
                       param=ajax.responseText;
					   matriu=new Array();
                       matriu=param.split("@#-&");
					   document.getElementById('res').innerHTML=matriu[0]; 
					   document.getElementById('res').scrollTop=matriu[1];
			    }
		}
        ajax.send(null)
}
                      
