//**********************************************************************************************************************
/**
* DOCUMENT: /core/plugins/events/front/projects.back.js
* DEVELOPED BY: Ryan Stemkoski
* COMPANY: Zipline Interactive
* EMAIL: ryan@gozipline.com
* PHONE: 509-321-2849
* DATE: 4/28/2010
* DESCRIPTION: This document has all of the javascript functions required for the events  plugin.
*/
//***********************************************************************************************************************

//***********************************************************************************************************************
//ON DOCUMENT READY FUNCTIONS
//***********************************************************************************************************************
$(function() {

	$('.calendar_interior_link').click(function() {
		//Hide the old event
		$('.event_info').hide();
		
		//Grab the mutual Ids
		var id = $(this).attr('id');
		id = id.replace('link_', '');
		
		//Show current event
		$('#event_' + id).fadeIn(1000);
		//Use glow jquery plugin
		$('#event_' + id).glow('#2CB1CC', 700, 10);
	});
	
	$('#on').show();
	
	$('.event_day').hover(function() {
		$(this).css('background-color', '#759fbe');
	});
	
	$('.event_day').mouseout(function() {
		$(this).css('background-color',  '#3c6380');
	});
	
	var finished = true;
	
	$('.event_title').click(function(){
		var index = $('.event_title').index(this);

		if (finished == true) {
			finished = false;
			$('.event_content').eq(index).slideToggle(300, function() {
				finished = true;
			});
		}
	});

	
});
