var J = jQuery.noConflict();

function result()
{
	J("#result p").remove();
	J("#result").hide();
	var stake = J('input:text:').val();

	if( stake == 0)
	{
		J("#stake").css({'border' : 'red 2px solid'});
                J("#result").append("<p class=\"red\"><strong> Please enter a value</strong></p>");	
		J("#result").show("slow");
                
	}
	else if( J('input:radio:checked').val() == "Buy")
	{		
		J("#result").append("<p style=\"margin-top: 15px; \"><strong><span class=\"red\">Congratulations. You have won ZAR" + stake * 10 + 
								  "</strong></span><br />For the purpose of this example the Dow Jones <strong>rose to 10785</strong></p>");	

                 J("#result").append("<p style=\"margin-top: 15px; \"><strong>Calculation:</strong><br />Your stake was <strong>ZAR" + stake + "</strong><br />Difference between price and result = 10785 - 10775 = 10<br />Profit =" + stake + " x 10 = <strong>ZAR" + stake * 10 + "</strong><br /></p>");
                J("#stake").css({'border' : '1px solid #B3B9BF'});
		J("#result").show("slow");
	}
	else if( J('input:radio:checked').val() == "Sell")
	{
		J("#result").append("<p style=\"margin-top: 15px; \"><strong><span class=\"red\" >Unfortunately. You have lost ZAR" + stake * 20 + 
								  "</span></strong><br />For the purpose of this example the Dow Jones <strong>rose to 10785</strong></p>");	
		J("#result").append("<p style=\"margin-top: 15px; \"><strong>Calculation:</strong><br />Your stake was <strong>ZAR" + stake + "</strong><br />Difference between price and result = 10785 - 10765 = 20<br />Loss =" + stake + " x 20 = <strong>ZAR" + stake * 20 + "</strong><br /></p>");
                J("#stake").css({'border' : '1px solid #B3B9BF'});
		J("#result").show("slow");
	}
	return false;
}
