/* FUNCTIONS FOR TRACKING LOGIN DIALOGUE BOX CHANGES */	
var t;
var timer_period=20;	
var timer_is_on=0;

function loginTimerCheck()
{
	if (window.location.hash == "#loginComplete") {
		//LOGIN PROCESS COMPLETE
		window.location.hash = "";
		//alert('loginTimerCheck() - found loginComplete');
		if (getCookie("LOGGEDIN") == 'true') {
			//alert('Back in parent - you were just logged in - should refresh page now');
			window.location.reload();
		}
		else {
			//USER DID NOT COMPLETE LOGIN. DO NOTHING.
			//alert('loginTimerCheck() - Back in parent - user was not logged in yet. stopping.');
		}
	}else if(window.location.hash == "#userRegistrationStep3"
			|| window.location.hash == "#showConfirmationFacebook"){
			//USER COMPLETED REGISTRATION. NEED TO RELOAD PAGE.
			//alert('loginTimerCheck() - USER COMPLETED REGISTRATION. Reload page');
			window.location.hash = "";
			window.location.reload();
	}else {
		//alert('reseting timeout');
        //setTimeout(check, period);
		t=setTimeout("loginTimerCheck()",timer_period);
    }
}

function startLoginTimer()
{
	if (!timer_is_on)
	  {
	  timer_is_on=1;
	  loginTimerCheck();
	  }
}

function stopLoginTimer()
{
	clearTimeout(t);
	timer_is_on=0;
}	

