var selectedId = "";


function nover(action, id) {
  eval("var img = document.images['navi_" +id +"'];");


  var extension = "";
  if(action == 1) {
    extension = "_b";
    //selectedId = id;
  }

  // if is mouseout but current is selected, dont fade
  if(action == 0 && id == selectedId) {
    extension = "_b";
  }

  var evalstr = "img.src = img_" +id +extension +".src;";
  //alert("evalstr: " +evalstr);

  eval ("img.src = img_" +id +extension +".src;");
}

function showGallery2(pageid, gid, cid) {
  alert("showGallery2: pageid: " +pageid);
  selectedId = cid;
  ///alert("showGallery(): gid: " +gid +", cid: " +cid +", naviElemCount: " +naviElemCount);

  // Clear all menus except the one clicked
  for(i = 0; i < naviElemCount; i++) {
    if(cid != naviElements[i]) {
      eval("var img2 = document.images['navi_" +naviElements[i] +"']");
      // alert("img2: " +img2);
      eval ("img2.src = img_" +naviElements[i] +".src;");
    }
  }
 
}
function showGallery(gid, cid) {

  selectedId = cid;
  ///alert("showGallery(): gid: " +gid +", cid: " +cid +", naviElemCount: " +naviElemCount);

  // Clear all menus except the one clicked
  for(i = 0; i < naviElemCount; i++) {
    if(cid != naviElements[i]) {
      eval("var img2 = document.images['navi_" +naviElements[i] +"']");
      // alert("img2: " +img2);
      eval ("img2.src = img_" +naviElements[i] +".src;");
    }
  }

  setGalleryContent(gid, cid);

}


function setGalleryContent(gid, cid) {
  var val = siteUrl +"gallery.php?gid=" +gid +"&cid=" +cid;

  //alert("setGalleryContent(): val: " +val);

  var iframe = document.getElementById('Iframe1');
  iframe.src=val;
}



