jQuery(document).ready(function(){

	/*function mySideChange(front) {
		if (front) {
			$('#logo .o').css('background-image', 'url(http://dev.yee-dor.com/wp-content/themes/yeedor/images/o.jpg)');
		} else {
			$('#logo .o').css('background-image', 'url(http://dev.yee-dor.com/wp-content/themes/yeedor/images/o-filled.jpg)');
		}
	}

	function myComplete() {
		$('#logo .o').css('background-image', 'url(http://dev.yee-dor.com/wp-content/themes/yeedor/images/o.jpg)');
	}

	$('#logo .o').hover(function () {
		$('#logo .o').rotate3Di(
			'360',
			'slow',
			{
				sideChange: mySideChange,
				complete: myComplete
			}
		);
	});*/

	$('#logo').click(function(){
		$('body').fadeOut(500,function() {
		 window.location = 'http://lab.yee-dor.com'; });
	});



	/*********Pink & Lectures*********/
	//When mouse rolls over
    jQuery("#nav li.lectures").mouseover(function(){
        jQuery("#bars li.pink").stop().animate({left: '-=376px'}, {queue: false, duration: 700}).animate({width:'500px'},{queue:false, duration:500, easing: 'easeInQuad'});
    });

    //When mouse is removed
    jQuery("#nav li.lectures").mouseout(function(){
        jQuery("#bars li.pink").stop().animate({left: '0px'}, {queue: false, duration: 1000}).animate({width:'126px'},{queue:false, duration:1000, easing: 'easeOutQuad'});
    });

    /*********Cyan & Resource*********/
	//When mouse rolls over
    jQuery("#nav li.resources").mouseover(function(){
        jQuery("#bars li.cyan").stop().animate({left: '-=376px'}, {queue: false, duration: 700}).animate({width:'500px'},{queue:false, duration:500, easing: 'easeInQuad'});
    });

    //When mouse is removed
    jQuery("#nav li.resources").mouseout(function(){
        jQuery("#bars li.cyan").stop().animate({left: '0px'}, {queue: false, duration: 1000}).animate({width:'126px'},{queue:false, duration:1000, easing: 'easeOutQuad'});
    });


	/*********Yellow & Gallery*********/
	//When mouse rolls over
    jQuery("#nav li.gallery").mouseover(function(){
        jQuery("#bars li.yellow").stop().animate({left: '-376px'}, {queue: false, duration: 700}).animate({width:'500px'},{queue:false, duration:500, easing: 'easeInQuad'});
    });

    //When mouse is removed
    jQuery("#nav li.gallery").mouseout(function(){
        jQuery("#bars li.yellow").stop().animate({left: '0px'}, {queue: false, duration: 1000}).animate({width:'126px'},{queue:false, duration:1000, easing: 'easeOutQuad'});
    });

	/*********Black & Contact*********/
	//When mouse rolls over
    jQuery("#nav li.contact").mouseover(function(){
        jQuery("#bars li.black").stop().animate({left: '-376px'}, {queue: false, duration: 700}).animate({width:'500px'},{queue:false, duration:500, easing: 'easeInQuad'});
    });

    //When mouse is removed
    jQuery("#nav li.contact").mouseout(function(){
        jQuery("#bars li.black").stop().animate({left: '0px'}, {queue: false, duration: 1000}).animate({width:'126px'},{queue:false, duration:1000, easing: 'easeOutQuad'});
    });

    $("#shortcuts li").hover(function() {
		$(this).stop().animate({ "margin-bottom": "10px"},{queue:false, duration:500, easing: 'easeOutBounce'});
		},function() {
		$(this).stop().animate({ "margin-bottom": "0px" }, {queue:false, duration:500, easing: 'easeOutBounce'});
		});

	/*Set all the captions to 0%*/
	$(function() {
	$("#caption a.syllabus").css("opacity","0");
	$("#caption a.homework").css("opacity","0");
	$("#caption a.downloads").css("opacity","0");
	$("#caption a.contact").css("opacity","0");

	// Syllabus Mouseover
	$("#shortcuts li.syllabus").hover(function () {
		$("a.syllabus").stop().animate({
		opacity: 1.0
		}, "5000");
	},
	// Syllabus Mouseout
	function () {
		$("a.syllabus").stop().animate({
		opacity: 0
		}, "2000");
		});

	// Homework Mouseover
	$("#shortcuts li.homework").hover(function () {
		$("a.homework").stop().animate({
		opacity: 1.0
		}, "5000");
	},
	// Homework Mouseout
	function () {
		$("a.homework").stop().animate({
		opacity: 0
		}, "2000");
		});

	// Downloads Mouseover
	$("#shortcuts li.downloads").hover(function () {
		$("a.downloads").stop().animate({
		opacity: 1.0
		}, "5000");
	},
	// Downloads Mouseout
	function () {
		$("a.downloads").stop().animate({
		opacity: 0
		}, "2000");
		});

	// Contact Mouseover
	$("#shortcuts li.contact").hover(function () {
		$("#caption a.contact").stop().animate({
		opacity: 1.0
		}, "5000");
	},
	// Contact Mouseout
	function () {
		$("#caption a.contact").stop().animate({
		opacity: 0
		}, "2000");
		});

	});

$(function() {
	$("#calendar li.no-school").css("opacity","0.4");
});


$("#calendar li[class!='today']").hover(function() {
		$(this).stop().animate({ bottom: "20px"},{queue:false, duration:200, easing: 'easeOutBounce'});
		},function() {
		$(this).stop().animate({ bottom: "0px" }, {queue:false, duration:800, easing: 'easeOutBounce'});
		});

$("#calendar li.today").everyTime(100,function(){
    $(this).animate({"background-color":"#00ADEE"}, {duration:1000, easing:'easeInQuad'}).animate({"background-color": "#5dd3ff"}, {duration:1000, easing: 'easeOutQuad'});
    });

$("#copyright li.credit-link").everyTime(10,function(){
    $(this).animate({"margin-right":"10px"}, "slow").animate({"margin-right": "0px"}, "slow");
    });

$("#calendar li a").append("<em></em>");
	$("#calendar li a").hover(function() {
		$(this).find("em").animate({opacity: "show", top: "-75"}, "slow");
		var hoverText = $(this).attr("title");
	    $(this).find("em").text(hoverText);
	}, function() {
		$(this).find("em").animate({opacity: "hide", top: "-85"}, "slow");
	});



});

