/**
 * SUPPORT FOR THE ELEMENT ID NAMING SCHEME
 */
 
var Names = { 
	/**
	 * Deprecated by prototype.js 1.5.x support
	 */
	endsWith: function(str, s){
		var regex = new RegExp(s + "$");
		return regex.test(str);
	},
	
	/**
	 * Strip the scope prefix from an element id attribute
	 */
	stripScopePrefix: function(id, prefix) {
		return id.slice(prefix.length, id.length);
	},

	/**
	 * Remove scope prefix from an element id attribute in order to identify an
	 * entity instance
	 */
	removeInstanceScopePrefix: function(id) {
		var parts = id.split(Service.SCOPE_SEPARATOR);
		return parts[parts.length - 1];
	},
	
	
	/**
	 * Remove scope prefix from an element id attribute in order to identify an
	 * entity instance
	 */
	getInstanceID: function(elementID) {
		var parts = elementID.split(Service.SCOPE_SEPARATOR);
		return parts[parts.length - 1];
	},
	
	/**
	 * Remove the scope prefix from an element id attribute in order to identify an
	 * entity instance
	 */
	removeIDScopePrefix: function(id) {
		var parts = id.split(Service.SCOPE_SEPARATOR);
		return parts[parts.length - 1];
	}
}



