var Pocasi = {
	"iframe" : null,
	"flash" : null,
	"oldId" : "",
	"block" : true,
	"init" : function(flash)
	{
		Pocasi.flash = flash;
		Pocasi.iframe = document.createElement("iframe");
		Pocasi.iframe.style.display = "none";
		document.body.appendChild(Pocasi.iframe);
		setInterval(Pocasi.check, 500);
	},
	"save" : function(id)
	{
		if(!Pocasi.iframe) return;
		if(!Pocasi.block)
		{
			Pocasi.oldId = id;
			Pocasi.iframe.src = "historie.html?" + id;
			Pocasi.block = true;
		}
		else
			Pocasi.block = false;
	},
	"load" : function(id)
	{
		top.location.hash = id;
	},
	"check" : function()
	{
		var newId = location.hash.substr(1);
		if(Pocasi.oldId != newId)
		{
//			alert("Načíst: " + newId);
			if(element(Pocasi.flash)) element(Pocasi.flash).SetVariable("new_page", newId);
			Pocasi.oldId = newId;
		}
	}
}
if(typeof(document.documentElement.style.msInterpolationMode) != "undefined")
{
	Starter.add("Pocasi.init(\"flash1-in\")", 1)
}
