// Copyright 2000-2009, DataCom\OTA, Inc.
        
// Setup
Projects_on=new Image(99,18);
Projects_on.src="/images/mainMenu/Projects_on.gif";
Projects_off=new Image(99,18);
Projects_off.src="/images/mainMenu/Projects_off.gif";

ServicesI_on=new Image(99,18);
ServicesI_on.src="/images/mainMenu/Services_on.gif";
ServicesI_off=new Image(99,18);
ServicesI_off.src="/images/mainMenu/Services_off.gif";

AboutUs_on=new Image(99,18);
AboutUs_on.src="/images/mainMenu/AboutUs_on.gif";
AboutUs_off=new Image(99,18);
AboutUs_off.src="/images/mainMenu/AboutUs_off.gif";

Safety_on=new Image(99,18);
Safety_on.src="/images/mainMenu/Safety_on.gif";
Safety_off=new Image(99,18);
Safety_off.src="/images/mainMenu/Safety_off.gif";

Careers_on=new Image(99,18);
Careers_on.src="/images/mainMenu/Careers_on.gif";
Careers_off=new Image(99,18);
Careers_off.src="/images/mainMenu/Careers_off.gif";

Newsroom_on=new Image(99,18);
Newsroom_on.src="/images/mainMenu/Newsroom_on.gif";
Newsroom_off=new Image(99,18);
Newsroom_off.src="/images/mainMenu/Newsroom_off.gif";

ContactUs_on=new Image(99,18);
ContactUs_on.src="/images/mainMenu/ContactUs_on.gif";
ContactUs_off=new Image(99,18);
ContactUs_off.src="/images/mainMenu/ContactUs_off.gif";

//project scrollers
arrowLeft_on=new Image(25,80);
arrowLeft_on.src="/projects/arrowLeft_on.jpg";
arrowLeft_off=new Image(25,80);
arrowLeft_off.src="/projects/arrowLeft_off.jpg";

arrowRight_on=new Image(25,80);
arrowRight_on.src="/projects/arrowRight_on.jpg";
arrowRight_off=new Image(25,80);
arrowRight_off.src="/projects/arrowRight_off.jpg";

var theImages = new Array()
theImages[0] = "index00"
theImages[1] = "index01"
theImages[2] = "index02"
theImages[3] = "index03"
theImages[4] = "index04"

//Set Cookie for Current Page
function scPage(cName) {
	document.cookie = "cPage" + "=" + cName+";path=/;";
}

//Gray Out Current Page
function grayOut(imgName) {
	document[imgName].src=eval(imgName + "_on.src");
}

// Roll Over Buttons
function turnOn(imgName) {
	if(document.cookie.split("=")[1]!=document[imgName].name) {
		document[imgName].src=eval(imgName + "_on.src");
	}
}

function turnOff(imgName) {
	if(document.cookie.split("=")[1]!=document[imgName].name) {
		document[imgName].src=eval(imgName + "_off.src");
	}
}

//Gray Out Current Page
function swapImg(mastName, imgName) {
	document[mastName].src="/projects/" + mastName + imgName + "Mast.jpg";
}

//Index swf picker
function picPic() {
	var p = theImages.length;
	var preBuffer = new Array()
	for (i = 0; i < p; i++){
	preBuffer[i] = new Image()
	preBuffer[i].src = theImages[i]
	}
	var whichImage = Math.round(Math.random()*(p-1));
	document.write('<script type="text/javascript">');
	document.write('AC_FL_RunContent(\'codebase\',\'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\',\'width\',\'944\',\'height\',\'282\',\'title\',\'CCI\',\'src\',\'/images/'+theImages[whichImage]+'\',\'quality\',\'high\',\'wmode\',\'transparent\',\'pluginspage\',\'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\',\'movie\',\'/images/'+theImages[whichImage]+'\' ); //end AC code');
	document.write('</script>');
}

//Image Scroller
var scrollStep = 1;
var timerLeft = 0;
var timerRight = 0;

function scrollDivLeft(){
  clearTimeout(timerLeft) 
  document.getElementById('projectImg').scrollLeft+=scrollStep
  timerLeft=setTimeout("scrollDivLeft()",10)
}

function scrollDivRight(id){
  clearTimeout(timerRight)
  document.getElementById('projectImg').scrollLeft-=scrollStep
  timerRight=setTimeout("scrollDivRight()",10)
}

function stopDiv(){
  clearTimeout(timerLeft)
  clearTimeout(timerRight) 
}

//Open Files
function openFile(theFile) {
    window.open (theFile);
}

function openFileA(theFile, theWindow, theBar, theSize, theWidth, theHeight) {
    window.open (theFile, theWindow,"status=no,location=no,toolbars="+theBar+",menubar="+theBar+",directories=no,scrollbars=no,resizable="+theSize+",width="+theWidth+",height="+theHeight);
}

