
var regionImages = Array(); // Image cache for region maps 
if (document.images) {
/*
    regionImages["europecentraleast"] = new Image();
    regionImages["europecentraleast"].src = 'images/MAP_Europe_WEB_CentralEast.png';
    regionImages["europenorthwest"] = new Image();
    regionImages["europenorthwest"].src = 'images/MAP_Europe_WEB_NorthWest.png';
    regionImages["europesouthwest"] = new Image();
    regionImages["europesouthwest"].src = 'images/MAP_Europe_WEB_SouthWest.png';
    regionImages["europeoff"] = new Image();
    regionImages["europeoff"].src = 'images/MAP_Europe_WEB_off.png';
*/
    regionImages["africa"] = new Image();
    regionImages["africa"].src = 'images/MAP_World_WEB_Africa.png';
    regionImages["asiapacific"] = new Image();
    regionImages["asiapacific"].src = 'images/MAP_World_WEB_AsiaPacific.png';
    regionImages["canada"] = new Image();
    regionImages["canada"].src = 'images/MAP_World_WEB_Canada.png';
    regionImages["europe"] = new Image();
    regionImages["europe"].src = 'images/MAP_World_WEB_Europe.png';
    regionImages["middleeast"] = new Image();
    regionImages["middleeast"].src = 'images/MAP_World_WEB_MiddleEast.png';
    regionImages["southamerica"] = new Image();
    regionImages["southamerica"].src = 'images/MAP_World_WEB_SouthAmerica.png';
    regionImages["usa"] = new Image();
    regionImages["usa"].src = 'images/MAP_World_WEB_USA.png';
    regionImages["worldoff"] = new Image();
    regionImages["worldoff"].src = 'images/MAP_World_WEB_off.png';
/*
    regionImages["central"] = new Image();
    regionImages["central"].src = 'images/Map_US_WEB_Central.png';
    regionImages["northcalif"] = new Image();
    regionImages["northcalif"].src = 'images/Map_US_WEB_NorthCalif.png';
    regionImages["northeast"] = new Image();
    regionImages["northeast"].src = 'images/Map_US_WEB_NorthEast.png';
    regionImages["northwest"] = new Image();
    regionImages["northwest"].src = 'images/Map_US_WEB_NorthWest.png';
    regionImages["southeast"] = new Image();
    regionImages["southeast"].src = 'images/Map_US_WEB_South.png';
    regionImages["southwest"] = new Image();
    regionImages["southwest"].src = 'images/Map_US_WEB_SouthWest.png';
    regionImages["usaoff"] = new Image();
    regionImages["usaoff"].src = 'images/Map_US_WEB_off.png';
*/
}

function hilite(id) {
   /* Hilite the region when the cursor is over the anchor */
   if (document.images['regionmap'] && regionImages[id]) {
       document.images['regionmap'].src = regionImages[id].src;
   }
   /* Hilite the anchor when the cursor is over the region */
   if (document.getElementById) {
       var anchor = document.getElementById(id);
       if (anchor && anchor.style) {
           anchor.style.color = "#4b77f6";
       }
   }
   return true;
}

function unhilite(id, off) {
   if (document.images['regionmap'] && regionImages[off]) {
       document.images['regionmap'].src = regionImages[off].src;
   }
   if (document.getElementById) {
       var anchor = document.getElementById(id);
       if (anchor && anchor.style) {
           anchor.style.color = "black";
       }
   }
   return true;
}

function unhiliteWorld(id) {
   return unhilite(id, 'worldoff');
}

function unhiliteUSA(id) {
   return unhilite(id, 'usaoff');
}

function unhiliteEurope(id) {
   return unhilite(id, 'europeoff');
}
function asia_subr(subr) {
	window.location.href="/sales/byregion.php?region=Asia%20Pacific&subregion="+subr;
}
function eur_subr(subr) {
	window.location.href="/sales/byregion.php?region=Europe&subregion="+subr;
}
function us_subr(subr) {
    	window.location.href="/sales/byregion.php?region=United%20States&subregion="+subr;
}