Setting a Variable in Jquery or Javascript
===



    $('#firstname').bind('focusout focusin', function() {
    var get_firstname = $("#firstname").val().replace(/ /g,"+");
    var n_firstname = get_firstname.length;

    if (n_firstname > 2) {  
    $(".firstname_good").fadeIn("fast"); 
    var firstname_v = 1; 
    }
    else { 
    $(".firstname_good").fadeOut("fast"); 
    var firstname_v = ''; 
    } 
    });

I'm have trouble understanding how to use the VAR firstname_v below. What do I need to do in the above to be able to use it below


    $('#lastname').bind('focusout focusin', function() {
    if (firstname_v == 1) {  
    alert(firstname_v); 
    }
    });
