if (typeof bindLogout != 'function'){
	function bindLogout(){
		if (window.bForceRefresh != undefined){

		} else {
		//	bForceRefresh = true;
		}
		/*
		$('#topNavLogout').unbind('click').click(function(event){
								event.preventDefault();
								logout(bForceRefresh);
							})
		*/
	}
}

if (typeof logout != 'function') {
	function logout(reload) {
		$.ajax({
			url:         "/logout/reload",
			type:        "POST",
			context:     "document.body",
			dataType:    "json",
			data:        {"bReload": reload},
			error:       function(request, error) {},
			success:     function(data) {
							if (data.success != undefined) {
								if (data.success == true) {
									logoutSuccess(data);
								}
							}
						}
			});
		return false;
	}
}

if (typeof logoutSuccess != 'function') {
	function logoutSuccess(data) {
		$('.communityIn').hide();
		$('.communityOut').show();
		$('.topCommunity').attr('href','');
		$('#favAddRemove').removeClass('favDelButton').addClass('favAddButton')
		if (window.iVideoId == undefined) {
			iVideoId = 0;
		}
		if ( typeof addToFavorites == 'function'){
			$('#favAddRemove').unbind('click').bind('click', {iUserId: 0, iVideoId: iVideoId}, addToFavorites)
		}

		if (data.reload == 'true'){
			reload();
		}
	}
}

if (typeof reload != 'function'){
	function reload(){
		window.top.location.href = window.top.location;
	}
}
