// JavaScript Document
function sustituye(id){
	if(id == 'fb'){
		if(document.getElementById('fb').src == 'http://www.cibervoluntarios.org/img/icons/fb.png'){
			document.getElementById('fb').src= 'http://www.cibervoluntarios.org/img/icons/fbOn.png';
		}
		else{
			document.getElementById('fb').src= 'http://www.cibervoluntarios.org/img/icons/fb.png';
		}					
	}
	else if(id == 'tw'){
		if(document.getElementById('tw').src == 'http://www.cibervoluntarios.org/img/icons/tw.png'){
			document.getElementById('tw').src= 'http://www.cibervoluntarios.org/img/icons/twOn.png';
		}
		else{
			document.getElementById('tw').src= 'http://www.cibervoluntarios.org/img/icons/tw.png';
		}					
	}
	else if(id == 'fk'){
		if(document.getElementById('fk').src == 'http://www.cibervoluntarios.org/img/icons/fk.png'){
			document.getElementById('fk').src= 'http://www.cibervoluntarios.org/img/icons/fkOn.png';
		}
		else{
			document.getElementById('fk').src= 'http://www.cibervoluntarios.org/img/icons/fk.png';
		}					
	}
	else if(id == 'yt'){
		if(document.getElementById('yt').src == 'http://www.cibervoluntarios.org/img/icons/yt.png'){
			document.getElementById('yt').src= 'http://www.cibervoluntarios.org/img/icons/ytOn.png';
		}
		else{
			document.getElementById('yt').src= 'http://www.cibervoluntarios.org/img/icons/yt.png';
		}					
	}
	else if(id == 'gp'){
		if(document.getElementById('gp').src == 'http://www.cibervoluntarios.org/img/icons/IMG_G+_OFF.jpg'){
			document.getElementById('gp').src= 'http://www.cibervoluntarios.org/img/icons/IMG_G+_ON.jpg';
		}
		else{
			document.getElementById('gp').src= 'http://www.cibervoluntarios.org/img/icons/IMG_G+_OFF.jpg';
		}					
	}	
	else if(id == 'tu'){
		if(document.getElementById('tu').src == 'http://www.cibervoluntarios.org/img/icons/tu.png'){
			document.getElementById('tu').src= 'http://www.cibervoluntarios.org/img/icons/tuOn.png';
		}
		else{
			document.getElementById('tu').src= 'http://www.cibervoluntarios.org/img/icons/tu.png';
		}					
	}
}

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 MostrarConsulta(datos){
	
	// bueno a partir de aquí;
	divResultado = document.getElementById('cajas');
	divFotos = document.getElementById('fotosFlickr');	
	divCuerpo = document.getElementById('cuerpo');		
	ajax=objetoAjax();
	ajax.open("GET", datos);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			divCuerpo.style.height = screen.availHeight+'px';			
			divResultado.style.display = 'block';
			divResultado.innerHTML = ajax.responseText
			divFotos.style.display= 'none';
		}
	}
	ajax.send(null)
}

function MostrarConsulta1(datos){
	
	// bueno a partir de aquí;
	divResultado = document.getElementById('slider');
	ajax=objetoAjax();
	ajax.open("GET", datos);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			divResultado.innerHTML = ajax.responseText
		}
	}
	ajax.send(null)
}

