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=/;";
}

function show_para() {
    document.getElementById('top_para').style.display='block';
    //document.getElementById('top_text').style.display='none';
}

function show_para_less() {
    document.getElementById('top_para').style.display='none';
    //document.getElementById('top_text').style.display='none';
}

