function usernameBlur(obj,text){
	if(obj.value==''){ 
		obj.value = text;
		obj.type = 'text';
	};
};

function usernameFocus(obj,text){
	if(obj.value==text){
		obj.value = '';
		if(text=='Password'){
			obj.type = 'password';
		};
	};
};

String.prototype.trim = function() {
        return this.replace(/^\s+|\s+$/g,"");
}

function openNewUserSignUp(){
	//alert("hello");
	$("#newUserSignup").toggle();
	if($("#join-button").val().trim() == "New users, register here"){
		$("#join-button").val("Collapse");
	}else{
		$("#join-button").val("New users, register here");
	}
}

/*
$(document).ready(function() {

	//for username
	$("#id_username").attr('tabindex','5');
	$("#id_username").val('Username');
	$("#id_username").blur(function(){
		if ($(this).val()==""){	
			$(this).val("Username");
		};
	});
	$("#id_username").focus(function(){
		if ($(this).val()=="Username"){	
			$(this).val('');
		};
	});

	//for Email
	$("#id_email").attr('tabindex','6');
	$("#id_email").val('Email Address');
	$("#id_email").blur(function(){
		if ($(this).val()==""){	
			$(this).val("Email Address");
		};
	});
	$("#id_email").focus(function(){
		if ($(this).val()=="Email Address"){	
			$(this).val('');
		};
	});

	//for password1
	$("#id_email").attr('tabindex','7');
	$("#id_password1").val('Password');
	document.getElementById("id_password1").type='text';	
	$("#id_password1").blur(function(){
		if ($(this).val()==""){	
			$(this).val("Password");
			this.type="text";
		};
	});
	$("#id_password1").focus(function(){
		if ($(this).val()=="Password"){	
			$(this).val('');
			this.type='password';
		};
	});

	//for password2
	$("#id_email").attr('tabindex','8');
	$("#id_password2").val('Confirm Password');
	document.getElementById("id_password2").type='text';	
	$("#id_password2").blur(function(){
		if ($(this).val()==""){	
			$(this).val("Confirm Password");
			this.type="text";
		};
	});
	$("#id_password2").focus(function(){
		if ($(this).val()=="Confirm Password"){	
			$(this).val('');
			this.type='password';
		};
	});

});
*/
