﻿<!--
var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=getFFVersion>=0.1? 16 : 0 
function soQHi(iframename) {
  var pTar = null;
  if (document.getElementById){
    pTar = document.getElementById(iframename);
  }
  else{
    eval('pTar = ' + iframename + ';');
  }
  if (pTar && !window.opera){
    pTar.style.display="block"
    if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight){
      pTar.height = pTar.contentDocument.body.offsetHeight+FFextraHeight; 
    }
    else if (pTar.Document && pTar.Document.body.scrollHeight){
      pTar.height = pTar.Document.body.scrollHeight;
    }  }
	if(document.all){
var sub=pTar.contentDocument ? pTar.contentDocument:pTar.contentWindow.document;   
 if(pTar!=null&&sub!=null){pTar.height=sub.body.scrollHeight;}
 }
 reinitIframe(pTar);
 }

function reinitIframe(iframe){
try{ 
var bHeight = iframe.contentWindow.document.body.scrollHeight; 
var dHeight = iframe.contentWindow.document.documentElement.scrollHeight; 
var height = Math.max(bHeight, dHeight); 
iframe.height = height; 
}catch (ex){} 
} 

	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];}
}
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 chbg(col)
{
document.cookie= "HBG="+col;
}
function achbg(bgbg)
{
document.body.style.background=bgbg;
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function hotkeystart()
{
hotstar=document.getElementById("hotkey");
hotstar.direction="right";
hotstar.behavior="scroll";
hotstar.start();
}
function hotkeystartr()
{
hotstar=document.getElementById("hotkey");
hotstar.direction="left";
hotstar.behavior="scroll";
hotstar.start();
}
function hotkeystop()
{
hotstop=document.getElementById("hotkey");
hotstop.stop();
}
function checkfill()
{
str = document.form1.skwd.value;
  var re=/[\"\'\&\#\$\^\<\>\*\/\~\`\%\+\=]+/ig
  if(str==""){alert("未填搜尋文字,KEYWORDS??NULL");
    document.form1.skwd.focus();
  return false;
  }
  if(re.test(str)){alert("PLEASE DON'T KEY ALPHANUMERIC[不能輸入特殊字元]");
  document.form1.skwd.focus();
  return false;
  }
  else
  {form1.submit();}}
  var tCmg = "logo.gif";
  function errorTmg(X, Y) {
  if (Y == null) {
    X.src = tCmg;
  }
  else {
    X.src = Y;
  }
}
function clearLinkDot() {
   var i, a, main;
   for(i=0; (a = document.getElementsByTagName("a")[i]); i++) {
      if(     a.getAttribute("onFocus")==null) {
         a.setAttribute("onFocus","this.blur();");
      }else{
         a.setAttribute("onFocus",a.getAttribute("onFocus")+";this.blur();");
       }
      a.setAttribute("hideFocus","hidefocus");
   }
} 
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function ShowDiv(objID,ev){
		var InternetExplorer = document.all?true:false;
		if (!InternetExplorer) document.captureEvents(Event.MOUSEMOVE);
		var intX = 0,intY = 0;
		//if (InternetExplorer) {
		ev = ev?ev:(window.event?window.event:null);
		if(ev.pageX || ev.pageY){
			intX = ev.pageX;
			intY = ev.pageY;
		}
		else{
			intX = ev.clientX +  document.body.scrollLeft;
			intY = ev.clientY +  document.body.scrollTop ;
		}
		//}
		if(intX < 0) {intX = 0;}
		if(intY < 0) {intY = 0;}	
		intX = intX + 20;
		if(intX > screen.availWidth - 130) {intX = (screen.availWidth - 160);}
		objID.style.left = intX;
		objID.style.top = intY;
		MM_showHideLayers(objID,'','show');
	}
	
function popmenu(tableName){
	if (tableName.style.display=="none"){
	tableName.style.display="block";
	}else{
	tableName.style.display="none";
	}
}
function popmenuc(tableName,noD){
for (i=0;i<noD;i++){document.getElementById("menu" + i).style.display = "none";}
if (tableName.style.display=="none"){tableName.style.display="block"	;}
}

function homegotosh(z,w,s)
{
document.getElementById('form1').action= z;
document.getElementById('Submitsh').value=w;
for (i=1;i<9;i++){document.getElementById("a"+ i).className="at2";}
document.getElementById(s).className="at1";
checkfill();
}

function centerWindow(theURL,winName,width,height,features) {
	var staytime=document.fm0.time_spent.value;
	theURL=theURL+"&stime="+staytime;
    var window_width = width;
    var window_height = height;
    var edfeatures= features;
    var window_top = (screen.height-window_height)/2;
    var window_left = (screen.width-window_width)/2;
    newWindow=window.open(''+ theURL + '',''+ winName + '','width=' + window_width + ',height=' + window_height + ',top=' + window_top + ',left=' + window_left + ',features=' + edfeatures + '');
    newWindow.focus();
}
  if(navigator.cookieEnabled==false){alert('本站需要存取您的Cookies,請打開cookies覆寫');window.open('http://w2.hwc.edu.tw/digihwc/check_cookies/check_cookies.htm');}

function calendarsendRequest(url){
document.getElementById('calendar').innerHTML="<center><img src=mydate/ajax-loader.gif><br>載入中...</center>";
	createXHRC();
	url+='&ts='+new Date().getTime();
	cxmlHttp.open('GET',url,true);
	cxmlHttp.onreadystatechange=catchResultcalendar;
	cxmlHttp.send(null);
}
var cxmlHttp;
function createXHRC(){
	if (window.XMLHttpRequest) {
		cxmlHttp = new XMLHttpRequest();
	}else if (window.ActiveXObject) {
		cxmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}

	if (!cxmlHttp) {
		alert('您使用的瀏覽器不支援 XMLHTTP 物件');
		return false;
	}
}
function catchResultcalendar(){
	if (cxmlHttp.readyState==4){
		if (cxmlHttp.status == 200) {
			document.getElementById('calendar').innerHTML=cxmlHttp.responseText;
			}else{
			var msg='<strong>'+cxmlHttp.status+':</strong><br/>'+cxmlHttp.statusText;
			document.getElementById('calendar').innerHTML=msg;
		}}}
//-->