﻿var disableButtons	= function(){
	$( "button" ).attr( "disabled",true );
	return true;
}
//Input focus
var initInputFocus	=	function(){
	$( "textarea,input[ type=text ],input[ type=password ]").each( function(){
		var $this	=	$( this )
		 .addClass( "textInput" )
		 .focus( function(){ $this.addClass( "focus" ) } )
		 .blur( function(){ $this.removeClass( "focus" ) } );
	});
}
var initGlobal	=	function(){
	initInputFocus();
	$( "form:not( .noButtonDisabling )" ).submit( disableButtons );
}
// execute the lot when the DOM has loaded
$( initGlobal );