// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
function notify(flash_message)
{
// jQuery: reference div, load in message, and fade in
var flash_div = $("#flash");
flash_div.html(flash_message);
flash_div.fadeTo(0, 0);
flash_div.show();
flash_div.fadeTo(1000, 0.9);
// use Javascript timeout function to delay calling
// our jQuery fadeOut, and hide
setTimeout(function(){
flash_div.fadeOut(500,
function(){
flash_div.html("");
flash_div.hide()})},
3000);
}

$(function(){ // <<JQUERY after dom is loaded event
	// hide our container div
	$("#flash").hide();
	$("#flash").addClass('flash_ajax');
	// grab flash message from our div
	var flash_message = jQuery.trim($("#flash").html());
	// call our flash display function
	if(flash_message.length > 6)
	{
	notify(flash_message);
	}	
})

function toggleHeader() {
	$("#toggle_header").slideToggle("slow");
	$("#hide_header_link").toggle();
	$("#show_header_link").toggle();
}