function checkPassword(){
	var password1, password2;
	password1        = document.getElementById("password1").value;
	password2        = document.getElementById("password2").value;
	
	if (password1 != password2) {
		$("#buttonpanel").hide('fast');
		$("#passcheck").show('fast');
	}
	else {
		$("#buttonpanel").show('fast');
		$("#passcheck").hide('fast');
	}

}
function isValidEmailAddress(str){
	if (str.indexOf("@", 1) == -1) {
		$("#buttonpanel").hide('fast');
		$("#emailcheck").show('fast');
	}
	else {
		if (str.indexOf(".", 6) == -1) {
			$("#buttonpanel").hide('fast');
			$("#emailcheck").show('fast');
		}
		else{
			$("#buttonpanel").show('fast');
			$("#emailcheck").hide('fast');
		}
	}
}
function check_login()
{
	username        = document.getElementById("login").value;
	if (username) {
		$.ajax({
			url: "/users/checkusername/" + username + "/",
			beforeSend: function(){
				$.blockUI({
					message: 'Секундочку, проверяем ваш логин...',
					centerY: 0,
					css: {
						top: '200px',
						left: '',
						right: '300px'
					}
				});
			},
			success: function(answ){
				$.unblockUI({
					onUnblock: function(){
						$.growlUI('', '' + answ + '');
					}
				});
			}
		});
	}
	else{
		alert('Сначала введите логин');
	}
}
