if (typeof ourworld == "undefined") var ourworld = new Object();

ourworld.init = function () {
	ourworld.id = $("body").attr("id").replace("-", "_");
	
	console.log("ourworld.init()", ourworld.id);

	ourworld.cmatch.load();

	try {
		ourworld["init_" + ourworld.id]();
	} catch (e) {
	}

//	$("a[rel='external']").attr("target", "_blank");
	$("a[href^='http']").attr("target", "_blank");
}

ourworld.init_index = function () {
	console.log("ourworld.init_index()");
	
	if (swfobject.hasFlashPlayerVersion("6.0.65")) {
		var expressInstall = "_swf/expressInstall.swf";
		var flashvars = { autoplay: "true", images_folder: "images/homepage/", xml_folder: "http://ws.exploreyourfuture.org/" };
		var params = { menu: "false", /* wmode: "transparent", */  scale: "noscale", allowScriptAccess: "always" };
		var attributes =  { };
		
		//flashvars.xml_folder = "swf/homepage/";
		
		swfobject.embedSWF("swf/homepage/homepage.swf", "flash", "938", "345", "9", expressInstall, flashvars, params, attributes);
	}
}

ourworld.init_explore = function () {
	console.log("ourworld.init_explore()");
	
	if (swfobject.hasFlashPlayerVersion("6.0.65")) {
		var expressInstall = "_swf/expressInstall.swf";
		var flashvars = { xmlpath: "http://ws.exploreyourfuture.org/wheel" };
		var params = { menu: "false", /* wmode: "transparent", */  scale: "noscale", allowScriptAccess: "always" };
		var attributes =  { };

		flashvars["cmatch"] = ourworld.cmatch.state;
		
		//flashvars.xmlpath = "swf/explore/xml";
		
		swfobject.embedSWF("swf/explore/explore.swf", "flash", "938", "568", "9", expressInstall, flashvars, params, attributes);
	}
}
