//Imgs de cada sección

$(document).ready(function() { 



$('#texto').jScrollPane();
$('#texto_nosotros').jScrollPane();



//Valores iniciales (desaparecer)
$(".derecha").animate({opacity: 0},0);
//$("#texto").animate({opacity: 0},500);
//$("#fondo_azul").animate({opacity: 0},0);


$("#derecha_sitios_interes").animate({opacity: 1},1000);


//Aparecer texto en mouseenter
/*$('.derecha').mouseenter(function(){
$("#texto").animate({opacity: 1},500);
$("#fondo_azul").animate({opacity: .7},500);
	});
	//...desaparecer	
$('.derecha').mouseleave(function(){
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);
	});
*/





//Intercambio de fotos por sección
var secc1 = new Array();  //Quienes somos

secc1[0] = 'fotos/generales/4';
secc1[1] = 'fotos/generales/5';
secc1[2] = 'fotos/cv/3';
secc1[3] = 'fotos/oficinas/5';


$("#derecha_somos").css('background', 'url('+secc1[0]+'_big.jpg)');
$("#derecha_somos").animate({opacity: 1},1000);

$('#izq1').click(
function(){	$("#derecha_somos").css('background', 'url('+secc1[1]+'_big.jpg)'); 
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);

	}
);

$('#izq2').click(
function(){	$("#derecha_somos").css('background', 'url('+secc1[2]+'_big.jpg)');	
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);}
);

$('#izq3').click(
function(){	$("#derecha_somos").css('background', 'url('+secc1[3]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#derecha_somos').click(
function(){	$("#derecha_somos").css('background', 'url('+secc1[0]+'_big.jpg)');
$("#texto").animate({opacity: 1},0);
$("#fondo_azul").animate({opacity: .7},500);	}
);



//Intercambio de fotos por sección
var secc1m = new Array();  //Mision

secc1m[0] = 'fotos/amarilla/8';
secc1m[1] = 'fotos/generales/5';
secc1m[2] = 'fotos/cv/3';
secc1m[3] = 'fotos/oficinas/5';


$("#derecha_mision").css('background', 'url('+secc1m[0]+'_big.jpg)');
$("#derecha_mision").animate({opacity: 1},1000);

$('#izq1').click(
function(){	$("#derecha_mision").css('background', 'url('+secc1m[1]+'_big.jpg)'); 
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);

	}
);

$('#izq2').click(
function(){	$("#derecha_mision").css('background', 'url('+secc1m[2]+'_big.jpg)');	
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);}
);

