<!--
var projTracker=new Array(); // set array for tracking expand / shrink divs for use with rollovers
var imagesArray=new Array(); // set array for image size tracking
var catTrackerId=new Array(); // set array for storing all projects and their categories
var catTrackerDivs=new Array(); // set array for storing all projects and their categories
var columnSelect=new Array(); // array to store column selection and on/off state
var catLinkIds=new Array(); // array to store category id of each category link
var catTrackerCount = 0;
var expandedImage; // used to store name of expanded image
var expandedNum; // store the id number of the expanded image
var dimDiv; // used for the previously dimmed column div name
var dimDivNum; // used to store the dimmed div number

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_changeProp(objId,x,theProp,theValue) { //v9.0
  var obj = null; with (document){ if (getElementById)
  obj = getElementById(objId); }
  if (obj){
    if (theValue == true || theValue == false)
      eval("obj.style."+theProp+"="+theValue);
    else eval("obj.style."+theProp+"='"+theValue+"'");
  }
}

function displayDiv (id,prefix,divCounter) {
if (projTracker[divCounter] == 1) {
	hideDiv(id,prefix,divCounter);
	if (divCounter == 2) { MM_changeProp("footer",'','display','block','DIV'); } // if hiding div 2 then display the footer div
	return;
	}

if (divCounter == 2) { MM_changeProp("footer",'','display','none','DIV'); } // if expanding div 2 then remove the footer div


projTracker[divCounter] = 1; // set tracking flag for this project
thisDiv = "expandDiv"+divCounter;
moreDiv = "moreDiv"+divCounter;
closeDiv = "closeDiv"+divCounter;
thisTextDiv = "expandTextDiv"+divCounter; // additional div added June 18 2010 for separate text to stop column text from fading
MM_changeProp(thisDiv,'','display','block','DIV');
MM_changeProp(thisTextDiv,'','display','block','DIV');
MM_changeProp(closeDiv,'','display','block','DIV');
// disabled may 2010 iTQ9 - leave categories on: MM_changeProp(moreDiv,'','display','none','DIV');
thisImage = "projImage"+id;
document[thisImage].src = 'images/projects/'+prefix+'1-on.jpg';
// expand the green separators on either side of this div...
// get the max height of each vertical - left and right
separatorHeightSet(divCounter);
}

function hideDiv(id,prefix,divCounter) {
projTracker[divCounter] = 0; // set tracking flag for this project
thisDiv = "expandDiv"+divCounter;
thisTextDiv = "expandTextDiv"+divCounter; // additional div added June 18 2010 for separate text to stop column text from fading
moreDiv = "moreDiv"+divCounter;
closeDiv = "closeDiv"+divCounter;
MM_changeProp(thisDiv,'','display','none','DIV');
MM_changeProp(thisTextDiv,'','display','none','DIV');
MM_changeProp(closeDiv,'','display','none','DIV');
// disabled may 2010 - leave category links on: MM_changeProp(moreDiv,'','display','block','DIV');
thisImage = "projImage"+id;
document[thisImage].src = 'images/projects/'+prefix+'1.jpg';

// change vertical line heights...
separatorHeightSet(divCounter);
}

function imageOn(id,prefix,divCounter) {
	thisImage = "projImage"+id;
	if (projTracker[divCounter] !=1) {document[thisImage].src = 'images/projects/'+prefix+'1-on.jpg';} // only change the image if not already changed!
}
function imageOff(id,prefix,divCounter) {
	thisImage = "projImage"+id;
	if (projTracker[divCounter] !=1) {document[thisImage].src = 'images/projects/'+prefix+'1.jpg';} // only change the image if this project not expanded
}

function separatorHeightSet(divCounter) {
reduceBy = 4; // no of pixels to remove from bottom to align with bottom (Marit's x height) of text
// expand the green separators on either side of this div...
// get the max height of each vertical - left and right
prevDivNum = divCounter -1;
if (prevDivNum < 1) {prevDivNum =1;} // can't be less than 1!! 
nextDivNum = divCounter +1;
if (nextDivNum > maxCols) {nextDivNum =maxCols;} // can't be greater than the number of columns
prevDivName = "contentPanel"+prevDivNum;
nextDivName = "contentPanel"+nextDivNum;
thisName = "contentPanel"+divCounter;
thisHeight = document.getElementById(thisName).offsetHeight;
prevHeight = document.getElementById(prevDivName).offsetHeight;
nextHeight = document.getElementById(nextDivName).offsetHeight;
if (thisHeight > prevHeight) {leftSize = thisHeight;} else {leftSize = prevHeight;}
if (thisHeight > nextHeight) {rightSize = thisHeight;} else {rightSize = nextHeight;}

//adjust heights with the reduce by amount
leftSize-=reduceBy;
rightSize-=reduceBy;

leftSize = leftSize + "px";
rightSize = rightSize + "px";
currentDiv = "rightBorder"+divCounter;
MM_changeProp(currentDiv,'','height',rightSize,'DIV');
previousDiv = divCounter-1;
previousName = "rightBorder"+previousDiv;
MM_changeProp(previousName,'','height',leftSize,'DIV');
}


