function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}

function prepareThumbs() {
/*var myTooltips = new Tips($$('.winnerThumb'), {
	offsets: {'x': +10, 'y': +10},
	maxTitleChars: 100,
	fixed: false,
 
	initialize:function(){
		this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 200, wait: false}).set(0);
	},
	onShow: function(toolTip) {
		this.fx.start(1);
	},
	onHide: function(toolTip) {
		this.fx.start(0);
	}
});*/
}

function prepareMore() {
  if (!document.getElementsByTagName) return false;
  if (!document.getElementById) return false;
  if (!document.getElementById("more")) return false;
  var more = document.getElementById("more");
  var links = more.getElementsByTagName("a");
  for (var i=0; i<links.length; i++) {
  links[i].onclick = function() {
      toggleCredits();
    	links[i].onkeypress = links[i].onclick;
		return false;
		
  	}
  }
}

function setCreditsOpacity() {
if (!document.getElementById("credits")) return false;
$('credits').setStyle('opacity', 0);
}

function toggleCredits() {
	if (!document.getElementsByTagName) return false;
  	if (!document.getElementById) return false;
  	if (!document.getElementById("more")) return false;
  	var more = document.getElementById("more");
  	var links = more.getElementsByTagName("a");
	var newText = null;
	var oldText = links[0].firstChild.data;
	oldText == "show credits" ? newText = "hide credits" : newText = "show credits";
	links[0].firstChild.data = newText;
	var myFx = new Fx.Style('credits', 'opacity');
	var opacity = $('credits').getStyle('opacity');
	if (opacity>0) { myFx.start(0.95,0); } else { myFx.start(0,0.95);}	
	return false;
}

//addLoadEvent(prepareThumbs);
//addLoadEvent(prepareMore);
//addLoadEvent(setCreditsOpacity);