
$(document).ready(function(){
    $("input[name=p_user_email]").focusin(function(){
        if($(this).val() == 'e-mail:')
            $(this).val('');
    });
    $("input[name=p_user_email]").focusout(function(){
        if($(this).val().length == 0)
            $(this).val('e-mail:');
    });

    $("input[name=p_newsletter_email]").focusin(function(){
        if($(this).val() == 'e-mail:')
            $(this).val('');
    });
    $("input[name=p_newsletter_email]").focusout(function(){
        if($(this).val().length == 0)
            $(this).val('e-mail:');
    });

    $("input[name=p_user_password]").focusin(function(){
        if($(this).val() == 'password:')
            $(this).val('');
    });
    $("input[name=p_user_password]").focusout(function(){
        if($(this).val().length == 0)
            $(this).val('password:');
    });
});

function validate_email(){
    var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
    if(!regex.test($("input[name=email]").val())){
        $("img.email").show();
        return false;
    }else{
        $("img.email").hide();
        return true;
    }
}


