// JavaScript Document
jQuery(document).ready(function() {

	jQuery(window).scroll(function() {
  
  		// Scrolling effect for access
  		if(jQuery(this).scrollTop() >= 440) {
			jQuery('#access').animate({top:jQuery(window).scrollTop()+ 40 + "px" },{queue: false, duration: 0});
  		} else {
			jQuery('#access').animate({top: "480px"}, {duration: 0});
  		}
  
  		// Show #goingUp
  		if(jQuery(this).scrollTop() >= 10) {
			jQuery('#goingUp').animate({marginTop: "-120px"},{duration: 60});
  		} else {
			jQuery('#goingUp').animate({marginTop: "0"},{duration: 30});
  		}
  
	});

 	// Hover effect for #goingUp
  	jQuery('#goingUp').hover(function() {
		jQuery('#goingUp').animate({marginTop: "-140px"},{duration: 60});
	}, function() {
		jQuery('#goingUp').animate({marginTop: "-120px"},{duration: 60});
	});
  
	//  goingUp Click effect	
	jQuery('#goingUp').click(function() {
		jQuery("html:not(:animated),body:not(:animated)").animate({scrollTop: 0}, {duration: 500});
		return false;
  	});
  	
  	// scroll to position	
	jQuery('.CV_Education').click(function() {
		jQuery("html:not(:animated),body:not(:animated)").animate({
			scrollTop: jQuery('.Education').offset().top-60}, 600);
		return false;
  	});
  	jQuery('.CV_TeachingExperience').click(function() {
		jQuery("html:not(:animated),body:not(:animated)").animate({
			scrollTop: jQuery('.TeachingExperience').offset().top-60}, 600);
		return false;
  	});
  	jQuery('.CV_SubjectsTaught').click(function() {
		jQuery("html:not(:animated),body:not(:animated)").animate({
			scrollTop: jQuery('.SubjectsTaught').offset().top-60}, 600);
		return false;
  	});
  	jQuery('.CV_HonorsAndAwards').click(function() {
		jQuery("html:not(:animated),body:not(:animated)").animate({
			scrollTop: jQuery('.HonorsAndAwards').offset().top-60}, 600);
		return false;
  	});
  	jQuery('.CV_Books').click(function() {
		jQuery("html:not(:animated),body:not(:animated)").animate({
			scrollTop: jQuery('.Books').offset().top-60}, 600);
		return false;
  	});
  	jQuery('.CV_Articles').click(function() {
		jQuery("html:not(:animated),body:not(:animated)").animate({
			scrollTop: jQuery('.Articles').offset().top-60}, 600);
		return false;
  	});
  	jQuery('.CV_WorksCompleted').click(function() {
		jQuery("html:not(:animated),body:not(:animated)").animate({
			scrollTop: jQuery('.WorksCompleted').offset().top-60}, 600);
		return false;
  	});
  	jQuery('.CV_ResearchInProgress').click(function() {
		jQuery("html:not(:animated),body:not(:animated)").animate({
			scrollTop: jQuery('.ResearchInProgress').offset().top-60}, 600);
		return false;
  	});
  	jQuery('.CV_VideoAndMediaPresentations').click(function() {
		jQuery("html:not(:animated),body:not(:animated)").animate({
			scrollTop: jQuery('.VideoAndMediaPresentations').offset().top-60}, 600);
		return false;
  	});
  	jQuery('.CV_ReviewsAndNotices').click(function() {
		jQuery("html:not(:animated),body:not(:animated)").animate({
			scrollTop: jQuery('.ReviewsAndNotices').offset().top-60}, 600);
		return false;
  	});
  	jQuery('.CV_PaperPresentations').click(function() {
		jQuery("html:not(:animated),body:not(:animated)").animate({
			scrollTop: jQuery('.PaperPresentations').offset().top-60}, 600);
		return false;
  	});
  	jQuery('.CV_InvitedLectures').click(function() {
		jQuery("html:not(:animated),body:not(:animated)").animate({
			scrollTop: jQuery('.InvitedLectures').offset().top-60}, 600);
		return false;
  	});
  	jQuery('.CV_Presentations').click(function() {
		jQuery("html:not(:animated),body:not(:animated)").animate({
			scrollTop: jQuery('.Presentations').offset().top-60}, 600);
		return false;
  	});
  	jQuery('.CV_ServiceToProfession').click(function() {
		jQuery("html:not(:animated),body:not(:animated)").animate({
			scrollTop: jQuery('.ServiceToProfession').offset().top-60}, 600);
		return false;
  	});
  	jQuery('.CV_PublicService').click(function() {
		jQuery("html:not(:animated),body:not(:animated)").animate({
			scrollTop: jQuery('.PublicService').offset().top-60}, 600);
		return false;
  	});
  	jQuery('.CV_CollegeService').click(function() {
		jQuery("html:not(:animated),body:not(:animated)").animate({
			scrollTop: jQuery('.CollegeService').offset().top-60}, 600);
		return false;
  	});
  	jQuery('.CV_Memberships').click(function() {
		jQuery("html:not(:animated),body:not(:animated)").animate({
			scrollTop: jQuery('.Memberships').offset().top-60}, 600);
		return false;
  	});
  	jQuery('.CV_Personal').click(function() {
		jQuery("html:not(:animated),body:not(:animated)").animate({
			scrollTop: jQuery('.Personal').offset().top-60}, 600);
		return false;
  	});
	
});
