function getLocation() {
	var ind=document.QuickSearch.countrylist.selectedIndex;
	var cntName=document.QuickSearch.countrylist[ind].text;
	if (document.QuickSearch.countrylist[ind].value != 0) {
	    if(cntName=='Australia' || cntName=='New Zealand' || cntName=='South Africa')
	    {
		window.open(document.QuickSearch.countrylist[ind].value);
	    }
	    else
	    {
		location.href=document.QuickSearch.countrylist[ind].value;	    
	    }
	}
}

function getLocation2() {
	var ind=document.QuickSearch2.countrylist2.selectedIndex;
	var cntName=document.QuickSearch2.countrylist2[ind].text;
	if (document.QuickSearch2.countrylist2[ind].value != 0) {
	    if(cntName=='Australia' || cntName=='New Zealand' || cntName=='South Africa')
	    {
		window.open(document.QuickSearch2.countrylist2[ind].value);
	    }
	    else
	    {
		location.href=document.QuickSearch2.countrylist2[ind].value;	    
	    }
	}
}



// random bg image

var currentdate = 0
var base = 0

function StringArray (n) {
  this.length = n;
  for (var i =1; i <= n; i++) {
    this[i] = ' '
  }
}

image = new StringArray(6)
image[0] = 'img/bg-main-1.jpg'
image[1] = 'img/bg-main-2.jpg'
image[2] = 'img/bg-main-3.jpg'
image[3] = 'img/bg-main-4.jpg'
image[4] = 'img/bg-main-5.jpg'
image[5] = 'img/bg-main-6.jpg'

var randNum = 60/image.length

function randBg() {
  currentdate = new Date()
  base = currentdate.getSeconds()
  base = Math.floor(base/randNum)
    return(image[base])
}

function topBG() { document.write("<div id=\"topBG\"><img src='" +randBg()+ "'></div>") }




// map locator script
function newImage(arg) {
if (document.images) {
rslt = new Image();
rslt.src = arg;
return rslt;
}
}

function changeImages() {
if (document.images && (preloadFlag == true)) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
}
}
}

var preloadFlag = false;
function preloadImages() {
if (document.images) {
map3_namerica_over = newImage("../img/map/map3-namerica-over.gif");
map3_europe_over = newImage("../img/map/map3-europe-over.gif");
map3_europe_map3_africa_over = newImage("img/map/map3-europe-map3-africa_ove.gif");
map3_asia_over = newImage("../img/map/map3-asia-over.gif");
map3_asia_map3_europe_over = newImage("../img/map/map3-asia-map3-europe_over.gif");
map3_asia_map3_africa_over = newImage("img/map/map3-asia-map3-africa_over.gif");
map3_africa_over = newImage("img/map/map3-africa-over.gif");
map3_africa_over015 = newImage("../img/map/map3-africa-over-15.gif");
map3_asia2_map3_asia_over = newImage("../img/map/map3-asia2-map3-asia_over.gif");
map3_samerica_over = newImage("../img/map/map3-samerica-over.gif");
map3_australia_over = newImage("../img/map/map3-australia-over.gif");
preloadFlag = true;
}
}


ns6 = (document.getElementById)? true:false
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

var countryArray = new Array("asialinks","oceanialinks","africalinks","samericalinks","namericalinks","europelinks");


// Show/Hide functions for non-pointer layer/objects

function show(map) {
hide();
var linksArea = map + "links";


if (ns4) {
document.layers[linksArea].visibility = "show";
}else if (ns6) {
document.getElementById(linksArea).style.visibility = "visible";
}else if (ie4) {
document.all[linksArea].style.visibility = "visible";
}
}

function hide() {
for (var item in countryArray){        

if (ns4) {
document.layers[countryArray[item]].visibility = "hide";
}else if (ns6) {
document.getElementById(countryArray[item]).style.visibility = "hidden";
}else if (ie4) {
document.all[countryArray[item]].style.visibility = "hidden";
}
}
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerwidth; document.MM_pgH=innerheight; onresize=MM_reloadPage; }}
else if (innerwidth!=document.MM_pgW || innerheight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
