My Website: Untitled Document

First click on the big blue div at the bottom then click the back button and you will not be able to see these buttons again, instead some content from the page you navigated away from. This does not occur if you proceed to any other places such as clicking the big blue div then one of the buttons and navigating back on yourself.

Upon clicking a button, variables PreviousLocation and CurrentLocation are set, however I cannot seem to return these values. Please note, in my live view I have removed my attempts.

Code:
    var PreviousLocation;
    var CurrentLocation;
    $("#Home .button").click(function () {
    	var slidedown = '#' + $(this).attr('id').replace('_Btn', '');
    		PreviousLocation = '#' + $(this).parent().parent().attr('id');
    		CurrentLocation = '#' + $(this).attr('id').replace('_Btn', '');
    		DomainPush = $(this).attr('id').replace('_Btn', '');
    	$("#Home").slideUp(2000);
    	$(slidedown).slideDown(2000);
    	history.pushState(null, null, "?Category=" + DomainPush);
    
    });
    
    $("#Fundraiser_Categories .button").click(function () {
    	var slidedown = '#' + $(this).attr('id').replace('_Btn', '_Fundraising_Content');
    	PreviousLocation = '#' + $(this).parent().parent().attr('id');
    	CurrentLocation = '#' + $(this).attr('id').replace('_Btn', '_Fundraising_Content');
    	DomainPush = $(this).attr('id').replace('_Btn', '_Fundraising');
    	$("#Fundraiser_Categories").slideUp(2000);
    	$(slidedown).slideDown(2000);
    	history.pushState(null, null, "?Category=fundraising&content=" + DomainPush);
    });
    
    var sParameterName;
    
    function GetQueryStringParams(sParam) {
    	var sPageURL = window.location.search.substring(1);
    	var sURLVariables = sPageURL.split('&');
    	for (var i = 0; i < sURLVariables.length; i++) {
    		var sParameterName = sURLVariables[i].split('=');
    		if (sParameterName[0] == sParam) {
    			return sParameterName[1];
    		};
    	};
    };
    
    var PageCategory = GetQueryStringParams('Category');
    	PageContent = GetQueryStringParams('content');
    
    if (PageContent !== undefined) {
    	if (PageCategory !== undefined) {
    		$('.ContentInner #Home').css('display', 'none');
    		$('.ContentInner #' + PageContent + '_Content').css('display', 'block');
    	}
    }else if (PageCategory !== undefined) {
    	$('.ContentInner #Home').css('display', 'none');
    	$('.ContentInner #' + PageCategory).css('display', 'block');
    }else{
    	$('#Home').css('display', 'block');
    };
    
    window.onpopstate = function () {
    	alert(CurrentLocation);
    	var PageContent = GetQueryStringParams('content');
    		PageCategory = GetQueryStringParams('Category');
    	if (PageContent !== undefined) {
    		if (PageCategory !== undefined) {
    			$('.ContentInner #Home').css('display', 'none');
    			$('.ContentInner #' + PageContent + '_Content').css('display', 'block');
    		}
    	}else if (PageCategory !== undefined) {
    		$('.ContentInner #Home').css('display', 'none');
    		$('.ContentInner #' + PageCategory).css('display', 'block');
    	}else{
    		$('#Home').css('display', 'block');
    	};
    };
You can see the relevant code above. I've searched Google and browsed some pages for help in resolving, however I cannot seem to find anything like what I am personally doing to be able to give me an idea what I am doing wrong and how to make the window.onpopstate work correctly.

Best Regards,
Tim