// JavaScript Document
function changeActive(elmnt)
{
	if(document.getElementById(elmnt).style.visibility=="visible")
	{
		document.getElementById(elmnt).style.visibility="hidden";
		document.getElementById(elmnt).style.display="none";
	}
	else
	{
		document.getElementById(elmnt).style.visibility="visible";
		document.getElementById(elmnt).style.display="inline";
	}
}
function buttonOver(elmnt)
{
	document.getElementById(elmnt).style.color="#ffbd3c";
	document.getElementById(elmnt).style.textDecoration="underline";
}
function buttonOut(elmnt)
{
	document.getElementById(elmnt).style.color="#d69d2d";
	document.getElementById(elmnt).style.textDecoration="none";
}
function changeImage(obj,txt)
{
  obj.src = txt;
}
//slide show functions
var index = 0;
var count = 4;
var t;
function start()
{
	update();
	t=setTimeout("change()",3500);
}
function change()
{
	fadeOut(index);
	index ++;
	if(index>=count)
	{
		index = 0;
	}
	start();
}
function setIndex(i)
{
	fadeOut(index);
	index = i;
	clearTimeout(t);
	start();
}
function fadeOut(elmnt)
{
	switch(elmnt)
	{
		case 0:	document.slide0.src = "includes/Images/Slideshow/actionButtonFade.png";
			break;
		case 1:	document.slide1.src = "includes/Images/Slideshow/customizeButtonFade.png";
			break;
		case 2: document.slide2.src = "includes/Images/Slideshow/eeButtonFade.png";
			break;
		case 3: document.slide3.src = "includes/Images/Slideshow/multiplayerButtonFade.png";
			break;
	}
}
function fadeIn(elmnt)
{
	switch(elmnt)
	{
		case 0:	document.slide0.src = "includes/Images/Slideshow/actionButton.png";
			break;
		case 1:	document.slide1.src = "includes/Images/Slideshow/customizeButton.png";
			break;
		case 2: document.slide2.src = "includes/Images/Slideshow/eeButton.png";
			break;
		case 3: document.slide3.src = "includes/Images/Slideshow/multiplayerButton.png";
			break;
	}
}
function update()
{
	switch(index)
	{
		case 0:	document.getElementById("slideshow").style.background = "url(includes/Images/Slideshow/action.gif)";
				document.getElementById("slideshow").style.backgroundPosition = "4px 6px";
				document.getElementById("slideshow").style.backgroundRepeat = "no-repeat";
			break;
		case 1:	document.getElementById("slideshow").style.background = "url(includes/Images/Slideshow/customize.gif)";
				document.getElementById("slideshow").style.backgroundPosition = "4px 6px";
				document.getElementById("slideshow").style.backgroundRepeat = "no-repeat";
			break;
		case 2: document.getElementById("slideshow").style.background = "url(includes/Images/Slideshow/enemies.gif)";
				document.getElementById("slideshow").style.backgroundPosition = "4px 6px";
				document.getElementById("slideshow").style.backgroundRepeat = "no-repeat";
			break;
		case 3: document.getElementById("slideshow").style.background = "url(includes/Images/Slideshow/multiplayer.gif)";
				document.getElementById("slideshow").style.backgroundPosition = "4px 6px";
				document.getElementById("slideshow").style.backgroundRepeat = "no-repeat";
			break;
	}
	fadeIn(index);
}
//pop up confirm
function disp_confirm_reset_account()
{
	return confirm("Are you sure you would like to reset your stats?\r\nWarning: You will not be able to retrieve your stats after confirmation.");
}
function disp_confirm_delete_user()
{
	return confirm("Are you sure you would like to delete this user?\r\nWarning: You will not be able to undo this action.");
}
function disp_confirm_delete_topic()
{
	return confirm("Are you sure you would like to delete this topic?\r\nWarning: You will not be able to undo this action.");
}
//forum scripts
function buttonClick(elmnt)
{
	window.location = elmnt;
}
function topicOver(elmnt)
{
	elmnt.style.cursor='pointer';
	elmnt.style.backgroundColor="#7c7c7c";
	elmnt.style.color="#000000";
}
function topicOut(elmnt)
{
	elmnt.style.cursor='auto';
	elmnt.style.backgroundColor="#1e1e1e";
	elmnt.style.color="#ffffff";
}