function javaSearchFor(searchtype){
		if(searchtype == "People"){
			//Show Search By Table
			$('tableSearchBy').style.visibility = "visible";
			$('tableSearchBy').style.display = "block";
			
			$('tableSystem').style.visibility = "hidden";
			$('tableSystem').style.display = "none";
			$('tableGame').style.visibility = "hidden";
			$('tableGame').style.display = "none";
			$('tableLocation').style.visibility = "hidden";
			$('tableLocation').style.display = "none";
		}else if(searchtype == "Games"){
			$('tableSystem').style.visibility = "visible";
			$('tableSystem').style.display = "block";
			$('tableGame').style.visibility = "visible";
			$('tableGame').style.display = "block";
			
			//Hide Search By Table
			$('tableSearchBy').style.visibility = "hidden";
			$('tableSearchBy').style.display = "none";
			$('tableSearch').style.visibility = "hidden";
			$('tableSearch').style.display = "none";
			$('tableRefine').style.visibility = "hidden";
			$('tableRefine').style.display = "none";
			$('systemspan').style.visibility = "hidden";
			$('systemspan').style.display = "none";
			$('tableLocation').style.visibility = "hidden";
			$('tableLocation').style.display = "none";
		}
	}
	
	function javaSearchBy(searchtype){
		if(searchtype == "MemberName" || searchtype == "Username" ||  searchtype == "Gamertag" ||  searchtype == "PS3" ||  searchtype == "PS2"){
			if(searchtype == "PS3"){
				$('searchspan').update("Enter a PS3 Network ID:");
			}else if(searchtype == "PS2"){
				$('searchspan').update("Enter a PS2 Network ID:");
			}else if(searchtype == "MemberName"){
				$('searchspan').update("Enter a Name:");
			}else if(searchtype == "Username"){
				$('searchspan').update("Enter a Username:");
			}else if(searchtype == "Gamertag"){
				$('searchspan').update("Enter a Gamertag:");
			}
			
			$('tableSearch').style.visibility = "visible";
			$('tableSearch').style.display = "block";
						
			//Hide Systems
			$('tableSystem').style.visibility = "hidden";
			$('tableSystem').style.display = "none";
			$('tableGame').style.visibility = "hidden";
			$('tableGame').style.display = "none";
			$('tableRefine').style.visibility = "hidden";
			$('tableRefine').style.display = "none";
			$('tableLocation').style.visibility = "hidden";
			$('tableLocation').style.display = "none";
		}else if(searchtype == "Console"){
			$('tableSystem').style.visibility = "visible";
			$('tableSystem').style.display = "block";
			$('systemspan').style.visibility = "visible";
			$('systemspan').style.display = "inline";
			
			//Hide Searchbox
			$('tableSearch').style.visibility = "hidden";
			$('tableSearch').style.display = "none";
			$('tableGame').style.visibility = "hidden";
			$('tableGame').style.display = "none";
			$('tableLocation').style.visibility = "hidden";
			$('tableLocation').style.display = "none";
			$('tableRefine').style.visibility = "hidden";
			$('tableRefine').style.display = "none";
		}else if(searchtype == "Game"){
			$('tableSystem').style.visibility = "visible";
			$('tableSystem').style.display = "block";
			$('tableGame').style.visibility = "visible";
			$('tableGame').style.display = "block";
			
			//Hide Searchbox
			$('tableSearch').style.visibility = "hidden";
			$('tableSearch').style.display = "none";
			$('systemspan').style.visibility = "hidden";
			$('systemspan').style.display = "none";
			$('tableLocation').style.visibility = "hidden";
			$('tableLocation').style.display = "none";
			$('tableRefine').style.visibility = "hidden";
			$('tableRefine').style.display = "none";
		}else if(searchtype == "Location"){
			$('tableLocation').style.visibility = "visible";
			$('tableLocation').style.display = "block";
		
			//Hide Searchbox
			$('tableSystem').style.visibility = "hidden";
			$('tableSystem').style.display = "none";
			$('tableGame').style.visibility = "hidden";
			$('tableGame').style.display = "none";
			$('tableRefine').style.visibility = "hidden";
			$('tableRefine').style.display = "none";
			$('tableSearch').style.visibility = "hidden";
			$('tableSearch').style.display = "none";
			$('systemspan').style.visibility = "hidden";
			$('systemspan').style.display = "none";
		}
	}
	
	function javaSearch4Update(){
		var index = $('systems').selectedIndex; 
		var systemID = $('systems')[index].value;
		var systemName = $('systems')[index].text;
		
		$('search4text').update(systemName + " Owners");
	}
	
	function addGame(gid, sid, mid){
		var requestPage = '/ajax/addgame.aspx';
		var method = 'post';
		var params = 'gid=' + gid + '&sid=' + sid + '&mid=' + mid;
		
		new Ajax.Request(
			requestPage,
			{
				method: method,
				postBody: params,
				onSuccess: function(response){
					$('add_' + gid).update('<span class="block"><input type="checkbox" class="checkbox" name="chkgames" id="chkgames" CHECKED DISABLED/>&nbsp;Game Owned</span>');					
				}
			}
		);	
	}
	
	function addFav(gid, sid, mid){
		var requestPage = '/ajax/addfavorite.aspx';
		var method = 'post';
		var params = 'gid=' + gid + '&sid=' + sid + '&mid=' + mid;
		
		new Ajax.Request(
			requestPage,
			{
				method: method,
				postBody: params,
				onSuccess: function(response){
					$('fav_' + gid).update('<span class="block"><input type="checkbox" class="checkbox" name="chkfav" id="chkfav" CHECKED DISABLED/>&nbsp;A Favorite Game</span>');					
				}
			}
		);	
	}
	
	function addPlaying(gid, sid, mid){
		var requestPage = '/ajax/addcurrent.aspx';
		var method = 'post';
		var params = 'gid=' + gid + '&sid=' + sid + '&mid=' + mid;
		
		new Ajax.Request(
			requestPage,
			{
				method: method,
				postBody: params,
				onSuccess: function(response){
					$('cur_' + gid).update('<span class="block"><input type="checkbox" class="checkbox" name="chkplaying" id="chkplaying" CHECKED DISABLED/>&nbsp;Currently Playing</span>');					
				}
			}
		);	
	}
	
	function sendInvite(myID, mid){
		var requestPage = '/ajax/friendrequest.aspx';
		var method = 'post';
		var params = 'myID=' + myID + '&mid=' + mid;
		
		new Ajax.Request(
			requestPage,
			{
				method: method,
				postBody: params,
				onSuccess: function(response){
					$('friend_' + mid).update('<span class="block lightGray70"><img src="/images/whiteInviteSent.png" class="icon" alt="Invite Sent Icon" />Friend Invite Sent</span>');					
				}
			}
		);	
	}
	
	function refineSearch(){
		var index = $('blah').selectedIndex; 
		var droptext = $('blah')[index].text;

		if(droptext == "Country"){
			$('tableCountry').style.visibility = "visible";
			$('tableCountry').style.display = "inline";
			
			$('tableCityState').style.visibility = "hidden";
			$('tableCityState').style.display = "none";
			$('tableZip').style.visibility = "hidden";
			$('tableZip').style.display = "none";
			$('tableGender').style.visibility = "hidden";
			$('tableGender').style.display = "none";
		}else if(droptext == "City and State"){
			$('tableCityState').style.visibility = "visible";
			$('tableCityState').style.display = "inline";
		
			$('tableCountry').style.visibility = "hidden";
			$('tableCountry').style.display = "none";
			$('tableZip').style.visibility = "hidden";
			$('tableZip').style.display = "none";
			$('tableGender').style.visibility = "hidden";
			$('tableGender').style.display = "none";
		}else if(droptext == "Zip"){
			$('tableZip').style.visibility = "visible";
			$('tableZip').style.display = "inline";
			
			$('tableCityState').style.visibility = "hidden";
			$('tableCityState').style.display = "none";
			$('tableCountry').style.visibility = "hidden";
			$('tableCountry').style.display = "none";
			$('tableGender').style.visibility = "hidden";
			$('tableGender').style.display = "none";
		}else if(droptext == "Gender"){
			$('tableGender').style.visibility = "visible";
			$('tableGender').style.display = "inline";
			
			$('tableCountry').style.visibility = "hidden";
			$('tableCountry').style.display = "none";
			$('tableCityState').style.visibility = "hidden";
			$('tableCityState').style.display = "none";
			$('tableZip').style.visibility = "hidden";
			$('tableZip').style.display = "none";
		}
	}
	
	function moreGames(start, sid, mid){
		var requestPage = '/ajax/viewCollection.aspx';
		var method = 'post';
		var params = 'mid=' + mid + '&sid=' + sid + '&start=' + start;
		
		new Ajax.Request(
			requestPage,
			{
				method: method,
				postBody: params,
				onLoading: $('loadCollection').update("<img src='/images/loadingText.gif'/>"),
				onSuccess: function(response){
					response = response.responseText.split('|');
					
					if(response[0] == 'Success'){
						$('results').update(response[1]);
					}			
				}
			}
		);	
	}