$(document).ready(function(){	
	//setup the form labels
	$(this).formevents();
	
	//setup the active nav item
	if(act_nav != ''){ $('#'+act_nav).addClass('act'); }
	
	//setup the hero cycle
	$('#hero').cycle({
		fx:     'fade',
		speed:	2000, 
		prev:   '.prev', 
		next:   '.next',
		pause: 1,
		timeout: 7000, //Adjusts the speed of the cycling
		pager: '#hero-markers'
	});
	
	//reveal the email address
	showEmailAddress();
	
	//remove the spam-catcher
	hideSpamCatcher();
	
	//place the logo
	placeLogo();
	
	//setup login form to recognize the enter key to submit
	$('#login_form input').keypress(function(e,o){
		var keycode;
		if (window.event) keycode = window.event.keyCode;
		else if (e) keycode = e.which;
		else return true;
		
		if (keycode == 13)
   	{
   		validateLoginForm();
   		return false;
   	}
		else
   		return true;

	});


	
	//add the modal and overlay just before the body ends
	var overlay = '<div id="overlay" style="display:none;"></div><div id="modal" style="display:none;"></div>';
	$("body").append(overlay);
  
  //set up the show/hide behavior on the FAQ page
  $("div.faq .faq_question h4").click(function(){
  	var thisid = $(this).attr('id');
  	showAnswer(thisid);
  });  
  
  //look for #! URLs
  //parseHashTag(window.location.hash);
  bindHashTag(100);
  
  //if the browser completed the login forms, get rid of the labels
  setTimeout("clearFormLabels()",250);
    
	$.shake({ callback: function() { onShake(); } });
});	
