function Initialize()
{
	var cst = document.referrer;
	var pos1 = cst.indexOf("sunbathersclubs");
	if (pos1 != -1)
	{
	elem = document.getElementById('home');
	elem.style.visibility = "hidden";
	}
	var pos2 = cst.indexOf("aprilgenter");
	if (pos2 != -1)
	{
	elem = document.getElementById('home');
	elem.style.visibility = "hidden";
	}
}

function FillBox(box) 
{
     box.options[box.options.length] = new Option('US Dollars','0');
     box.options[box.options.length] = new Option('Canadian Dollars','1');
     box.options[box.options.length] = new Option('Euros','2');
     box.options[box.options.length] = new Option('British Pounds','3');
     box.options[box.options.length] = new Option('Swiss Francs','4');
     box.options[box.options.length] = new Option('Japanese Yen','5');
}

function FormatCurrency(num) 
{
    num = num.toString().replace(/\$|\,/g,'');
    if(isNaN(num))
    num = "0";
    sign = (num == (num = Math.abs(num)));
    num = Math.floor(num *100+0.50000000001);
    cents = num%100;
    num = Math.floor(num/100).toString();
    if(cents<10)
    cents = "0" + cents;
    for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
    num = num.substring(0,num.length-(4*i+3))+','+
    num.substring(num.length-(4*i+3));
    return (((sign)?'':'-') + num);
}

function Convert(box, Price)
{
	var sum = 0;
	var str = "";
	var STR = "";
	
	var Date = "Rate as of 2010.09.08 19:10:00 UTC";
	
	usd = 1.000;
	cad = 1.0474157043;
	eur = 0.7880216455;
	gbp = 0.6516402353;
	chf = 1.0103874346;
	jpy = 83.7917283217;
	
	index = box.selectedIndex;
	switch(index)
	{
		case 0: sum = usd; STR = "$"; break;
		case 1: sum = cad; STR = "$"; break;
		case 2: sum = eur; STR = "&#128;"; break;
		case 3: sum = gbp; STR = "&#163;"; break;
		case 4: sum = chf; STR = "&#131;"; break;
		case 5: sum = jpy; STR = "&#165;"; break;
	}

	cst = Price.replace(",", "");
	value1 = parseFloat(cst);
	value2 = value1 * sum;
	cst = FormatCurrency(value2);
	str = STR + cst;
	
	elem = document.getElementById('price');
	elem.innerHTML = str;
	
	if (index == 0) Date = "Click on the arrow for conversion";
	elem = document.getElementById('date');
	elem.innerHTML = Date;
}
