//***Adds a new class to an object, preserving existing classes
function AddClass(obj,className){ 
    KillClass(obj,className); 
    return obj && (obj.className+=(obj.className.length>0?' ':'')+className); 
}

//***Removes a particular class from an object, preserving other existing classes.
function KillClass(obj,className){ 
    return obj && (obj.className=obj.className.replace(new RegExp("^"+className+"\\b\\s*|\\s*\\b"+className+"\\b",'g'),'')); 
}

//***Returns true if the object has the class assigned, false otherwise.
function HasClass(obj,cName){ 
    return (!obj || !obj.className)?false:(new RegExp("\\b"+cName+"\\b")).test(obj.className) 
}

function toggle(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != 'none' ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = '';
	}
	
}

function updateBehaviour() {
    Behaviour.apply();
}

