code: function in_array( needle, haystack )
  	{
  		var found = 0,
  			key;
  		for ( key in haystack )
  		{
  			if ( haystack[ key ] == needle )
  			{
  				found = 1;
  				break;
  			}
  		}
  		return found;
  	}
docs: Checks if a value exists in an array