// pop up
function gotoContactUs(t_contactLoc) {
	var i_screenWidth, i_screenHeight, i_winHeight, i_winWidth, i_top, i_left
	
	i_screenWidth = screen.width;
	i_screenHeight = screen.height;
	i_winHeight = 600;
	i_winWidth = 810;
	
	i_top = 1;
	i_left = (i_screenWidth-i_winWidth)/2;
	
	window.open("http://www.legacymfg.com/contact_us/ContactType.asp?contactLoc=" + t_contactLoc, "_blank", "scrollbars=1,height=" + i_winHeight + ",width=" + i_winWidth + ",top=" + i_top + ",left=" + i_left);
	
	return;
}

// circle mouseovers

function cirmo(elementId, bool) {
  if (bool)  var myClass = 'linkCircleTextMo';
	if (!bool) var myClass = 'linkCircleText';
	if (document.getElementById('linkCircleText'+elementId)) document.getElementById('linkCircleText'+elementId).className = myClass;
}
		
// navigation

var displayTable = 'divHomeGlobal';

function displayBox(myid) {
  // suport ie7 + ie's inability to stop audio playback
  if (myid == 'divFlashFullGlobal') {
    document.getElementById('tdFlashPlayerFull').innerHTML = flashFull;
  } else {
	  document.getElementById('tdFlashPlayerFull').innerHTML = '<span>null</span>';
	}
  if (myid == 'divFlashCipsGlobal') {
    document.getElementById('tdFlashPlayerClips').innerHTML = flashClips;
  } else {
	  document.getElementById('tdFlashPlayerClips').innerHTML = '<span>null</span>';
	}
  if (myid != displayTable && document.getElementById(myid)) {
	  document.getElementById(displayTable).style.display='none';
	  document.getElementById(myid).style.display='block';
		displayTable = myid;
	}
}		

function displayCircleContent(mynum) {
  var localCircle = circleArray[mynum];
  document.getElementById("imgCircleContent").src              = localCircle.img;
	document.getElementById("imgCircleContentHeader").src        = localCircle.headerSrc;
	document.getElementById("divCircleContentText").innerHTML   = localCircle.text;
  displayBox('divCircleContentGlobal');
}
	
// circle object

function circlePage(myimg, myheadersrc, mytext) {
  this.img = myimg;
	this.text = mytext;
	this.headerSrc = myheadersrc;
}
					
// scrolling

var isScrolling     = false;
var scrollDir       = false;
var tableLeft       = 0;
var circleStartNum  = 8;
var circleCellWidth = 80;
var divWidth        = 774;

function scroll(myDir) {
	scrollDir = myDir;
	isScrolling = true;
	doScroll();
}

function doScroll() {
  var myTable = document.getElementById('tableCircles'); 
	var rightVal = ((myTable.offsetWidth - divWidth) * -1) + 5;
  if (isScrolling) {
	  if (scrollDir == 'left')  tableLeft = tableLeft + 10;
		if (scrollDir == 'right') tableLeft = tableLeft - 10;
	  myTable.style.left = tableLeft+'px';
		if (tableLeft < 0) document.getElementById("imgArrowLeft").style.visibility="visible";
		if (tableLeft > rightVal) document.getElementById("imgArrowRight").style.visibility="visible";
		if (tableLeft == 0) {
		  stopScroll();
		  document.getElementById("imgArrowLeft").style.visibility="hidden";
		}
		if (tableLeft < rightVal) {
		  stopScroll();
			document.getElementById("imgArrowRight").style.visibility="hidden";
		}
	  setTimeout('doScroll();', 20);
	}
}

function stopScroll() {
  isScrolling = false;
}
											 
