$(document).ready(function(){
	
	$('#dataUserPassword').val("Password");
	
	
	
	
	$('#loginCont #dataUserUsername').focus(function(){
			$(this).addClass('focus');
			checkInput(this, "Username", "");
		})
		.blur(function(){
			if($(this).val() == '') $(this).removeClass('focus');
			checkInput(this, "", "Username");
		});

	$('#resetCont #dataUserUsername').focus(function(){
			$(this).addClass('focus');
			checkInput(this, "Username", "");
		})
		.blur(function(){
			if($(this).val() == '') $(this).removeClass('focus');
			checkInput(this, "", "Username");
		});

	$('#dataUserPassword').focus(function(){
		checkInput(this, 'Password', '');
		$(this).addClass('focus');
		$(this).unbind('focus').changeInputType('password');
		document.getElementById('dataUserPassword').focus();
		setTimeout("document.getElementById('dataUserPassword').focus()",100);
	});
	
	
	$('#loginForm').submit(function(){
	});
	
	
	
	
	
	
	

});

function showReset(){
	$('#loginCont').css('display', 'none');
	$('#resetCont').css('display', 'block');
	$("#dataUserAction").val("passwordResetRequest");

}


function checkInput(inputID, checkfor, changeto){
	if($(inputID).val() == checkfor) $(inputID).val(changeto);	
}

$.fn.changeInputType=function(oType){
	return this.each(function(){
		var newObject=document.createElement('input');
		newObject.type=oType;
		if(this.size) newObject.size=this.size;
		if(this.value) newObject.value=this.value;
		if(this.name) newObject.name=this.name;
		if(this.id) newObject.id=this.id;
		if(this.title) newObject.title=this.title;
		if(this.tabIndex) newObject.tabIndex=this.tabIndex;
		if(this.className) newObject.className=this.className;
		this.parentNode.replaceChild(newObject,this);
		return $(newObject);
	});
};
