function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function setImage(strImageName, strImageFullPath) {
	//alert(strImageFullPath);
    var objImage;

    objImage = MM_findObj(strImageName);
    if (objImage != null) { objImage.src = strImageFullPath; }
}


function displayCountries(strCountryListElementName, imagePath){

	var objCountryListElement;
	// list of navigation layers should be defined here
	//var navLayers = new Array('northAmerica', 'latinAmerica', 'africaMiddleEast', 'asiaPacific', 'europe', 'southAsia', 'subSahara');

    for(i=0;i<navLayers.length;i++) {
	objTempCountryListElement = MM_findObj(navLayers[i]);
	if (objTempCountryListElement != null) {
	    if (objTempCountryListElement.style) { objTempCountryListElement = objTempCountryListElement.style; } 
	    objTempCountryListElement.display = "none";		
	}

    }
    
    objCountryListElement = MM_findObj(strCountryListElementName);
    if (objCountryListElement != null) {
        if (objCountryListElement.style) { objCountryListElement = objCountryListElement.style; } 
	objCountryListElement.display = "";		
    }
    
    setImage("regionMap2", imagePath);
}

function swapMaps(){
	
	$("#regionMap").css({'display':'none'});
	$("#regionMap2").css({'display':'block'});
}


