<!--
// -------------------------------------------------------------
// 	  Javascript for browser detection and customization 
// 	     by Mark Desnoyer for http://www.origin.com 
// 			            June 2001
// -------------------------------------------------------------
 
 ns4=((navigator.appName == "Netscape") &&
    (parseInt(navigator.appVersion) == 4 ));
 ns6=((navigator.appName == "Netscape") &&
    (parseInt(navigator.appVersion) >= 5 ));
 ie=((navigator.appName == "Microsoft Internet Explorer") &&
	 (parseInt(navigator.appVersion) >= 4 ));
 var windowStartSize
 var colTotal

 if (ns4){   //Determines browser and loads the appropriate script to handle menus
  	SmallScreen();
	document.write("<script language='JavaScript' src='javascript/net_menus.js'></script>");
	LoadMenu();
 }else if (ns6){
	InitScreen();
	document.write("<script language='JavaScript' src='javascript/ns6_write.js'></script>");
	document.write("<script language='JavaScript' src='javascript/ns6_menus.js'></script>");
 }else if (ie){
	InitScreen();
	document.write("<script language='JavaScript' src='javascript/ms_write.js'></script>");
	document.write("<script language='JavaScript' src='javascript/ms_menus.js'></script>");	 
 }else{
 	document.write("<map name='FPMap1'><area href='bbs.htm' shape='rect' coords='611, 3, 718, 23'><area href='contact.htm' shape='rect' coords='482, 3, 583, 23'><area href='training.htm' shape='rect' coords='373, 3, 462, 23'><area href='products.htm' shape='rect' coords='254, 2, 352, 24'><area href='company_info.htm' shape='rect' coords='102, 1, 231, 24'><area href='http://www.origin.com/public/default.htm' shape='rect' coords='9, 1, 93, 24'></map><img rectangle='(373,3) (462,23) training.htm' rectangle='(254,2) (352,24) products.htm' rectangle='(102,1) (231,24) company_info.htm' rectangle='(9,1) (93,24) http://www.origin.com/public/default.htm' src='images/menu_bar.gif' alt='menu_bar.gif (3262 bytes)' border='0' usemap='#FPMap1' width='725' height='25'>")
 }

 window.onload = LoadImages;  //Preloads images for scrolling images.
 window.onresize  = ResizeHeader; //Whenever the user resizes the screen, get the header to adjust

 function InitScreen(){   //determines whether the use is in a large browser window or a small one and displays the appropriate sized header
	if((document.body.clientWidth >= 975) || (window.innerWidth >= 975)) {	  //Display header for 1024x768 screen
		document.write("<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td width='100%' nowrap><img border='0' name='picLeft' height='49' src='images/pic_header_left1024.gif'><img border='0' name='pHead1' src='images/pic_header_pic1.gif'><img border='0' name='pHead2' src='images/pic_header_pic2.gif' hspace='5'><img name='pHead3' border='0' src='images/pic_header_pic3.gif'><img border='0' name='pHead4' src='images/pic_header_pic4.gif' hspace='5'><img border='0' name='pHead5' src='images/pic_header_pic5.gif'><img border='0' src='images/pic_header_right.gif'></td></tr></table>");
		document.write("<img border='0' name='menuBar' height ='23' src='images/menubar1024.GIF'>");
		document.headerLogo.src = "images/header1024.gif"; //Changes the first part of the header to a larger size
		document.headerLogo.width= 975;
		windowStartSize = "large"
	} else {
		SmallScreen();
	}
 }

 function SmallScreen(){		//Display header for 800x600 screen
	document.write("<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td width='100%' nowrap><img border='0' name='picLeft' height='49' src='images/pic_header_left800.gif'><img border='0' name='pHead1' src='images/pic_header_pic1.gif' ><img border='0' name='pHead2' src='images/pic_header_pic2.gif' hspace='5'><img name='pHead3' border='0' src='images/pic_header_pic3.gif'><img border='0' name='pHead4' src='images/pic_header_pic4.gif' hspace='5'><img border='0' name='pHead5' src='images/pic_header_pic5.gif'><img border='0' src='images/pic_header_right.gif'></td></tr></table>");
	document.write("<img border='0' name='menuBar' height='23' src='images/menubar800.GIF'>");
	windowStartSize = "small"
 }

 function LoadImages() { //preloads all the needed images so the user doesn't see partial images
	ResizeTable();
	if (windowStartSize == "large") {
		image1 = new Image();
		image1.src = "images/header.gif";
		image2 = new Image();
		image2.src = "images/pic_header_left800.gif";
		image3 = new Image();
		image3.src = "images/menubar800.gif";
	} else {
		image1 = new Image();
		image1.src = "images/header1024.gif";
		image2 = new Image();
		image2.src = "images/pic_header_left1024.gif";
		image3 = new Image();
		image3.src = "images/menubar1024.gif";
	}
	//LoadHeadImages();
 }

 function ResizeHeader() { //Sets the appropriate size for the header images to fit into user's screen
	if(ie || ns6){
		if((document.body.clientWidth >= 975) || (window.innerWidth >= 975)) {
			document.headerLogo.src = "images/header1024.gif";
			document.headerLogo.width = 975;
			document.picLeft.src = "images/pic_header_left1024.gif";
			document.picLeft.width = 505;
			document.menuBar.src = "images/menubar1024.gif";
			document.menuBar.width = 975;
		} else {
			document.headerLogo.src = "images/header.gif";
			document.headerLogo.width = 725;
			document.picLeft.src = "images/pic_header_left800.gif";
			document.picLeft.width = 255;
			document.menuBar.src = "images/menubar800.gif";
			document.menuBar.width = 725;
						
		}
		ResizeTable();
	}
 }

 function ResizeTable() { //Resizes the table holding the page's content to fit screen so that sidebars stay the same size
	var mainTable
	var mainCell
	var mainCell2
	if (ie) { //sets variables to point to objects in the table
		mainTable = document.all["aTable"]
		mainCell = document.all["bodyCell"]
		if (colTotal == 4){
			mainCell2 = document.all["bodyCell2"];
		}
	} else if (ns6) {
		mainTable = document.getElementById("aTable")
		mainCell = document.getElementById("bodyCell")
		if (colTotal == 4){
			mainCell2 = document.getElementById("bodyCell2");
		}

	}
	
	if (ns4) {
	} else if((document.body.clientWidth >= 975) || (window.innerWidth >= 975)) {
		mainTable.width = 975;
		if (colTotal == 3) { //Checks for a situation where there are three colums (none have at the moment)
			mainCell.width = "600px";
		} else if(colTotal == 4) { //Checks for situations with 4 columns (ie. Front Page)
			mainCell.width = "385px";
			mainCell2.width = "385px";
		} else {
			mainCell.width = "790px";
		}
	} else {
		mainTable.width = 728;
		if (colTotal == 3) {
			mainCell.width = "350px";
		} else if(colTotal == 4) {
			mainCell.width = "265px";
			mainCell2.width = "265px";
		} else {
			mainCell.width = "540px";
		}
	}
}

