var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

var hasReqestedVersion = 0;

if (hasReqestedVersion) {
	var header = '<div id="small-map-holder">';
	document.write(header);
	
	window.addEvent('domready', function(){
		smallMap = new Swiff('IPUGroup/images/map_small.swf', {
			width: 233 ,
			height: 155 ,
			container:'small-map-holder',
			id:'small-map',
			params: {
				wmode: 'transparent'
			}
		});
	});
 
	var alternateContent = '</div>'
	+ '<div style="padding-top: 4px;font-size: 12px;color: #6d6e71">'
	+ 'Select an office:'
	+ '<select id="location-selector" style="width:233px">'
	+ '	<option value="">Please select...</option>'
	+ '	<option value="uk">UK</option>'
	+ '	<option value="europe">Europe</option>'
	+ '	<option value="malaysia">Malaysia</option>'
	+ '	<option value="singapore">Singapore (Distributor)</option>'
	+ '</select>'
	+ '<div>';
	
	document.write(alternateContent);
	
	$('location-selector').addEvent('change', function(){
		switch(this.value){
			case 'uk':
			$('small-map').callUK();
			break;
			case 'europe':
			$('small-map').callEurope();
			break;
			case 'malaysia':
			$('small-map').callMalaysia();
			break;
			case 'singapore':
			$('small-map').callSingapore();
			break;
		}
	});
} 
else {  // flash is too old or we can't detect the plugin
	var img1 = new Image().src = "IPUGroup/home/images/map-UK.jpg"
	var img2 = new Image().src = "IPUGroup/home/images/map-EU.jpg"
	var img3 = new Image().src = "IPUGroup/home/images/map-MA.jpg"
	var img4 = new Image().src = "IPUGroup/home/images/map-SI.jpg"
			
	function setImage(imageSelect) {
		theImageIndex = imageSelect.options[imageSelect.selectedIndex].value;
		if (document.images)
			mapa.src = eval("img" + theImageIndex);
	}

	var alternateContent = '<img name="mapa" id="mapa" src="IPUGroup/home/images/map-START.jpg">'
	+ '<div style="padding-top: 4px;font-size:12px;color:#6d6e71">'
	+ 'Select an office:'
	+ '<select style="width:233px" onChange="setImage(this)">'
	+ '	<option value="">Please select...</option>'
	+ '	<option value="1">UK</option>'
	+ '	<option value="2">Europe</option>'
	+ '	<option value="3">Malaysia</option>'
	+ '	<option value="4">Singapore</option>'
	+ '</select>'
	+ '</div>';

	document.write(alternateContent);  // insert non-flash content		
}
