window.addEvent('domready', function() {
	if (!window.demo_path) window.demo_path = '';
	var demo_path = window.demo_path;
	// ------------	
	$('SocutForm').addEvent('submit', function(e) {	
		e.stop();
		$('log').addClass('show');
		var log = $('log_res').empty().addClass('ajax-loading');
		this.set('send', {onComplete: function(response) { 
			log.removeClass('ajax-loading');
			log.set('html', response);
			var vJS=$("JS");
			if(vJS!=null)
			{
			   vJS=vJS.value.split(',');
			   if(response==vJS[0])//验证通过
			   window.location=vJS[1];	
			}
		}});
		
		if(CheckForm()==null)//验证表单
		{
		   this.send();
		}
		else
		{
		   log.removeClass('ajax-loading');
		   log.set('html', CheckForm());
		}
	});
});