$(function(){  
  $('.col').hide().fadeIn('4000');
});


(function($){
  $(document).ready(function(){
    var padding   = 10,
        container = $(".scroll"),
        images    = container.children(),
        width     = 0;
    if (container.length >0 ){
      // Temporarily increase the size of the container
      // so we can figure out how big our children actually are
      container.css("width", "99999em");
      images.css('float', 'left');
      width = images.outerWidth(true);

      container.css({ 
        width: $(window).width() - container.offset()["left"], 
        height: parseInt(images.css("height"),100)+padding,
        overflow:"auto" 
      });

      images.css({ 
        width: width
      });
    
      var scrollPane = container.jScrollPane();
      fixJspDrag();

      $(window).resize(function(){
        container.css({ width: $(window).width() - container.offset()["left"] });
        scrollPane.data('jsp').reinitialise();
        fixJspDrag();
      });
    }

if ($.fn.anythingSlider) {
      
      
$('#slider').anythingSlider({
        resizeContents      : false,     
        buildArrows         : true, 
        buildNavigation     : false,
	    buildStartStop: false, 
        autoPlay            : true,
		delay				: 3000,
		hashTags            : false,
		enableNavigation: true,
		expand : true,
        appendBackTo: "#slider-controls .back",
        appendForwardTo: "#slider-controls .forward",
        forwardText: "next",
        backText: "back",
		startText           : '',
		stopText            : ''
		
      });

	  $('#sliderhome').anythingSlider({
        resizeContents      : false,     
        buildArrows         : false, 
        buildNavigation     : false, 
        autoPlay            : true,
		delay				: 3000,
		hashTags            : true
      });
	
      // Clicking the image triggers forward movement
      $(".activePage").live('click',function(e){
        e.preventDefault();
        $("#slider-controls .forward a").trigger('click');
      });
    }

    // containers should be full-height to allow bottom calculation 
    if ($.fn.flex) {
      $('html, body').flex('height', 1);
      // flex all position properties of the test div 
      $('.thumb').flex('top', 1).flex('bottom', 1).flex('left', 1).flex('right', 1);
      // flexify! 
      $(document).flexify();
    }
  });

  // We'll end up with a scrollbar that's properly matching the browser's
  // scrollbar in terms of sizing and positioning, so we'll need to adjust
  // it to match the actual content
  function fixJspDrag(){
    return $(".jspDrag").css({
      width: 200,
      marginLeft: 180,
      paddingRight: 0
    });
  }
	$(function() {
	    $("#assignments .landing .large-thumb").hover( function ( e ) {
	        $(this).children('#assignments .landing .large-thumb .title').toggle(e.type === 'mouseenter');
	   });
	});
	$('a:has(span)').hover(function(){
	$('span', this).fadeTo("slow", 0.6); // This sets the opacity to 60% on hover
	},function(){
	$('span', this).fadeTo("slow", 1.0); // This sets the opacity back to 100% on mouseout
	});
})(jQuery);
