function StartMenu()
	{
	if(document.getElementById("StartMenu") != null)
		{
		var StartMenu = document.getElementById("StartMenu");
		var Count = StartMenu.childNodes.length;
		s = 0;

		for(i = 0; i < StartMenu.childNodes.length; i++)
			{
			if(StartMenu.childNodes[i].tagName == "LI")
				{
				if(s == 0)
					{
					StartMenu.childNodes[i].className = "FirstTab";
					}
				if(s == 5)
					{
					StartMenu.childNodes[i].className = "LastTab";
					}
				s++;
				
				StartMenu.childNodes[i].onmouseover = function()
					{
					this.className += "Open";
					}
				StartMenu.childNodes[i].onmouseout = function()
					{
					this.className = this.className.replace("Open","");
					}
				}			
			}
		}
	}

function SideBar()
	{
	if(document.getElementById("SideBar") != null)
		{
		var SideBar = document.getElementById("SideBar");
		var browser = navigator.appName;
		
		for (i = 0; i < SideBar.childNodes.length; i++)
			{
			if(SideBar.childNodes[i].tagName == "LI")
				{
				SideBar.childNodes[i].onmouseover = function()
					{
					this.className += "Open";
					}
				SideBar.childNodes[i].onmouseout = function()
					{
					this.className = this.className.replace("Open", "");
					}
			
				for(p = 0; p < SideBar.childNodes[i].childNodes.length; p++)
					{
					if(SideBar.childNodes[i].childNodes[p].tagName == "UL")
						{
						SideBar.childNodes[i].className = "subs";
						}
	
					for(q = 0; q < SideBar.childNodes[i].childNodes[p].childNodes.length; q++)
						{
						if(SideBar.childNodes[i].childNodes[p].childNodes[q].tagName == "LI")
							{
							SideBar.childNodes[i].childNodes[p].childNodes[q].onmouseover = function()
								{
								this.className = "Open";
								}
							SideBar.childNodes[i].childNodes[p].childNodes[q].onmouseout = function()
								{
								this.className = "Closed";
								}
							}
						}
					}
				}
			}
		}
	}

function FAQS()
	{
	if(document.getElementById("faqs") != null)
		{
		var faqs = document.getElementById("faqs");
		var Count = faqs.childNodes.length;
		s = 0;

		for(i = 0; i < faqs.childNodes.length; i++)
			{
			if(faqs.childNodes[i].tagName == "DT")
				{
				faqs.childNodes[i].onclick = function()
					{
					for(p = 0; p < faqs.childNodes.length; p++)
						{
						if(faqs.childNodes[p].tagName == "DT")
							{
							faqs.childNodes[p].className = "";
							}

						if(faqs.childNodes[p].tagName == "DD")
							{
							faqs.childNodes[p].style.display = "none";
							}
						}

					this.className = "Open";
					document.getElementById("definition-"+ this.id).style.display = "block";
					}
				}			
			}
		}
	}

function Pop(File, ID)
	{
	window.open("/popup/"+ File +".asp?ID="+ ID +"","lib",'resizable=no,scrollbars=yes,toolbar=no,fullscreen=no,width=900,height=600');
	}


function ScreenPlay()
	{
	var goLeft = document.getElementById("goLeft");
	var goRight = document.getElementById("goRight");
	var ScreenPlay = document.getElementById("ScreenPlay");
	
	goRight.onclick = function()
		{
		var obj = document.getElementById("ScreenPlay");
		var currentPos = parseFloat(obj.style.left);
		if (!currentPos)
			{
			var currentPos = 0;
			}

		if(currentPos + parseFloat(obj.offsetWidth) != 750 && parseFloat(obj.offsetWidth) > 750)
			{
			Play(currentPos - 250, "Right", 5);
			}
		}

	goLeft.onclick = function()
		{
		var obj = document.getElementById("ScreenPlay");
		var currentPos = parseFloat(obj.style.left);
		if (!currentPos)
			{
			var currentPos = 0;
			}

		if(currentPos != 0)
			{
			Play(currentPos + 250, "Left", 5);
			}
		}
	}

function Play(Limit, Direction, speed)
	{
	var obj = document.getElementById("ScreenPlay");
	var currentPos = parseFloat(obj.style.left);
	if (!currentPos)
		{
		var currentPos = 0;
		}
	var amountToMove = speed + 5;
	
	//alert(Limit + currentPos);
	
	if(Limit != currentPos)
		{
		if(Direction == "Left")
			{
			if(Limit > currentPos + amountToMove)
				{
				obj.style.left = currentPos + amountToMove +"px";
				setTimeout("Play("+ Limit +",'"+ Direction +"',"+ amountToMove +")",10);
				}
			else
				{
				obj.style.left = Limit +"px";
				}
			}
		if(Direction == "Right")
			{
			if(Limit < currentPos - amountToMove)
				{
				obj.style.left = currentPos - amountToMove +"px";
				setTimeout("Play("+ Limit +",'"+ Direction +"',"+ amountToMove +")",10);				
				}
			else
				{
				obj.style.left = Limit +"px";
				}
			}
		}
	}

window.onload = function()
	{
	StartMenu();
	SideBar();
	ScreenPlay();
	FAQS();
	}
