// Copyright 2008 Google Inc. All Rights Reserved. var fileLocation = "http://www.gapminder.org/communityproxy"; var collectionKey = "pk7kRzzfckbzz4AmH_e3DNA"; var chartTitle = "Gapminder World"; var titleLink = "http://www.gapminder.org"; var skinColor = "31BBFF"; var defaultChart = "VALUE!"; var bubbleswf = fileLocation + "/trendalyzer.swf"; var playOnLoadEnabled = false; /** * Called initially by movie */ function getCurrentHash(){ return escape(window.location.href); } /** * Updates the anchor tag with information about the current * chart state. Used to support bookmarking chart state. * This function is called from flash. */ function updateUrl(newUrl){ if (newUrl.length > 1 ) { location.hash=newUrl; } } /** * Returns true if the browser url does not yet * contain a hash string. */ function noChartSpecifiedInUrl(){ return location.hash.length == 0; } /** * Adds the default has defined in the datacollection sheet * to the browser's url. */ function setDefaultChart(){ if (defaultChart.length > 0) location.hash = defaultChart; } /** * Loads the bubble chart and places it in a div called * bubblePanel. This id MUST be present in the embedding * page to work. */ function loadBubbleGraph(){ if (noChartSpecifiedInUrl()) setDefaultChart(); document.title=chartTitle; chart = new SWFObject(bubbleswf, "uid", "100%", "100%", "7", "#FFFFFF", false,"high", null, "noflash.html"); chart.setProxy(null, 'javascript/swfobject_js_gateway.swf'); chart.addVariable('href', escape(window.location.href)); chart.addVariable('skinColor', '0x'+skinColor); chart.addVariable('chartTitle', chartTitle); chart.addVariable('linkToChartUrl', window.location); chart.addVariable('chartLink', titleLink); chart.addParam("scale", "default"); chart.addVariable("playOnLoad", playOnLoadEnabled); chart.addVariable("urlPrefix", fileLocation + "/"); chart.addVariable("collectionKey", collectionKey); chart.write("bubblePanel"); }