var ie6=false;
function loadStates(element){
	element.onmouseover=function(){
		height=this.offsetHeight;
		this.style.backgroundPosition='0px -'+height+'px';
	}
	element.onmouseout=function(){
		this.style.backgroundPosition='0px 0px';
	}
}

function activateRollover(){
	var li=document.getElementsByTagName('li');
	var div=document.getElementsByTagName('div');
	var a=document.getElementsByTagName('a');
	for(i=0;i<li.length;i++){
		if(li[i].className=='roll')
			loadStates(li[i]);
	}
	for(i=0;i<div.length;i++){
		if(div[i].className=='roll')
			loadStates(div[i]);
	}
	for(i=0;i<a.length;i++){
		if(a[i].className=='roll')
			loadStates(a[i]);
	}
}

function addEvent(elm, evType, fn, useCapture){  //cross-browser event handling
	if(elm.addEventListener){//firefox, safari, chrome, opera
		elm.addEventListener(evType, fn, useCapture);
		return true;
	}else if(elm.attachEvent){//ie
		var r = elm.attachEvent('on' + evType, fn);
		return r;
	}else{
		elm['on' + evType] = fn;
	}
}
addEvent(window, 'load', activateRollover, false);