
$('#loginLink').click(function (e) {
	e.preventDefault();
	//showlogin();
	togglelogin();
});

$(document).ready(function() {
	hidelogin();
});

var loginshown = false;

function togglelogin() {
	if (loginshown)
		hidelogin();
	else
		showlogin();
}

function hidelogin() {
	$("#OnTrackLoginContainer").css("background", "none");
	$("#OnTrackLoginBox").hide();
	loginshown = false;
}

function showlogin() {
	openLogin();
	$("#tf-other-pages").hide();
	$("#tf-login-form").show();
	$("#OnTrackLoginContainer").css("background", "url(/wp-content/themes/telogis/images/template/login-box-corner.png) no-repeat scroll left bottom");
	$("#OnTrackLoginBox").show();
	$("#OnTrackLoginBox").width("220px");
	$("#OnTrackLoginBox").height("auto");
	loginshown = true;
	$("#username").focus();
}
