	var path	= 'images/';
	var zones	= new Array('default','af', 'as', 'au', 'na', 'sa', 'we', 'ee', 'me');
	var imgs	= new Array('MapAll.jpg','MapAF.jpg', 'MapAS.jpg', 'MapAAP.jpg', 'MapNCA.jpg', 'MapSA.jpg', 'MapWE.jpg', 'MapEE.jpg', 'MapME.jpg');

	var imageid			= 'imagemap';
	var defaultzone		= 'default';


function map_preloadImages() {
	if(document.images){
		if(!document._preloaded) document._preloaded	= new Array();
		var i;
 		for(i = 0; i<imgs.length; i++){
			document._preloaded[i]		= new Image;
			document._preloaded[i].src	= path + imgs[i];
		}
	}
}

function map_swapImage(zone) {
	var i, x;
	if ((x=findObject(imageid))!=null){
 		for(i = 0; i < zones.length; i++){
			if (zones[i] == zone){
				x.src		= path + imgs[i];
				activeimg	= x.src;
			}
		}
	}
}

function map_restoreImage() {
	map_swapImage(defaultzone);
}

var ratesSearchButtonName			= 'SearchButton';
	ratesSearchButtonLoadingCaption	= 'Loading...';

function findObject(n, d) {
	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=findObject(n,d.layers[i].document);
	if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function getValue(id_object){
	var x;
	
	if ((x=findObject(id_object))!=null){
		if (x.value) return x.value;
	} 

	return '';

}

function setValue(id_object, Value){
	var x;
	
	if ((x=findObject(id_object))!=null){
			x.value	= Value;
	} 

}

function clearContent(id_object){
	var x;
	
	if ((x=findObject(id_object))!=null){
		if (x.innerHTML != ''){
			x.innerHTML	= '';
		}
	}

}

function getContent(id_object){
	var object;
	
	if ((object=findObject(id_object))!=null){
		if (object.innerHTML) return object.innerHTML;
	}

}

function setContent(object_id,text)
{
	var x;

	if ((x=findObject(object_id))!=null) {
		x.innerHTML = text;
	}

}

function setClassName(id_object, classname){
	var x;
	
	if ((x=findObject(id_object))!=null){
			x.className	= classname;
	} 

}

function qgetClassName(id_object){
	var x;
	
	if ((x=findObject(id_object))!=null){
			return x.className;
	} 

	return false;

}

function bookmark(){

	var title	= document.title;
	var url		= document.location.href;

	if( window.external ) { // IE

		window.external.AddFavorite( url, title); 

	} else if (window.sidebar) { // Mozilla Firefox

		window.sidebar.addPanel(title, url,"");

	} else if(window.opera && window.print) { // Opera

		alert("Press CTRL+T to bookmark!");

	}

}

function reselectCountryFrom(){
	var x;

	redirection();

	if (document.mapform){
		document.mapform.id_from_country.value	= document.c_sel.id_from_country.value;
		document.mapform.submit();
	} else {
		document.c_sel.submit();
	}

}

function onLoadEvent(){

	if (document.c_sel){
		document.c_sel.id_from_country.onchange	= reselectCountryFrom;
	}

	if (window.preloadImages){
		preloadImages();
	}

}

function redirection(){
	var x;

	if ((x=findObject(ratesSearchButtonName))!=null){
		x.innerHTML	= ratesSearchButtonLoadingCaption;
	}
 
}

function setCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	
	document.cookie = name+"="+value+expires+"; path=/;";
}

