$(document).ready(function() { 
	var cellCount = $('.calDateCells').length;
	var currentURL = $(location).attr('href');
	currentURL = currentURL.substring(currentURL.lastIndexOf("/"));
	$('.nuRelmNavLevel1').each(function(){
		currentURL = currentURL.replace('/','');
		if(currentURL == ($(this).attr('href'))){
			$(this).removeClass('nuRelmNavLevel1 NuContentNavLevel1').addClass('nuRelmNavLevel1Selected').addClass('NuContentNavLevel1Selected');
		}
	});
	
	$('.nuRelmNavLevel1').addClass('fade');
	
	$('.navLevel1').prepend('<img src=images/bullet_sub.png class=bullet />');
	
	$('.navLevel1Selected').prepend('<img src=images/bullet_sub_selected.png class=bullet />');
	
	$('.navLevel1').each(function() {
		$(this).mouseover(function(){
			var bulletImage = $(this).children('.bullet');
			bulletImage.attr("src","images/bullet_sub_selected.png");
		}),
		$(this).mouseout(function(){
			var bulletImage = $(this).children('.bullet');
			bulletImage.attr("src","images/bullet_sub.png");
		});
	});
	
	/*$("#announcement").hover(function(){
  			$(this).animate( { backgroundColor: '#007100' }, 100)
		},
		function(){
			$(this).animate( { backgroundColor: '#54B948' }, 100)
	});*/
	
	$('.fade').dwFadingLinks({ 
  		color: '#B6B7BA',
    	duration: 200 
  	}); 
	
	$('.fade-nav').dwFadingLinks({ 
  		color: '#666666',
    	duration: 200 
  	}); 
	
	$("a.lightbox").fancybox({
		'autoScale'		:	false,
		'autoDimensions':	false,
		'height'		:	160,
		'width'			:	380,
		'overlayColor'	:	'#000',
		'overlayOpacity':	0.6,
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200
	});
	
	$("img.a").hover(function() {
		$(this).stop().animate({"opacity": "0"}, "slow");
	},
	function() {
		$(this).stop().animate({"opacity": "1"}, "slow");
	});
	
	$('#twitter_update_list li:last').css({border: '0'});
	
	/*$('#video-library .NuContentRepeatItemSummary').text("Next");
	$('#video-library .NuContentRepeatItemSummary').append("<img src='images/btn.png'>");*/
	
	$('#Enrollment-Email').validate({
		errorLabelContainer: $("#error")								
	});
	
	 $("#bulletin-board").find(".bb-item:last").css("border-bottom","none");
});

function clearField(field){
	if(field.value==field.defaultValue) 
		field.value='';
}

function restoreField(field){
	if(field.value=='') 
		field.value=field.defaultValue;
}
