//******************************* For Hover images
//******************************* sd_all.htm
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//******************************* For iframe Scroll
var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
//extra height in px to add to iframe in FireFox 1.0+ browsers
var FFextraHeight=getFFVersion>=0.1? 16 : 0 

function dyniframesize(iframename) {
  var pTar = null;
  if (document.getElementById){
    pTar = document.getElementById(iframename);
  }
  else{
    eval('pTar = ' + iframename + ';');
  }
  if (pTar && !window.opera){
    //begin resizing iframe
    pTar.style.display="block"
    
    if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight){
      //ns6 syntax
      pTar.height = pTar.contentDocument.body.offsetHeight+FFextraHeight; 
    }
    else if (pTar.Document && pTar.Document.body.scrollHeight){
      //ie5+ syntax
      pTar.height = pTar.Document.body.scrollHeight;
    }
  }
}
//******************************* For icon 
//function mmLoadMenus() {
//  if (window.mm_menu_0410110030_0) return;
//  window.mm_menu_0410110030_0 = new Menu("root",76,18,"",12,"#993333","#990000","#FFEEDF","#FFD89D","center","middle",3,0,100,-5,7,true,true,true,0,true,true);
//  mm_menu_0410110030_0.addMenuItem("道院宗旨","window.open('#', '_self');");
//  mm_menu_0410110030_0.addMenuItem("祀奉主神","window.open('#', '_self');");
//  mm_menu_0410110030_0.addMenuItem("神蹟顯像","window.open('#', '_self');");
//  mm_menu_0410110030_0.addMenuItem("地理位置","window.open('#', '_self');");
//  mm_menu_0410110030_0.addMenuItem("玄德團隊","window.open('#', '_self');");
//   mm_menu_0410110030_0.hideOnMouseOut=true;
//   mm_menu_0410110030_0.bgColor='#FFFFFF';
//   mm_menu_0410110030_0.menuBorder=1;
//   mm_menu_0410110030_0.menuLiteBgColor='#FFFFFF';
//   mm_menu_0410110030_0.menuBorderBgColor='#993333';

//mm_menu_0410110030_0.writeMenus();
//}