// generic function
function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

// set the rollover boxes to go black on rollover
function setupPromoHighlight() {		
	//defensive test
	if( document.getElementsByTagName ) {
		//get all the div tags
		promoEffect = getElementsByClass('rollover');
	
		//apply event handlers
		for ( var i=0; i<promoEffect.length; i++ ) {
			promoEffect[i].aTag    = ( promoEffect[i].getElementsByTagName( "a"    ) )? promoEffect[i].getElementsByTagName( "a"    ) : "";
	
			//check we have what we need before we move on
			if ( promoEffect[i].aTag ) {
				promoEffect[i].onclick = function() {				
					location.href = this.aTag[1].href;
				}
	
				promoEffect[i].onmouseover = function() {
					this.style.cursor = 'pointer';
					this.className = "featurePromo rollover featureOn";				
				}
	
				promoEffect[i].onmouseout = function() {
					this.className = "featurePromo rollover";
				}
			} 	
		}
	}
}