/**
 	File Overview:		Cengage Learning Careers - careers.js
 	Company:			Versant
 	Description:		Initialize and functions for all JS needed
 	Last Updated:		04/12/10 13:14:21
	Last Changed By:	Ben Reed 
*/

//FAQs

//Scroll to top button
$(function () {
	var scroll_timer;
	var displayed = false;
	var $message = $('#message a');
	var $window = $(window);
	var top = $(document.body).children(0).position().top;
	$window.scroll(function () {
		window.clearTimeout(scroll_timer);
		scroll_timer = window.setTimeout(function () {
			if($window.scrollTop() <= top)
			{
				displayed = false;
				$message.fadeOut(500);
			}
			else if(displayed == false)
			{
				displayed = true;
				$message.stop(true, true).show().click(function () { $message.fadeOut(500); });
			}
		}, 100);
	});
});

//Smooth scroll
$(document).ready(function(){

    $('a[href*=#]').click(function() {

      if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
&& location.hostname == this.hostname) {
   var $target = $(this.hash);
   $target = $target.length && $target
    || $('[name=' + this.hash.slice(1) +']');
    if ($target.length) {
     var targetOffset = $target.offset().top;
 $('html,body')
 .animate({scrollTop: targetOffset}, 1000);
return false;
    }
  }
});

$("#slider").easySlider({
		auto: true, //made the images rotate
		continuous: true,
		numeric: true
	});


});