/* icon images code*/
search_off = new Image();
search_off.src = "images/button.search.gif";
search_on = new Image();
search_on.src = "images/button.search.on.gif";

submit_off = new Image();
submit_off.src = "images/button.submit.gif";
submit_on = new Image();
submit_on.src = "images/button.submit.on.gif";

reset_off = new Image();
reset_off.src = "images/button.reset.gif";
reset_on = new Image();
reset_on.src = "images/button.reset.on.gif";

icon_leftphoto_off = new Image();
icon_leftphoto_off.src = "images/icon.photo_left.jpg";
icon_leftphoto_on = new Image();
icon_leftphoto_on.src = "images/icon.photo_leftON.jpg";

icon_rightphoto_off = new Image();
icon_rightphoto_off.src = "images/icon.photo_right.jpg";
icon_rightphoto_on = new Image();
icon_rightphoto_on.src = "images/icon.photo_rightON.jpg";
  
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");
}
sfHover = function() {
	var sfEls = document.getElementById("menu").getElementsByTagName("TD");
	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);

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

function setGalleryPhoto(id_num, newSource, newTitle){
  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
  // set current photo to white border
  //var doc_id =  "photo" + id_num;
  //document.getElementById(doc_id).className  = 'white_border';
}
function updateSearchFormAction(search_type) {
  var the_form = document.getElementById("search_form");
  the_form.action = search_type;
  document.getElementById('search_form').submit();
}








