// Scott Andrew's event attacher
function addEvent(obj, evType, fn){
	if (obj.addEventListener){
		obj.addEventListener(evType, fn, true);
		return true;
	} else if (obj.attachEvent){
		var r = obj.attachEvent("on"+evType, fn);
		return r;
	} else {
		return false;
	}
}

function switchIt(type)
{
   	var e = document.getElementById(type);
   	var img = document.getElementById(type + "Arrows");
		
	if (e.style.display != "none")
	{
		e.style.display = "none";
		img.src = "images/arrows.gif";
		if (type == "submitRating") img.alt = "click to show rating menu"; else img.alt = "click to show comment menu";
	}
	else
	{
		if (document.all) e.style.display = "block"; else e.style.display = "table";
		img.src = "images/arrowsup.gif";
		if (type == "submitRating") img.alt = "click to hide rating menu"; else img.alt = "click to hide comment menu";
	}
}

function preloadImage(path)
{
	image = new Image();
	image.src = path;
}

function preloadImages()
{
	preloadImage("images/arrowsup.gif");
	preloadImage("images/issue_previous_anim.gif");
	preloadImage("images/issue_next_anim.gif");	
	preloadImage("images/enlarge_anim.gif");
}

function initialize()
{	
	// frame burster  (www.fczbkk.sk)
	if (top != self) {top.location = self.location;}

	preloadImages();
	switchIt('submitRating');
	switchIt('submitComment');
}

addEvent(window, "load", initialize);
