$(document).ready(function(){
	$(".hidden").removeClass('hidden').hide();
	switch($('body').attr('page')) {
		case 'sign':
			$("ul.tabs > li").tabs("div.sign-block > div", "current");
			$('input[name=login]').check('hasValue', '#login-empty');
			$('input[name=password]').check('hasValue', '#password-empty');
			$('input[name=password2]').check('equals', '#password-not-match', $('input[name=password]').get(0));
			$('input[name=email]').check('hasValue', '#email-empty')
				.check('email', '#email-wrong');
			$('input[name=nick]').check('hasValue', '#nick-empty');
			$('input[name=captcha]').check('hasValue', '#captcha-wrong');
			$('form').noErrSubmit();		
			break;
		case 'contacts':
			$('input[name=name]').check('hasValue', '#no-name');
			$('input[name=m]').check('hasValue', '#no-email')
				.check('email', '#email-wrong');
			$('input[name=title]').check('hasValue', '#no-title');
			$('textarea[name=body]').check('hasValue', '#no-body');
			$('form').noErrSubmit();		
			break;
		case 'passrecovery':
			$('input[name=password]').check('hasValue', '#password-empty');
			$('input[name=password2]').check('equals', '#password-not-match', $('input[name=password]').get(0));
			$('form').noErrSubmit();
			break;
	}
	
});
