		// string to hold option list for matches selection
		var str_matchSelection = "";

		// create a array to hold the json based on the game details
		var arr_game = [];

		arr_game[2] = {"gameDetails": [{"matches":2,"winnings":["7","14","35","70"],"odds":"1 in 13"}]};;
		arr_game[3] = {"gameDetails": [{"matches":3,"winnings":["25","50","125","250"],"odds":"1 in 48"}]};;
		arr_game[4] = {"gameDetails": [{"matches":4,"winnings":["100","200","500","1,000"],"odds":"1 in 189"}]};;
		arr_game[5] = {"gameDetails": [{"matches":4,"winnings":["5","10","25","50"],"odds":"1 in 50"},{"matches":5,"winnings":["250","500","1,250","2,500"],"odds":"1 in 781"}]};
		arr_game[6] = {"gameDetails": [{"matches":5,"winnings":["25","50","125","250"],"odds":"1 in 169"},{"matches":6,"winnings":["1,000","2,000","5,000","10,000"],"odds":"1 in 3,383"}]};
		arr_game[7] = {"gameDetails": [{"matches":5,"winnings":["5","10","25","50"],"odds":"1 in 63"},{"matches":6,"winnings":["50","100","250","500"],"odds":"1 in 619"},{"matches":7,"winnings":["5,000","10,000","25,000","50,000"],"odds":"1 in 15,464"}]};
		arr_game[8] = {"gameDetails": [{"matches":6,"winnings":["10","20","50","100"],"odds":"1 in 199"},{"matches":7,"winnings":["200","400","1,000","2,000"],"odds":"1 in 2,436"},{"matches":8,"winnings":["25,000","50,000","125,000","250,000"],"odds":"1 in 74,941"}]};
		arr_game[9] = {"gameDetails": [{"matches":6,"winnings":["5","10","25","50"],"odds":"1 in 86"},{"matches":7,"winnings":["100","200","500","1,000"],"odds":"1 in 685"},{"matches":8,"winnings":["1,000","2,000","5,000","10,000"],"odds":"1 in 10,325"},{"matches":9,"winnings":["50,000","100,000","250,000","500,000"],"odds":"1 in 387,197"}]};
		arr_game[10] = {"gameDetails": [{"matches":0,"winnings":["2","4","10","20"],"odds":"1 in 39"},{"matches":7,"winnings":["25","50","125","250"],"odds":"1 in 261"},{"matches":8,"winnings":["200","400","1,000","2,000"],"odds":"1 in 2571"},{"matches":9,"winnings":["5,000","10,000","25,000","50,000"],"odds":"1 in 47,238"},{"matches":10,"winnings":["250,000","500,000","1,250,000","2,500,000"],"odds":"1 in 2,147,181"}]};


		// function to populate the match options based on the  number of numbers being player
		var populateMatchSelection = function(){
			str_matchSelection = '<option value="">&#160;&#160;&#160;</option>';

			// loop over json array based on the number of numbers being player
			$.each( arr_game[parseInt($("#numbersPicked").val())].gameDetails, function(i, jsonNode){
				str_matchSelection += '<option value="'+ jsonNode.matches +'">'+jsonNode.matches+' Numbers</option>';
			});
			
			resetWinningsOddsSelection();	

			return str_matchSelection;
		}

		// function to populate the winnings and odds values based upon the number of matches and wager
		var populateWinningsOddsSelection = function(selectedValue){
			//loop over json array based on the number of numbers being player
			$.each( arr_game[parseInt($("#numbersPicked").val())].gameDetails, function(i, jsonNode){

				// find a match on the number of matches being played
				
				if(parseInt(jsonNode.matches) === parseInt(selectedValue))
				{
					// based on the position of the selected wager choose the item from the winnings array
					str_winnings = "$"+jsonNode.winnings[parseInt($("#wager").attr("selectedIndex")-1)];
					// populate the winnings and odds values
					if(str_winnings != '$undefined') {
						$("#winnings").val(str_winnings);
						$("#odds").val(jsonNode.odds);
					} else {
						 resetWinningsOddsSelection();
					}

					// end the loop
					return false;
				}
			});
		}

		var resetWinningsOddsSelection = function () {
			// populate the winnings and odds values
			$("#winnings").val("");
			$("#odds").val("");
		}

		// jquery dom ready functions

		$(document).ready(function(){

			// change handler for numbers selection
			$("#numbersPicked").change(function(objEvent){
				// activate the wager selection box
				$("#wager").removeAttr("disabled");

				// set the default value of the wager
				$("#wager").val("");

				// trigger the change handler
				$("#wager").triggerHandler("change");
				
				// empty the match selection options
				$("#match").empty();

				// populate the match selection box
				str_matchSelectionValues = populateMatchSelection();
				$("#match").append(str_matchSelectionValues);
				
				resetWinningsOddsSelection();
			});

			// change handler for the match selection
			$("#match").change(function(objEvent){
				// populate the winnings and odds values
				resetWinningsOddsSelection();
				populateWinningsOddsSelection($("#match").val());
			});
			
			// change handler for the wager selection
			$("#wager").change(function(objEvent){

				// activate the match selection box
				$("#match").removeAttr("disabled");

				// trigger the change handler
				$("#match").triggerHandler("change");
				
				populateWinningsOddsSelection($("#match").val());
			});

		});