imgIndex = 0 // placeholder for header image scrolling
imgTot = 5 //The number of images in the rototion

function LoadHeadImages() { //Loads the images to scroll in header. Currently disabled (see LoadImages()).
	imgArray = new Array(imgTot) // Currently contains five images. To add more, change imgTot and add the image in the same format as below.
	imgArray[0] = new Image()
	imgArray[0].src = "images/pic_header_pic1.gif"
	imgArray[1] = new Image()
	imgArray[1].src = "images/pic_header_pic2.gif"
	imgArray[2] = new Image()
	imgArray[2].src = "images/pic_header_pic3.gif"
	imgArray[3] = new Image()
	imgArray[3].src = "images/pic_header_pic4.gif"
	imgArray[4] = new Image()
	imgArray[4].src = "images/pic_header_pic5.gif"
	HeaderImageChange()
}

//*not tested at the moment*
function HeaderImageChange() { //Causes the images in the header to scroll through all the images entered in LoadHeadImages()
	document.pHead1.src = imgArray[imgIndex].src
	if (imgIndex <= (imgTot - 2)) {
		document.pHead2.src = imgArray[imgIndex + 1].src
	} else {
		document.pHead2.src = imgArray[imgIndex - (imgTot - 1)].src
	}
	if (imgIndex <= (imgTot -3)) {
		document.pHead3.src = imgArray[imgIndex + 2].src
	} else {
		document.pHead3.src = imgArray[imgIndex - (imgTot - 2)].src
	}
	if (imgIndex <= (imgTot - 4)) {
		document.pHead4.src = imgArray[imgIndex + 3].src
	} else {
		document.pHead4.src = imgArray[imgIndex - (imgTot - 3)].src
	}
	if (imgIndex <= (imgTot - 5)) {
		document.pHead5.src = imgArray[imgIndex + 4].src
	} else {
		document.pHead5.src = imgArray[imgIndex - (imgTot -4)].src
		clearTimeout(timerID)
	}
	if (imgIndex == (imgTot - 1)) {
		imgIndex = 0
	} else {
		imgIndex++
	}
	timerID = setTimeout(HeaderImageChange, 1000) //delay between image changes
}
		
 //-->
