
var els = new Array();//This is an array of elements which we will use to control with the various functions herein

function getElementsByClass(cl) {//returns an array of elements that are of the same class

	var c = new Array();//define a new array which will hold the elements that fit the class specified
	
	var e = document.getElementsByTagName('*');//Here we gather all of the specified elements to search thru
	
	var pat = new RegExp("(^|\\\\s)"+cl+"(\\\\s|$)");
	
	for(i = 0, n = 0; i < e.length; i++) {//check every element in variable e
	
		if(e[i].className != null) {//if current elements className property is not null we'll continue... this may prove to be unneccessary

			if(pat.test(e[i].className)) {//test the current element against the regexp to see if it has the class we are looking for
			
				c[n] = e[i];//if it does we add it to our array and move to the next slot.
				
				n++;
			}
		}
	}
	els = c;
	return c;
}

function style(prop,val) {
	if (els == null) {
		err('missing elements');
		return false;
	}
	for(i in els) {
		els[i].style[prop] = val;
	}
}