$(function() { 
	
	$('.readmore').live('click', function(){
			toggleJobs(this);
			//$(this).hide();
			return false;
		});
	
	function toggleJobs(job) {
		$(job).parent().parent().find('.summary').toggle();
		if ($(job).parent().parent().find('.readmore').html() == 'Read more...') {		
			$(job).parent().parent().find('.readmore').html('Close');
		} else {
			$(job).parent().parent().find('.readmore').html('Read more...');
		}
		$(job).parent().parent().find('.full').slideToggle();
		$(job).parent().parent().find('.bottomLinks .emailmethis').toggle();
		$(job).parent().parent().find('.bottomLinks .closeme').toggle();
	}
	
	$('.closeme').live('click', function(){
		toggleJobs(this);
		return false;
	});
	
	
	$('.watermark').focus(function(){
		$(this).val('');
	});

	$('.helper-wrap a.toggle').live('click', function(){
		$('.helper-wrap').slideUp();
		$('a.whatsthis').show();
		$.cookie(this.rel, 1, { expires: 365 });
		return false;
	});

	$('a.whatsthis').live('click', function() {
		$('.helper-wrap').slideDown();
		$(this).hide();
		$.cookie(this.rel, null);
		return false;
	});

	$('.toggle').live('click', function(){
		$('#' + $(this).attr('href')).slideToggle();
		return false;
	});

});