$('#izq3').click(
function(){	$("#derecha_mision").css('background', 'url('+secc1m[3]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#derecha_mision').click(
function(){	$("#derecha_mision").css('background', 'url('+secc1m[0]+'_big.jpg)');
$("#texto").animate({opacity: 1},0);
$("#fondo_azul").animate({opacity: .7},500);	}
);






//Intercambio de fotos por sección
var secc1we = new Array();  //Nosotros

secc1we[0] = 'fotos/nosotros/maria';
secc1we[1] = 'fotos/nosotros/carolina';
secc1we[2] = 'fotos/nosotros/guillermo';
secc1we[3] = 'fotos/nosotros/roberto';
secc1we[4] = 'fotos/generales/2';

$("#derecha_nosotros").css('background', 'url('+secc1we[4]+'_big.jpg) no-repeat center');
$("#texto_nosotros").css('background', 'url('+secc1we[0]+'.jpg) no-repeat top left');
$("#derecha_nosotros").animate({opacity: 1},1000);

$('#izq11').click(
function(){	$("#texto_nosotros").css('background', 'url('+secc1we[1]+'.jpg) no-repeat top left'); 
$("#texto_nosotros").html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><p><strong>Mta. Carolina Esquivel Flores</strong><br />Licenciatura en Psicología Clínica<br />Universidad Autónoma de Querétaro.<br />Ced. Prof. 4956997<br />Maestría en Prevención Integral del Consumo de Drogas.<br />Universidad Veracruzana, Xalapa, Veracruz.<br />Experiencia de 6 años en el área de adicciones en la modalidad residencial y psicoterapia ambulatoria.<br /><a href="mailto: carolina.esquivel@integravida.com">carolina.esquivel@integravida.com</a></p><br /><br /><br />');

	}
);

$('#izq22').click(
function(){	$("#texto_nosotros").css('background', 'url('+secc1we[2]+'.jpg) no-repeat top left');	
$("#texto_nosotros").html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><p><strong>Lic. José Guillermo del Hoyo Huidobro</strong><br />Licenciatura en Administración de Empresas.<br />Universidad Anáhuac.<br />Experiencia de 9 años en el área de adicciones en la modalidad residencial y de programas de medio camino.<br />Participación en  congresos nacionales e internacionales de adicciones.<br /><a href="mailto: guillermo.delhoyo@integravida.com">guillermo.delhoyo@integravida.com</a></p><br /><br /><br />');
}
);

$('#izq33').click(
function(){	$("#texto_nosotros").css('background', 'url('+secc1we[3]+'.jpg) no-repeat top left');
$("#texto_nosotros").html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><p><strong>Dr. Roberto Vázquez Ortega</strong><br />Médico Cirujano<br />Universidad Nacional Autónoma de México.<br />Ced.Prof. 907297<br />Experiencia de 15 años en el área de adicciones en cuatro clínicas de adicciones (Querétaro, Irapuato, San Miguel de Allende y León) como Médico Responsable y como Director de la clínica San Miguel de Allende.<br /><a href="mailto: roberto.vazquez@integravida.com">roberto.vazquez@integravida.com</a></p><br /><br /><br />');
}
);

$('#izq00').click(
function(){	$("#texto_nosotros").css('background', 'url('+secc1we[0]+'.jpg) no-repeat top left');
$("#texto_nosotros").html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><p><strong>Mta. María Guadalupe López Aguayo</strong><br />Licenciatura en Psicología Clínica<br />Universidad de Guanajuato<br />Ced. Prof. 3610696<br />Maestría en Prevención Integral del Consumo de Drogas.<br />Universidad Veracruzana, Xalapa, Veracruz.<br />Experiencia de 15 años en el área de adicciones en la modalidad residencial y psicoterapia ambulatoria.<br />Participación en 5 congresos nacionales e internacionales  de adicciones.<br /><a href="mailto: guadalupe.lopez@integravida.com">guadalupe.lopez@integravida.com </a></p><br /><br /><br />');
}
);












//Intercambio de fotos por sección
var seccte = new Array();  //Testimonios

seccte[0] = 'fotos/generales/4';
seccte[1] = 'fotos/azul/2';
seccte[2] = 'fotos/amarilla/1';
seccte[3] = 'fotos/generales/6';


$("#derecha_testimonios").css('background', 'url('+seccte[0]+'_big.jpg) no-repeat center');
$("#derecha_testimonios").animate({opacity: 1},1000);

$('#izq1').click(
function(){	$("#derecha_testimonios").css('background', 'url('+seccte[1]+'_big.jpg) no-repeat center'); 
}
);

$('#izq2').click(
function(){	$("#derecha_testimonios").css('background', 'url('+seccte[2]+'_big.jpg) no-repeat center');	
}
);

$('#izq3').click(
function(){	$("#derecha_testimonios").css('background', 'url('+seccte[3]+'_big.jpg) no-repeat center');
}
);

$('#derecha_testimonios').click(
function(){	$("#derecha_testimonios").css('background', 'url('+seccte[0]+'_big.jpg) no-repeat center');
$("#texto").animate({opacity: 1},0);
$("#fondo_azul").animate({opacity: .7},500);
}
);







var secc2 = new Array();  //Instalaciones

secc2[0] = 'fotos/generales/4';
secc2[1] = 'fotos/azul/6';
secc2[2] = 'fotos/amarilla/1';
secc2[3] = 'fotos/cv/1';


$("#derecha_instalaciones").css('background', 'url('+secc2[0]+'_big.jpg)');
$("#derecha_instalaciones").animate({opacity: 1},1000);

$('#izq1').click(
function(){	$("#derecha_instalaciones").css('background', 'url('+secc2[1]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#izq2').click(
function(){	$("#derecha_instalaciones").css('background', 'url('+secc2[2]+'_big.jpg)');	
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);}
);

$('#izq3').click(
function(){	$("#derecha_instalaciones").css('background', 'url('+secc2[3]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#derecha_instalaciones').click(
function(){	$("#derecha_instalaciones").css('background', 'url('+secc2[0]+'_big.jpg)');
$("#texto").animate({opacity: 1},0);
$("#fondo_azul").animate({opacity: .7},500);
	}
);







var secc21 = new Array();  //Instalaciones Casa Amarilla

secc21[0] = 'fotos/amarilla/2';
secc21[1] = 'fotos/amarilla/7';
secc21[2] = 'fotos/amarilla/4';
secc21[3] = 'fotos/amarilla/6';


$("#derecha_instalaciones_casa_amarilla").css('background', 'url('+secc21[0]+'_big.jpg)');
$("#derecha_instalaciones_casa_amarilla").animate({opacity: 1},1000);

$('#izq1').click(
function(){	$("#derecha_instalaciones_casa_amarilla").css('background', 'url('+secc21[1]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#izq2').click(
function(){	$("#derecha_instalaciones_casa_amarilla").css('background', 'url('+secc21[2]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#izq3').click(
function(){	$("#derecha_instalaciones_casa_amarilla").css('background', 'url('+secc21[3]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#derecha_instalaciones_casa_amarilla').click(
function(){	$("#derecha_instalaciones_casa_amarilla").css('background', 'url('+secc21[0]+'_big.jpg)');
$("#texto").animate({opacity: 1},0);
$("#fondo_azul").animate({opacity: .7},500);	}
);





var secc22 = new Array();  //Instalaciones Casa Azul

secc22[0] = 'fotos/azul/5';
secc22[1] = 'fotos/azul/1';
secc22[2] = 'fotos/azul/4';
secc22[3] = 'fotos/azul/2';


$("#derecha_instalaciones_casa_azul").css('background', 'url('+secc22[0]+'_big.jpg)');
$("#derecha_instalaciones_casa_azul").animate({opacity: 1},1000);

$('#izq1').click(
function(){	$("#derecha_instalaciones_casa_azul").css('background', 'url('+secc22[1]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#izq2').click(
function(){	$("#derecha_instalaciones_casa_azul").css('background', 'url('+secc22[2]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#izq3').click(
function(){	$("#derecha_instalaciones_casa_azul").css('background', 'url('+secc22[3]+'_big.jpg)');	
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500); }
);

$('#derecha_instalaciones_casa_azul').click(
function(){	$("#derecha_instalaciones_casa_azul").css('background', 'url('+secc22[0]+'_big.jpg)');
$("#texto").animate({opacity: 1},0);
$("#fondo_azul").animate({opacity: .7},500);	}
);







//Intercambio de fotos por sección
var secc12 = new Array();  //objetivos

secc12[0] = 'fotos/generales/2';
secc12[1] = 'fotos/generales/5';
secc12[2] = 'fotos/cv/3';
secc12[3] = 'fotos/oficinas/5';


$("#derecha_objetivos").css('background', 'url('+secc12[0]+'_big.jpg)');
$("#derecha_objetivos").animate({opacity: 1},1000);

$('#izq1').click(
function(){	$("#derecha_objetivos").css('background', 'url('+secc12[1]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#izq2').click(
function(){	$("#derecha_objetivos").css('background', 'url('+secc12[2]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#izq3').click(
function(){	$("#derecha_objetivos").css('background', 'url('+secc12[3]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#derecha_objetivos').click(
function(){	$("#derecha_objetivos").css('background', 'url('+secc12[0]+'_big.jpg)');	
$("#texto").animate({opacity: 1},0);
$("#fondo_azul").animate({opacity: .7},500);}
);











//Intercambio de fotos por sección
var secc12h = new Array();  //Historia

secc12h[0] = 'fotos/generales/7';
secc12h[1] = 'fotos/generales/5';
secc12h[2] = 'fotos/cv/3';
secc12h[3] = 'fotos/oficinas/5';


$("#derecha_historia").css('background', 'url('+secc12h[0]+'_big.jpg)');
$("#derecha_historia").animate({opacity: 1},1000);

$('#izq1').click(
function(){	$("#derecha_historia").css('background', 'url('+secc12h[1]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#izq2').click(
function(){	$("#derecha_historia").css('background', 'url('+secc12h[2]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#izq3').click(
function(){	$("#derecha_historia").css('background', 'url('+secc12h[3]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#derecha_historia').click(
function(){	$("#derecha_historia").css('background', 'url('+secc12h[0]+'_big.jpg)');	
$("#texto").animate({opacity: 1},0);
$("#fondo_azul").animate({opacity: .7},500);}
);






//Intercambio de fotos por sección
var secc12ff = new Array();  //filosofia

secc12ff[0] = 'fotos/generales/8';
secc12ff[1] = 'fotos/generales/5';
secc12ff[2] = 'fotos/cv/3';
secc12ff[3] = 'fotos/oficinas/5';


$("#derecha_filosofia").css('background', 'url('+secc12ff[0]+'_big.jpg)');
$("#derecha_filosofia").animate({opacity: 1},1000);

$('#izq1').click(
function(){	$("#derecha_filosofia").css('background', 'url('+secc12ff[1]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#izq2').click(
function(){	$("#derecha_filosofia").css('background', 'url('+secc12ff[2]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#izq3').click(
function(){	$("#derecha_filosofia").css('background', 'url('+secc12ff[3]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#derecha_filosofia').click(
function(){	$("#derecha_filosofia").css('background', 'url('+secc12ff[0]+'_big.jpg)');	
$("#texto").animate({opacity: 1},0);
$("#fondo_azul").animate({opacity: .7},500);}
);















//Intercambio de fotos por sección
var secc3 = new Array();  //Tratamiento

secc3[0] = 'fotos/cv/4';
secc3[1] = 'fotos/generales/3';
secc3[2] = 'fotos/actividades/3';
secc3[3] = 'fotos/actividdes/6';


$("#derecha_tratamiento").css('background', 'url('+secc3[0]+'_big.jpg)');
$("#derecha_tratamiento").animate({opacity: 1},1000);

$('#izq1').click(
function(){	$("#derecha_tratamiento").css('background', 'url('+secc3[1]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#izq2').click(
function(){	$("#derecha_tratamiento").css('background', 'url('+secc3[2]+'_big.jpg)');	
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);  }
);

$('#izq3').click(
function(){	$("#derecha_tratamiento").css('background', 'url('+secc3[3]+'_big.jpg)');	$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500); }
);

$('#derecha_tratamiento').click(
function(){	$("#derecha_tratamiento").css('background', 'url('+secc3[0]+'_big.jpg)');
$("#texto").animate({opacity: 1},0);
$("#fondo_azul").animate({opacity: .7},500);	}
);








//Intercambio de fotos por sección
var seccuuu = new Array();  //rehabilitacion

seccuuu[0] = 'fotos/azul/7';
seccuuu[1] = 'fotos/azul/8';
seccuuu[2] = 'fotos/generales/9';
seccuuu[3] = 'fotos/actividades/7';


$("#derecha_rehabilitacion").css('background', 'url('+seccuuu[0]+'_big.jpg)');
$("#derecha_rehabilitacion").animate({opacity: 1},1000);

$('#izq1').click(
function(){	$("#derecha_rehabilitacion").css('background', 'url('+seccuuu[1]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#izq2').click(
function(){	$("#derecha_rehabilitacion").css('background', 'url('+seccuuu[2]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#izq3').click(
function(){	$("#derecha_rehabilitacion").css('background', 'url('+seccuuu[3]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#derecha_rehabilitacion').click(
function(){	$("#derecha_rehabilitacion").css('background', 'url('+seccuuu[0]+'_big.jpg)');	
$("#texto").animate({opacity: 1},0);
$("#fondo_azul").animate({opacity: .7},500);}
);













//Intercambio de fotos por sección
var seccontacto = new Array();  //contacto

//seccontacto[0] = 'fotos/azul/7';
seccontacto[1] = 'fotos/cv/1';
seccontacto[2] = 'fotos/azul/9';
seccontacto[3] = 'fotos/azul/6';


$("#derecha_contacto").css('background', '#50BDEB;');
$("#derecha_contacto").animate({opacity: 1},1000);

$('#izq1').click(
function(){	$("#derecha_contacto").css('background', 'url('+seccontacto[1]+'_big.jpg)');
$("#texto_contacto").animate({opacity: 0},500);	}
);

$('#izq2').click(
function(){	$("#derecha_contacto").css('background', 'url('+seccontacto[2]+'_big.jpg)');
$("#texto_contacto").animate({opacity: 0},500);	}
);

$('#izq3').click(
function(){	$("#derecha_contacto").css('background', 'url('+seccontacto[3]+'_big.jpg)');
$("#texto_contacto").animate({opacity: 0},500);	}
);

$('#derecha_contacto').click(
function(){	$(".derecha").css('background', '#50BDEB');	
$("#texto_contacto").animate({opacity: 1},500);}
);








//Intercambio de fotos por sección
var secc4 = new Array();  //Programa

secc4[0] = 'fotos/cv/4';
secc4[1] = 'fotos/generales/';
secc4[2] = 'fotos/actividades/3';
secc4[3] = 'fotos/actividdes/6';


$("#derecha_programa").css('background', 'url('+secc4[0]+'_big.jpg)');
$("#derecha_programa").animate({opacity: 1},1000);

$('#izq1').click(
function(){	$("#derecha_programa").css('background', 'url('+secc4[1]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#izq2').click(
function(){	$("#derecha_programa").css('background', 'url('+secc4[2]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#izq3').click(
function(){	$("#derecha_programa").css('background', 'url('+secc4[3]+'_big.jpg)');
$("#texto").animate({opacity: 0},500);
$("#fondo_azul").animate({opacity: 0},500);	}
);

$('#derecha_programa').click(
function(){	$("#derecha_programa").css('background', 'url('+secc4[0]+'_big.jpg)');
$("#texto").animate({opacity: 1},0);
$("#fondo_azul").animate({opacity: .7},500);	}
);











//Intercambio de fotos por sección
 //Rehabilitación

















































 });
