/************************************************************************/// // CAPTION ///************************************************************************/
$(document).ready(function(){
				//Caption Sliding (Partially Hidden to Visible)
				$('.img-block').hover(function(){
					$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:500, easing:'easeOutBounce'});
				}, function() {
					$(".cover", this).stop().animate({top:'179px'},{queue:false,duration:500, easing:'easeOutBounce'});
				});
				$('.img-block-hottie').hover(function(){
					$(".cover-hottie", this).stop().animate({top:'0px'},{queue:false,duration:500, easing:'easeOutBounce'});
				}, function() {
					$(".cover-hottie", this).stop().animate({top:'231px'},{queue:false,duration:500, easing:'easeOutBounce'});
				});
				$('.img-block-stat').hover(function(){
					$(".cover-stat", this).stop().animate({top:'0px'},{queue:false,duration:500, easing:'easeOutBounce'});
				}, function() {
					$(".cover-stat", this).stop().animate({top:'179px'},{queue:false,duration:500, easing:'easeOutBounce'});
				});
				
			});

jQuery.easing['BounceEaseOut'] = function(p, t, b, c, d) {
	if ((t/=d) < (1/2.75)) {
		return c*(7.5625*t*t) + b;
	} else if (t < (2/2.75)) {
		return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
	} else if (t < (2.5/2.75)) {
		return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
	} else {
		return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
	}
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        easing: 'BounceEaseOut',
        animation: 1000,
		wrap: 'circular',
		scroll: 1
    });
	
	jQuery('#gallery').jcarousel({
        easing: 'BounceEaseOut',
        animation: 1000,
		wrap: 'circular',
		scroll: 1
    });
	
	jQuery('#gallerywin').jcarousel({
        easing: 'BounceEaseOut',
        animation: 1000,
		wrap: 'circular',
		scroll: 1
    });
	
	jQuery('#vjScroll').jcarousel({
        easing: 'BounceEaseOut',
        animation: 1000,
		wrap: 'circular',
		scroll: 1
    });
	
	jQuery('#gallerydate').jcarousel({
        easing: 'BounceEaseOut',
        animation: 1000,
		wrap: 'circular',
		scroll: 1
    });
	
    jQuery('#bloodycarousel').jcarousel({
			easing: 'BounceEaseOut',
			animation: 1000,
			wrap: 'circular',
			scroll: 2
    });

	jQuery('#campus-rep-carousel').jcarousel({
			easing: 'easeInBack',
			animation: 700,
			wrap: 'circular',
			scroll: 1
    });
	
		jQuery('#campus-rep-frm-carousel').jcarousel({
			easing: 'easeInBack',
			animation: 700,
			wrap: 'circular',
			scroll: 1
    });
	
	jQuery('#videos-carousel').jcarousel({
			easing: 'easeInBack',
			animation: 700,
			wrap: 'circular',
			scroll: 1
    });
	jQuery('#latest-videos').jcarousel({
			easing: 'easeInBack',
			animation: 700,
			wrap: 'circular',
			scroll: 1
    });
	jQuery('#most-videos').jcarousel({
			easing: 'easeInBack',
			animation: 700,
			wrap: 'circular',
			scroll: 1
    });
	jQuery('#mycarousel-vj').jcarousel({
        easing: 'BounceEaseOut',
        animation: 1000,
		wrap: 'circular',
		scroll: 1
    });
	
	jQuery('#downloads-carousel').jcarousel({
	easing: 'easeInBack',
	animation: 700,
	wrap: 'circular',
	scroll: 1
	});
	jQuery('#hottie-carousel').jcarousel({
			easing: 'BounceEaseOut',
			animation: 700,
			wrap: 'circular',
			scroll: 1
    });


//for the schedule carousel
function schedulecarousel_initCallback(carousel) {
    jQuery('.schedule-control a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).attr('rel')));
        return false;
    });
};

function schedulehighlight(carousel, obejctli,liindex,listate){
	jQuery('.schedule-control a:nth-child('+ liindex +')').attr("class","selected");
};
function scheduleremovehighlight(carousel, obejctli,liindex,listate){
	jQuery('.schedule-control a:nth-child('+ liindex +')').removeAttr("class","selected");
};

