/* General Spartasoft Functions */

var openSubMenu = "none";
var imgpath;
var timeoutId;

var winIE = false;
var macIE = false;
var NS6   = false;
var NS7   = false;

function browserCheck()
{
	agent = navigator.userAgent;

	if((agent.search("MSIE 6.0") != -1 || agent.search("MSIE 5.5") != -1 ) && agent.search("Windows") != -1 && agent.search("Opera") == -1) winIE=true;
	else if(agent.search("MSIE 5") != -1 && agent.search("Mac_PowerPC") != -1 && agent.search("Opera") == -1) macIE=true;
	else if(agent.search("Netscape6") != -1) NS6=true;
	else if(agent.search("Netscape/7.0") != -1) NS7=true;
}

function browserAlert()
{
	if(!winIE && !macIE && !NS6 && !NS7)
	{
		//alert("Sorry, you are not using a web browser that has been tested compatible with this web site.  You are welcome to stay, but don't be surprised if some things look or act funny.  The Spartasoft home page is designed to run on Windows IE 5.5+, Mac IE 5+, and Netscape 6 or 7 on both mac and pc.");
	}
}

function roll(targetPic,newPic){
	for(i=0;i<document.images.length; i++)
		if(document.images[i].name == targetPic){
			document.images[i].src=newPic;
			return;
		}
}

function showSubMenu(targetSubMenu,path)
{
	imgpath=path;
	hideSubMenu();
	pictureToRoll = targetSubMenu + "pic";
	newPicturePath = imgpath + targetSubMenu + "down.gif";
	subMenuID = targetSubMenu + "subnav";

	roll(pictureToRoll,newPicturePath);
	subMenu = document.getElementById(subMenuID);
	subMenu.style.visibility="visible";
	openSubMenu = targetSubMenu;
}

function hideSubMenu()
{
	if(openSubMenu != "none")
	{
		pictureToRoll = openSubMenu + "pic";
		newPicturePath = imgpath + openSubMenu + "up.gif";
		subMenuID = openSubMenu + "subnav";
	
		roll(pictureToRoll,newPicturePath);
		subMenu = document.getElementById(subMenuID);
		subMenu.style.visibility="hidden";
		openSubMenu = "none";
	}
}

function setCounter(){timeoutId = setTimeout("hideSubMenu()",500);}
function clearCounter(){clearTimeout(timeoutId);}

function placeImageBarPic(pic)
{
	document.getElementById("imagebarpicdiv").style.left=document.body.offsetWidth;
	//document.getElementById("imagebarpicdiv").style.left=0;
	document.getElementById("imagebarpicdiv").style.visibility="visible";
	if(winIE)
		document.getElementById("imagebarpic").style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + pic + "', sizingMethod='scale')";
	else
		roll("imagebarpic", pic);

	//moveImageBarPic();
	document.getElementById("imagebarpicdiv").style.left=document.body.offsetWidth-300;

}

function moveImageBarPic()  //not turned on
{
	pic=document.getElementById("imagebarpicdiv");
	left=parseInt(pic.style.left);
	pic.style.left=left-10;
	
	if(left > document.body.offsetWidth-300)
	  setTimeout("moveImageBarPic()",20);
}