var current_hash = "";
if(typeof flash_elem_class == "undefined") {
    var flash_elem_class = "mainflashembed";
}
function changePageHash(hash)
{
	hash = hash.indexOf("/")==0 ? hash : "/"+hash;
	if(current_hash.toLowerCase() == hash.toLowerCase()) return;
	document.location.hash = hash;
}
function checkHash()
{
	var h = document.location.hash;
	if(h.indexOf("#") == 0) h = h.substr(1, h.length);
	if(current_hash != h){
		current_hash = h;
		notifyFlashOnHashChange();
	}
}
function notifyFlashOnHashChange() 
{
	$("."+flash_elem_class).each(function() {
		if(typeof this.openPageByHash != "undefined") this.openPageByHash(current_hash);
	});
}

window.setInterval(checkHash, 200);