jQuery(document).ready(function() {
	jQuery("#schedule-carousel").jcarousel({
		scroll: 1,
    easing: 'easeInOutBack',
		animation:500,
		initCallback: schedulecarousel_initCallback,
    itemVisibleInCallback:  schedulehighlight,
    itemVisibleOutCallback: scheduleremovehighlight
	});
});
	
});

$(document).ready(function(){
						   
		/*the menu section*/
		var headermenu_cfg = {    
			sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)    
			interval: 100, // number = milliseconds for onMouseOver polling interval    
			over: megaHoverOver, // function = onMouseOver callback (REQUIRED)    
			timeout: 500, // number = milliseconds delay before onMouseOut    
			out: megaHoverOut // function = onMouseOut callback (REQUIRED)    
		};
		
		$(function() {
		var zIndexNumber = 100000;
		$('div').each(function() {
		$(this).css('zIndex', zIndexNumber);
		zIndexNumber -= 10;
		});
		});
		
		$("ul#topnav li .sub").css({'opacity':'0'});
		$("ul#topnav li").hoverIntent(headermenu_cfg);


    /*the hot or not slideshow section*/
    $('#hotrnot-sl').cycle({
        fx:      'scrollHorz',
        timeout:  0,
        prev:    '#hrn-prev',
        next:    '#hrn-next'
    });

    $('#hotrnot-sl-text').cycle({
        fx:      'scrollHorz',
        timeout:  0,
        prev:    '#hrn-prev',
        next:    '#hrn-next'
    });

    /*the news ticker section*/
		$("ul#tickerleft").liScroll();
		$("ul#tickerright").liScroll();

		$("ul#tickernowplaying").liScroll();
		
		/*the school cool section*/
		$("#sch-cool").hover(function(){
			$(this).children(".div1").stop().animate({"height" : "0px"}, 500);
			}, function(){
			$(this).children(".div1").stop().animate({"height" : "176px"}, 300);
		});
	});
	
/*$(function() {
var zIndexNumber = 10000;
$('div').each(function() {
$(this).css('zIndex', zIndexNumber);
zIndexNumber -= 10;
});
});*/
/*$(function() {

		    $(".jMyCarousel").jMyCarousel({
		        visible: '7',
		        eltByElt: true,
		        evtStart: 'mousedown',
		        evtStop: 'mouseup'
		    });

		});
	*/

// START Initiating
jQuery(document).ready(function(){
   
    /***************************************************
     JQUERY TOGGLE
     ***************************************************/
    $(".toggle-body").hide();
    $(".toggle-head").click(function(){
        var tb = $(this).next(".toggle-body");      
        if (tb.is(':hidden')) {
            tb.prev('.toggle-head').children('h3').addClass('minus');
            tb.slideDown('slow');
            
        }
        else {
            tb.slideUp(200, function(){
                 tb.prev('.toggle-head').children('h3').removeClass('minus');
            });
        }
    });
    /***************************************************
     Misc
     ***************************************************/
    $('.opacity').css('opacity', '0.8');
	
	
}); // End Initiating

// for the expand and minify

$(document).ready(function(){
	$("#showhide").click(function(){
		$(".functions").slideToggle("slow");
		$(".thought").slideToggle("slow");
		$(this).toggleClass("minify"); return false;
	});
});

