/*
* jQuery 表单ajax检测插件(utf-8)版 1.0
* http://www.firste.cn
* Copyright (c) 2008 - 2009 firste
* 2008年8月下旬开始设计
* 完成于2008年11月20日
* 此文件生成于2008-11-27
*/
$(document).ready(function() {	
	var validator = $("#firste_reg").validate({
		rules: {
			title: {
				required: true,
				
				maxlength: 40,
				minlength: 2},
			contact: {
				required: true,
				fstringCN: true,
				maxlength: 20,
				minlength: 2},
			tel: {
				required: true,
				digits: true},
			qq: {
				digits: true},
			content: {
				required: true,
				minlength: 2},
			addcode: {
				required: true,
				digits: true},
			vip: {
				required: true,
				digits: true}

			
		},
		messages: {
			title: {
				required: "请输入信息标题",
				
				maxlength: jQuery.format("信息标题不能多于 {0} 个字符"),
				minlength: jQuery.format("信息标题不能少于 {0} 个字符")},
			contact: {
				required: "请输入您的姓名",
				fstringCN: "请输入正确的姓名，只可输入中文",
				maxlength: jQuery.format("姓名不能多于 {0} 个字符"),
				minlength: jQuery.format("姓名不能少于 {0} 个字符")},
					
			
			tel: {
				digits: "请输入正确的QQ号码，只可输入数字",
				required: "请输入您的联系电话"},
				
			qq: {
				digits: "请输入正确的QQ号码，只可输入数字"},
			content: {
				required: "请输入内容",
				minlength: jQuery.format("内容不能少于 {0} 个字符")},
			addcode: {
				digits: "请输入正确的验证码，只可输入数字",
				required: "请输入您的验证码"},
			vip: {
				required: "请输入您的VIP号码",
				digits: "请输入正确的VIP号码，只可输入数字"}

		},
		errorPlacement: function(error, element) {
				error.appendTo( element.parent() );
		},
		success: function(label) {
			label.html("&nbsp;").addClass("checked");
		}
	});

});
function getcode(url)
{
document.getElementById("safecodeimg").src=url+"?"+Math.random();}
