function popupfotos(foto,x,y){ 
	   var win_hija;
	   prop=x/y;
	   sc='';
	   if (x>screen.availWidth) {x=screen.availWidth; 
	   y=x/prop; 
	   //sc=',scrollbars=1';
	   }
	   if (y>screen.availHeight) { y=screen.availHeight; 
	   x=y*prop; 
	   //sc=',scrollbars=yes';
	   }
	   
	   win_hija = window.open('fotos.php?foto='+foto+'&w='+x+'&h='+y,'','width='+(x+4)+',height='+(y+4)+',status=no'+sc) 
	}
	
	function popup(url){ 
	   var win_hija;
	   win_hija = window.open(url,'width=760,height='+(screen.availHeight-50)+',status=no') 
	}
	
	function nuevoAjax(){
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 cargadiv(url,capa) { 
	var ajax=nuevoAjax();
	var contenedor = document.getElementById(capa);
	contenedor.innerHTML='cargando...';	
	 var nocache = Math.random();
	 //alert(url+'&nocahe='+nocache.toString());
	 ajax.open("GET", url+'&nocahe='+nocache.toString(),true);
	 ajax.onreadystatechange=function() {
			
	if (ajax.readyState==4) {
		
		contenedor.innerHTML=ajax.responseText;	
		//alert(ajax.responseText);
	}
	}
	ajax.send(null);
	}
	
function cargadiv2(url,capa) {
	
	var ajax2=nuevoAjax();
	nocache = Math.random();
	 ajax2.open("GET", url+'&nocahe='+nocache.toString(),true);
	 ajax2.onreadystatechange=function() {
			
	if (ajax2.readyState==4) {
		contenedor = document.getElementById(capa);
		contenedor.innerHTML=ajax2.responseText;	
	}
	}
	ajax2.send(null);
	}
