﻿jQuery(function(){
  var btns = jQuery('button.fg-button');
  
  btns.hover(
	function(){ 
		jQuery(this).addClass("ui-state-hover"); 
	},
	function(){ 
		jQuery(this).removeClass("ui-state-hover").css('font-weight','normal'); 
	}
  );
  
  btns.bind('mousedown',function(){jQuery(this).removeClass("ui-state-hover");});
  btns.bind('mouseup',function(){jQuery(this).addClass("ui-state-hover");});
  btns.css('font-weight','normal');
  
  var $submitBtn = $('button.defaultBtn');
  
  if($submitBtn.length > 0 )
  {
    jQuery('form input').keyup(function(e) {
     
     if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
           $submitBtn.click();
           return true;
     }
    });
    
    jQuery('form select').keyup(function(e) {
     if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
           
           $submitBtn.click();
           return true;
     }
    });
    
  }
});