var savecolor;

function openRates (ie, div, country) {
	if ($(div + 'Info').style.display == 'none') {
		//perform ajax		
		savecolor = $(div).style.backgroundColor;
		$(div + 'Info').update('<img src="../images/ajax_loader_orange.gif" />');
		$(div + 'Info').addClassName('countryInfoWait');
		$(div + 'Price').insert({top:'<div id="closeButton' + div + '" class="closeButton"><a href="#" onclick="openRates('+ ie +',\'' + div +'\');return false;" style="text-decoration:none"><img src="../images/ico-close.gif" style="vertical-align:middle;border:0px" /> <span style="text-decoration:underline">Close</span></a></div>'});
		$(div + 'Info').show();	
		new Ajax.Request ('../javascript/per-minutes_ajax.php', {
			parameters: { country: country },
			method: 'post',
			onSuccess: function(transport) {
				$(div + 'Info').removeClassName('countryInfoWait');
				$(div + 'Info').update(transport.responseText);
			},
			onFailure: function () {
				$(div + 'Info').removeClassName('countryInfoWait');
				$(div + 'Info').update('<strong style="padding:10px">Information unavailable.  Please try again later.</strong>');
			}
		});
		$$('#' + div + ' div').each(function (element) {element.style.backgroundColor = '#D7E1F5';});		
		$(div + '_plus').hide();
		$(div + '_minus').show();
		
		if (ie) {
			$(div + 'Name').style.width = "413px";
			$(div + 'Price').style.width = "197px";	
		} else {
			$(div + 'Name').style.width = "440px";
			$(div + 'Price').style.width = "186px";
		}
		$(div).style.border = "1px solid #000000";		
	} else {
		$('closeButton' + div).remove();
		$$('#' + div + ' div').each(function (element) {element.style.backgroundColor = savecolor;});
		$(div + 'Info').hide();	
		$(div + '_plus').show();
		$(div + '_minus').hide();
		
		if (ie) {
			$(div + 'Name').style.width = "414px";
			$(div + 'Price').style.width = "198px";		
		} else {
			$(div + 'Name').style.width = "441px";
			$(div + 'Price').style.width = "187px";
		}
		$(div).style.border = "0px";
		$(div + 'Info').update();
	}		
	return false;
}