/*-- -----------------------------------------------------------------------
	Copyright 2006 Auto-trol Technology Corp.  All rights reserved.
 --------------------------------------------------------------------------- */

menuObj = ""
lastMenuID = ""
timerID = ""
lastMenu = "menuHome"

function showMenu(currMenu, menuID, showBar, menuNameID) {
	if (lastMenu != menuNameID) {
		if (document.getElementById) {
			document.getElementById(lastMenu).className = "style1"
		}
		else if (document.all) {
			document.all.lastMenu.className = "style1"
		}
		else if (document.layers) {
			document.lastMenu = "style1"
		}
	}

	clearTimeout(timerID)
	timerID = setTimeout('hideAll()', 10*1000)

	if (document.getElementById) {
		document.getElementById(menuID).style.color = "#FFFFFF"
	}
	else if (document.all) {
		document.all.menuID.style.color = "#FFFFFF"
	}
	else if (document.layers) {
		document.menuID.style.color = "#FFFFFF"
	}

	if (menuObj.visibility == "visible") {
		hideMenu()
	}

	menuObj = document.getElementById(currMenu).style
	menuObj.visibility = "visible"

	if (document.getElementById) {
		document.getElementById(menuID).style.color = "#FFFFFF"
	}
	else if (document.all) {
		document.all.menuID.style.color = "#FFFFFF"
	}
	else if (document.layers) {
		document.menuID.style.color = "#FFFFFF"
	}

	if (showBar == "bars") {
		if (document.getElementById) {
			document.getElementById('whiteBarTop').style.visibility = "visible"
			document.getElementById('whiteBarBottom').style.visibility = "hidden"
		}
		else if (document.all) {
			document.all.whiteBarTop.style.visibility = "visible"
			document.all.whiteBarBottom.style.visibility = "hidden"
		}
		else if (document.layers) {
			document.whiteBarTop.style.visibility = "visible"
			document.whiteBarBottom.style.visibility = "hidden"
		}
	}

	lastMenuID = menuID
	lastMenu = menuNameID
}
function hideMenu() {
	menuObj.visibility = "hidden"

	if (document.getElementById) {
		document.getElementById('whiteBarTop').style.visibility = "hidden"
		document.getElementById('whiteBarBottom').style.visibility = "hidden"
		document.getElementById(lastMenuID).style.color = "#CCCCCC"
	}
	else if (document.all) {
		document.all.whiteBarTop.style.visibility = "hidden"
		document.all.whiteBarBottom.style.visibility = "hidden"
		document.all.lastMenuID.style.color = "#CCCCCC"
	}
	else if (document.layers) {
		document.whiteBarTop.style.visibility = "hidden"
		document.whiteBarBottom.style.visibility = "hidden"
		document.lastMenuID.style.color = "#CCCCCC"
	}
}
function hideAll() {
	hideMenu()
	if (document.getElementById) {
		document.getElementById(lastMenu).className = "style1"
	}
	else if (document.all) {
		document.all.lastMenu.className = "style1"
	}
	else if (document.layers) {
		document.lastMenu.className = "style1"
	}
}

var newWindow = null;

function openWindow(contentURL,windowName,windowWidth,windowHeight, scroll, tool, menu) {
	var winleft = (screen.width - windowWidth) / 2;
	var winUp = (screen.height - windowHeight) / 2;
	winProp = 'width='+windowWidth+',height='+windowHeight+',right='+winleft+',top='+winUp+',scrollbars='+scroll+',toolbar='+tool+',menubar='+menu+',resizable';
	Win = window.open(contentURL, windowName, winProp);
	//Win.moveTo(winleft,winUp);
	Win.focus();
}

function closeWindow() {
	if (newWindow != null)  {	
	 newWindow.close();
	 newWindow = null;
	}
}

function toggleWindow(contentURL,windowName,windowWidth,windowHeight) {
	if (newWindow == null) {
		widthHeight = 'HEIGHT=' + windowHeight + ',WIDTH=' + windowWidth;
		newWindow = window.open(contentURL,windowName,widthHeight);
		newWindow.focus()
	}
	else {	
	 	newWindow.close();
	 	newWindow = null;
	}
}

function closePop() {
	self.close();
}

function WhitePage(itemId)
{
  var URL = "http://www.auto-trol.com/attc/jsp/Login.jsp?ActionPage=/attc/jsp/getFile.jsp&ReqType=237&Request=" + itemId;
  
  openWindow(URL,'Request',764,500,1,0,0);
}

function RequestInfo(itemId)
{
  var URL = "/attc/jsp/Login.jsp?ActionPage=/attc/html/RequestInfo.html&ReqType=233&Request=" + itemId;
  
  openWindow(URL,'Request',764,650,1,0,0);
}

function Seminar(itemId)
{
  var URL = "/attc/jsp/Login.jsp?ActionPage=/attc/jsp/TYSeminar.jsp&ReqType=236&Request=" + itemId;
  
  openWindow(URL,'Request',764,650,1,0,0);
}

function TechRegistration(itemId)
{
  var URL = "/attc/jsp/Login.jsp?ActionPage=/attc/html/TIRegistration.html&ReqType=235&Request=" + itemId;
  
  window.open(URL, '_self');
}

function RequestEval(itemId)
{
  var URL = "http://www.auto-trol.com/attc/jsp/Login.jsp?ActionPage=/attc/html/TIEval.html&ReqType=234&Request=" + itemId;
  
  openWindow(URL,'Request',768,500,1,0,0);
}

