/*
 * Nicholls Core Javascript
 *
 * version 1.0 
 *
 * by James Planck <james.planck@nicholls.edu>
 *
 * Core javascript functionality for the Nicholls website. Part of the Nicholls Core website
 * theme. Dependent on jQuery and some jQuery plugins.
 */

						
function the_resize(thewindowwidth) {
	if ( thewindowwidth < 964 ) {
		jQuery('body').addClass('screen-narrow');
	} else {
		jQuery('body').removeClass('screen-narrow');
	}
	return;
}

jQuery(document).ready( function() {		
	var thewindowwidth = jQuery(window).width();
	the_resize(thewindowwidth);
	
	jQuery('.menu-top-').pngFix();
	jQuery('.logo-container-').pngFix();
	
	jQuery('.info-primary-').corner('bottom');
	jQuery('.logo-container-').corner('top');

	// Drawer 
	jQuery('.menu-top-sitebox a').toggle(
		function () {
			if( jQuery('#nicholls-sitebox').text() == '' ) {
				jQuery.ajax({
					url:'http://webmanager.nicholls.edu/nicholls_test/wp-content/themes/nicholls-core/sitebox.html',
					method:'GET',
					success:function(r) {
						jQuery('.menu-top-sitebox a').html('hide');
						jQuery('#nicholls-sitebox').html(r).hide().slideDown(600);
					},
					error:function() {
						jQuery('#nicholls-sitebox').html('Sorry! There was a problem loading content!');
					}
				});
			} else {
				jQuery(this).html('hide');
				jQuery('#nicholls-sitebox').slideDown(600);
			}
		},
		function () {
			jQuery(this).html('show ');
			jQuery('#nicholls-sitebox').slideUp(1000);
		}
	);





});

jQuery(function() {
	jQuery(window).resize(function() {
		var thewindowwidth = jQuery(window).width();
		the_resize(thewindowwidth);
	});
});
			