//global functions
$(function(){

	//submit form on enter keypress
	$("input[type='text'], input[type='password']").keydown(function(e){
	
        if (e.keyCode == 13) {
        	e.preventDefault();
		$(this).closest('form').find('#submit-btn, input[type=submit], a.btn.submit').trigger('click');
        }
    });
    
    //hook up all buttons with class of btn submit to submit the closest form
    $(".btn.submit, #submit-btn").click(function(e){
    	e.preventDefault();
		$(this).closest('form').submit();
	});
	
	//provide rounded boxes
	if(typeof($.fn.roundbox) != 'undefined' && $('.rounded').length) {
	
		$.fn.roundbox.themes = [
			{
				name:'esobox',
				/* titleColor:'6e5f52', */
				titleColor:'681510',
				imagePrefix:'/css/images/roundbox',
				gradient:['ffffff','f6efea'],
				stroke:'dac7b6',
				fill:'ffffff'
			}
		];
		
		$('.rounded').roundbox({
			bruteForceGradients:true
		});
		
	}
	
	
})