//var country = "united-states";
var defaultSearch = {
//title : "Politics",
title : "",
query : "unitedstates_uselections"
};
var newsbox;
var myMap = null;
NewsBox.fetch(defaultSearch.query, "finishNewsBoxBoot");
function finishNewsBoxBoot(context, resultObject, status, details) {
// create a static newsbox
var options = {
title : defaultSearch.title,
autoOpenMode : true,
moreTitle : "MORE",
bootMode : resultObject,
maxResults : 5
};
newsbox = new NewsBox('newsbox' , options);
}
google.load("search", "1");
//google.load("maps", "2.x");
function initialize() {
// complete the news box boot process by calling bootSearcher, and
// then re-executing the query
newsbox.bootSearcher();
newsbox.loadNewsBox(defaultSearch.query, defaultSearch.title);
// for all browser except for safari, it's ok
// to create the map while its div is display:none
// for safari, we need to defer create the map
// if (!newsbox.safari) {
// load and setup the map
// - create and center on the us
// - add a state level polygon overlay
// myMap = new GMap2(document.getElementById("map"),
// {draggableCursor: 'crosshair'});
// myMap.setCenter(new GLatLng(38, -96), 3);
// myMap.addControl(new GSmallMapControl());
// for (var stateCode in stateBorders) {
// var polygon = createPolygon(stateCode);
// myMap.addOverlay(polygon);
// }
// }
}
//function createPolygon(stateCode) {
//var polygon = new GPolygon(stateBorders[stateCode],
// "#f33f00", 1, .2, // stroke color, weight, opacity
// stateFacts[stateCode].color, 0.1);
//GEvent.addListener(polygon, "click",
// function(latlng) {
// var stateName = stateFacts[stateCode].name;
// loadNews(stateName);
// });
// return polygon;
// }
google.setOnLoadCallback(initialize, true);
function loadNews(title) {
var query = title.toLowerCase();
computedSuffix = " any_politics";
query = query + computedSuffix;
newsbox.loadNewsBox(query, title);
}