var $j = jQuery.noConflict();
$j(document).ready(function(){
	 $j('#m4moduleform_1').ajaxForm({
		target: '#content',
		success: function() {$j('#content').fadeIn('slow');} 
	 });
});
$j(function() {
	$j('a[rel=banner-images]').lightBox({
         fixedNavigation:true
         
         });
});
$j(function() {
	$j('a[rel=banner-images2]').lightBox({
         fixedNavigation:true
         
         });
});
$j(document).ready(function ($) {
        if ($j.browser.msie && $.browser.version < 7) return;
        
        $j('#courseNavIntro li')
            .removeClass('highlight')
            .find('a')
            .append('<span class="hover" />').each(function () {
                    var $span = $j('> span.hover', this).css('opacity', 0);
                    $(this).hover(function () {
                        // on hover
                        $span.stop().fadeTo(500, 1);
                    }, function () {
                        // off hover
                        $span.stop().fadeTo(500, 0);
                    });
                });
                
    });
$j(document).ready(function($){			
	$j('#largeImgIntroPreLoad ').fadeIn('slow');
	
	/**
	 * All the functions below, are used to update the summary div
	 * That is not the objective of the plugin, the really important part 
	 * is the one right below. The option placeholder, and threshold.
	 */
	$.preload('#slideshowIntro img', {//the first argument is a selector to the images
		onRequest:request,
		onComplete:complete,
		onFinish:finish,
                random: false,
		//placeholder:'../img/placeholder.jpg',//this is the really important option
		//notFound:'../img/notfound.jpg',//optional image if an image wasn't found
		threshold: 1 //'2' is the default, how many at a time, to load.
	});
	
	function update( data ){
		$j('#done').html(''+data.done );
		$j('#total').html(''+data.total );
		$j('#loaded').html(''+data.loaded );
		$j('#failed').html(''+data.failed );
	};
	function complete( data ){
		update( data );
		$j('#image-next').html( 'none' );//reset the "loading: xxxx"
		$j('#image-loaded').html( data.image );
	};
	function request( data ){
		update( data );
		$j('#image-next').html( data.image );//set the "loading: xxxx"
	};
	function finish(){//hide the summary
		$j('#largeImgIntroPreLoad').fadeOut('slow');
		if ($j('#slideshowIntro') != null){
		$j(function() {
		$j('#slideshowIntro').cycle({
		fx: 'fade',
		speed: 2500,
		timeout: 10000,
		pause: 1,
		random: false,
		pager: '#slideshowIntroNav',
		delay: -4000,
		pauseOnPagerHover: true 
		});
		});
}
	};
});
$j(document).ready(function(){
	if ($j('ul.newsRotator') != null){
		$j('ul.newsRotator').cycle({
		fx: 'scrollUp',
		continuous: 1,
		timeout: 2000,
		speed: 6000,
		
		random: false,
		pause: 1
		});
	}
});

