$(document).ready(function(){

	$('input[type="text"], input[type="password"]').focus(function() {
		if(this.value==this.defaultValue)this.value='';
		});

	$('input[type="text"], input[type="password"]').blur(function() {
		if(this.value=='')this.value=this.defaultValue;								  
		});
                
        /* Custom checkboxes and radio buttons */
        $('input[type=checkbox], input[type=radio]').checkBox();
       	
});

function validateEmail() {
    
    var error = false;

    var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
    if(emailPattern.test($("#email").val()) == false){
        error = true;
    }
    return error;
}

jQuery.fn.ForceNumericOnly =
function()
{
    return this.each(function()
    {
        $(this).keydown(function(e)
        {
            var key = e.charCode || e.keyCode || 0;
            // allow backspace, tab, delete, arrows, numbers and keypad numbers ONLY
            return (
                key == 8 ||
                key == 9 ||
                key == 46 ||
                key == 190 ||
                key == 110 ||
                (key >= 37 && key <= 40) ||
                (key >= 48 && key <= 57) ||
                (key >= 96 && key <= 105));
        })
    })
};
