function checkAndSubmit(){
	if(document.getElementById('tradeFormCompetition').value != -1){
		submit;
	}else{
		alert('Please select a competition!');
		return false;
	}
}

function addRowToTable(tableName)
{
  var el;
  var attr;
	var tbl = document.getElementById(tableName);
	var lastRow = tbl.rows.length;
	// if there's no header row in the table, then iteration = lastRow + 1
	var iteration = lastRow - 2;
	var row = tbl.insertRow(lastRow);

	// *****************************************************
	var cell_action = row.insertCell(0);
	cell_action.innerHTML = "<select class='select' name='action'><option value='Buy'>Buy</option><option value='Short'>Short</option><option value='Sell'>Sell</option><option value='Cover'>Cover</option></select>";

	// *****************************************************
	var cell_orderType = row.insertCell(1);
	cell_orderType.innerHTML = "<select class='select' name='orderType'><option value='Market'>Market</option><option value='Limit'>Limit</option><option value='Stop'>Stop</option><option value='OCO'>OCO</option></select>"

	// *****************************************************
	var cell_symbol = row.insertCell(2);
	cell_symbol.innerHTML = "<input name='symbol' size='3' type='text' class='input' />";

	// *****************************************************
	var cell_quantity = row.insertCell(3);
	cell_quantity.innerHTML = "<input name='quantity' size='10' type='text' class='input' />";

	// *****************************************************
	var cell_limitPrice = row.insertCell(4);
	cell_limitPrice.innerHTML = "<input name='limitPrice' size='10' type='text' class='input' />";

	// *****************************************************
	var cell_stopPrice = row.insertCell(5);
	cell_stopPrice.innerHTML = "<input name='stopPrice' size='10' type='text' class='input' />";

	// *****************************************************
	var cell_duration = row.insertCell(6);
	cell_duration.innerHTML = "<select class='select' name='duration'><option value='GFD'>Good For Day</option><option value='GTC'>Good Till Cancelled</option></select>";

	// *****************************************************
	var cell_aon = row.insertCell(7);
	cell_aon.innerHTML = "<input value='"+ iteration + "' name='aon' type='checkbox' />";

}
