Styling = Class.create({
	
	TOTAL_ROLLOVERS : 1,
	
	// these imgs are replaced with red img on rollover
	setImgLinks:function()
	{
		var ar = $$('img.rollover');
		
		for(var i=0; i<ar.length; i++)
		{
			ar[i].observe('mouseover',this.onImgMouseover.bindAsEventListener(this));
			ar[i].observe('mouseout',this.onImgMouseout.bindAsEventListener(this,ar[i].src));
			ar[i].observe('click',this.onImgClick.bindAsEventListener(this));
		}
	},
	
	onImgMouseover:function(event)
	{
		//var n = Math.ceil(Math.random()*this.TOTAL_ROLLOVERS);
		//event.target.src = "gfx/ro-"+n+".gif";
		event.target.src = "gfx/ro-1.gif";
	},
	
	onImgMouseout:function(event,src)
	{
		event.target.src = src;
	},
	
	onImgClick:function(event)
	{
		window.location.href = HOST + event.target.alt;
	},
	
	// Split long words (16+) so that they break at end of line
	splitLongWords:function(str)
	{
		var ar = $$('.longword');
		
		for(var i=0; i<ar.length; i++){
			ar[i].innerHTML = ar[i].innerHTML.replace(/([^\s<>]{16,})/g, this.splitString); //
		}
	},
	
	splitString : function(str, p1)
	{
		// check if str contains = (likely a node attribute)
		if(p1.indexOf("=")>-1) return p1;
		else return p1.split("").join("<span> </span>");
		
		// .. chunk str by 15, join w "<br>"
		/*var ar = p1.split(""), chunks = [];
		while(ar.length) chunks.push(ar.splice(0,15).join(""));
		return chunks.join("<br/>");*/
	}
	
});