/****************************************************************
 *                                                              *
 * This library has been deprecated. The prototype companion    *
 * library (proto-companion.js) should be used instead.         *
 *                                                              *
 ****************************************************************/

var strings = {

/*
 * Returns the value of the supplied key in the supplied string. Handy to use when
 * looking for a parameter value in a URL. This function returns false if the key
 * could not be found.
 *
 * str	The string to parse (i.e. window.location.href)
 * key	The target string to look for
 */
getParam: function(str, key) {
	return strings.getValue(str, key + "=", "&");
},

/*
 * Returns a portion of the str that is sandwiched between the before and after
 * substrings. This function returns false if the key could not be found.
 *
 * str		The string to parse
 * before	The substring delimiting the left-hand side of the target string
 * after	The substring delimiting the right-hand side of the target string
 */
getValue: function(str, before, after) {
	var value = false;
	var start = str.indexOf(before);
	var end;
	if (start > -1) {
		start = start + before.length;
		end = str.indexOf(after, start) > -1 ? str.indexOf(after, start) : str.length;
		value = str.substring(start, end);
	}
	return value;
}

}
