$(document).ready(function(){
	
	$("#login").focus(function () {
		if ($(this).val() == "Username") {
			$(this).val("");
		}    
	});
	
	$("#login").blur(function () {
		if (jQuery.trim($(this).val()) == "") {
			$(this).val("Username");
		}    
	});
	
	$("#password").focus(function () {
		if ($(this).val() == "Password") {
			$(this).val("");
		}    
	});
	
	$("#password").blur(function () {
		if (jQuery.trim($(this).val()) == "") {
			$(this).val("Password");
		}    
	});

 	$("#loginform").submit(function() {
		if ($("#login").val() == "Username" || jQuery.trim($("#login").val()) == "") {
			alert("Please fill in the form!");
			return false;
		}
		else if ($("#password").val() == "Password" || jQuery.trim($("#password").val()) == "") {
			alert("Please fill in the form!");
			return false;
		}
		else {
			return true;
		}
	});

	$("#menurow a img").bind("mouseenter",function(){
    	var temp = $(this).attr("src");
		var temp2 = $(this).attr("swap");
		$(this).attr("src", temp2);
		$(this).attr("swap", temp);
    }).bind("mouseleave",function(){
      	var temp = $(this).attr("src");
		var temp2 = $(this).attr("swap");
		$(this).attr("src", temp2);
		$(this).attr("swap", temp);
    });
	
	$("#twitterfeed").load("/twitter.php");
	
	$('#trailer').click(function (e) {
		e.preventDefault();
		$('#basic-modal-content').load("ajaxtrailer.html", {}, function(){
			$('#basic-modal-content').modal();
		});
	});

});