﻿
//iframe 高度宽度自适应 start
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; 
	  //pTar.width = pTar.contentDocument.body.offsetHeight+FFextraWidth; 
    }
    else if (pTar.Document && pTar.Document.body.scrollHeight){
      //ie5+ syntax
      pTar.height = pTar.Document.body.scrollHeight;
	  //pTar.width = pTar.Document.body.scrollWidth;
    }
  }
}
//iframe 高度宽度自适应 end


 function ReImgSize(){
	  //alert (document.images.length);
  for (i=0;i<document.images.length;i++)
   {
	  //alert (document.images.length);
	if (document.images[i].src.search("buttonBack.gif") == -1) if (document.all){
	   //alert ("OK")
       document.images[i].outerHTML='<a href="'+document.images[i].src+'" target="_blank" title="在新窗口打开图片">'+document.images[i].outerHTML+'</a>';
   }
  else{
	  document.images[i].title="在新窗口打开图片"
	  document.images[i].style.cursor="pointer"
	  document.images[i].onclick=function(e){window.open(this.src)}
  }
  }
 }


 function which_page(){
   var ss;                         // 声明变量。
   var s = top.location.href;
   //ss= s.lastIndexOf("n");
   ss = s.substring(s.lastIndexOf("."),s.lastIndexOf("/")+1);   // 取子字符串。
   return(ss);                     // 返回子字符串。
   //alert (ss);
}
//alert (which_page());
pages = which_page();
if (pages != "index")
{
	window.onload = function(){ReImgSize();MM_preloadcalendar();}
}
else
{
	window.onload = function(){MM_preloadcalendar();}
	
	}
