///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// On Load

$(document).ready(function(){
	
	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// Rollovers for images
	
	$('.roll').hover(function(){
		$(this).attr("src", $(this).attr("src").replace(/_off/, '_on'));
	},function(){
		$(this).attr("src", $(this).attr("src").replace(/_on/, '_off'));
	});
	
	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// Toggle Item (FAQ)
	
	$(".question").click(function () {
		$('#answer_'+this.id).slideToggle(200);
	});
	
	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// AJAX Log in
	
	function log_in(){
		username = $('#site_username').val();
		password = $('#site_password').val();
		
		$.ajax({
			type: "POST",
			url: "http://domain.com/inc/login.php",
			data: "username="+username+"&password="+password,
			success: function(msg){
				if(msg == 'success'){
					//window.location="index.php";
					//alert('You have successfully logged in!');
					window.location.reload(true);
				} else {
					alert('Incorrect: Please check your username or password.');
				}
			}
		});
	}
	
	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	
});

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

