$( document ).ready( function(){


	$('.blink')
		.focus( function(){
			if ( $( this ).val() == $( this ).attr('title') ) {
				 $( this ).attr({ 'value': '' });
				 $( this ).addClass('black');
			}
		})
		.blur( function(){
			if ( $( this ).val() == '' ) {
				$( this ).attr({ 'value': $( this ).attr('title') });
				$( this ).removeClass('black');
			}
		});
		



	$('#namepropertydata input').click(function(){
		if($(this).is(':checked')){
			$(this).prevAll('label').addClass('selectedlabel');
			
		}
		else{
			if(!($(this).siblings('input').is(':checked'))){
			$(this).prevAll('label').removeClass('selectedlabel');
			}
		}
	
		
															   
	});
	$('a#monthlink').click(function(){
		$('#namepropertydata input.checkright').attr('checked','checked');	
		$('#namepropertydata label').addClass('selectedlabel');	
		
															   
	});
	$('a#budgetlink').click(function(){
		$('#namepropertydata input.budgetcheck').attr('checked','checked');	
		$('#namepropertydata label').addClass('selectedlabel');	
		
															   
	});
	$('a.monthlytab').click(function(){
		$('.securefiles#budgetfiles').hide();	
		$('.securefiles#monthfiles').show();	
		
															   
	});
	$('a.budgettab').click(function(){	
		$('.securefiles#monthfiles').hide();
		$('.securefiles#budgetfiles').show();	
		
		
															   
	});
	$('.formbox input').focus(function(){	
		$('.formbox.selectedgray').removeClass('selectedgray');
		$(this).parents('.formbox').addClass('selectedgray');	
		
		
															   
	});
	

	$('.secureprop a.viewalltitle, .secureprop a.viewall').click(function(){
		$('.hiddenall').slideUp();
		$('a.viewall').html('view all &gt;');
	
		if($(this).parent().parent().find('.hiddenall').is(':visible')){
			$('.secureprop').removeClass('gogray');	
		}
		else{
			$('.secureprop').addClass('gogray');	
			$(this).parent().parent().removeClass('gogray');
			$(this).parent().parent().find('a.viewall').html('hide &gt;');
			$(this).parent().parent().find('.hiddenall').slideDown();
		}
	});



// message box

	$('a#closesaved')
		.click( function(){
			$( this ).parent().hide();
		});
		



		$(function() {
				 // doesn't work in MAC FF?????? FFFFFFF
				
				 var timer = setTimeout(hideMsg, 4000);
			
				function hideMsg() {
					$('.messagebox')
						.stop()
						.fadeOut();
				}
		
		});
							 
});