﻿$(document).ready(function(){

    var flashvars = {  
        menu: menu,  
        id: id,
        current_hash: self.document.location.hash.substring(1),
        safari: $.browser.safari        
    };
    var params = {
        allowfullscreen: true
    }
    var attributes = {
        id: "blaest",
        name: "blaest"
    };
    swfobject.embedSWF("blaest_old.swf", "blaest", "100%", "100%", "8.0.0", "swf/expressInstall.swf",flashvars,params,attributes);
 
	// This is the method that will recieve notifications from the History Keeper,
	// which will then update the state of the app.
	// :NOTE: This will be called when a new entry is added.
	// :NOTE: This will be called if another app on the page sets a history,
	//        so you will need to watch out for this, if you have more than
	//        one script using the history keeper, by doing some kind of 
	//        check to make sure that the new hash belongs to this app.
	//        I wouldn't expect this to be a problem all that frequently.
	this.historyListener = function(historyHash) {
		// update the stateVar
		stateVar = historyHash;
		if (historyHash != '') historyHash = " - " + historyHash;
		// update display content
		//displayDiv.innerHTML = "Current History: " + historyHash;
		// update document title
		document.title = "Blæst Design AS"; //+ historyHash;
	};
	// subscribe to unFocus.History
	unFocus.History.addEventListener('historyChange', this.historyListener);
	
	// Check for an initial value (deep link).
	// In this demo app, the historyListener can handle the task.
	this.historyListener(unFocus.History.getCurrent());
	
	// register with flash
	History.SWFID("blaest");
});



