function lastIndexOf( str, search ) {
	var sub;
	var len;
	var N;
	var i;
	var j;

	len = str.length;
	N = search.length;
	if ( N > len ) {
		return -1;
	}
	for ( j = str.length; j >= N; j-- ) {
		i = j - N;
		sub = str.substring( i, j );
		if ( sub === search ) {
			return i;
		}
	}
	return -1;
}
Returns the last index of a substring matching a specified string.

@private
@param {string} str - string to search
@param {string} search - string to match
@returns {integer} index