jQuery.fn.hint = function()
{
    return this.each(
        function()
        {
            // get jQuery version of 'this'
            var t = jQuery( this );
            
            // get it once since it won't change
            var title = t.attr( 'title' );
            
            // only apply logic if the element has the attribute
            if( title )
            {
                // on blur, set value to title attr if text is blank
                t.blur(
                    function ()
                    {
                        if( t.val() == '' )
                        {
                            t.addClass( 'blur' );
                            t.val( title );
                        }
                    }
                );
                
                // on focus, set value to blank if current value
                // matches title attr
                t.focus(
                    function()
                    {
                        if( t.val() == title )
                        {
                            t.val( '' );
                            t.removeClass( 'blur' );
                        }
                    }
                );
                
                // clear the pre-defined text when form is submitted
                $( 'input[type=submit]' ).bind( 'click',
                    function()
                    {
                        if( t.val() == title )
                        {
                            t.val( '' );
                        }
                    }
                );
                
                // now change all inputs to title
                t.blur();
            }
        }
    );
}
        
function do_search_form()
{
//    if( $( '#keyword' ).val() == '' && $( '#location' ).val() == '' ) {
//        return false; // require a keyword search
//    }
    
    $( '#search' ).submit();
    return false;
}

function do_store_form()
{
    // validate to make sure user entered in something...
    if( ( $( '#lookup_store_postcode' ).val() == 'Enter postcode or suburb here' ) == true ) {
        $( '#postcode_tag' ).css( 'color', '#FF0000' );
        return false; // require a keyword search
    }
    
    $( '#stores' ).submit();
    
    return false;
}

function do_submit_form( obj )
{
    $( obj ).submit();
    return false;
}
