var VISICORE_loaded=true;


function event_remove(aObj,aEvType,aFunction,aCap)
{
	if (aObj.removeEventListener) 
	{ aObj.removeEventListener(aEvType, aFunction, aCap); } 
    else 
    { aObj.detachEvent('on'+ aEvType, aFunction); }
}

function event_add(aObj,aEvType,aFunction,aCap)
{
	if (aObj.addEventListener) 
	{ aObj.addEventListener(aEvType, aFunction, aCap); } 
    else 
    { aObj.attachEvent('on'+ aEvType, aFunction); }
}
function class_remove(EID,CLS)
{
	var el = getEl(EID);
	if ( el && el.className )
	{ 
		var re = new RegExp("\\b"+CLS+"\\b\\s*",'g');
		el.className = el.className.replace(re,'');
	}
}

function class_add(EID,CLS)
{
	var el = getEl(EID)
	if ( el )
	{
		if (!el.className) 
		{ el.className = CLS; }
		else if (!class_have(el,CLS)) 
		{ el.className +=' '+CLS;}
	}
}

function class_have (EID,CLS)
{
	var el = getEl(EID);
	if ( el && el.className )
	{ 
		var re = new RegExp('\\b'+CLS+'\\b','');
		return el.className.search(re)>=0;
	}
	return false;
}

function getEl(aEl)
{
	if (typeof(aEl) == 'string')
	{
		var R = document.getElementById(aEl);
		return R;
	}
	return aEl;	
}

