function convert(to, from, amount) {
	// return (Math.round(100 * rates[to] / rates[from] * amount) / 100);
	return Math.round(rates[to] / rates[from] * amount) + '.00';
}

function convert_all(to) {
	// perform all conversions on the page from to to from
	var els = getElementsByClass('money', null, 'span');
	
	// we look for the symbol, then the amount
	var re = new RegExp("([^0-9]*)([0-9,]+)\.");
	
	for (cost in els) {
		var price   = els[cost].innerHTML;
		var matches = re.exec(price);
		var from = '';
		
		if (matches) {
			// find the from currency
			from = '';
			for (s in symbols)
				if (symbols[s] == matches[1]) {
					from = s;
				}
			
			if (from != '') {
				// remove the ,
				price = matches[2].replace(',', '');
				// convert to gbp
				price = convert('GBP', from, price);
				// then to the new currency
				price = convert(to, 'GBP', price);
				// now update
				els[cost].innerHTML = symbols[to] + price;
			}
		}
	}
}