
/*
 * Now for the jQuery goodness
 */
$(function(){
	/*
	 * Lets start with some the standard modernizr yepnope actions!
	 *
	 * 1. Add HTML5 form field flexibility in
	 */
	Modernizr.load({
		test: Modernizr.inputtypes.email && Modernizr.input.required && Modernizr.input.placeholder && Modernizr.input.pattern,
		nope: '/js/libs/h5f.js',
		callback: function() {
			H5F.setup(document.getElementsByTagName('form'),{
				validClass: "valid",
				invalidClass: "error",
				requiredClass: "required"
			});
		}
	});

	/* Set up pop-up window */
	$('.popup').click(function() {
        window.open($(this).attr("href"));
        return false;
    });
	
	$('a[rel="external"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    });
	
	/* Set up "back" button */
	$('.back').click(function() {
		window.history.back();
		return false;
	});
	
	/* Print the window */
	$('a.print').click(function() {
	  window.print();
	  return false;
	 });
	 
	 if ($('.awards-carousel').length != 0) {
		 /* Set up the carousel */
		 $(".awards-carousel").jCarouselLite({
			btnNext: ".next",
			btnPrev: ".prev",
			visible: 1,
			auto: 4800,
			speed: 1600
		});
	 }
	 
	 
});
