// JavaScript Document Callery Scripts

var mac = navigator.userAgent.indexOf('Mac'); 
var IE = navigator.userAgent.indexOf('MSIE');
var macIE = (mac != -1) && (IE != -1);
var imageID = -1;

//for image descriptions in gallery
var imageDescArray = new Array;
	imageDescArray[0] = "Energy - Private collection";
	imageDescArray[1] = "Lyreform - Private collection";
	imageDescArray[2] = "Medicine Bundle - App.7 ft 6 inches tall $750";
	imageDescArray[3] = "The Nature of Things - Private Collection";
	imageDescArray[4] = "Round Peg- Square Hole - Private Collection";
	imageDescArray[5] = "Pierced Vessels - Private Collection";
	imageDescArray[6] = "Rok Rapped #6 - $250";
	imageDescArray[7] = "Pierced Vessel -  $450";
	imageDescArray[8] = "Offering #4 - $475";
	imageDescArray[9] = 'Cairn in Memory of the Placentia Bay Fishermen - Pt. Verde, Newfoundland, Canada 7/2007';
	imageDescArray[10] = 'Paul working in his shop';
	imageDescArray[11] = 'Preparing bamboo for use in a project';


//////////////////////////////////////////////////////////////////////////////////////////////////////
// for older browsers that do not support Array.push method
if(typeof Array.prototype.push == "undefined")
  Array.prototype.push = function(){
    var i=0;
    b=this.length,a=arguments;
    for(i;i<a.length;i++)this[b+i]=a[i];
    return this.length
  }
  
  
//create work around for css hover state on ie
hoverThumb = function(){
	var thumbControl = document.getElementById("thumbs").getElementsByTagName("IMG");
	for (var i=0; i<thumbControl.length; i++){
		thumbControl[i].onmouseover=function(){
			this.className+="hover galleryImage";
		}
		thumbControl[i].onmouseout=function(){
			this.className=this.className.replace(new RegExp("hover\\b"), "");
		}
	}
	
}

	
//load thumbnail as enlarged image
function loadImage(num){
	var imageDesc = "mainImgDesc" + num;
	if(safari == "safari"){//used to get around safari reload/resize image bug
		document.getElementById('mainImg').src = "../images/spacer.gif";
	}
	document.getElementById('mainImg').src = mockup[num];
	document.getElementById('imageDesc').innerHTML = imageDescArray[num];
	var imageID = num;
}

if(macIE){window.onload = hoverThumb;}
else if(window.attachEvent){window.attachEvent("onload", hoverThumb);}

