
$(function() {

  // Focus/blur styles for form elements
  $(":input").focus(function () {
    $(this).addClass('selectedInput')
  });    
  $(":input").blur(function () {
    $(this).removeClass('selectedInput')
  });
  
  
  // Mouseover/out styles for submit buttons
  $(".submitButton").mouseover(function () {
    $(this).addClass('submitHover')
  });    
  $(".submitButton").mouseout(function () {
    $(this).removeClass('submitHover')
  });
  
  
  // Mouseover/out styles for basket buttons
  $(".basketButton").mouseover(function () {
    $(this).addClass('basketButtonHover')
  });    
  $(".basketButton").mouseout(function () {
    $(this).removeClass('basketButtonHover')
  });
  
  // Make textarea resizable 
  $('textarea.resize:not(.processed)').TextAreaResizer();

  // focus on the first text input field in the first field on the page
  $("input[type!='checkbox'][disabled=''][id!='CybersourceDeliveryDate']:first", document.forms[0]).focus();
  
  // initialise modal boxes
  $('#samplecodeHelpLink').click(function (e) {
	e.preventDefault();
	$('#samplecodeHelp').modal({
		close: false
	});
  });
  $('#calculatorHelpLink').click(function (e) {
	e.preventDefault();
	$('#calculatorHelp').modal({
		close: false
	});
  });
  
});