var countryCode = ''; 

//Set Focus on country
function setCountryVariable(countryID) {
	countryCode = countryID;
	if (countryID != '00') {
		document.site.SetVariable("jsCountry", countryID);
		showAddresses(countryCode)
	}
}

// event handler
function addEvent(obj, type, fn) {
	if (obj.addEventListener)
		obj.addEventListener( type, fn, false );
	else if (obj.attachEvent) {
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
	}
}

// write text to element
function showAddresses(addresses) {
	var container = $('#worldmap_txtbox');
	var mapjs = map[addresses];
	container.html(map[addresses]);
	$("#worldmap_select").selectedValue=addresses;
	countryCode = addresses;
	setDropDown("worldmap_select", addresses);
}

function setDropDown(dropDownName, dropDownValue) {
	var myDropdownList = document.getElementById('worldmap_select');
	// Loop through all the items
	for (iLoop = 0; iLoop< myDropdownList.options.length; iLoop++)
	{    
		if (myDropdownList.options[iLoop].value == dropDownValue)
		{
			myDropdownList.options[iLoop].selected = true;
			break;
		}
	}
}
