var Heineken = {

	flashId : 'fotoblog' + Math.round( Math.random() * 1000000),
	flashProxy : null,
	lastHistoryChange : '',

	useHistory : true, //document.all === undefined;// document.body.addEventListener !== undefined;

	init : function() {
	
		if (this.useHistory) {
			dhtmlHistory.initialize();
			
			dhtmlHistory.addListener(fotoblog_historyChange);
			
			var initialLocation = dhtmlHistory.getCurrentLocation();
			
			if (initialLocation != null) {
				fotoblog_open(initialLocation);
			} else {
				// nic nie robimy, php przekaza? ju? wcze?niej odpowiedni parametr...
			}
		}

	},

	openUrl : function(url) {
		flashProxy.call('openUrl', url, false);
	},

	historyChanged : function(newLocation, historyData) {
		if (lastHistoryChange == newLocation) return;
		this.openUrl(newLocation);
	}
};

function fotoblog_historyAdd(url) {
	lastHistoryChange = url;
	if (useHistory) {
		dhtmlHistory.add(url);
	}
}

function fotoblog_entryActivated(url) {
	fotoblog_historyAdd(url);
	urchinTracker(url); 
}

function fotoblog_comments(id) {
	window.open('/?comments_popup='+id, '_blank', 'width=400,height=500,scrollbars=yes,status=yes');
	return void(0);
}


