function calc(){

	//action=parseInt(radio_button_checker());
	action = 2;
	
	//psamount=parseInt(document.sell.amount.value);
	psamount=document.sell.amount.value;
	if(isNaN(psamount) || psamount==""){
		psamount=0;
		document.sell.amount.value="";
	}else{
		document.sell.amount.value=psamount;
	}

	percent=sell_t;
	result=roundNumber(psamount*percent/100, 2);

	document.sell.exchange.value=result;
}

function radio_button_checker()
{
	// Loop from zero to the one minus the number of radio button selections
	for (counter = 0; counter < document.sell.opt.length; counter++)
	{
	// If a radio button has been selected it will return true
	// (If not it will return false)
		if (document.sell.opt[counter].checked){ return document.sell.opt[counter].value; }
	}
}
function checkItems(){

	check=document.sell.starsID.value;
	check=check.replace(/(^\s*)|(\s*$)/g,''); 
	if(check==""){alert("Please enter your PokerStars ID."); document.sell.starsID.focus(); return false;}
	
	check=document.sell.email.value;
	check=check.replace(/(^\s*)|(\s*$)/g,''); 
	if(check==""){alert("Please enter your Email Address."); document.sell.email.focus(); return false;}
	
	if (document.sell.amount.value <= 0) {
		alert("Please enter an amount.");
		return false;
	}
	//exch=document.sell.exchange.value
	//exch_val=parseFloat(exch);
	//if(exch<10){
	//	alert("The exchange value must be $10 or more");
	//	return false;
	//}
	
	

	//if(document.sell.agree.checked!=true){
	//	alert("You must agree with the terms and conditions of this transaction!"); document.sell.email.focus(); return false;
	//}

}

function roundNumber(number, digits) {
	var multiple = Math.pow(10, digits);
        var rndedNum = Math.round(number * multiple) / multiple;
        return rndedNum;
}