function toggleImage(thisImage,thisDiv) {
thisImageName = "subImage"+thisImage;
nextDiv = thisDiv + 1;
changeDiv = "expandDiv"+nextDiv;

if (dimDiv && dimDivNum < totalColumns+1) {setOpacity (dimDiv,1);} // if we have previously dimmed a column then turn on again

if (imagesArray[thisImage]!=1) { // this image currently small so make larger...
	document[thisImageName].width=281;
	document[thisImageName].height=274;
	imagesArray[thisImage] = 1; // set image flag to large
	if (thisDiv < totalColumns+1) {setOpacity (changeDiv,0.33);}
	}
	else // must be large already so make small
	{
	document[thisImageName].width=132;
	document[thisImageName].height=132;
	imagesArray[thisImage] = 0; // set image flag to small
	if (thisDiv < totalColumns+1) {setOpacity (changeDiv,1);}
	}

if (expandedImage > "" && expandedNum != thisImage) { // we have a previous expanded image so reduce it's size - only if it's not the same image being clicked again
	document[expandedImage].width=132;
	document[expandedImage].height=132;
	imagesArray[expandedNum] = 0;
}
expandedNum = thisImage; // store the number of the expanded image
expandedImage = thisImageName; // set current expanded image
dimDiv = changeDiv; // set dimmed div name
dimDivNum = nextDiv; // set dimmed div number

if (columnSelect[thisDiv] == 0) {columnSet(0); } // if this div is off and image clicked then turn on all divs

// reset separator heights - to match image height increase or decrease
separatorHeightSet(thisDiv);

}

function setOpacity(objectId,objectOpacity) {
  if (document.all){
  thisOpacity = objectOpacity*100;
       document.all(objectId).filters.alpha.opacity = thisOpacity;
	  } else if (!document.all && document.getElementById) {
	  document.getElementById(objectId).style.MozOpacity = objectOpacity;
	  document.getElementById(objectId).style.opacity = objectOpacity; // fix for Safari
	  }
}

function columnSet(catId) {
for (i=1;i<=maxCols;i++) {
	if (catId==0) {
			columnSelect[i] = 1;
			}
		else {
			columnSelect[i] = 0;
			}
		} // reset all column on/off states


for (i=1;i<=catTrackerCount;i++)
	{
	if (catTrackerId[i] == catId) { // we have a matching div so highlight it
		tempCol = catTrackerDivs[i];
		columnSelect[tempCol] = 1;
		} // end of matching
	} // end of for loop
	
for (i=2;i<=maxCols;i++) {
		thisColName = "contentPanel"+i;
		if (columnSelect[i]==1) { // if selected then turn it up!
		setOpacity(thisColName,1);
		}
		else { // if not selected then dim
		setOpacity(thisColName,0.33);
		} // end of if else
	} // end of for loop

// set the active category
for (i=1;i<=maxCats;i++) {
	catSelectedClass = ".catSelector"+i; // set the class name
	if (i==catId) { // if current category then highlight
	changecss(catSelectedClass,'color','#6FFF00');
	}
	else { // if not current then set to grey
	changecss(catSelectedClass,'color','#AAAAAA');
		}
	}
} // end of function


function changecss(theClass,element,value) {
	//Last Updated on June 23, 2009
	 var cssRules;
	 var added = false;
	 for (var S = 0; S < document.styleSheets.length; S++){
    if (document.styleSheets[S]['rules']) {
	  cssRules = 'rules';
	 } else if (document.styleSheets[S]['cssRules']) {
	  cssRules = 'cssRules';
	 } else {
	  //no rules found... browser unknown
	 }
	  for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {
	   if (document.styleSheets[S][cssRules][R].selectorText == theClass) {
	    if(document.styleSheets[S][cssRules][R].style[element]){
	    document.styleSheets[S][cssRules][R].style[element] = value;
	    added=true;
		break;
	    }
	   }
	  }
	  if(!added){
	  if(document.styleSheets[S].insertRule){
			  document.styleSheets[S].insertRule(theClass+' { '+element+': '+value+'; }',document.styleSheets[S][cssRules].length);
			} else if (document.styleSheets[S].addRule) {
				document.styleSheets[S].addRule(theClass,element+': '+value+';');
			}
	  }
	 }
	}


//-->
