$(document).ready(function(){




var caption = $('#galery');

caption.children('li').css({'position':'relative', 'overflow':'hidden'}).children('span').css({'background':'#000', 'position':'absolute', 'z-index':'10', 'color':'#fff', 'display':'block', 'width':'100%', 'bottom':'0', 'padding':'4px'});
caption.children('li').children('span').css({'bottom':'-100px'});
caption.children('li').children('span').children('h4').css({'font-size':'0.8em', 'font-weight':'normal'});
caption.children('li').hover(function(){
	$(this).children('span').stop().animate({'bottom':'0'});
}, function(){
	$(this).children('span').stop().animate({'bottom':'-100px'});
});



	  

$('#galery').jcarousel({
        auto:5,
        scroll: 10,
        wrap: 'circular',
        easing: 'easeInOutSine',
        animation: '1000'
    });


$('.downArrow').click(function(){
	scrollit('#textContainer','up', 20);
});
$('.upArrow').click(function(){
	scrollit('#textContainer','down', 20);
});


$('.downArrowDOC').click(function(){
	scrollit('#docentes ul','up', 20);
});
$('.upArrowDOC').click(function(){
	scrollit('#docentes ul','down', 0);
});

$('.downArrowDOC').click(function(){
	scrollit('#docentesizq ul','up', 20);
});
$('.upArrowDOC').click(function(){
	scrollit('#docentesizq ul','down', 0);
});

$('.downArrowDOC').click(function(){
	scrollit('#docentesder ul','up', 20);
});
$('.upArrowDOC').click(function(){
	scrollit('#docentesder ul','down', 0);
});

$('.downArrowCV').click(function(){
	scrollit('#textContainer','up', 0);
});
$('.upArrowCV').click(function(){
	scrollit('#textContainer','down', 0);
});


/* SCROLL */
var act = 10;
function scrollit(id, where, init){
	var h= $(id).height();
	var t= $(id).css('margin-top');
	var distance = h/4;	
	
	if(where=='up'){
		if(act < (h-350)){
			act += distance;
			
		}
		$(id).animate({'marginTop':'-'+act+'px'});
	}
	if(where=='down'){
		if(act < (h)){
			act -= distance;
			if((act<80)){
				act = init;
				$(id).animate({'marginTop': act+'px'});
			} else {
				$(id).animate({'marginTop':'-'+act+'px'});
			}
		}
	}
}


/* ESCONDER FLECHAS */
function esconderFlechas(){
		var h= $('#textContainer').height();
		if(h>320){
			$('.upArrow').show();
			$('.downArrow').show();
		} else{
			$('.upArrow').hide();
			$('.downArrow').hide();		
		}
	}


/* botones */

$('#textContainer').animate({'marginTop':'20px'});
$('#objetivoGeneral_btn').click(function(){
	$('#textContainer').load(path + ' #ObjetivoGeneral', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	return false;
});
    

    
$('#objetivoParticular_btn').click(function(){
	$('#textContainer').load(path + ' #ObjetivosParticulares', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});

	esconderFlechas();
		return false;
		

});
    
$('#perfilDeIngreso_btn').click(function(){
	$('#textContainer').load(path + ' #PerfilDeIngreso', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;


});  

$('#planDeEstudios_btn').click(function(){
	$('#textContainer').load(path + ' #PlanDeEstudios', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
		return false;
		
		

});  

$('#requisitosDeIngreso_btn').click(function(){
	$('#textContainer').load(path + ' #RequisitosDeIngreso', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;
		

});

$('#lineasDeInvestigacion_btn').click(function(){
	$('#textContainer').load(path + ' #lineasDeInvestigacion', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#objetivos_btn').click(function(){
	$('#textContainer').load(path + ' #objetivos', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#mision_btn').click(function(){
	$('#textContainer').load(path + ' #mision', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#javierAlcaraz_btn').click(function(){
	$('#textContainer').load(path + ' #javierAlcaraz', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#alfonsoCachu_btn').click(function(){
	$('#textContainer').load(path + ' #alfonsoCachu', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#patriciaCachu_btn').click(function(){
	$('#textContainer').load(path + ' #patriciaCachu', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#antonioCedeno_btn').click(function(){
	$('#textContainer').load(path + ' #antonioCedeno', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});

$('#cristinaCuadra_btn').click(function(){
	$('#textContainer').load(path + ' #cristinaCuadra', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#aideDorantes_btn').click(function(){
	$('#textContainer').load(path + ' #aideDorantes', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#guiomarJimenez_btn').click(function(){
	$('#textContainer').load(path + ' #guiomarJimenez', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#romanEsqueda_btn').click(function(){
	$('#textContainer').load(path + ' #romanEsqueda', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#karinaEscogido_btn').click(function(){
	$('#textContainer').load(path + ' #karinaEscogido', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#noraAlicia_btn').click(function(){
	$('#textContainer').load(path + ' #noraAlicia', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#julietaHaidar_btn').click(function(){
	$('#textContainer').load(path + ' #julietaHaidar', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#sinuheHernandez_btn').click(function(){
	$('#textContainer').load(path + ' #sinuheHernandez', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#miguelJaramillo_btn').click(function(){
	$('#textContainer').load(path + ' #miguelJaramillo', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#sergioKoleff_btn').click(function(){
	$('#textContainer').load(path + ' #sergioKoleff', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#guillermoLeon_btn').click(function(){
	$('#textContainer').load(path + ' #guillermoLeon', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#ivanLeroy_btn').click(function(){
	$('#textContainer').load(path + ' #ivanLeroy', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#diegoLizarazo_btn').click(function(){
	$('#textContainer').load(path + ' #diegoLizarazo', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#gracielaMartinez').click(function(){
	$('#textContainer').load(path + ' #gracielaMartinez', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#xochitlMatus_btn').click(function(){
	$('#textContainer').load(path + ' #xochitlMatus', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#rafaelMauleon_btn').click(function(){
	$('#textContainer').load(path + ' #rafaelMauleon', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#omarMendoza_btn').click(function(){
	$('#textContainer').load(path + ' #omarMendoza', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#franciscoMitre_btn').click(function(){
	$('#textContainer').load(path + ' #franciscoMitre', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#franciscoMontoya_btn').click(function(){
	$('#textContainer').load(path + ' #franciscoMontoya', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});

$('#karlaPaniagua_btn').click(function(){
	$('#textContainer').load(path + ' #karlaPaniagua', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#franciscoPaz_btn').click(function(){
	$('#textContainer').load(path + ' #franciscoPaz', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#JuanManuelCampos_btn').click(function(){
	$('#textContainer').load(path + ' #JuanManuelCampos', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#juanSolis_btn').click(function(){
	$('#textContainer').load(path + ' #juanSolis', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#alejandroTapia_btn').click(function(){
	$('#textContainer').load(path + ' #alejandroTapia', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#roselenaVargas_btn').click(function(){
	$('#textContainer').load(path + ' #roselenaVargas', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#leonardoVazquez_btn').click(function(){
	$('#textContainer').load(path + ' #leonardoVazquez', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#angelFrancisco_btn').click(function(){
	$('#textContainer').load(path + ' #angelFrancisco', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#joseManuelVargas_btn').click(function(){
	$('#textContainer').load(path + ' #joseManuelVargas', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#juanCarlosZuniga_btn').click(function(){
	$('#textContainer').load(path + ' #juanCarlosZuniga', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	
});
$('#fernandoMolina_btn').click(function(){
	$('#textContainer').load(path + ' #fernandoMolina', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#gracielaSanchez_btn').click(function(){
	$('#textContainer').load(path + ' #gracielaSanchez', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});

$('#mauroZepeda_btn').click(function(){
	$('#textContainer').load(path + ' #mauroZepeda', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});
$('#carlosAcevedo_btn').click(function(){
	$('#textContainer').load(path + ' #carlosAcevedo', function(){
			esconderFlechas();
		});
	$('#textContainer').animate({'marginTop':'20px'});
	esconderFlechas();
		return false;	

});




esconderFlechas();
    
/* menuuu desplegable */

$('#menu>ul>li>ul').hide();
$('#menu>ul>li').hover(function(){
	$(this).css({'padding-bottom':'20px'});
	$(this).children('ul').show();
}, function(){
	$(this).css({'padding-bottom':'0'});
	$('#menu>ul>li>ul').hide();
} );     
    
});


//functions



