// JavaScript Document

$(document).ready( function() {
			
    $('.slideshow').cycle({ fx:'fade'});
	$('.pics').cycle({ 
		fx: 'shuffle',
		speed:  500,
		cleartypeNoBg: true
	});
	
	$("body.contact #contactTable  tr:even").not('tr.heads').css('background-color', '#dddddd');	
	$('body.contact #contactTable tr>td:nth-child(1)').css('padding-left', '4px');
	$('body.jrLakers .jrlakers table tr>td:nth-child(1)').css('border-right', '1px solid #ddd');
    $('#menu ul.menu').lavaLamp({ speed: 400 });
	

			   
										
	
	$("#accordion").accordion({
		collapsible: true,
		autoHeight: false,
		alwaysOpen: false,
		active: false
	});
				
				
												 
									
									 

				
	  $('#calendar').fullCalendar({
	
		 viewDisplay: function(view) {
			 var startDate = view.start.getDate() -1;
			 var month = view.start.getMonth();
			  
			 if(month==11){
				
				 $('td div').each(function(){
					$(this).removeClass('highlight');
					
					if ($(this).text() ==startDate+4 ) {
						$(this).addClass('highlight');
					}
					if ($(this).text() ==startDate+5) {
						$(this).addClass('highlight');
					}
					if ($(this).text() ==startDate+10) {
						$(this).addClass('highlight');
					}
					if ($(this).text() ==startDate+11) {
						$(this).addClass('highlight');
					}
					if ($(this).text() ==startDate+14) {
						$(this).addClass('highlight');
					}
					if ($(this).text() ==startDate+24) {
						$(this).addClass('highlight');
					}
					if ($(this).text() ==startDate+25) {
						$(this).addClass('highlight');
					}
					if ($(this).text() ==startDate+31) {
						$(this).addClass('highlight');
					}
				}) 
				
			}
			else if (month==0){
				 $('td div').each(function(){
					 $(this).removeClass('highlight');
						if ($(this).text() ==startDate+1) {
						$(this).addClass('highlight');
					}
				}) 
			}
			else {
				
				$('td div').each(function(){
					 $(this).removeClass('highlight');
				
				}) 
			}
			
		},  // end view
        
 	header: { left:   '',    center: 'title',    right:  ' prev,next' },
	
    dayClick: function(date, allDay, jsEvent, view) {
	
			
	 
		
			var calendarDate = date.getDate();
			
			calendarDate =(date.getMonth()+1) + '/' + date.getDate();
			
		
			if (calendarDate=="12/4") {
				alert("Cool Yule Party • 9am-1pm");
				
			}
			else if (calendarDate=="12/5") {
				alert("Blood Drive • 9am-3pm");
			}
			
			else if (calendarDate=="12/10") {
				alert("Pre-registration");
			}
			else if (calendarDate=="12/11") {
				alert("Comedy Night for the Y at Flappers • 5pm");
			}
			else if (calendarDate=="12/14") {
				alert("Open Registration");
			}
			else if (calendarDate=="12/24") {
				alert("Y closes at 12noon");
			}
			else if (calendarDate=="12/25") {
				alert("Y closed...Merry Christmas!");
			}
			else if (calendarDate=="12/31") {
				alert("Y closes at 3pm");
			}
			else if (calendarDate=="1/1") {
				alert(" Y closed...Happy New Year!");
			}
			
			
       

    }
	
});

   
	//$("#promo").hide().delay(2000).slideDown('slow').delay(4000).slideUp('slow');;

	

   
 


	var domainroot="www.burbankymca.org"
	function Gsitesearch(curobj){
		curobj.q.value="site:"+domainroot+" "+curobj.qfront.value
	}

});  //end document ready
