//跳出一個新視窗    
//日期視窗
var gDate;
function selDate(clickobj) {
  gDate = clickobj;
  calwin = window.open('USH0007.htm','Calendar','top=270,left=350,width=215, height=160, toolbar=no, location=no, directories=no, status=no, menubar=no, resizable=no, scrollbars=no');
   calwin.focus(); 
}
//上傳檔案
function openFile(clickobj,commObj) {
  gFile = clickobj;
  gComm = commObj;
  calwin = window.open('../include/USA0004.asp','Upload','width=520, height=200, toolbar=no, location=no, directories=no, status=no, menubar=no, resizable=no, scrollbars=no');
   calwin.focus(); 
}
//上傳檔案可輸入檔名的
function openFile1(clickobj,commObj) {
  gFile = clickobj;
  gComm = commObj;
  calwin = window.open('../include/USA0006.asp','Upload','width=520, height=200, toolbar=no, location=no, directories=no, status=no, menubar=no, resizable=no, scrollbars=no');
   calwin.focus(); 
}
//勞工作業環境測定內容查詢子視窗
function openUSA04022(testcode,testcont) {
  Ptestcode = testcode;
  Ptestcont = testcont;
  calwin=window.open("../US04/USA04022.asp","subwin",'Menubar = yes,Status=yes,Scrollbars=yes,Resizable=yes,Width=700,Height=500,Top=50,Left=100');
   calwin.focus(); 
}
//主管資訊查詢
function openUSA014(possid,dept) {
  P_possid = possid;
  calwin=window.open("../include/USA0014.asp?req_dept="+dept,"subwin",'Menubar = yes,Status=yes,Scrollbars=yes,Resizable=yes,Width=500,Height=350,Top=50,Left=100');
   calwin.focus(); 
}
//開啟視窗
function newWindow(url) 
{
	 popupWindow = window.open(url,'newWin','width=600,height=400,toolbar=no,location=no,scrollbars=yes,resizable=yes,top=100,left=150')
   popupWindow.focus(); 
	 // popupWindow = window.open(url,'newWin','width=800,height=400,toolbar=yes,location=yes,scrollbars=yes,resizable=no,top=0,left=0')
}
//開啟視窗
function newWindow2(URL,clickobj) 
{
   clickvalue = clickobj;
	 popupWindow = window.open(url,'newWin','width=600,height=400,toolbar=no,location=no,scrollbars=yes,resizable=no,top=100,left=150')
   popupWindow.focus(); 
	 // popupWindow = window.open(url,'newWin','width=800,height=400,toolbar=yes,location=yes,scrollbars=yes,resizable=no,top=0,left=0')
}
//開啟視窗
function newWindow3(URL,clickobj,setobj) 
{
   clickvalue = clickobj;
   setvalue = setobj;
	 popupWindow = window.open(url,'newWin','width=600,height=400,toolbar=no,location=no,scrollbars=yes,resizable=no,top=100,left=150')
   popupWindow.focus(); 
	 //popupWindow = window.open(url,'newWin','width=600,height=400,toolbar=yes,status=yes,location=yes,scrollbars=yes,resizable=no,top=100,left=150')
}
//跳出一個新視窗
function newTWindow(url) 
{
	 popupWindow = window.open(url,'newWin','width=600,height=400,toolbar=yes,location=yes,scrollbars=yes,resizable=yes,top=100,left=150,status=yes')
   popupWindow.focus(); 
	 // popupWindow = window.open(url,'newWin','width=800,height=400,toolbar=yes,location=yes,scrollbars=yes,resizable=no,top=0,left=0')
}
//跳出一個新視窗
function wopen(tarHtm,x,y,w,h){ 
    popupWindow = window.open(tarHtm,"","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + w + ",height=" + h +",left=" + x +",top=" + y) 
   popupWindow.focus(); 
}
//跳出一個新視窗
function wopen1(tarHtm,x,y,w,h){ 
    popupWindow = window.open(tarHtm,"","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + w + ",height=" + h +",left=" + x +",top=" + y) 
   popupWindow.focus(); 
}
//新增時按reset
function insert_reset(form) {
	form.isadd.value="";
	form.submit();
}
//刪除時確認
function make_sure(form,action)
{
	var ret;
	ret = confirm("確定刪除此筆資料");
    if (ret){
    	if (action!="")
     		form.action=action;
		form.submit();
	}	
	return ret;  	
}
function CaricaFoto(img){
	foto1= new Image();
	foto1.src=(img);
	Controlla(img);
}
function Controlla(img){
	if((foto1.width!=0)&&(foto1.height!=0)){
		viewFoto(img);
	}
	else{
		funzione="Controlla('"+img+"')";
		intervallo=setTimeout(funzione,20);
	}
}
function viewFoto(img){
	largh=foto1.width+20;
	altez=foto1.height+20;
	stringa="width="+largh+",height="+altez;
	finestra=window.open(img,"",stringa);
}
function CaricaFoto1(img){
	foto1= new Image();
	foto1.src=(img);
	largh=foto1.width+30;
	altez=foto1.height+40;
    //calwin=window.open("../include/USH0006.htm","","Menubar = yes,Status=yes,Scrollbars=yes,Resizable=yes,Width="+largh+",Height="+altez+",Top=30,Left=50");
	stringa="Menubar = yes,Status=yes,Scrollbars=yes,Resizable=yes,width="+largh+",height="+altez;
    calwin=window.open("../include/USH0006.htm","",stringa);
    calwin.document.write("<span style='cursor: hand;' onClick='javascript:viewimg.style.zoom=0.3333;'>33%</span> | ");
    calwin.document.write("<span style='cursor: hand;' onClick='javascript:viewimg.style.zoom=0.5;'>50%</span> | ");
    calwin.document.write("<span style='cursor: hand;' onClick='javascript:viewimg.style.zoom=0.6667;'>67%</span> | ");
    calwin.document.write("<span style='cursor: hand;' onClick='javascript:viewimg.style.zoom=0.75;'>75%</span> | ");
    calwin.document.write("<span style='cursor: hand;' onClick='javascript:viewimg.style.zoom=1;'>原尺寸</span> |");
	calwin.document.write("<input type='button' name='closewin' value='關閉視窗' onclick='window.close();'><br>");
    calwin.document.write("<img id='viewimg' style='ZOOM:0.3333' src="+img+" border=0>");
    calwin.focus();	
	
	
}
function CaricaFoto100(img){
	foto1= new Image();
	foto1.src=(img);
	largh=foto1.width+200;
	altez=foto1.height+200;
    //calwin=window.open("../include/USH0006.htm","","Menubar = yes,Status=yes,Scrollbars=yes,Resizable=yes,Width="+largh+",Height="+altez+",Top=30,Left=50");
	stringa="Menubar = yes,Status=yes,Scrollbars=yes,Resizable=yes,width="+largh+",height="+altez;
    calwin=window.open("../include/USH0006.htm","",stringa);
    calwin.document.write("<span style='cursor: hand;' onClick='javascript:viewimg.style.zoom=0.5;'>50%</span> | ");
    calwin.document.write("<span style='cursor: hand;' onClick='javascript:viewimg.style.zoom=0.75;'>75%</span> | ");
    calwin.document.write("<span style='cursor: hand;' onClick='javascript:viewimg.style.zoom=1;'>原尺寸</span> |");
    calwin.document.write("<span style='cursor: hand;' onClick='javascript:viewimg.style.zoom=1.5;'>150%</span> | ");
    calwin.document.write("<span style='cursor: hand;' onClick='javascript:viewimg.style.zoom=1.75;'>175%</span> | ");
	calwin.document.write("<input type='button' name='closewin' value='關閉視窗' onclick='window.close();'><br>");
    calwin.document.write("<img id='viewimg' src="+img+" border=0>");
    calwin.focus();	
	
	
}
function delFile(fileobj,flagobj)
{
	flagobj.value = "del";
	fileobj.value = "";
	
}
