var bname = navigator.appName;
var isIE=false;
if (bname == "Microsoft Internet Explorer")
{
    isIE=true;
}
function getFlashMovie(movieName) {
  var isIE = navigator.appName.indexOf("Microsoft") != -1;
  return (isIE) ? window[movieName] : document[movieName];
}




var currentPage="";


function displayFlash() {
    document.write('<table border=0 cellpadding=0 cellspacing=0 width=100% height=100%><tr><td width=100% height=100%>');
    document.write('<table border=0 cellpadding=0 cellspacing=0 width=100% height=100%><tr><td width=100% height=100%>');
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="100%" height="100%" id="main" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="allowFullScreen" value="false" />');
	document.write('<param name="movie" value="main.swf" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="salign" value="lt" /><param name="bgcolor" value="#e4e5e6" />');
	document.write('<embed src="main.swf" quality="high" scale="noscale" salign="lt" bgcolor="#e4e5e6" width="100%" height="100%" name="main" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
	document.write('</td></tr></table>');
	document.write('<img src="images/blank.gif" width=' + 990 + ' height=1>');
	document.write('</td><td width=1 height=' + 640 + '><img src="images/blank.gif" width=1 height=' + 640 + '></td></tr></table>');
	  
  if (isIE) {
    document.write("<iframe width=0 height=0 src='showpage.html' id='historyframe' frameborder=0></iframe>");
  }
}
function loadFlashPage(p) {
    
    if (isIE) {
        //alert("IS IE");
        document.getElementById("historyframe").src="showpage.html?page="+p;
    } else {
        document.location.href="#"+p;
        setPage(p);
    }
}
function loadFlashPageTest(p) {
    
   alert(p);
}
function setPage(page) {
   	 currentPage=page;
	//alert(window.document.main);
	if (window.document.main) {
		//alert("loading "+page);
		var myMovie=getFlashMovie("main");
		myMovie.jsSetPage(page);
	} else {
		alert("no movie to go back!"+window.document.main);
	}
}
function checkNavURL() {
    var fullurl=""+document.location.href;
    var page=fullurl.split("#")[1];
    if (currentPage!=page) {
        setPage(page);
    }
}
function reloadPage() {
	setPage(parent.historyframe.getPage());
}
function ifInitCallback() {
	var myMovie=getFlashMovie("main");
	myMovie.setBackEnabled(true);
}

if (!isIE) {
    setInterval("checkNavURL()", 200);
}