// for navicon text
var navicon_text = new Array(3);
navicon_text[0] = "HOME";
navicon_text[1] = "ABOUT US";
navicon_text[2] = "OUR TOURS";
navicon_text[3] = "PHOTO GALLERY";

/* navicon images code*/
navicon_home_off = new Image();
navicon_home_off.src = "images/navicon2.tent.off.gif";
navicon_home_on = new Image();
navicon_home_on.src = "images/navicon2.tent.on.gif";

navicon_aboutus_off = new Image();
navicon_aboutus_off.src = "images/navicon2.flag.off.gif";
navicon_aboutus_on = new Image();
navicon_aboutus_on.src = "images/navicon2.flag.on.gif";

navicon_gallery_off = new Image();
navicon_gallery_off.src = "images/navicon2.gallery.off.gif";
navicon_gallery_on = new Image();
navicon_gallery_on.src = "images/navicon2.gallery.on.gif";

navicon_tours_off = new Image();
navicon_tours_off.src = "images/navicon2.footprint.off.gif";
navicon_tours_on = new Image();
navicon_tours_on.src = "images/navicon2.footprint.on.gif";


function naviconOver(imgName, newStateImage, text_id){
  // swap image
  document.getElementById(imgName).src = eval(newStateImage+".src");
  
  var caption = navicon_text[text_id];
  var caption_span = document.getElementById("navicons_text");
  var oldText = caption_span.childNodes.item(0);
  var newText = document.createTextNode(caption);
  var replaced = caption_span.replaceChild(newText,oldText);
}

function naviconOut(imgName, newStateImage){
  // swap image
  document.getElementById(imgName).src = eval(newStateImage+".src");
  
  var caption = "OUR TOURS";
  var caption_span = document.getElementById("navicons_text");
  var oldText = caption_span.childNodes.item(0);
  var newText = document.createTextNode(caption);
  var replaced = caption_span.replaceChild(newText,oldText);
}

/* icon images code*/
// for icon text
var icon_text = new Array(3);
icon_text[0] = "RESERVATION FORM";
icon_text[1] = "BOOKMARK THIS SITE";
icon_text[2] = "JOIN OUR DATABASE";
icon_text[3] = "EMAIL A FRIEND";
icon_text[4] = "USEFUL LINKS";


/* icon images code*/

icon_info_off = new Image();
icon_info_off.src = "images/icon.info.off.gif";
icon_info_on = new Image();
icon_info_on.src = "images/icon.info.on.gif";

icon_contact_off = new Image();
icon_contact_off.src = "images/icon.contact.off.gif";
icon_contact_on = new Image();
icon_contact_on.src = "images/icon.contact.on.gif";

icon_mail_off = new Image();
icon_mail_off.src = "images/icon.email.off.gif";
icon_mail_on = new Image();
icon_mail_on.src = "images/icon.email.on.gif";

icon_signup_off = new Image();
icon_signup_off.src = "images/icon.joindb.off.gif";
icon_signup_on = new Image();
icon_signup_on.src = "images/icon.joindb.on.gif";

icon_links_off = new Image();
icon_links_off.src = "images/icon.links.off.gif";
icon_links_on = new Image();
icon_links_on.src = "images/icon.links.on.gif";

function iconOver(imgName, newStateImage, text_id){
  // swap image
  document.getElementById(imgName).src = eval(newStateImage+".src");
  
  var caption = icon_text[text_id];
  var caption_span = document.getElementById("icons_text");
  var oldText = caption_span.childNodes.item(0);
  var newText = document.createTextNode(caption);
  var replaced = caption_span.replaceChild(newText,oldText);
}

function iconOut(imgName, newStateImage){
  // swap image
  document.getElementById(imgName).src = eval(newStateImage+".src");
  
  var caption = "";
  var caption_span = document.getElementById("icons_text");
  var oldText = caption_span.childNodes.item(0);
  var newText = document.createTextNode(caption);
  var replaced = caption_span.replaceChild(newText,oldText);
}
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(large_id, id_num, newSource, newTitle, newCaption){
  galleryOver(id_num);
  // set photo
  var gallery_photo_image_name = "gallery_photo_image" + large_id;
  document.getElementById(gallery_photo_image_name).src = newSource;
  // set title
  var gallery_photo_title_name = "gallery_photo_title" + large_id;
  var title_span = document.getElementById(gallery_photo_title_name);
  var oldText = title_span.childNodes.item(0);
  var newText = document.createTextNode(newTitle);
  var replaced = title_span.replaceChild(newText,oldText);
  // set caption
  var gallery_photo_caption_name = "gallery_photo_caption" + large_id;
  var caption_span = document.getElementById(gallery_photo_caption_name);
  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';
}
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");
}








