function initNav(){
	$$('ul#nav li a img').each(function(obj){ registerRollOvers(obj); });
	$$('div#pnInner a img').each(function(obj){ registerRollOvers(obj); });
	$$('div#calNav a img').each(function(obj){ registerRollOvers(obj);});	
	$$('.formBtn').each(function(obj){ registerRollOvers(obj); });
	$$('div#prodFormBtns a img').each(function(obj){ registerRollOvers(obj); });	
	$$('.rover').each(function(obj){ registerRollOvers(obj); });		
	$$('.buttons input').each(function(obj){ registerRollOvers(obj); });				
	$$('.newButtons input').each(function(obj){ registerRollOvers(obj); });			
	$$('.newButtons a img').each(function(obj){ registerRollOvers(obj); });				
	$$('a#past_events_button img').each(function(obj){ registerRollOvers(obj); });				
	$$('a#current_events_button img').each(function(obj){ registerRollOvers(obj); });				
	//$$('ul#promos li a img').each(function(obj){ registerRollOvers(obj); });
}

function registerRollOvers(obj){
	obj.onmouseover=function(){ 
		obj.src = obj.src.replace("off","over");
	}
	obj.onmouseout=function(){ 
		obj.src = obj.src.replace("over","off");
	}
}

function init(){
	initNav();
	var copies = $$('.eventCopy');
	
	$$('.eventCopy').each(function(elem) {
		elem.innerHTML = linkify_plain(elem.innerHTML)	;	
	});

}
	
Event.observe(window, 'load', init, false);

function linkify_plain(text){
	if( !text ) return text;
		text = text.replace(/((https?\:\/\/|ftp\:\/\/)|(www\.))(\S+)(\w{2,4})(:[0-9]+)?(\/|\/([\w!:.?+=&%@!\-\/]))?/gi,function(url){

		nice = url;

		if( url.match('^https?:\/\/') ){
			nice = nice.replace(/^https?:\/\//i,'')
		}else{
			url = 'http://'+url;
		}
		return '<a target="_blank" rel="nofollow" href="'+ url +'">'+ url +'</a>';		
//		return '<a target="_blank" rel="nofollow" href="'+ url +'">'+ nice.replace(/^www./i,'') +'</a>';
	});
	return text;
}