Question: In the Maven Standard Directory Layout where do I put Rules Engine files? Specifically, I'm using JBoss Rules (Drools), if that matters.

Answer: 
hasClass function:

```js
HTMLElement.prototype.hasClass = function(cls) {
    var i;
    var classes = this.className.split(" ");
    for(i = 0; i < classes.length; i++) {
        if(classes[i] == cls) {
            return true;
        }
    }
    return false;
};

```

addClass function:

```js
HTMLElement.prototype.addClass = function(add) {
    if (!this.hasClass(add)){
        this.className = (this.className + " " + add).trim();
    }
};

```

removeClass function:

```js
HTMLElement.prototype.removeClass = function(remove) {
    var newClassName = "";
    var i;
    var classes = this.className.replace(/\s{2,}/g, ' ').split(" ");
    for(i = 0; i < classes.length; i++) {
        if(classes[i] !== remove) {
            newClassName += classes[i] + " ";
        }
    }
    this.className = newClassName.trim();
};

```
Use something like:

```
Array.prototype.indexOf.call(myHTMLSelector.classList, 'the-class');

```