var speed
var marqueewidth=200
var marqueeheight=20

function regenerate(){
window.location.reload()
}

function getcontents()
{
	var item, tempcontents, arrcontents;
	
	
	tempcontents = marqueecontents
	arrcontents = tempcontents.split(", ")

for(item in arrcontents)
{
	arrtemp = (arrcontents[item]).split(" ")
	if(parseFloat(arrtemp[2]) != 1.00)
	{
	arrtemp[2] = format(parseFloat(arrtemp[2]) + (parseFloat(arrtemp[2]) * (Cmmsn/100)), 8)
	}
	arrcontents[item] = arrtemp.join(" ")
}

marqueecontents = arrcontents.join("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")
marqueecontents = marqueecontents + "</b>"

	if(document.all)
	{
		document.all.ticker.innerHTML = marqueecontents
	}
}

function regenerate2(){
var item;

speed = sspeed
getcontents()
if(document.all)
{
	document.all.ticker.scrollAmount = sspeed
}
if (document.layers){
setTimeout("window.onresize=regenerate",450)

intializemarquee()
}
}

function intializemarquee(){
document.cmarquee01.document.cmarquee02.document.write('<nobr>'+marqueecontents+'</nobr>')
document.cmarquee01.document.cmarquee02.document.close()
thelength=document.cmarquee01.document.cmarquee02.document.width
scrollit()
}

function scrollit(){
if (document.cmarquee01.document.cmarquee02.left>=thelength*(-1)){
document.cmarquee01.document.cmarquee02.left-=speed
setTimeout("scrollit()",100)
}
else{
document.cmarquee01.document.cmarquee02.left=marqueewidth
scrollit()
}
}

function switchCountry(num)
{
	if(document.calc)
	{
		  if(document.calc.To.options[document.calc.To.selectedIndex].value == 1 || document.calc.Convert.options[document.calc.Convert.selectedIndex].value == 1)
		{
			if(document.calc.To.options[document.calc.To.selectedIndex].value == 1)
			{
				document.calc.Convert.selectedIndex = num
			}else{
				document.calc.To.selectedIndex = num
			}
		}else{
			document.calc.Convert.selectedIndex = 1
			document.calc.To.selectedIndex = num
		}
		Calculatevalue()
	}
}

function addmessage(strmessage)
{
	marqueecontents = marqueecontents + " " + strmessage
}

function format(expr, decplaces)
{
	str = "" + Math.round(eval(expr) * Math.pow(10, decplaces))
	while(str.length <= decplaces)
	{
		str = "0" + str
	}
	decpoint = str.length - decplaces
	return str.substring(0, decpoint) + "." + str.substring(decpoint, str.length)
}

