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 cambiaedificio(op){//u= ubicacion puede ser c de ciudad o z de zona
	ajax=objetoAjax();
	if(op=='s'){
		//alert(indiceactual+" < "+arredificios.length);
		
		if(indiceactual<arredificios.length-1){
			indiceactual++;	
	}else{
			indiceactual=0;
		}
	}else{		
		if(indiceactual>0){
			indiceactual--;	
		}else{
			indiceactual= arredificios.length-1;
		}
			
	}
	cantidadedificios = arredificios.length;
	datos="obtiene_edificios.php?id=" + arredificios[indiceactual]+"&indiceactual="+indiceactual+"&cantidadedificios="+cantidadedificios+"&tipo=" + lateral_tipo;
	//alert(datos);
	ajax.open("GET",datos);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {						
				document.getElementById('contenido_edificio').innerHTML = ajax.responseText;
		}
	}
	ajax.send(null);
}



function abrirventana(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function cerrar(){
	window.opener.agregaridnoticias(window.contenido.document.getElementById('selccionadas').value);
	window.opener.focus();
	window.close();
	
}


