var current_hash = "";
if(typeof flash_elem_class == "undefined") {
    var flash_elem_class = "mainflashembed";
}
function changePageHash(hash)
{
	hash = hash.indexOf("/")==0 ? hash.substr(1, hash.length) : hash;
	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.hashChanged != "undefined") {
		    this.hashChanged(current_hash);
	    }
	});
}

window.setInterval(checkHash, 200);

