//global variable to store information about world map
var worldMap;

var currentHighlight = null;

//Default map settings
var options = {
		autodisplay  : true,
		oceanColor   : '0xefefef',
		zoomMax 	 : 10,
		displayList  : false,
		lblPrefix 	 : '',
		displayStats : false,
		dragInfo	 : false,
		showInfoBox  : false,
		statusDefault: {lbl:'Unknown', clr: '0xFFDC7F'},
		statusList   : [
		               {code:1, lbl:'', clr: '0xFFDC7F'}
		               ]
};

var countryList = [
		               	{
	            			'code': 'fr',
	            			'lbl' : 'EuroDNS France',
	            			'desc': '+33 (0)1 80801100',
	            			'sts' : 1
		            	},
		               	{
	            			'code': 'uk',
	            			'lbl' : 'EuroDNS United Kingdom',
	            			'desc': '+44 (0)20 70992129',
	            			'sts' : 1
		               	},		            	
		               	{
		               		'code': 'de',
		               		'lbl' : 'EuroDNS Germany',
		               		'desc': '+49 (0)180 5 236275',
		               		'sts' : 1
		               	},		            	
		               	{
		               		'code': 'be',
		               		'lbl' : 'EuroDNS Belgium',
		               		'desc': '+32 (0)2 8881600',
		               		'sts' : 1
		               	},		            	
//		               	{
//		               		'code': 'nl',
//		               		'lbl' : 'EuroDNS Netherlands',
//		               		'desc': '+44 (0)20 70992129',
//		               		'sts' : 1
//		               	},
		               	{
		               		'code': 'us',
		               		'lbl' : 'EuroDNS US',
		               		'desc': '+1 2122023003',
		               		'sts' : 1
		               	},
		               	{
		               		'code': 'mx',
		               		'lbl' : 'EuroDNS Mexico',
		               		'desc': '+52 55 11638887',
		               		'sts' : 1
		               	},
		               	{
		               		'code': 'br',
		               		'lbl' : 'EuroDNS Brazil',
		               		'desc': '+55 61 37172118',
		               		'sts' : 1
		               	},
		               	{
		               		'code': 'ar',
		               		'lbl' : 'EuroDNS Argentina',
		               		'desc': '+54 11 59839448',
		               		'sts' : 1
		               	},
		               	{
		               		'code': 'cl',
		               		'lbl' : 'EuroDNS Chile',
		               		'desc': '+56 32 2768686',
		               		'sts' : 1
		               	},
		               	{
		               		'code': 'au',
		               		'lbl' : 'EuroDNS Australia',
		               		'desc': '+61 2 80147283',
		               		'sts' : 1
		               	},
		               	{
		               		'code': 'jp',
		               		'lbl' : 'EuroDNS Japan',
		               		'desc': '+81 3 45209243',
		               		'sts' : 1
		               	},
		               	{
		               		'code': 'lu',
		               		'lbl' : 'EuroDNS Luxembourg',
		               		'desc': '+352 26 37 25 200',
		               		'sts' : 1
		               	},
			            {
			            	'code': 'sg',
			            	'lbl' : 'EuroDNS Singapore',
			            	'desc': '+65 31031134',
			            	'sts' : 1
			            },
			            {
			            	'code': 'bh',
			            	'lbl' : 'EuroDNS Bahrain',
			            	'desc': '+973 16199135',
			            	'sts' : 1
			            }
		               	
                   ]

//When the dom is ready...
jQuery(function() {
	jQuery.noConflict();
	//Add the flash to the container
	swfobject.embedSWF("/swf/worldmap.swf", "worldMapContainer", "430", "242", "9.0.0","expressInstall.swf");
});

function flashMapReady(){
	//store element worldMap
	worldMap = document.getElementById('worldMapContainer');
	worldMap.setOptions(options);
	//worldMap.setCountryList(countryList);
	for(i=0;i<=countryList.length;i++){
		worldMap.addCountry(countryList[i]);
	}

}

function clickCountry(country){
	var codeId = '#'+country.code;
	if(currentHighlight != null){
		currentHighlight.removeClass('highlight');		
	}
	currentHighlight = jQuery(codeId);
	currentHighlight.addClass('highlight');
}