	function lookupxbox(gamesearch) {
		if(gamesearch.length == 0) {
			// Hide the suggestion box.
			$('#suggestions').hide();
		} else {
			$.post("rpcx.php", {queryString: ""+gamesearch+"", queryFormat: "Xbox 360"}, function(data){
				if(data.length >0) {
					$('#suggestions').show();
					$('#autoSuggestionsList').html(data);
				}
			});
		}
	} // lookup
	
	function fill(thisValue) {
		$('#gamesearch').val(thisValue);
		setTimeout("$('#suggestions').hide();", 200);
	}
	function lookupps3(gamesearch) {
		if(gamesearch.length == 0) {
			// Hide the suggestion box.
			$('#suggestions').hide();
		} else {
			$.post("rpc3.php", {queryString: ""+gamesearch+"", queryFormat: "Playstation 3"}, function(data){
				if(data.length >0) {
					$('#suggestions').show();
					$('#autoSuggestionsList').html(data);
				}
			});
		}
	} // lookup
	
	function fill(thisValue) {
		$('#gamesearch').val(thisValue);
		setTimeout("$('#suggestions').hide();", 200);
	}
	function lookupwii(gamesearch) {
		if(gamesearch.length == 0) {
			// Hide the suggestion box.
			$('#suggestions').hide();
		} else {
			$.post("rpcwii.php", {queryString: ""+gamesearch+"", queryFormat: "wii"}, function(data){
				if(data.length >0) {
					$('#suggestions').show();
					$('#autoSuggestionsList').html(data);
				}
			});
		}
	} // lookup
	
	function fill(thisValue) {
		$('#gamesearch').val(thisValue);
		setTimeout("$('#suggestions').hide();", 200);
	}
	function lookupnds(gamesearch) {
		if(gamesearch.length == 0) {
			// Hide the suggestion box.
			$('#suggestions').hide();
		} else {
			$.post("rpcnds.php", {queryString: ""+gamesearch+"", queryFormat: "nds"}, function(data){
				if(data.length >0) {
					$('#suggestions').show();
					$('#autoSuggestionsList').html(data);
				}
			});
		}
	} // lookup
	
	function fill(thisValue) {
		$('#gamesearch').val(thisValue);
		setTimeout("$('#suggestions').hide();", 200);
	}
	function lookup3ds(gamesearch) {
		if(gamesearch.length == 0) {
			// Hide the suggestion box.
			$('#suggestions').hide();
		} else {
			$.post("rpc3ds.php", {queryString: ""+gamesearch+"", queryFormat: "3ds"}, function(data){
				if(data.length >0) {
					$('#suggestions').show();
					$('#autoSuggestionsList').html(data);
				}
			});
		}
	} // lookup
	
	function fill(thisValue) {
		$('#gamesearch').val(thisValue);
		setTimeout("$('#suggestions').hide();", 200);
	}
	function lookuppc(gamesearch) {
		if(gamesearch.length == 0) {
			// Hide the suggestion box.
			$('#suggestions').hide();
		} else {
			$.post("rpcpc.php", {queryString: ""+gamesearch+"", queryFormat: "pc"}, function(data){
				if(data.length >0) {
					$('#suggestions').show();
					$('#autoSuggestionsList').html(data);
				}
			});
		}
	} // lookup
	
	function fill(thisValue) {
		$('#gamesearch').val(thisValue);
		setTimeout("$('#suggestions').hide();", 200);
	}
$(document).ready(function() {
    $('#xboxsearchstring').hide();
    $('#ps3searchstring').hide();
    $('#wiisearchstring').hide();
    $('#ndssearchstring').hide();
    $('#n3dsearchstring').hide();
    $('#pcsearchstring').hide();
    $('#searchstring').show();

    $('#cat').change(function() {
        if ($('#cat option:selected').text() == "Xbox 360") {
            $('#xboxsearchstring').show();
            $('#ps3searchstring').hide();
            $('#wiisearchstring').hide();
            $('#ndssearchstring').hide();
            $('#n3dsearchstring').hide();
            $('#pcsearchstring').hide();
            $('#searchstring').hide();
        }
        else if ($('#cat option:selected').text() == "Playstation 3") {
            $('#ps3searchstring').show();
            $('#xboxsearchstring').hide();
            $('#wiisearchstring').hide();
            $('#ndssearchstring').hide();
            $('#n3dsearchstring').hide();
            $('#pcsearchstring').hide();
            $('#searchstring').hide();
        }
        else if ($('#cat option:selected').text() == "Nintendo WII") {
            $('#ps3searchstring').hide();
            $('#xboxsearchstring').hide();
            $('#wiisearchstring').show();
            $('#ndssearchstring').hide();
            $('#n3dsearchstring').hide();
            $('#pcsearchstring').hide();
            $('#searchstring').hide();
        }
        else if ($('#cat option:selected').text() == "Nintendo DS") {
            $('#ps3searchstring').hide();
            $('#xboxsearchstring').hide();
            $('#wiisearchstring').hide();
            $('#ndssearchstring').show();
            $('#n3dsearchstring').hide();
            $('#pcsearchstring').hide();
            $('#searchstring').hide();
        }
        else if ($('#cat option:selected').text() == "Nintendo 3ds") {
            $('#ps3searchstring').hide();
            $('#xboxsearchstring').hide();
            $('#wiisearchstring').hide();
            $('#ndssearchstring').hide();
            $('#n3dsearchstring').show();
            $('#pcsearchstring').hide();
            $('#searchstring').hide();
        }
        else if ($('#cat option:selected').text() == "PC") {
            $('#ps3searchstring').hide();
            $('#xboxsearchstring').hide();
            $('#wiisearchstring').hide();
            $('#ndssearchstring').hide();
            $('#n3dsearchstring').hide();
            $('#pcsearchstring').show();
            $('#searchstring').hide();
        }
    });
});
