var sCustSiteMap = '';
var sDomainPath = 'tidesturnvacationrental.com/tidesturn/';
var sRecorderPath = 'http://globalwebimage.com/dansun/';
var bAutoScroll = false;
var bSideMenu = true;
var bServerTransfer = true;
var bGalleryEdit = false;
var bSiteMap = true;
var bSiteMapFramed = false;
var bShopText = true;
var bToolsText = true;
var bNoBullets = false;
var bImgSwap = false;
var bgMusicLoop = true;
var bgMusic = false;
var bgAutoStart = false;
var bAutoHide = false;
var bASPSearch = true;
var bCSSa = false;
var bTextAlignRight = true;
var sLastImg = 'rainbow from deck_Small.htm';
var bHTMLNextPrev = true;
var bHLRow = true;
var bHLMouseOver = true;
var bRecordHits = true;
var bTBFramed=true;
var iFraHidden = 6;
var iFraSearchDB = 5;
var sFraTopic = 'fraTopic';
var iFraTopic = 4;
var iFraLogo = 0;
var iFraTB = 3;
var iFraIndex = 2;
var iFraPhoto = 0;
var bFramedIndex = true;
var sSUGTab = "";
var sSUGTabPostfix = '';
var bBoldOnSelect = true;
var bRememberLastPage = true;
var bOnSelectHideDivs = true;
var j=0;
var sMenuDir = '../Menu2/';
var sSUG = '';
var bZoom = true;
var sDomain = 'tidesturnvacationrental.com';
var sPolicyFile = '';
var sHelpFile = '';
var sGallery = '';
var sGalleryHref = '';
var bHighLightMenuItem = true;
var sHighLightColor = '#FFFFFF';
var bPlusMinus = false;
var sColorOut = '#5959FF';
var sColorOver = '#0000FF';
var sColorOn = '#0000C4';



//----------- Start Generic -----------

var sSearchText = '';
var ofra = parent.frames[iFraTopic];  //fraTopic
var i = 1;  //slideshow
var oImgs;
var iTimeout;
var bSlideShowOn = false;
var eMenu;
var bImgs = false;
var sImgs = ['test'];
var idPrev;
var idNext;
var img;
var sImg;
var sLastDiv;
var bCartEmpty = true;
var iKnt = 0;
var oDiv;
var sPath;
var sSUGs = sSUG.split("|");
var sSUGTemp;
var sCollage = "collage.htm";
var sDiv1;
var sDiv2;
var sDiv3;
var sDiv4;
var sDiv5;
var sHref = '';  //RS
var bFind = false;
var bSDShowGal;
var bSDExpand;
var bMusicOn = false;
var ns6=document.getElementById&&!document.all;
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1;
var bESOInProgress = false;
var iTOESO5,iTOESO4,iTOESO3,iTOESO2,iTOESO1;
var bSetMenu = "true";
var sDivCollage = "";
var iLeafCollage = 0;
var sVideoPlayer = "WMV";
var sEditPage = '';
var sEditHTML = '';
var sRevertPage = '';
var sGalleryPath = '';
var sMI = (bSiteMapFramed) ? "fs-MenuIndex.htm" : "MenuIndex.htm";
var imgFold=new Image();
var imgOpen=new Image();
var imgList=new Image();
imgFold.src='fold.gif';
imgOpen.src='open.gif';
imgList.src='list.gif';

document.onclick=on_click; 
if (bHLMouseOver) {
  document.onmouseover=mouse_over; 
  document.onmouseout=mouse_out;
}
function window_onload() {

  var sTemp = getCookie("bZoom");
  if (sTemp == "false") bZoom = false;
  if (sTemp == "true") bZoom = true;
  if (bAutoScroll) initialize();
  if (parent.sLastPage != null) sEditPage = parent.sLastPage;
  sSessionID = parent.sSessionID;

  if (parent.frames[iFraLogo].bTabHit==false) ShowDiv(sSUGTab, true, false);
  if (sSUGTab != "") { 
    bSDShowGal = false;
    bSDExpand = null;
    if (parent.sLastPage == null) setTimeout('ShowDiv(sSUGTab)',1000);
  }
  var args = getArgs();
  if ((args["f"] != "" && args["f"] != null && args["f"] != "undefined") || sEditPage.indexOf("pg-help") != -1 || args["g"].indexOf("pg-help") != -1) {
    bSDShowGal = false;
    bSDExpand = null;
    ShowDiv(sSUGTab);
    if (sEditPage.indexOf("pg-help") != -1 || args["g"].indexOf("pg-help") != -1) {
      setTimeout("toff_addtocart()",1);
    }
  }
  eMenu = document.getElementsByTagName("A");
  if(document.getElementById) {
     for(i=0;i<eMenu.length;i++)
       eMenu[i].onfocus=new Function("if(this.blur)this.blur()");
  }
  if (j >= 0) {
    if (bCSSa != true) {
      eMenu[j].style.color = sColorOn;
    }
    if (bHighLightMenuItem == true) {
      if (bHLRow == true) 
        eMenu[j].parentNode.parentNode.parentNode.style.backgroundColor = sHighLightColor;
      else
        eMenu[j].parentNode.style.backgroundColor = sHighLightColor;
    }
  }
  sSUGTemp = sSUG;
  if (bgAutoStart) setTimeout('toggleMusic(false)',500);
}

function SetTitle(sTitle, sGalPath, sMapIt, sFirstImg) {
  if (sGalPath == null) sGalPath = ofra.sGalleryPath;
  if (sMapIt == null) sMapIt = ofra.sMapIt;
  if (sFirstImg == null) sFirstImg = ofra.sFirstImg;
  var sTemp = "";
  try {
    if (sMapIt != "") {
      sTemp = sMapIt.replace("googleimg=","i=../" + sGalPath  + "/" + sFirstImg.replace("_Small", "_Small_Collage"));
      sTemp = "&nbsp; &nbsp; <b><a href=\"" + sTemp + "\" target='fraTopic'>MapIt</a></b>";
    }
  } catch(es) {}
  try {
    if (sTitle != "common") { 
      parent.frames[iFraTB].document.getElementById('idCrumbs').innerHTML = sTitle + sTemp;
    }
  } catch(es) {}
}

