/*!
 * Search Form
 * Author: IID, Inc.
 * URL: http://www.usability.gr.jp/
 * Version: 0.9
 */

placeholderColor = '#666666';
textColor = '#000000';
lengthDefault = "160px";
lengthOnFocus = "320px";

$(function(){
    $('input#s[value=""]').val(placeholderText).css('color',placeholderColor);
    
    $('input#s').focus(function(){
        $(this).css('color',textColor).animate({width:lengthOnFocus},'fast','swing');
        if(this.value == placeholderText){ $(this).val(''); }
    });
    
    $('input#s').blur(function(){
        $(this).css('color',placeholderColor).animate({width:lengthDefault},'fast','swing');
        if(this.value == ''){ $(this).val(placeholderText); }
        if(this.value != placeholderText){ $(this).css('color',textColor); }
    });
    
    $('input#searchsubmit').click(function(){
        $('input#s[value=placeholderText]').val('');
    });
});
