﻿function handleSearchSubmit(obj)
{
    if (!obj) return true;

    var query = document.getElementById('q');
    var location = document.getElementById('l');

    //deleted default values
    if (query.value == 'Search This Site') {
        query.value = '';
    }

    return true;
}

function handleSearchInputReset(obj, keyword)
{
    //should match the css for original settings
    obj.style.color = 'gray';
}

function handleSearchInputOnFocus(obj, keyword)
{
    if (!obj) return;
    
    obj.style.color = 'black';
    
    if (obj.value == keyword) {
        obj.value = '';
    }
}

function handleSearchInputOnBlur(obj, keyword)
{
    if (!obj) return;
    
    if (obj.value == '') {
        obj.value = keyword;
    }
    
    if (obj.value == keyword) {
        handleSearchInputReset(obj, keyword);
    }
}