$(document).ready(function(){
	$.formValidator.initConfig({formid:"commentForm"});
	$("#loginName")
		.formValidator({tipid:"loginTip",onshow:"Please enter your Member ID and Password.",onfocus:"Please input your Member ID.",oncorrect:"OK"})
		.functionValidator({fun:chineseValidator})
		.inputValidator({min:4, onerror:"Member ID must be have 4 characters at least."});
	$("#password")
		.formValidator({tipid:"loginTip",onshow:"Please enter your Member ID and Password.",onfocus:"Please input a Password.",oncorrect:"OK"})
		.inputValidator({min:6,max:20,onerror:"Password between 6~20 characters."})
		.regexValidator({regexp:"password",datatype:"enum",onerror:"The password is invalid."});
	$("#title")
		.formValidator({onshow:"Please enter your report's subject.",onfocus:"Please enter your report's subject.",oncorrect:"OK"})
		.inputValidator({min:5,max:120,onerror:"Your report's Subject must be 5~120 characters."});
	$("#content")
		.formValidator({onshow:"Your message must be between 20~2000 characters.",onfocus:"Your message must be between 20~2000 characters.",oncorrect:"OK"})
		.inputValidator({min:20,max:2000,onerror:"Your Message must be between 20~2000 characters."})
		.keyup(function(){textLimitCheck($("#content").get(0),$("#messageCount").get(0),2000)})
		.keypress(function(){textLimitCheck($("#content").get(0),$("#messageCount").get(0),2000)})
		.keydown(function(){textLimitCheck($("#content").get(0),$("#messageCount").get(0),2000)});
	$("#validateCode")
		.formValidator({onshow:"Enter the characters you see in the image.",onfocus:"Enter the characters you see in the image.", oncorrect:"OK"})
		.regexValidator({regexp:"^\\w{5}$",onerror:"Enter the characters you see in the image."});
});