
/**
 * Tools
 *
 * @copyright Copyright (c) 2010, ecto.lt
 * @author    Benas Valančius <benas@ecto.lt>
 * @package   Framework
 *
 * $Id: tools.js 537 2010-05-13 08:29:36Z noen $
 */

/**
 * Custom field validation
 *
 * @param string selector - jQuery selector
 * @param string value    - Default value
 * @param bool   empty    - Can be empty?
 *
 * @return bool
 */
tools.validateField = function(selector, value, empty)
{
    if(typeof empty == 'undefined')
        empty = false;
    
    if($(selector).val() == value || (!empty && $(selector).val() == ''))
        return false;
        
    return true;
};
