// JavaScript Document
//var thisPic=0 //index to pictures array for left project nav
var projPic=0 //index to pictures array for bottom project images
var blank = "images/blank.gif"
var projnext = "images/more.gif"
var projprevious = "images/previous.gif"
var projimgCt = myProjVars.length-8


function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

  function swapPic(img) {
    document['mainPhoto'].src = img;
  }
  
  function swapThumb(img) {
    document['thumbPhoto'].src = img;
  }
  
// function getlink(theURL) { //v2.0
//	window.location=myDescr[theURL][1];
//} 


    function swapDesc(thumbNum) {	 
	 // Change Text On Screen
			 try{ // Using a try statement to prevent javascript errors from showing up and/or halting other scripts
				var txtOBJ = document.getElementById("projName");
				var message=myProjNames[thumbNum];
				if (myProjNames[thumbNum] != "") {
				txtOBJ.innerHTML = message;
				}
			}catch( er ){  alert("JavaScript Error: " + er );  return; } // Custom error alert. wrap alert statement with /* */ to hide all errors for this chunk of code
  }
      function clearDesc() {	 
	 // Change Text On Screen
			 try{ // Using a try statement to prevent javascript errors from showing up and/or halting other scripts
				var txtOBJ = document.getElementById("archDescr");
				txtOBJ.innerHTML = "";
			}catch( er ){  alert("JavaScript Error: " + er );  return; } // Custom error alert. wrap alert statement with /* */ to hide all errors for this chunk of code
  }

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 projectNext() {
		if(document.images && projPic != 8) {
			projPic = projPic+8
			if (myProjVars[projPic]) { document.pthumbnail1.src= myProjVars[projPic] }
			if (myProjVars[projPic+1]) { document.pthumbnail2.src= myProjVars[projPic+1] } else { document.pthumbnail2.src= blank }
			if (myProjVars[projPic+2]) { document.pthumbnail3.src= myProjVars[projPic+2] } else { document.pthumbnail3.src= blank }
			if (myProjVars[projPic+3]) { document.pthumbnail4.src= myProjVars[projPic+3] } else { document.pthumbnail4.src= blank }
			if (myProjVars[projPic+4]) { document.pthumbnail5.src= myProjVars[projPic+4] } else { document.pthumbnail5.src= blank }
			if (myProjVars[projPic+5]) { document.pthumbnail6.src= myProjVars[projPic+5] } else { document.pthumbnail6.src= blank }
			if (myProjVars[projPic+6]) { document.pthumbnail7.src= myProjVars[projPic+6] } else { document.pthumbnail7.src= blank }
			if (myProjVars[projPic+7]) { document.pthumbnail8.src= myProjVars[projPic+7] } else { document.pthumbnail8.src= blank }
			if(projPic==0){	document.projCnt.src=blank }
			if(projPic==8){ document.projCnt.src=projprevious }
			}
			else 
			{
			projPic = 0;
			document.pthumbnail1.src= myProjVars[projPic]
			document.pthumbnail2.src= myProjVars[projPic+1]
			document.pthumbnail3.src= myProjVars[projPic+2]
			document.pthumbnail4.src= myProjVars[projPic+3]
			document.pthumbnail5.src= myProjVars[projPic+4]
			document.pthumbnail6.src= myProjVars[projPic+5]
			document.pthumbnail7.src= myProjVars[projPic+6]
			document.pthumbnail8.src= myProjVars[projPic+7]
			document.projCnt.src=projnext
			
			
		}
	}
