$(document).ready(function() {
	var displayed = false;
	$("#publisherLoginButton").click(function(){
		if(!displayed)
		{
			$("#publisherLoginDropDown").animate({ 
				top: "0"
			}, 500 );
			displayed = true;
		}
		else
		{
			$("#publisherLoginDropDown").animate({ 
				top: "-55"
			}, 500 );
			displayed = false;
		}
    });
    
    var textField = $("#sponsorUsername");
    if(textField.length == 1)
    {
		var textValue = textField.val();

	    textField.focus(function() {
	        $(this).filter(function() {
	        	textField.css("color","#999");
	            return $(this).val() == "" || $(this).val() == textValue
	        }).val("");
	
	    });
	    textField.blur(function() {
	        $(this).filter(function() {
	            return $(this).val() == ""
	        }).val(textValue);
	
	    });
	    $("input").keypress(function (e) {
      		textField.css("color","#999");
      	});
	    
	    var submit = $("#submit");
	    
	    submit.click(function() {
	        if(textField.val() == textValue || textField.val() == "")
	        {
	        	textField.val() == textValue;
	        	textField.css("color","red");
	        	return false;
	        }
	        else return true;
	    });
	} 
});