function doColorize()
{
	$(".zebra tbody tr").each(function(index) {
		if(index % 2 == 0) $(this).addClass("odd");
	});
}

function feedback_form_validate(form_id) {
	$(form_id).validate({
		rules: {
			in_name: { required: true },
			in_email: {
				required: true,
				email: true
			},
			in_subject: { required: true },
			in_message: { required: true }
		},
		messages: {
			in_name: 'Введите Ваше имя',
			in_email: 'Введите корректный E-mail.',
			in_subject: 'Введите Тему сообщения.',
			in_message: 'Введите Сообщение.'
		},
		submitHandler: function(form) {
			jQuery(form).ajaxSubmit({
				target: '#form_content',
				success: function(responseText) {
					
				}
			});
		}
	});
}

function frm_logon_validate() {
	$('#frm_logon').validate({
		rules: {
			in_login: {	required: true },
			in_password: { required: true }
		},
		messages: {
			in_login: 'Введите Логин.',
			in_password: 'Введите Пароль.'
		},
		submitHandler: function(form) {
			jQuery(form).ajaxSubmit({
				target: '#form_content',
				beforeSubmit: function(formData, jqForm) {
					
				},
				success: function(responseText) {
					frm_logon_validate();
				}
			});
		}
	});
}

function frm_logon_validate_top() {
	$('.frm_logon').validate({
		rules: {
			in_login: {	required: true },
			in_password: { required: true }
		},
		messages: {
			in_login: 'Введите Логин.',
			in_password: 'Введите Пароль.'
		},
		submitHandler: function(form) {
			jQuery(form).ajaxSubmit({
				target: '#form1_content',
				beforeSubmit: function(formData, jqForm) {
					
				},
				success: function(responseText) {
					frm_logon_validate();
				}
			});
		}
	});
}

function frm_subscribe_validate() {
	$('#subscribe_form').validate({
		rules: {
			in_email: {	required: true, email: true }
		},
		messages: {
			in_email: 'Введите корректный E-mail.'
		},
		submitHandler: function(form) {
			jQuery(form).ajaxSubmit({
				target: '#div_content',
				success: function(responseText) {
					$.scrollTo(0);
				}
			});
		}
	});
}

function get_hotels(city_id) {
	$.ajax({
		url: '/getdata/get_hotels/' + city_id,
		success: function(data) {
			$('#list_hotel').html(data);
			$('.menu_subitem').ajaxContent($.extend({}, ajaxSubContentOptions));
		}
	});
}

function frm_poll_validate() {
	$('#poll_form').validate({
		rules: {
			vote_id: {	required: true }
		},
		submitHandler: function(form) {
			jQuery(form).ajaxSubmit({
				target: '#div_content',
				success: function(responseText) {
					$.scrollTo(0);
				}
			});
		}
	});
}
