﻿function init() {
	if (getCookie('username')!= null&&getCookie('password')!=null){
		var u = (getCookie('username')==null)?'':getCookie('username');
		var p = (getCookie('password')==null)?'':getCookie('password');
		var url = "/login.php?code=auto&user="+u+"&pass="+p;				
		httpRequest("GET",url,true,handleAutologin);			
	}	
}
function handleAutologin(){	  
	if (request.readyState == 4) {
		if (request.status == 200) {			
			if (request.responseText == "1")
				document.location.href = document.location.href;
		}				
	}		
}
