// Copyright 2000-2009, DataCom\OTA, Inc.
        
// Setup


//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);
}
