var theCurrentLocation;
var justSet = false;
var theCurrentPage = "";

function SetCurrentPage(thePage){
    var theFrame = document.getElementById("frmLocation");
    var theDoc = theFrame.contentDocument || theFrame.contentWindow.document;
    if(thePage!=theCurrentPage){
        theDoc.open();
        theDoc.write( "<script>" );
        theDoc.write( "  var thePage = '"+thePage+"';" );
        theDoc.write( "  document.write( thePage );" );
        theDoc.write( "  parent.window.location.hash = '#'+'"+thePage+"';" );
        theDoc.write( "</script>" );
        theDoc.close();
    }
}

function thisMovie(movieName) {
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	return (isIE) ? window[movieName] : document[movieName];
}

function CheckLocation(){
    var theNewLocation = window.location.hash;
    theNewLocation = theNewLocation.substring(1, theNewLocation.length);
    setTimeout("CheckLocation();", 500);
    if( theCurrentLocation!=theNewLocation){
        theCurrentLocation = theNewLocation;
        SetFlashPage(theNewLocation);
    }
}

function SetFlashPage(thePage){
    theCurrentPage = thePage;
	thisMovie("sitemovie").gotoPageHash(thePage)
}