function Send_Email() {
  var sEmail = "mailto:?Subject=" + sDomain + escape(" :: ");
  var sBody;
  var sTemp;
  var sTemp = sDomainPath.substr(sDomain.length,sDomainPath.length-sDomain.length);
  if (bServerTransfer) {
    sBody = "http://" + ofra.location.hostname + sTemp + "default.asp?"
  } else {
    sBody = "http://" + ofra.location.hostname + sTemp + "default.htm?"
  }

  if (ofra.name == 'mainPhotos') {
    sTemp = ofra.parent.frames[iFraIndex].sImg;
    if (sTemp.indexOf("_Small.htm") == -1) sTemp += "_Small.htm";
    sBody += "Gallery=" + ofra.parent.sGalleryPath + "/Frames.htm?IMG=" + sTemp;
    //sEmail += ofra.parent.sGalleryPath.replace(/\//g," / ") + " - " + ofra.sImg.replace("_Small.jpg","");
  } else {
    if (ofra.sGalleryPath == null) {
      if (parent.frames[iFraTopic].location.href.indexOf('addtocart.asp') != -1) {
        sBody = "";
        sEmail = "";
      } else if (sHelpFile != "" && parent.frames[iFraTopic].location.href.indexOf(sHelpFile) != -1) {
        sBody += "Gallery=" + sHelpFile;
        sEmail += "Help";
      } else if (sPolicyFile != "" && parent.frames[iFraTopic].location.href.indexOf(sPolicyFile) != -1) {
        sBody += "Gallery=" + sPolicyFile + "?Gallery=" + sGallery + "&sGalleryHref=" + sGalleryHref;
        sEmail += "Sales Policy";
      } else if (parent.frames[iFraTopic].location.href.indexOf("search.asp") != -1) {
        sBody += "Find=" + sSearchText;
        sEmail += "Search=" + sSearchText;
      } else if (parent.frames[iFraTopic].location.href.indexOf("pg-slideshow") != -1) {
        sBody = "";
        sEmail = "";
      } else if (parent.frames[iFraTopic].location.href.indexOf('MenuIndex.htm') != -1) {
        sBody += "Gallery=" + "Menu2/sitemap/" + sMI + "?SetMenu=false";
        sEmail += "Site Map";
      } else {
        sTemp = ofra.location.pathname.substr(sTemp.length,ofra.location.pathname.length-sTemp.length);
        sBody += "Gallery=" + escape(sTemp);
        //alert("Sorry, cannot send this page as email " + ofra.location.href);    
        //alert("Cannot send this page - \n" + parent.frames[iFraTopic].location.href);    
        //return;
      }
    } else {
      sBody += "Gallery=" + escape(ofra.sGalleryPath);
      if (ofra.location.href.indexOf('collage.aspx') != -1) {
        sBody += "/collage.aspx";
      }
      sEmail += escape(ofra.sGalleryPath.replace(/\//g," / "));
      top.location.href = sBody;
      return;
    }
  }
  if (sBody != "") {
    sBody = sBody.replace(/ /g,"%20");
    sBody = sBody.replace(/&/g,"%26");
    //sBody = sBody.replace(/'/g,"-ap-");
    sEmail = sEmail + "&Body=" + sBody;
    //window.open(sEmail);
    top.location.href = sBody;
  } else {
    alert("You cannot link to this page");
  }
}

function EditPage() {
  if (ofra.bEditable) {
    sEditHTML = ofra.document.body.innerHTML;
    parent.frames[iFraTopic].location.href = "../common/edit/dwi-edit.asp"
  } else {
    alert('This page cannot be Edited');
  }
}

function toggleMusic(bNewPage) {
  if (bNewPage) { 
    if (bMusicOn) {
      var oTM = ofra.document.getElementById('idtoggleMusic');
      oTM.src = sMenuDir + 'musicOn.gif';
    } else {
      ofra.document.getElementById('idtoggleMusic').src = sMenuDir + 'musicOff.gif';
    }
    return;
  }
  if (bMusicOn) {
    document.getElementById('idMusic').innerHTML = "";
    ofra.document.getElementById('idtoggleMusic').src = sMenuDir + 'musicOff.gif';
    bMusicOn = false;  
  } else {
    if (bgMusicLoop) {
      document.getElementById('idMusic').innerHTML = "<EMBED SRC='" + sBGMusic + "' HEIGHT='60' WIDTH='145' AUTOSTART='true' LOOP='true' repeat='true' HIDDEN='true' id='idMusic'></EMBED>";
    } else {
      document.getElementById('idMusic').innerHTML = "<EMBED SRC='" + sBGMusic + "' HEIGHT='60' WIDTH='145' AUTOSTART='true' LOOP='false' repeat='false' HIDDEN='true' id='idMusic'></EMBED>";
    }
    ofra.document.getElementById('idtoggleMusic').src = sMenuDir + 'musicOn.gif';
    bMusicOn = true;  
  }
}
function Index() {
  parent.location.replace(sMenuDir.substr(0,sMenuDir.length-6)+'default.htm?Gallery=' + ofra.sGalleryPath);
}
function LP(oThis, sTarget) {  //used from mouse over row
  var oA = oThis.getElementsByTagName('A')[0];

  var sStep = oA.href.substr(0,oA.href.lastIndexOf("/"));
  sStep = sStep.substr(sStep.lastIndexOf("/"),sStep.length-sStep.lastIndexOf("/"));
  RS(sStep);

  on_click(null,true,oA.href);
  if (sTarget == "" || sTarget == null) {
    try { 
      sTarget = oA.target;
    } catch(es) {}
  }
  if (sTarget == "" || sTarget == null || sTarget == 'fraTopic') {
    if (oA != null) parent.frames[iFraTopic].location.href = oA.href;
  } else if (sTarget == "_parent") {
    parent.location.href = oA.href;
  }
  setCookie("lastpage", oA.href);
}

function setCookie(name, value, expires, path, domain, secure) {
  if (name == "lastpage") {
    if (value.indexOf("MenuIndex.htm") == -1) {
      sEditPage = value;
      sRevertPage = ofra.sRevertPage;
    }
  }
  if (!bRememberLastPage) return;
  //var expires = new Date();
  //expires.setTime(expires.getTime() + 365 * 24 * 60 * 60 * 1000);
  value = escape(value);
  value = value.replace(/&/g,"%26");
  document.cookie= name + "=" + value +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
}
function getCookie(name)
{
  
  if (!bRememberLastPage) return;
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1)
  {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  }
  else
  {
    begin += 2;
  }
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
  {
    end = dc.length;
  }
  return unescape(dc.substring(begin + prefix.length, end));
}
function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function PrintPage() {
  ofra.focus();
 
  if (!window.print) {
    alert("A printable version of this page will open\nUse your normal print method to print it.\n\nYour computer does not support the standard window.print() method.\nSorry for the inconviencence");
    window.open(ofra.location.href);
  } else {
    ofra.print();
  }
}

function Load_ShoppingCart() {
    setTimeout('Load_ShoppingCart2()',100);
}
function Load_ShoppingCart2() {
  if (ofra.location.href.indexOf('pg-help') != -1 || ofra.location.href.indexOf('pg-sales-policy') != -1) {
    ofra.location.href = '../common/addtocart.asp?Review=true&sID=' + sSessionID;
  } else {
    ofra.location.href = '../common/addtocart.asp?Refer='+escape(ofra.location.href)+'&Review=true&sID=' + sSessionID;
  } 
}

function Load_Collage() {
  SlideShowToggle(false);
  if (parent.frames[iFraTopic].location.href.indexOf('MenuIndex.htm') != -1 && sHelpFile != "") {  //not on menuindex and help file exists
    Load_Help();
  } else if (parent.frames[iFraTopic].location.href.indexOf('MenuIndex.htm') != -1 && sEditPage != "") {  //not on menuindex and lastpage exists
    if (sEditPage.indexOf('http://') == -1 && sEditPage.indexOf('../') == -1) { 
      parent.frames[iFraTopic].location.href = "../" + sEditPage;
    } else {
      parent.frames[iFraTopic].location.href = sEditPage;
    }
    setCookie("lastpage",  sEditPage);
  } else if (bSiteMap && parent.frames[iFraTopic].location.href.indexOf('collage.htm') != -1) {  //sitemap exists & not on collage
    sGalleryPath = parent.frames[iFraTopic].sGalleryPath + "/"
    if (bTBFramed) {
      parent.frames[iFraTopic].location.href = "../Menu2/sitemap/" + sMI + "?SetMenu=false";
    } else {
      parent.frames[iFraTopic].location.href = sMenuDir + "sitemap/" + sMI + "?SetMenu=false";
    }
    setCookie("lastpage",  "Menu2/sitemap/" + sMI + "?SetMenu=false");
  } else if (parent.frames[iFraTopic].location.href.indexOf('addtocart.asp') != -1) {  //on cart
    parent.frames[iFraTopic].location.href = "../" + sEditPage;
    setCookie("lastpage",  sGalleryPath + "collage.htm");
  } else if (parent.frames[iFraTopic].location.href.indexOf('Frames.htm') != -1) {  //on image w/thumbs
    if (bGalleryEdit) {
      sGalleryPath = "dwi/db/" + parent.frames[iFraTopic].frames[iFraIndex].sGalleryPath.replace("/","_") + "_"
    } else {
      sGalleryPath = parent.frames[iFraTopic].frames[iFraIndex].sGalleryPath + "/"
    }
    if (parent.frames[iFraTopic].frames[iFraPhoto].location.href.indexOf("image.aspx") != -1) {
      sEditPage = sGalleryPath + "collage.aspx?SetMenu=false;";
      parent.frames[iFraTopic].location.href = "../" + sEditPage;
      setCookie("lastpage",  sEditPage);
    } else {
      parent.frames[iFraTopic].location.href = "../" + sGalleryPath + "collage.htm?SetMenu=false";
      setCookie("lastpage",  sGalleryPath + "collage.htm");
    }
  } else if (sCustSiteMap != "") {  //on menuindex and CustIndexPage exists
    parent.frames[iFraTopic].location.href = sCustSiteMap + "?SetMenu=false";
  } else if (parent.frames[iFraTopic].location.href.indexOf('collage.htm') != -1 || parent.frames[iFraTopic].location.href.indexOf('MenuIndex.htm') != -1) {  //on collage or menuindex
    parent.frames[iFraTopic].location.href = "../" + sGalleryPath + "Frames.htm?SetMenu=false";
    setCookie("lastpage",  sPath + "Frames.htm?SetMenu=false");
  } else if (bSiteMap) {  //sitemap exisits
    parent.frames[iFraTopic].location.href = "../Menu2/sitemap/" + sMI + "?SetMenu=false";
    setCookie("lastpage",  "Menu2/sitemap/" + sMI + "?SetMenu=false");
  }
}

function Load_Help(sPathIn) {
  SlideShowToggle(false);
  sPath = sPathIn;
  toff_addtocart();
  //toff_sendemail();
  setCookie("lastpage", "help/pg-help.htm");
  setTimeout('Load_Help2()',10);
}

function Load_Help2() {
  parent.frames[iFraTopic].location.href='../'+sHelpFile + "?Gallery=" + escape(sGallery) + "&GalleryHref=" + sGalleryHref;
}

function Load_Policy() {
  SlideShowToggle(false);
  setTimeout('Load_Policy2()',10);
}

function Load_Policy2() {
  ofra.window.location.href='../'+sPolicyFile + "?Gallery=" + escape(sGallery) + "&GalleryHref=" + sGalleryHref;
}

function Load_Search() {
  setTimeout('Load_Search2()',100);
  toff_addtocart();
  SlideShowToggle(false);
}
function Load_Search2() {
  var sQS = '?MainPhoto=False';
  sQS = "?MainPhoto=False&SearchText=" + sSearchText;
  if (bASPSearch) parent.frames[iFraTopic].location.href='../common/pg-search.asp'+sQS;
  else parent.frames[iFraTopic].location.href='../common/pg-searchCriteria.htm';
}

function ExpandSelectionOpen(bShow, bSUG) {
  if (!bSideMenu) return;
  iKnt = 0;
  //if (bESOInProgress == true) clearMenu();
  if (bAutoHide) HideAllDivs();
  bESOInProgress = true;
  sDiv1 = '';
  sDiv2 = '';
  sDiv3 = '';
  sDiv4 = '';
  sDiv5 = '';
  var oImg;
  if (sSUGTemp == "" || sSUGTemp == null) return;
  var sSUGs = sSUGTemp.split("|");
  try { document.getElementById('divMenu2Home').style.visibility='visible'; } catch(es) {}
  for(var i=0;i<sSUGs.length;i++) {
    sSUGs[i] = sSUGs[i].replace('%20',' ');
    if (sSUGs[i].substr(0,3) == 'col' || sSUGs[i].substr(0,3) == 'div') { 
      oDiv = window.document.getElementById(sSUGs[i]);
      if (sSUGs[i].substr(0,3) != 'div') {
        try { 
          oImg = oDiv.previousSibling.previousSibling.getElementsByTagName("IMG")[0];
          oImg.src = imgOpen.src;
        } catch(es) {}
        try { oDiv.style.position='relative'; } catch(es) {}
      } else {
        try { oDiv.style.position = 'absolute'; } catch(es) {}
      }
      iKnt = iKnt+1;
      if (iKnt==5) {
        sDiv5 = sSUGs[i];
	//iTOESO5 = setTimeout("ShowDivTO(5)",300); 
	ShowDivTO(5);
      } else if (iKnt==4) {
        sDiv4 = sSUGs[i];
	//iTOESO4 = setTimeout("ShowDivTO(4)",250); 
	ShowDivTO(4);
      } else if (iKnt==3) {
        sDiv3 = sSUGs[i];
	//iTOESO3 = setTimeout("ShowDivTO(3)",200); 
	ShowDivTO(3);
      } else if (iKnt==2) {
        sDiv2 = sSUGs[i];
	//iTOESO2 = setTimeout("ShowDivTO(2)",150); 
	ShowDivTO(2);
      } else {
        sDiv1 = sSUGs[i];
        //iTOESO1 = setTimeout("ShowDivTO(1)",100); 
	ShowDivTO(1);
      }
    }
  }
  setTimeout("try {document.getElementById(sDiv1).style.visibility='hidden'} catch(es) {}",0);
  setTimeout("try {document.getElementById(sDiv1).style.visibility='visible'} catch(es) {}",0);
  if (sDiv2 != '' && sDiv2 != null) {
    setTimeout("try {document.getElementById(sDiv2).style.visibility='hidden'} catch(es) {}",0);
    setTimeout("try {document.getElementById(sDiv2).style.visibility='visible'} catch(es) {}",0);
  }
  try {
    var oTbl = document.getElementById('tbl' + sSUGs[0].substr(3,sSUGs[0].length));
    oTbl.style.position = 'absolute';
    oTbl.style.visibility = 'visible';
  } catch(es) {}
  try {
    var oDivs = document.getElementById(sDiv1).getElementsByTagName("Div");
    if (oDivs[oDivs.length-1].id == "botMenu") {
      oDivs[oDivs.length-1].style.visibility='visible';
    }
  } catch(es) {}
  bESOInProgress = false;
  if (bShow) {
    iTemp = 0;
    while (document.getElementById(sSUGTemp).getElementsByTagName("A")[iTemp].href.indexOf('javascript') != -1) {
      iTemp += 1;
    }
    try { 
      parent.frames[iFraTopic].location.href = document.getElementById(sSUGTemp).getElementsByTagName("A")[iTemp].href + "?SetMenu=true" 
    } catch(es) {}
  }
}

function ShowDivTO(ioDiv) {
  var lDiv;
  switch (ioDiv) {
    case 1: lDiv = sDiv1; break;
    case 2: lDiv = sDiv2; break;
    case 3: lDiv = sDiv3; break;
    case 4: lDiv = sDiv4; break;
    case 5: lDiv = sDiv5; break;
    default: return;
  }
  try { document.getElementById(lDiv).style.visibility='visible'; } catch(es) {}
}

function clearMenu() {
  clearTimeout(iTOESO5);
  clearTimeout(iTOESO4);
  clearTimeout(iTOESO3);
  clearTimeout(iTOESO2);
  clearTimeout(iTOESO1);
  HideAllDivs();
}

function HideAllDivs() {
  if (!bSideMenu) return;
  var oImg;
  var bHide = true;
  var oCols = document.getElementsByTagName('DIV');
  for(var i=0;i<oCols.length;i++) {
    if (oCols[i].id != 'divMenu2Home') {
      if (oCols[i].id.substr(0,3) == 'col' || oCols[i].id.substr(0,3) == 'div' || oCols[i].id == "botMenu") {
        bHide = true;
        if (sSUGTemp == oCols[i].id) bHide = false;  
        //if (sSUGTemp.indexOf(oCols[i].id) != -1) bHide = false;  
        if (bHide == true) {
          oCols[i].style.position='absolute';
          oCols[i].style.visibility = 'hidden';
        }
        try {
          oImg = oCols[i].previousSibling.previousSibling.getElementsByTagName("IMG")[0];
          if (oImg.id != 'MB_TopLeft') {
            oImg.src = imgFold.src;
          }
        } catch(es) {}
      }
    }
  }
  var oCols = document.getElementsByTagName('TABLE');
  for(var i=0;i<oCols.length;i++) {
    if (oCols[i].id.substr(0,3) == 'tbl') {
      oCols[i].style.position='absolute';
      oCols[i].style.visibility = 'hidden';
      try {
        oImg = oCols[i].previousSibling.previousSibling.getElementsByTagName("IMG")[0];
        if (oImg.id != 'MB_TopLeft') {
          oImg.src = imgFold.src;
        }
      } catch(es) {}
    }
  }
  return;
}

function ES(oThis, sDiv, bShow, bParent) {
  var oNext
  if (!bParent) oThis = oThis.parentNode.parentNode;
  oDiv = document.getElementById(sDiv);
  if (oDiv == null) return;

  var oImg = oThis.getElementsByTagName('IMG')[0];
  oNext = oDiv;

  if (oDiv.style.visibility == 'hidden') {
    if (bOnSelectHideDivs) {
      var sDivTab = oDiv.parentNode.parentNode.parentNode.parentNode.parentNode.id;
      if (sDivTab == "") {  
        var sDivTab = oDiv.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id;
      }
      if (sDivTab != "") {  
        if (sDivTab.substr(0,3) == "div") {
          sSUGTemp = sDivTab;
          HideAllDivs();
        }
      }
    }
    if (bShow==true) ShowDivs(oNext, "");
    if (oDiv.id.substr(0,3) == "div") oDiv.style.position='absolute';
    else    oDiv.style.position='relative';

    if (iKnt==5) {
      sDiv5 = sDiv;
      setTimeout("ShowDivTO(5)",10); 
    } else if (iKnt==4) {
      sDiv4 = sDiv;
      setTimeout("ShowDivTO(4)",10); 
    } else if (iKnt==3) {
      sDiv3 = sDiv;
      setTimeout("ShowDivTO(3)",10); 
    } else if (iKnt==2) {
      sDiv2 = sDiv;
      setTimeout("ShowDivTO(2)",10); 
    } else {
      sDiv1 = sDiv;
      setTimeout("ShowDivTO(1)",10); 
    }
    try { oImg.src = imgOpen.src; } catch(es) {}
  } else {
    HideDivs(oNext);
    oDiv.style.position='absolute';
    setTimeout("oDiv.style.visibility='hidden'",1);
    try { oImg.src = imgFold.src; } catch(es) {}
  }
}

function ShowDivs(oNode) {
  var oImg;
  var oCols = oNode.getElementsByTagName('DIV');

  for(var i=0;i<oCols.length;i++) {
    if (oCols[i].id.substr(0,3) == 'col') {
      oCols[i].style.position='relative';
      oCols[i].style.visibility = 'visible';
      oImg = oCols[i].parentNode.getElementsByTagName("IMG")[0];
      try { oImg.src = imgOpen.src; } catch(es) {}
      break;
    }
  }
  return;
}
function HideDivs(oNode) {
  var oImg;
  var oCols = oNode.getElementsByTagName('DIV');
  for(var i=0;i<oCols.length;i++) {
    if (oCols[i].id.substr(0,3) == 'col') {
      oCols[i].style.position='absolute';
      oCols[i].style.visibility = 'hidden';
      oImg = oCols[i].parentNode.getElementsByTagName("IMG")[0];
      try { oImg.src = imgFold.src; } catch(es) {}
    }
  }
  return;
}
function setMenu(sSUGIn, iLeafIn, cookie) {
  var sTab;
//alert('setMenu ' + sSUGIn + ', ' + iLeafIn + ', ' + cookie);
  re = /\|ampersand\|/g;
  if (bSetMenu != "" && bSetMenu != "true") {
    sDivCollage = sDivCollage.replace(re,'&');
    if (sDivCollage.indexOf('|') != -1) sTab = sDivCollage.substr(3,sDivCollage.indexOf('|')-3);
    else sTab = sDivCollage.substr(3,sDivCollage.length-3);
    sSUGTemp = sDivCollage;
    if (bSetMenu == true || cookie == "t") { 
      HideAllDivs();
      bSDShowGal = true;
      bSDExpand = false;
      ShowDiv(sTab);
      setTimeout('ExpandSelectionOpen(true,true)',10);
      try { highlightMenu(eMenu[parseInt(iLeafCollage)]); } catch(es) {}
    }
    return;
  }
  if (bgMusic) toggleMusic(true);
  if (sSUGIn != null && iLeafIn != null) {
    sSUGTemp = sSUGIn;
    sSUGTemp = sSUGTemp.replace(re,'&');
    var iLeaf = iLeafIn;
  } else {
    sSUGTemp = ofra.document.getElementById('idNextImg').getAttribute("menupath");
    var iLeaf = ofra.document.getElementById('idNextImg').getAttribute("iLeaf");
  }
  j = parseInt(iLeaf);
  if (sSUGTemp!='') {
    var sSUGs = sSUGTemp.split("|");
    if (bPlusMinus == true && bAutoHide) HideAllDivs();
    sTab = sSUGs[0].replace("div","");

    if (bFind || parent.frames[iFraLogo].sLastDiv != sTab) {
      if (parent.frames[iFraLogo].sLastDiv != sTab) {
        HideAllDivs();
      }
      bSDShowGal = true;
      bSDExpand = true;
      parent.frames[iFraLogo].SelectTab(sTab);
    }
    iKnt = 0;
    if (sSUGTemp != '') {
      setTimeout('ExpandSelectionOpen(false,true)',50);
    }
  }
  try { highlightMenu(eMenu[parseInt(iLeaf)]); } catch(es) {}
  return;
}
function ShowDiv(sTabIn) {
  if (sTabIn == "") return;
  if (sTabIn.substr(0,3) == "div") sTabIn = sTabIn.substr(3,sTabIn.length-3);
  sSUGTemp = sTabIn;
  parent.frames[iFraLogo].ShowDiv(sSUGTemp,bSDShowGal,bSDExpand);
}


function RS(sStep, bTryAgain) {
  if (!bRecordHits) return;
  if (sSessionID == "") sSessionID = 'missing';
  sHref = sRecorderPath + 'sc-record-step.asp?Domain=' + sDomain + '&Step='+sStep+'&SessionID='+sSessionID
  setTimeout("parent.frames[iFraHidden].location.replace(sHref)",100);
}

function PrevImg(bFromImg, bChangeGal) {
  var sTemp;
  if (eMenu.length <= 0) eMenu = document.getElementsByTagName("A");
  if (bFromImg == null) bFromImg = false;
  if (bChangeGal == null) bChangeGal = true;
  SlideShowToggle(false);
  if (!bFromImg || (bFromImg == true && bChangeGal == true) ) {
    var sLastDiv = eMenu[j].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id;   
    if (sLastDiv == '') sLastDiv = eMenu[j].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id;
    if (sLastDiv == '') sLastDiv = eMenu[j].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id;
    j--;
    if (!bNoBullets) j--;
    try {
      if (eMenu[j].href.indexOf('#') != -1) { j--; }
      if (eMenu[j].href.indexOf('#') != -1) { j--; }
      if (eMenu[j].href.indexOf('#') != -1) { j--; }
    } catch(es) {}
    if (j<=-1) { j=eMenu.length-1; }
    var sNewDiv = eMenu[j].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id;
    if (sNewDiv == '') sNewDiv = eMenu[j].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id;
    if (sNewDiv == '') sNewDiv = eMenu[j].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id;
    if (sLastDiv!=sNewDiv) {
       bSetMenu = "true";
       bSDShowGal = false;
       bSDExpand = null;
       ShowDiv(sNewDiv);
    }   
    if (eMenu[j].href.indexOf('javascript') == -1 && (eMenu[j].href.indexOf(sCollage) != -1 || eMenu[j].href.indexOf('Frames.htm') != -1 || bHTMLNextPrev == true)) {
      if (bRecordHits==true) RS(eMenu[j].innerHTML);
      setCookie("lastpage", eMenu[j].href);
      if (eMenu[j].href.indexOf('&Leaf=') != -1) {
        iLeafCollage = j;
        sDivCollage = eMenu[j].href.substr(eMenu[j].href.indexOf('div'),eMenu[j].href.indexOf('&Leaf')-eMenu[j].href.indexOf('div'));
        bSetMenu = "false";
      } else {
        bSetMenu = "true";
      }
      highlightMenu(eMenu[j]);
      if (ofra.name=='mainPhotos') {  //Frames with Image
        if (eMenu[j].href.indexOf(sCollage) != -1) {
          sTemp = eMenu[j].href.substr(0,eMenu[j].href.indexOf(sCollage) + sCollage.length);
          sTemp = sTemp.replace(sCollage,'Frames.htm?IMG=Last');
          if (bImgSwap) {
            if (parent.frames[iFraTopic].frames[iFraPhoto].location.href.indexOf('video.htm') != -1) {
              parent.frames[iFraTopic].frames[iFraPhoto].location.href = "../common/image.htm";
            }
            sTemp = sTemp.replace("Frames.htm","index.htm");
            parent.frames[iFraTopic].frames[iFraIndex].location = sTemp;
          } else {
            setTimeout("parent.frames[iFraTopic].location = sTemp",50);
          } 
        } else {
          setTimeout('parent.frames[iFraTopic].location = eMenu[j].href',50);
        }
      } else if (parent.frames[iFraTopic].location.href.indexOf(sCollage) != -1) {  //Collage
        if (bFromImg == true) {
          sTemp = eMenu[j].href;
          sTemp = sTemp.substr(sTemp.indexOf("?IMG=")+5,sTemp.length);
          sTemp = eMenu[j].href.substr(0,eMenu[j].href.indexOf(sCollage + "?IMG=")) + sTemp;
          setTimeout("parent.frames[iFraTopic].location = sTemp",50);
        } else { 
          if (eMenu[j].target == '_blank') {
            window.open(eMenu[j].href.replace('Frames.htm',sCollage));
          } else {
            setTimeout("parent.frames[iFraTopic].location = eMenu[j].href.replace('Frames.htm',sCollage)",50);
          }
        }
      } else if (ofra.name == sFraTopic) { //Image (no thumbs)
        try {
          img = ofra.document.images["ActiveImg"];
          idPrev = img.getAttribute("idPrev");
        } catch(es) {
          if (eMenu[j].target == '_parent') {
            setTimeout("parent.location = eMenu[j].href.replace('Frames.htm',sCollage)",50);
          } else if (eMenu[j].target == '_blank') {
            window.open(eMenu[j].href.replace('Frames.htm',sCollage));
          } else {
            setTimeout("parent.frames[iFraTopic].location = eMenu[j].href.replace('Frames.htm',sCollage)",50);
          }
          return;
        }
        var sPath = eMenu[j].href.substr(0,eMenu[j].href.lastIndexOf("/")+1)
        if (idPrev == "Start") {
          var idPrevGalImg = img.getAttribute("idPrevGalImg");
          if (idPrevGalImg == "") {
            sTemp = sPath + sLastImg;
            setTimeout("parent.frames[iFraTopic].location = sTemp",50);
          } else {
            sTemp = sPath + idPrevGalImg.substr(0,idPrevGalImg.length-3) + "htm"
            setTimeout("parent.frames[iFraTopic].location = sTemp",50);
          }
        } else {
          sTemp = sPath + idPrev.substr(0,idPrev.length-3) + "htm"
          setTimeout("parent.frames[iFraTopic].location = sTemp",50);
        }
      }
    } else {
      PrevImg(bFromImg); 
    }
  } else {
    if (bImgSwap) {
      if (parent.frames[iFraTopic].frames[iFraPhoto].location.href.indexOf('video.htm') != -1) {
        parent.frames[iFraTopic].frames[iFraPhoto].location.href = "../common/image.htm";
      }
      parent.frames[iFraTopic].frames[iFraIndex].PrevImg();
    } else {
      parent.frames[iFraTopic].frames[iFraIndex].PrevImg();
    }
  }
  return;
}
function LoadPrevPage() {
  if (bImgSwap) {
    parent.frames[iFraTopic].frames[iFraIndex].PrevImg();
  } else {
    var sPath = ofra.location.href;
    var idImg = img.getAttribute("idimg");
    idImg = encodeURI(idImg);
    sPath = sPath.substring(0,sPath.length-idImg.length-1);
    var idPrev = ofra.document.images['ActiveImg'].getAttribute('idPrev');
    idPrev = sPath + idPrev.substring(0,idPrev.length-4)+'.htm';
    ofra.location.href=idPrev;
  }
}

function NextImg(bFromImg, bChangeGal) {
  var sTemp;
  if (eMenu.length <= 0)  eMenu = document.getElementsByTagName("A");
  if (bFromImg == null) bFromImg = false;
  if (bChangeGal == null) bChangeGal = true;
  SlideShowToggle(false);
  if (!bFromImg || (bFromImg && bChangeGal) ) {
    var sLastDiv = eMenu[j].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id;   
    if (sLastDiv == '') sLastDiv = eMenu[j].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id;
    if (sLastDiv == '') sLastDiv = eMenu[j].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id;
    if (sLastDiv == '') sLastDiv = eMenu[j].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id;
    if (sLastDiv == '') sLastDiv = eMenu[j].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id;
    j++;
    if (!bNoBullets) j++;
    if (j>=eMenu.length) j=0;
    try {
      if (eMenu[j].href.indexOf('#') != -1) { j++; }
      if (eMenu[j].href.indexOf('#') != -1) { j++; }
      if (eMenu[j].href.indexOf('#') != -1) { j++; }
    } catch(es) {}
    var sNewDiv = eMenu[j].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id;
    if (sNewDiv == '') sNewDiv = eMenu[j].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id;
    if (sNewDiv == '') sNewDiv = eMenu[j].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id;
    if (sNewDiv == '') sNewDiv = eMenu[j].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id;
    if (sNewDiv == '') sNewDiv = eMenu[j].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id;
    if (sLastDiv!=sNewDiv) {
       bSetMenu = "true";
       bSDShowGal = false;
       bSDExpand = null;
       ShowDiv(sNewDiv);
    }
    if (eMenu[j].href.indexOf('javascript') == -1 && (eMenu[j].href.indexOf(sCollage) != -1 || eMenu[j].href.indexOf('Frames.htm') != -1 || bHTMLNextPrev == true)) {
      if (bRecordHits==true) RS(eMenu[j].innerHTML);
      setCookie("lastpage", eMenu[j].href);
      if (eMenu[j].href.indexOf('&Leaf=') != -1) {
        iLeafCollage = j;
        sDivCollage = eMenu[j].href.substr(eMenu[j].href.indexOf('div'),eMenu[j].href.indexOf('&Leaf')-eMenu[j].href.indexOf('div'));
        bSetMenu = "false";
      } else {
        bSetMenu = "true";
      }
      highlightMenu(eMenu[j]);
      if (ofra.name=='mainPhotos') {
        if (eMenu[j].href.indexOf(sCollage) != -1) {
          if (bImgSwap) {
            if (parent.frames[iFraTopic].frames[iFraPhoto].location.href.indexOf('video.htm') != -1) {
              parent.frames[iFraTopic].frames[iFraPhoto].location.href = "../common/image.htm";
            }
            parent.frames[iFraTopic].frames[iFraIndex].location = eMenu[j].href.replace(sCollage,'index.htm');
          } else {
            setTimeout("parent.frames[iFraTopic].location = eMenu[j].href.replace(sCollage,'Frames.htm')",50);
          }
        } else {
          setTimeout('parent.frames[iFraTopic].location = eMenu[j].href',50);
        }
      } else {
        if (bFromImg == true) {
          sTemp = eMenu[j].href;
          if (eMenu[j].href.indexOf(sCollage) != -1 || eMenu[j].href.indexOf('Frames.htm') != -1) {
            sTemp = sTemp.substr(sTemp.indexOf("?IMG=")+5,sTemp.length);
            sTemp = eMenu[j].href.substr(0,eMenu[j].href.indexOf(sCollage + "?IMG=")) + sTemp;
          }
          setTimeout("parent.frames[iFraTopic].location = sTemp",50);
        } else { 
          if (eMenu[j].target == '_parent') {
            setTimeout("parent.location = eMenu[j].href.replace('Frames.htm',sCollage)",50);
          } else if (eMenu[j].target == '_blank') {
            window.open(eMenu[j].href.replace('Frames.htm',sCollage));
          } else {
            setTimeout("parent.frames[iFraTopic].location = eMenu[j].href.replace('Frames.htm',sCollage)",50);
          }
        }
      }
    } else {
      NextImg(bFromImg); 
    }
  } else {
    if (bImgSwap) {
      if (parent.frames[iFraTopic].frames[iFraPhoto].location.href.indexOf('video.htm') != -1) {
        parent.frames[iFraTopic].frames[iFraPhoto].location.href = "../common/image.htm";
      }
      parent.frames[iFraTopic].frames[iFraIndex].NextImg();
    } else {
      parent.frames[iFraTopic].frames[iFraIndex].NextImg();
    }
  }
  return;
}
function LoadNextPage() {
  if (bImgSwap) {
    parent.frames[iFraTopic].frames[iFraIndex].NextImg();
  } else {
    var sPath = ofra.location.href;
    var idImg = img.getAttribute("idimg");
    idImg = encodeURI(idImg);
    sPath = sPath.substring(0,sPath.length-idImg.length);
    var idNext = ofra.document.images['ActiveImg'].getAttribute('idNext');
    idNext = sPath + idNext.substring(0,idNext.length-4)+'.htm';
    ofra.location.href=idNext;
  }
}
function ton_SlideShow(bLocal) {
  if (bLocal != null) {
    try { 
      ofra.document.images['idSlideShow'].src = "../Menu2/" + 'slideshow-anim.gif';
    } catch(es) {}
  } else {
    try { 
      ofra.document.images['idSlideShow'].src = sMenuDir + 'slideshow-anim.gif';
    } catch(es) {}
  }
}
function toff_SlideShow() {
  try { 
    ofra.document.images['idSlideShow'].src = sMenuDir + 'slideshow.gif';
  } catch(es) {
  }
}

function ton_Cart() {
  bCartEmpty = false;
  try { 
    parent.frames[iFraTB].document.images['idShop'].style.visibility = 'visible';
    if (bShopText) {
      parent.frames[iFraTB].document.getElementById('idCheckout').style.visibility = 'visible';
    }
  } catch(es) {}
}
function toff_cart() {
  try { 
    if ((bImgSwap && ofra.name == 'mainPhotos') || bTBFramed) sTemp = "../Menu2/";
    else sTemp = ofra.sMenuDir;
    parent.frames[iFraTB].document.images['idShop'].style.visibility = 'hidden';
    if (bShopText) { 
      parent.frames[iFraTB].document.getElementById('idCheckout').style.visibility = 'hidden';
    }
  } catch(es) {}
}
function ton_addtocart() {
  try { 
    if ((bImgSwap && ofra.name == 'mainPhotos') || bTBFramed) sTemp = "../common/";
    else sTemp = ofra.sDir;
    parent.frames[iFraTB].document.images['idAddtoCart'].src = sTemp + 'addtocart.gif';
    if (bShopText) parent.frames[iFraTB].document.getElementById('idAddtoCartText').innerHTML = 'Add to Cart';
  } catch(es) {}
}
function toff_addtocart() {
  try { 
    if ((bImgSwap && ofra.name == 'mainPhotos') || bTBFramed) sTemp = "../common/";
    else sTemp = ofra.sDir;
    parent.frames[iFraTB].document.images['idAddtoCart'].src = sTemp + 'blank.gif';
    if (bShopText) parent.frames[iFraTB].document.getElementById('idAddtoCartText').innerHTML = '';
  } catch(es) {}
}
function ton_sendemail() {
  try { 
    if ((bImgSwap && ofra.name == 'mainPhotos') || bTBFramed) sTemp = "../Menu2/";
    else sTemp = ofra.sMenuDir;
    parent.frames[iFraTB].document.images['idSend'].src = sTemp + 'sendemail.gif';
    if (bShopText) parent.frames[iFraTB].document.getElementById('idSendText').innerHTML = 'Send';
  } catch(es) {}
}
function toff_sendemail() {
  try { 
    if ((bImgSwap && ofra.name == 'mainPhotos') || bTBFramed) sTemp = "../Menu2/";
    else sTemp = ofra.sMenuDir;
    parent.frames[iFraTB].document.images['idSend'].src = sTemp + 'blank.gif';
    if (bShopText) parent.frames[iFraTB].document.getElementById('idSendText').innerHTML = '';
  } catch(es) {}
}
function SlideShowToggle(bOn, bLocal) {
  if (bOn==false) {
     bSlideShowOn = false;
     toff_SlideShow();
     return;
  }
  if (ofra.location.href.indexOf('pg-slideshow') != -1) return;
  if (!bSlideShowOn) {
    toff_addtocart();
    setTimeout("Load_SlideShow()",100);
    UpdateSlideShow();
    return true;
  } else {
    toff_SlideShow();
    //setTimeout('toff_SlideShow()',500);
    bSlideShowOn = !bSlideShowOn;
    SlideShow(true,false,false);
    return false;
  }
}
function Load_SlideShow() {
  parent.frames[iFraTopic].location.href = "pg-slideshow.htm";
}
function UpdateSlideShow() {
  try {
    setTimeout('ofra.document.frmSlideShow.tbxSlideShow.value = iDelay', 500);
    setTimeout('ofra.document.frmSlideShow.tbxSlideShow.select()',700);
  } catch(es) {}
}
function StartSlideShow() {
  if (ofra.name == 'mainPhotos') {
    var sRtn = parent.frames[iFraTopic].frames[iFraPhoto].document.frmSlideShow.tbxSlideShow.value;
  } else {
    var sRtn = ofra.document.frmSlideShow.tbxSlideShow.value;
  }
  if (sRtn == null || sRtn == "") {
    bSlideShowOn = false;
    return false;
  }
  if (isNaN(sRtn)==true) {
    alert(sRtn + ' is not a Number');
    bSlideShowOn = false;
    return false;
  }
  i=0;
  iDelay = sRtn;
  eMenu = document.getElementsByTagName("A");
  bSlideShowOn = true;
  //ofra.document.images['idSlideShow'].src = "../Menu2/slideshow-anim.gif";
  SlideShow(true,false,false);
}

var bStartUp = true;
var iKnt2 = 0;
function SlideShow(bStart, bGetImages, bGetNextGallery) {
//alert('ss ' + j);
  var sImgRaw;
  var sPath;
  var k = j;
  //alert('bStart = ' + bStart + '  bGetImages = ' + bGetImages + '  bGetNextGallery = ' + bGetNextGallery);
  var sHref;
  if (bSlideShowOn==false) {
    clearTimeout(iTimeout);
    return; 
  }
  if (bStart==true) {
    //ofra.location.href = eMenu[j].href;
    setTimeout('ton_SlideShow()',100);
    iTimeout = setTimeout('SlideShow(false,true,true)',100);
    return;
  }
  if (bGetImages==true) {
    try {
      if (ofra.name == 'mainPhotos') {
        oImgs = parent.frames[iFraTopic].frames[iFraIndex].document.getElementsByTagName("img");
      } else {
        oImgs = ofra.document.getElementsByTagName("img");
      }
      bImgs = true;
      sImgs.length = oImgs.length;
      iKnt2 = 0;
      for(var l=0;l<oImgs.length;l++) {
         try {
            sImgRaw = oImgs[l].getAttribute('Frame');
            if (sImgRaw != null) {
               sPath = oImgs[l].src;
               for (var m=sPath.length-1;m>0;m--) {
                  if (sPath.substr(m,1) == "/") {
                     sPath = sPath.substr(0,m+1);
                     break;
                  }
               }
               sImgs[iKnt2] = sPath + sImgRaw;
               iKnt2 += 1;
            }
         } catch(es) {
            bImgs = false;
         } 
      }
    } catch(es) {
      bImgs = false;
    }
    if (j==0) j=1; 
    if (eMenu[j-1].href.indexOf('Frames.htm') != -1) i++;
  }
  if (bImgs==false || bGetNextGallery==true) { //change gallery
//alert('change gallery ' + j);
    if (j>=eMenu.length) {
      j=0;
      sHref = eMenu[j].href;
      if (sHref.indexOf('#') != -1 || sHref.indexOf('javascript:') != -1) j++;
    } else {
      if (bStartUp == false && bGetNextGallery==true) {
        j++;
        if (j>=eMenu.length) {
          j=0;
          sHref = eMenu[j].href;
          if (sHref.indexOf('#') != -1 || sHref.indexOf('javascript:') != -1) j++;
        }
      } else {
        bStartUp = false;
      }
    }
    if (eMenu[j].href.indexOf('#') != -1 || eMenu[j].href.indexOf('javascript:') != -1) j++;
    i=0;
    sHref = eMenu[j].href;
    try {
      if (ofra.name == 'mainPhotos') {
        parent.frames[iFraTopic].location.href = sHref;
      } else {
        ofra.location.href = sHref; 
      }
    } catch(es) {
      parent.frames[iFraTopic].location.href = sHref;
    }
    setTimeout('ton_SlideShow()',10);
    if (eMenu[j].href.indexOf(sCollage) != -1 || eMenu[j].href.indexOf('Frames.htm') != -1) {
      iTimeout = setTimeout("SlideShow(false,true,false)",iDelay*1000);
    } else {
      iTimeout = setTimeout("SlideShow(false,false,true)",iDelay*1000);
    }  

    if (j==eMenu.length) j=2;
    var sNewDiv = eMenu[j].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id;
    if (sLastDiv!=sNewDiv) {
       bSDShowGal = false;
       bSDExpand = null;
       ShowDiv(sNewDiv);
       //parent.frames[iFraLogo].ShowDiv(sNewDiv.substr(3,sNewDiv.length),false,false,"Select");
    }   
    highlightMenu(j);
    sLastDiv = eMenu[j].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id;   
    j++;
    return;

  } else {  // ****************************************** change photo
//alert('change photo');
    if (sImgs.length==1 && i==1) i=0;
    if (i>0) {
      if (sImgs[i].indexOf('Frames.htm?IMG=') != -1 ) {
        sImg = sImgs[i].substr(0,sImgs[i].indexOf('Frames.htm?IMG='));
        sImg += sImgs[i].substr(sImgs[i].indexOf('Frames.htm?IMG=')+15,sImgs[i].length);
        sImgs[i] = sImg;
      }    
    }
    if (sImgs[i].indexOf(sCollage) != -1 ) {
      i++;
      if (iKnt2==i) {
        iTimeout = setTimeout("SlideShow(false,false,true)",10);
        return;
      } else { 
        iTimeout = setTimeout("SlideShow(false,false,false)",10);
        return;
      }
    }
    if (i<=0) {
      parent.frames[iFraTopic].location.href = sImgs[i];
    } else {
      if (bImgSwap || sImgs[i].toUpperCase().indexOf(".MOV") != -1 || sImgs[i].toUpperCase().indexOf(".WMV") != -1)  {
        parent.frames[iFraTopic].frames[iFraIndex].NextImg();
      } else {
        ofra.location.href = sImgs[i];
      }
      setTimeout('HighlightImg()',100);
    }
  }
  i++;
  setTimeout('ton_SlideShow()',100);
  if (iKnt2==i) {
    iTimeout = setTimeout("SlideShow(false,false,true)",iDelay*1000);
    return;
  } else { 
    iTimeout = setTimeout("SlideShow(false,false,false)",iDelay*1000);
    return;
  }
}

function HighlightImg() {
  try {
    var oAs = parent.frames[iFraTopic].frames[iFraIndex].document.getElementsByTagName("A");
    var oImgs = parent.frames[iFraTopic].frames[iFraIndex].document.getElementsByTagName("IMG");
    parent.frames[iFraTopic].frames[iFraIndex].HighlightImg(oImgs[i-1], true);
    parent.frames[iFraTopic].frames[iFraIndex].j=i-1;
  } catch(es) {
    setTimeout('HighlightImg()',100);
    return;
  } 
}

var cur;
var iLastHover;
function mouse_over(e) {
  if (bAutoScroll) if (myspeed != 0) return;
  cur=ns6? e.target : event.srcElement;
  if (cur.nodeName == "SPAN") cur = cur.parentNode;
  if (cur.nodeName == "B") cur = cur.parentNode;
  iLastHover = null;
  for(var i=0;i<eMenu.length;i++) {
    if (eMenu[i].href == cur.href) {
      iLastHover=i;
    }
  }   
  if (iLastHover != null) {
    highlightMenu(iLastHover, "Over");
  }
  return;
}
function mouse_out() {
  if (iLastHover != null) {
    if (j != iLastHover) {
      highlightMenu(iLastHover, "Out");
    }
  }
  return;
}

function highlightMenu(eM, sAction) {
  var k;
  if (isNaN(eM)==true) {
    cur=eM;
    if (cur == null) return;
    for(var i=0;i<eMenu.length;i++) {
      if (eMenu[i].href == cur.href) {
        k=i;
        if (sAction==null) j=i;
      }
    }   
  } else {
    k=eM;
    if (sAction==null) j=eM;
  }
  if (sAction == "Over") {
    eMenu[k].style.color = sColorOver;
    if (bHLRow == true) { 
      eMenu[k].parentNode.parentNode.parentNode.style.backgroundColor = sHighLightColor;
    } else {
      eMenu[k].style.backgroundColor = sHighLightColor;
    }
    return;
  }
  if (sAction == "Out") {
if (k-1!=j) {  
    eMenu[k].style.color = sColorOut;
    if (bHLRow == true) { 
      eMenu[k].parentNode.parentNode.parentNode.style.backgroundColor = "";
    } else {
      eMenu[k].style.backgroundColor = "";
    }
}
    return;
  }
  for(i=0;i<eMenu.length;i++) {
    if (i==j-1 && sAction == "Over") {
    } else {
      if (bCSSa != true) {
        eMenu[i].style.color = sColorOut;
        if (bBoldOnSelect != true) eMenu[i].style.fontWeight = 'normal';
      }
      if (bHighLightMenuItem == true) {
        if (bHLRow == true) {
          eMenu[i].parentNode.parentNode.parentNode.style.backgroundColor = "";
        } else {
          eMenu[i].style.backgroundColor = "";
        }
      }
    }
  }
  if (sAction != "Out") {
    var sColor = sColorOn;
    if (sAction = "Over") sColor = sColorOver;
    try {
      if (bCSSa != true) {
        eMenu[k].style.color = sColor;
        if (bBoldOnSelect) eMenu[k].style.fontWeight = 'bold';
      }
      if (bHighLightMenuItem == true) {
        if (bHLRow == true) { 
          eMenu[k].parentNode.parentNode.parentNode.style.backgroundColor = sHighLightColor;
        } else {
          eMenu[k].style.backgroundColor = sHighLightColor;
        }
      }
    } catch(es) {} 
    eMenu[k].scrollIntoView(false);
  }
  return;
}

function on_click(e,bFromHL,sHrefIn) {
  var bPar = false;
  var bParentHasImgs = false;
  var sHref;
  try {SlideShowToggle(false);} catch(es) {}
  if (bFromHL) {
    sHref = sHrefIn;
  } else {
    cur=ns6? e.target : event.srcElement;
    if (cur.href == null) return;
    if (cur.href.indexOf('#') != -1) return;
    if (cur.href.indexOf('javascript') != -1) return;
    if (cur.parentNode.parentNode.bParentHasImgs == 'true') {  //Camping
       bParentHasImgs = true;
       cur = cur.parentNode.parentNode;
    }
    sHref = cur.href;
  }
  for(var i=0;i<eMenu.length;i++) {
    if (eMenu[i].href == sHref && eMenu[i].innerHTML.toUpperCase().indexOf('IMG') == -1) {
      if (eMenu[i].href.indexOf('#') != -1) bPar = true;
      j=i;
      break;
    }
  }   
  for(i=0;i<eMenu.length;i++) {
    if (bCSSa != true && bPar == false) {
      eMenu[i].style.color = sColorOut;
      if (bBoldOnSelect) eMenu[i].style.fontWeight = 'normal';
    }
    if (bHighLightMenuItem == true && bPar == false) {
      if (bHLRow == true) 
        eMenu[i].parentNode.parentNode.parentNode.style.backgroundColor = "";
      else
        eMenu[i].parentNode.style.backgroundColor = "";
    }
  }
  try {
    if (bCSSa != true) {
      eMenu[j].style.color = sColorOn;
      if (bBoldOnSelect) eMenu[j].style.fontWeight = 'bold';
    }
    if (bHighLightMenuItem == true) {
      if (bHLRow == true) 
        eMenu[j].parentNode.parentNode.parentNode.style.backgroundColor = sHighLightColor;
      else
        eMenu[j].parentNode.style.backgroundColor = sHighLightColor;
    }
  } catch(es) {} 
}
