var location_str = "";
var flashPlayer;

function initialize() {
	//alert("FLASH");
   	var isIE = navigator.appName.indexOf("Microsoft") != -1;
  	flashPlayer = (isIE) ? window['flash'] : document['flash'];
}

function loadLocation() {
	
	location_str = window.location.search.substring(1);
	
	flashPlayer.setInitialLocation(location_str);
	
}

function loadDistributorsPage() {
	if(opener)
		opener.loadDistributors();
	else
		window.location ="http://bardsbeer.com/#/bards_beer_distributors/";
}

function loadHome() {
	if(opener)
		opener.loadHome();
	else
		window.location ="http://bardsbeer.com/#/gluten_free_beer_home/";
}

function loadNewLocation(str) {
	
	var temp = str.slice("?");
	location_str = temp[1];
	flashPlayer.searchAddressExternal(location_str);
	
}

function closeWindow() {
	
	window.close();	
}

function init() {
	browserDetect.init();
	browserScale();
	
}

function loadFlash() {
	swfobject.embedSWF("locator.swf", "content", "100%", "100%", "9.0.0", "swf/expressInstall.swf", {}, {}, {id: 'flash'});
	//var so = new SWFObject("locator.swf", "flash", "100%", "100%", "9", "#FFFFFF");
	//so.write("content");
	
}

function loadFlashTest() {
	swfobject.embedSWF("locator_test.swf", "content", "100%", "100%", "9", "swf/expressInstall.swf", {}, {}, {id: 'flash'});
	//var so = new SWFObject("locator.swf", "flash", "100%", "100%", "9", "#FFFFFF");
	//so.write("content");
	
}
