function iniciar() {
    try {
    	aopen = new XMLHttpRequest();
    } catch (e) {
           try {
            	aopen = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (E) {
            	try
            	{
            		aopen = new ActiveXObject("Microsoft.XMLHTTP");		
            	}
            	catch(e)
            	{
                	aopen = false;
                }
            }
   }
   return aopen;
}

function inclourepag(web, contingut) {
	var conec=false;
	conec=iniciar();
	conec.open('GET', 'web.php?aviso=0&web='+web, true);
	conec.onreadystatechange=function() {
		if (conec.readyState==1) {
			document.getElementById(contingut).innerHTML = "";
			document.getElementById(contingut).innerHTML = "Cargando...";
		}
		if(conec.readyState==4) {
			if(conec.status==200)
			{	
				//document.getElementById("estat").style.display = 'none'; 
				document.getElementById(contingut).innerHTML = "";
				document.getElementById(contingut).innerHTML = conec.responseText;
			}
			else
			{
				document.getElementById(contingut).innerHTML = "<div align=\"center\">No se ha podido mostrar la página</div>";
			}
		}
	}
	conec.send(null);	
}
