function getRef(name) {

	return document.getElementById(name);
}
   
/**
  Add a css classname to the passed object - assumes that space separated classnames are readable by the browser
*/
function addCSSClass(obj, aClassName) {

	index = obj.className.indexOf(aClassName);
	if (index <= -1 ) {
		obj.className = obj.className + " " + aClassName;
	}
}

/**
  Remove a css classname from the passed object - assumes that space separated classnames are readable by the browser
*/
function removeCSSClass(obj, aClassName) {

	index = obj.className.indexOf(aClassName);
	if (index > 0 ) {
		obj.className = obj.className.substring(0,index -1 ) + obj.className.substr(index+aClassName.length);
	}
}

/**
  Opens a new window of set width and height.  If the new window has a global javascript variable of opener, then it is set to a reference of the calling window.
*/
function NewWin (url, pointer, name, aWidth, aHeight) {

    if(!name) name="_blank";
    if(!aWidth) aWidth="600";
    if(!aHeight) aHeight="400";
    pointer = open (url, name, "SCROLLBARS=YES,RESIZABLE=YES,WIDTH="+aWidth+",HEIGHT="+aHeight);
    if (pointer.opener) pointer.opener = self;
    pointer.focus ();
}

/**
  adds an inline style to the object passed.  Uses the IE method first then DOM1 getAttribute method as DOM2 is not minimum standard yet.
*/
function setInlineCssStyle(obj,styleName,value) {

	if (obj.style) {
	   eval("obj.style."+styleName+" = '"+value+"';");
	} else {
	
		var styleAttr = obj.getAttribute("style");
		if (styleAttr) {

			styleAttr = styleAttr + ";"+styleName+":"+value;
			obj.setAttribute("style",styleAttr);
		}
	}
}


function getInlineCssStyle(obj,styleName) {

	if (obj.style) {
	   return eval("obj.style."+styleName+";");
	}
}


