﻿jQuery.utils = function() {	
        
	return {
        //alert text then go page
        showAlert: function(alertStr, page){
            if($('#alertcontrol').val() == 1)
                return;   
            alert(alertStr);
            if(!(page == "" || page == "[path]"))
                location.href = page;
            window.onbeforeunload = function(){
                $('#alertcontrol').val(1);
            } 
        },
        //alert confirm then go page
        showConfirm: function(confirmStr, page){
            if(!confirm(confirmStr)){
                if(!(page == "" || page == "[path]"))
                    location.href = page;
            }
        },
        focusButton : function (e, button){            
            if (!e)
                e = window.event;
            if (e.keyCode==13)    
                document.getElementById(button).focus();
            else
                return false; 
        }               
	};
}();