App.load = function(){
	App.startTime = (new Date()).getTime();
	if (!user || !user.id){
		if(getCookie("user_id") && getCookie("session_id") && !getCookie("logout")){
			dataHandler.loadUser();
		}else{
			if(getCookie("logout")){
				deleteCookie("logout");
			}
			renderer.renderUser();
		}
	}
}

App.loading = function(st){
	if(st==0){
		window.location.reload();
	}
}

App.reload = function(){
		window.location.reload();
}

App.logout = function(){
	setCookie("logout","1",36500,"");
	deleteCookie("user_id");
	dataHandler.logout();
	App.reload();
}

App.showLogin = function (args){
var settingsElem = $("wwgSettings");
	if (settingsElem && settingsElem.visible()) {
		App.closeSettings();
	}
	
	if(this.popupPassRecovery){
		this.popupPassRecovery.state(0);
	}
	
	if(this.popupLogin){
		this.popupLogin.state(1);
		return;
	}
	App.shadowing(1);
		
	var win = App.popupLogin = new popupWindow("login","SIGN_IN","<form id='formSignin'><div>"+
	'<div style="padding-top:20px;padding-bottom:20px;padding-left:50px;padding-right:50px"><table style="width:100%">\
	<tr><td><label for="settingsAccountLoginMail">EMAIL</label></td><td style="padding:5px; width:170px;"><input style="width:100%" type="text" id="settingsAccountLoginMail"/></td></tr>\
	<tr><td><label for="settingsAccountLoginPassword">PASSWORD</label></td><td style="padding:5px; width:170px;"><input style="width:100%" type="password" id="settingsAccountLoginPassword"/></td></tr>\
	</table></div><div style="text-align:right;padding-right:50px;"><input class="submit_btn" type="submit" value="SIGN_IN"/></div>'
	+"</div></form>",400,200);	

	App.popupLogin.div.style.height="200px";
	
	App.translate($('formSignin'));
	
	this.popupLogin = win;
	 //Event.observe("formSignin","submit",
	document.getElementById("formSignin").onsubmit = function(){// handling submit event via prototype break the callback return value...
		dataHandler.login(document.getElementById("settingsAccountLoginMail").value, 
		document.getElementById("settingsAccountLoginPassword").value);
		return false;
	};
}

App.sendSms = function (invite_id,prefix,mobile_number){

}