
// simple utility to clear the default value of an input 
// field to make room for user-supplied form data

function clearDefaultValue(e) { 

    var elem = Event.element(e);
    
    if (! elem.defaultCleared) {
        elem.value = "";
        elem.className="active-form-element form-input-text";
    }
    Event.stop(e);
}

/*
 *  Get around IE's lack of support for changing a elements type.
 */
function changePasswordField(elem) {

    $('display-password').hide();
    $('enter-password').show();
    $('password').focus();
}

Event.observe(window, 'load' , function() {
        if ($('storeLocatorInput')) {
            Event.observe('storeLocatorInput', 'focus', clearDefaultValue);
        }
        
        if ($('userName')) {
            Event.observe('userName', 'focus', clearDefaultValue);
        }
    });
