// JavaScript Document
function validate_user()
{
	var myajax=ajaxpack.ajaxobj;
	var myfiletype=ajaxpack.filetype;
	if (myajax.readyState == 4){ //if request of file completed
	if (myajax.status==200 || window.location.href.indexOf("http")==-1){ //if request was successful or running script locally
	if (myajax.responseText=='1')
	{
		document.location='login.php';
	}
	else
	{
		document.getElementById("validate").style.display='block';
		document.getElementById("validate").innerHTML='логин/пароль не правильные [<a href="javascript:void(0)" onclick="document.getElementById(\'validate\').style.display=\'none\'">X</a>]';
	}
}
}
}

function submit_login()
{
	ajaxpack.getAjaxRequest("validate_user.php", "login="+encodeURI(document.login_form.login.value)+"&pass="+encodeURI(document.login_form.pass.value)+"&save_id="+(document.login_form.save_id.checked==true?1:0) , validate_user, "txt");
	return false;
}

function iFrameHeight() {
			var h = 0;
			if ( !document.all ) {
				h = document.getElementById('blockrandom').contentDocument.height;
				document.getElementById('blockrandom').style.height = h + 60 + 'px';
			} else if( document.all ) {
				h = document.frames('blockrandom').document.body.scrollHeight;
				document.all.blockrandom.style.height = h + 20 + 'px';
			}
			return h;
		}

