/* icon images code*/
sfHover = function() {
	var sfEls = document.getElementById("menu").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
/* gallery arrow images code*/
left_arrow_off = new Image();
left_arrow_off.src = "images/icon.left_arrow.off.gif";
left_arrow_on = new Image();
left_arrow_on.src = "images/icon.left_arrow.on.gif";

right_arrow_off = new Image();
right_arrow_off.src = "images/icon.right_arrow.off.gif";
right_arrow_on = new Image();
right_arrow_on.src = "images/icon.right_arrow.on.gif";

function popwindow(imageurl, winname, winfeatures) {
  window.open(imageurl,winname,winfeatures); 
}
function setLocation(url) {
  window.location=url; 
}
function setPhoto(imgName, newStateImage){
  document.getElementById(imgName).src = eval(newStateImage+".src");
}

function galleryOver(id_num) {
  var doc_id =  "photo" + id_num;
  document.getElementById(doc_id).className  = 'gallery_thumb_over';
}
function galleryOut(id_num) {
  var doc_id =  "photo" + id_num;
  document.getElementById(doc_id).className = 'gallery_thumb';
}

function setGalleryPhoto(id_num, newSource, newTitle, newCaption){
  galleryOver(id_num);
  // set photo
  document.getElementById("gallery_photo_image").src = newSource;
  // set title
  var title_span = document.getElementById("gallery_photo_title");
  var oldText = title_span.childNodes.item(0);
  var newText = document.createTextNode(newTitle);
  var replaced = title_span.replaceChild(newText,oldText);
  // set caption
  var caption_span = document.getElementById("gallery_photo_caption");
  var oldText = caption_span.childNodes.item(0);
  var newText = document.createTextNode(newCaption);
  var replaced = caption_span.replaceChild(newText,oldText);
  // set current photo to white border
  //var doc_id =  "photo" + id_num;
  //document.getElementById(doc_id).className  = 'white_border';
}








