// JavaScript Document
//general javascript to include on each page
function $(myID){return document.getElementById(myID);}

//functionality for loading pics into the gallery
function LoadGalPicture(myID,myIndex){
	var displayImage = getImageItemSrc(pic[myIndex]);
	document.getElementById(myID).src=displayImage;
	var tnNum = myIndex;
	document.getElementById(myID).alt="picture "+ tnNum;
}

//toggleVisible opens and closes divs
function toggleVisible(myId,myState)
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    {elem = $(myId);}
  else if( document.all ) // this is the way old msie versions work
      {elem = document.all[myId];}
  else if( document.layers ) // this is the way nn4 works
    {elem = document.layers[myId];}
  vis = elem.style;
  vis.display=myState;
}

function imageItem(imageLocation) {
this.imageItem = new Image(450,350);
this.imageItem.src = imageLocation;
}

function getImageItemSrc(imageObj) {
return(imageObj.imageItem.src)
}

//functionality for loading pics and info on artist page
function loadGalPicture(myID,myIndex,aStyle,msgType){
	var displayImage = getImageItemSrc(pic[myIndex]);
	var myCap;
	if(msgType=='artist'){myCap='view artist\'s gallery';}
	if(msgType=='show'){myCap='view show';}
	var myDisplay=$(myID);
	var displayName=artistName[myIndex];
	myDisplay.src=displayImage;
	myDisplay.alt=displayName;
	var myHeader= '<a href="'+linkUrl[myIndex]+'" class='+aStyle+'>'+displayName+'</a>';
	var caption = '<a href="'+linkUrl[myIndex]+'" class='+aStyle+'>'+myCap+'</a>';
	if(debug){alert(myHeader);}
	$('artistName').innerHTML=myHeader;
	$('viewCap').innerHTML=caption;
}
