// JScript 文件

var xmlHttp;
function createXHR(){
	if (window.XMLHttpRequest) {
		xmlHttp = new XMLHttpRequest();
	}else if (window.ActiveXObject) {
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}

	if (!xmlHttp) {
		alert('您使用的瀏覽器不支援 XMLHTTP 物件');
		return false;
	}
}

function sendRequest(url){
	createXHR();
	url+='?ts='+new Date().getTime();
	xmlHttp.open('GET',url,true);
	xmlHttp.onreadystatechange=catchResult;
	xmlHttp.send(null);
}

function catchResult(){
	if (xmlHttp.readyState==4){
		if (xmlHttp.status == 200) {
			document.getElementById('tabContent').innerHTML=xmlHttp.responseText;
    		}else{
			var msg='<strong>'+xmlHttp.status+':</strong><br/>'+xmlHttp.statusText;
			document.getElementById('tabContent').innerHTML=msg;
		}
	}
}

function loadTab(obj,url,ly){
	//建立載入畫面
//	var tab=document.getElementById('tabContent');
//	tab.innerHTML='<img src="images/Loading.gif" width="16" height="16" align="absmiddle" /> Loading...';

	//將 Tab 標籤樣式設成 Blur 型態
	var tabsF=document.getElementById('tabsF').getElementsByTagName('li');
	for (var i=0;i<tabsF.length;i++){
		tabsF[i].setAttribute('id',null);
	}

	//變更分頁標題樣式
	obj.parentNode.setAttribute('id','current');
showDivs(ly);
	//啟動AJAX
//	setTimeout('sendRequest(\''+url+'\')',500);
}

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 show_name(){
    var obj=document.all ("File1");
    var obj2=document.all("mytext");
    var str=(obj.value).substring((obj.value).lastIndexOf("\\")+1);
    obj2.value=str;
   
    }
    
    
function TABLE1_onclick() {

}

function showDivs(fromwhich){
    var div1=document.getElementById ("Layer1");
     var div2=document.getElementById ("Layer2");
     if(fromwhich=="1"){
        div1.style.visibility="visible";
        div2.style.visibility="hidden";
     }
     else if(fromwhich=="2"){
        div2.style.visibility="visible";
        div1.style.visibility="hidden";
     }

 }   


