var country = "south korea"; if(country == "") { var tmpStr = 'any_business'; }else { var tmpStr = country + ' any_business'; } //var newsSources = ' (site:cnn.com | site:tmz.com | site:washingtonpost.com | site:people.com)'; var defaultSearch = { title : '', query : tmpStr }; var newsBoxContainer; 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, orderByDate : true }; newsBoxContainer = new NewsBox('newsbox' , options); } google.load("search", "1"); function initialize() { // complete the news box boot process by calling bootSearcher, and // then re-executing the query newsBoxContainer.bootSearcher(); newsBoxContainer.loadNewsBox(defaultSearch.query, defaultSearch.title); } google.setOnLoadCallback(initialize, true); function loadNews(title) { var query = '"' + title.toLowerCase() + '"'; query = query + newsSources; newsBoxContainer.loadNewsBox(query, title); }