﻿/*
initialise global scripts
*/
var disableButtons = function(){
	$("button,input[type=submit],input[type=button]").each(function(){
		$(this).attr("disabled",true);
	});
	return true;
}
//Input focus
var initInputFocus = function(){
	var aryFocusInputs = $("textarea,input[type=text],input[type=password]").get();
	$(aryFocusInputs).each(function(){$(aryFocusInputs).focus(function(){$(this).addClass("focus")});});
	$(aryFocusInputs).each(function(){$(aryFocusInputs).blur(function(){$(this).removeClass("focus")});});
}
// actionLink styling
   $(document).ready(function(){
    $('.actionLink').each(function(){
    	var b = $(this);
    	var tt = b.text() || b.val();
    	b.text('').prepend('<i></i>').append($('<span>').
   		text(tt).append('<i></i><span></span>'));
   	});
  });



var initGlobal = function(){
	initInputFocus();
	//$("form").submit(disableButtons);
}
// execute the lot when the DOM has loaded
$(initGlobal);