/*$(document).ready(function(){
  $("#showhide").click(function(){
    $(".functions").slideToggle('slow', function(){
			if ($("#showhide").hasClass('expand')) {
				$("#showhide").removeClass('expand').addClass('minify');
			}else if($("#showhide").hasClass('minify')){
				$("#showhide").removeClass('minify').addClass('expand');
			}
		});
	
	$(".thought").slideToggle('slow', function(){
			
		});
	
  });
});
*/
// for the confession block
$(document).ready(function(){
  $(".tell-secret").click(function(){
		$('.error').hide();
		$(".secret-text-form").stop().animate({top:'0px'},{queue:false,duration:250, easing:'easeInExpo'});
	});
	
  $("#submit-secret").click(function(){
		//Added By Mathew
		var name = $("textarea#secrettext").val();
		if (name == "") {
		  $("label#name_error").show();
		  $("textarea#secrettext").focus();
		  return false;
		}
		var ugctype = $("input#ugctype").val();
		var userip = $("input#ip").val();
		var dataString = 'confession='+ escape(name) + '&ugctype=' + ugctype + '&userip=' + userip;
		$.ajax({
		  type: "POST",
		  url: "process.php",
		  data: dataString,
		  success: function(data) {
			if(data!='Y'){
				alert('Confession Submission Failed');
				return false;
			}else{
				$('.error').hide();
				$("textarea#secrettext").val("");
			}
		  }
		});
		//End of Mathew
		$(".secret-text-form").stop().animate({top:'235px'},{queue:false,duration:250, easing:'easeInExpo'});
	});
	
	$("#close-secret").click(function(){
		$(".secret-text-form").stop().animate({top:'235px'},{queue:false,duration:250, easing:'easeInExpo'});
	}); 	
  $(".ask-divo-form-link").click(function(){
		$('.error').hide();
		$(".ask-divo-form").stop().animate({top:'0px'},{queue:false,duration:250, easing:'easeInExpo'});
	});
  $("#ask-divo-submit").click(function(){
		//Added By Mathew
		var name = $("textarea#askandy").val();
		if (name == "") {
		  $("label#name_error").show();
		  $("textarea#askandy").focus();
		  return false;
		}
		var qtype = $("input#qtype").val();
		var userip = $("input#ip").val();
		var dataString = 'askandy='+ escape(name) + '&qtype=' + qtype + '&userip=' + userip;
		$.ajax({
		  type: "POST",
		  url: "processandy.php",
		  data: dataString,
		  success: function(data) {
			if(data!='Y'){
				alert('Ask Andy Submission Failed');
				return false;
			}else{
				$('.error').hide();
				$("textarea#askandy").val("");
			}
		  }
		});
		//End of Mathew
		$(".ask-divo-form").stop().animate({top:'179px'},{queue:false,duration:250, easing:'easeInExpo'});
	});
	$("#close-divo-submit").click(function(){
		$(".ask-divo-form").stop().animate({top:'179px'},{queue:false,duration:250, easing:'easeInExpo'});
	});
	$(".divo-speak-form-link").click(function(){
		$(".divo-speak-form").stop().animate({top:'26px'},{queue:false,duration:250, easing:'easeInExpo'});
		return false;
	});
  $("#divo-speak-submit").click(function(){
		$(".divo-speak-form").stop().animate({top:'302px'},{queue:false,duration:250, easing:'easeInExpo'});
		return false;
	});
  
  	$(".trivia-form-link").click(function(){
		$('.error').hide();
		$(".trivia-form").stop().animate({top:'26px'},{queue:false,duration:250, easing:'easeInExpo'});
		return false;
	});
  $("#trivia-submit").click(function(){
		//Added By Mathew
		var name = $("textarea#campustriva").val();
		if (name == "") {
		  $("label#name_error").show();
		  $("textarea#campustriva").focus();
		  return false;
		}
		var ugctype = $("input#ugctype").val();
		var userip = $("input#ip").val();
		var dataString = 'confession='+ escape(name) + '&ugctype=' + ugctype + '&userip=' + userip;
		$.ajax({
		  type: "POST",
		  url: "process.php",
		  data: dataString,
		  success: function(data) {
			if(data!='Y'){
				alert('Campus Trivia Submission Failed');
				return false;
			}else{
				$('.error').hide();
				$("textarea#campustriva").val("");
			}
		  }
		});
		//End of Mathew
		$(".trivia-form").stop().animate({top:'302px'},{queue:false,duration:250, easing:'easeInExpo'});
		return false;
	});
	$("#trivia-close").click(function(){
		$(".trivia-form").stop().animate({top:'302px'},{queue:false,duration:250, easing:'easeInExpo'});
		return false;
	});
});
jQuery(function(){
			jQuery('ul.sf-menu').superfish();
		});

/*Calender date picker*/
/*$(function() {
		$( "#datepicker" ).datepicker({
			showOn: "button",
			buttonImage: "images/calendar.gif",
			buttonImageOnly: true
		});
	});*/

