var gDefaultValues = new Array();
var gInputIds = new Array();

window.addEvent('domready', function(){
    gGalleryCount = $$('.navImage').length;

    $$('input').each(function(item, i)
    {
        if(item.get('type') == 'text')
        {
            var id = item.get('id');
            var value = item.get('value');

            if( id && value)
            {
                gDefaultValues.push(value);
                gInputIds.push(id);
            }
        }

        item.addEvents(
        {
            focus: inputFocus,
            blur: inputBlur
        });
    });
});

function inputFocus()
{
    for (var i = 0; i <  gInputIds.length; i++)
    {
        if( this.get('id') == gInputIds[i] )
        {
            if( this.get('value') == gDefaultValues[i] )
            {
                this.set('value', "");
                this.setStyle('color', '#631B4B');
            }
        }
    }
}

function inputBlur()
{
    if( ! this.get('value') )
    {
        for (var i = 0; i <  gInputIds.length; i++)
        {
            if( this.get('id') == gInputIds[i] )
            {
                this.set('value', gDefaultValues[i]);
                this.setStyle('color', '#80a1b6');
            }
        }
    }
}

