/*
Form Validation Rules: A collection of useful rules for the 
jQuery form validation plug-in v.0.2
Copyright (C) 2006  J鰎n Zaefferer

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
*/

jQuery.validator.rules={required:function(value,element,parameters,utility){switch(element.nodeName.toLowerCase()){case'select':var options=utility.getSelectedOptions(element);return options.length==0||options[0].value.length==0;case'input':switch(element.type.toLowerCase()){case'checkbox':return!element.checked;case'radio':return utility.countChecked(element)==0;default:return value.length==0}default:return value.length==0}},length:function(value,element,parameters,utility){var length=utility.getLength(value,element);return length<parameters[0]||length>parameters[1]},min:function(value,element,parameters,utility){var length=utility.getLength(value,element);return length<parameters[0]},max:function(value,element,parameters,utility){var length=utility.getLength(value,element);return length>parameters[0]},email:function(value){return!value.match(/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i)},url:function(value){return!value.match(/^(https?|ftp):\/\/[A-Z0-9](\.?[A-Z0-9能謁[A-Z0-9_\-能謁*)*(\/([A-Z0-9能謁[A-Z0-9_\-\.能謁*)?)*(\?([A-Z0-9能謁[A-Z0-9_\-\.%\+=&能謁*)?)?$/i)},date:function(value){return/Invalid|NaN/.test(new Date(value))},dateDE:function(value){return!value.match(/\d\d?\.\d\d?\.\d\d\d?\d?/)},number:function(value){return isNaN(value)}};
