$(document).ready(function(){
	$.formValidator.initConfig({formid:"InquiryForm"});
	$("#subject")
		.formValidator({onshow:"Please enter your message's subject.",onfocus:"Please enter your message's subject.",oncorrect:"OK"})
		.inputValidator({min:5,max:120,onerror:"Your message's Subject must be between 5~120 characters."});
	$("#content")
		.formValidator({onshow:"Your message must be between 20~3000 characters.",onfocus:"Your message must be between 20~3000 characters.",oncorrect:"OK"})
		.inputValidator({min:20,max:3000,onerror:"Your Message must be between 20~3000 characters."})
		.keyup(function(){textLimitCheck($("#content").get(0),$("#messageCount").get(0),3000)})
		.keypress(function(){textLimitCheck($("#content").get(0),$("#messageCount").get(0),3000)})
		.keydown(function(){textLimitCheck($("#content").get(0),$("#messageCount").get(0),3000)});
	$("#company")
		.formValidator({onshow:"Please specify your company's name.",onfocus:"Please specify your company's name.",oncorrect:"OK"})
		.inputValidator({min:2,max:120,onerror:"Your Company's name must be between 2~120 characters."});
	$("#name")
		.formValidator({onshow:"Please specify your name.",onfocus:"Please specify your name.",oncorrect:"OK"})
		.inputValidator({min:2,max:30,onerror:"Your Name must be between 2~30 characters."});
	$("#email")
		.formValidator({onshow:"Please specify a valid email address.",onfocus:"Please specify a valid email address.",oncorrect:"OK"})
		.inputValidator({min:5,max:100,onerror:"Your Email must be between 5~100 characters."})
		.regexValidator({regexp:"email",datatype:"enum",onerror:"Please specify a valid email address."});
	$("#tel")
		.formValidator({tipid:"telTip",onshow:"",onfocus:"Please input Phone number.",oncorrect:"OK"})
		.regexValidator({regexp:"^\\d{2,14}$",onerror:"Phone number incorrect."});
	$("#fax1")
		.formValidator({empty:true,tipid:"faxTip",onshow:"",onfocus:"Please input Country code.",oncorrect:"OK",onempty:"OK"})
		.regexValidator({regexp:"^\\d{1,6}$",onerror:"Country code incorrect."});
	$("#fax2")
		.formValidator({empty:true,tipid:"faxTip",onshow:"",onfocus:"Please input Area code.",oncorrect:"OK",onempty:"OK"})
		.regexValidator({regexp:"^\\d{1,8}$",onerror:"Area code incorrect."});
	$("#fax3")
		.formValidator({empty:true,tipid:"faxTip",onshow:"",onfocus:"Please input Fax number.",oncorrect:"OK",onempty:"OK"})
		.regexValidator({regexp:"^\\d{2,14}$",onerror:"Fax number incorrect."});
	$("#country")
		.formValidator({onshow:"Please select a country.",onfocus:"Please select a country.",oncorrect:"OK"})
		.inputValidator({min:1,onerror:"Please select a Country."});
	$("#replyDays")
		.formValidator({onshow:"",onfocus:"Please select reply days.",oncorrect:"OK"})
		.inputValidator({min:0,onerror:"Please select Reply Days."});
	$("#address")
		.formValidator({onshow:"Please specify your business address.",onfocus:"Please specify your business address.",oncorrect:"OK"})
		.inputValidator({min:10,max:120,onerror:"Business Address must be between 10~120 characters."});
	$("#website")
		.formValidator({empty:true,onshow:"eg. http://www.hisupplier.com",onfocus:"eg. http://www.hisupplier.com",oncorrect:"OK",onempty:"OK"})
		.inputValidator({min:5,max:100,onerror:"URL must be between 5~50 characters."})
		.functionValidator({fun:webSiteValidator});
	$("#HI_vc_value")
		.formValidator({onshow:"Enter the characters you see in the image.",onfocus:"Enter the characters you see in the image.", oncorrect:"OK"})
		.regexValidator({regexp:"^\\d{4}$",onerror:"Enter the characters you see in the image."});
});

