﻿
//MUST Width Height FIRST
var tmpPMWWidth=0;
var tmpPMWHeight=0;
var tmpPMWLeft=0;
var tmpPMWTop=0;
var tmpPMHead="";
var tmpPMBLeft="";
var tmpPMBRight="";
var tmpPMFoot="";
document.write("<iframe src='JavaScript:false' id='PnlMsgWinFrm' name='PnlMsgWinFrm' frameborder='0' style='display: none; position: absolute; left: " + tmpPMWLeft + "px; top: " + tmpPMWTop + "px; width: " + tmpPMWWidth + "px; height: " + tmpPMWHeight + "px; z-index: 8888; background-color: #FFFFFF;'></iframe>");
document.write("<div id='PnlMsgWinDiv' style='display: none; position: absolute; left: " + tmpPMWLeft + "px; top: " + tmpPMWTop + "px; width: " + tmpPMWWidth + "px; height: " + tmpPMWHeight + "px; z-index: 8888; padding: 5px; border-top: 1px solid #696969; border-right: 1px solid #696969; border-bottom: 1px solid #696969; border-left: 1px solid #696969; background-color: #FFFFFF;'>");
document.write("<table width='100%' height='100%' border='0' cellspacing='0' cellpadding='5' summary='FrmTbl'>");
document.write("<tr>");
document.write("<td style='text-align: center; background-color: #DEDEDE; background-image: url(" + a4ceecd8c3e9682c + "img/defbg.gif); height: " + GetStyleHeight(30) + "px;'><table width='100%' height='100%' border='0' cellspacing='0' cellpadding='0' summary='FrmTbl'>");
document.write("<tr>");
document.write("<th style='font-family: Arial, Helvetica, sans-serif; color: #0F0FFF; cursor: hand;'><img src='" + a4ceecd8c3e9682c + "img/pnlmsgwin.gif' border='0' align='absmiddle' alt='關閉' onClick='ClosePnlMsgWin()' onKeyPress='ClosePnlMsgWin()'></th>");
document.write("<th width='100%'><span id='PnlMsgHead' style='font-size: 10pt; color: #75420F;'></span></th>");
document.write("</tr>");
document.write("</table></td>");
document.write("</tr>");
document.write("<tr>");
document.write("<td height='100%'><table width='100%' height='100%' border='0' cellspacing='0' cellpadding='5' summary='FrmTbl'>");
document.write("<tr>");
document.write("<td width='0%' valign='top'><span id='PnlMsgBoxLeft'></span></td>");
document.write("<td width='100%' valign='top'><span id='PnlMsgBoxRight'></span></td>");
document.write("</tr>");
document.write("</table></td>");
document.write("</tr>");
document.write("<tr><td background='" + a4ceecd8c3e9682c + "img/hr01.gif'></td></tr>");
document.write("<tr>");
document.write("<td align='right'><span id='PnlMsgFoot' style='font-size: 10pt; color: #333333;'></span></td>");
document.write("</tr>");
document.write("</table>");
document.write("</div>");

function ClosePnlMsgWin()
{
  document.getElementById("PnlMsgWinFrm").style.display="none";
  PnlMsgWinDiv.style.display="none";
}

function OpenPnlMsgWin()
{
  if ((tmpPMWLeft+tmpPMWWidth)>(GetClientLeft()+GetClientWidth()))
  {
    tmpPMWLeft=tmpPMWLeft-tmpPMWWidth;
  }
  if ((tmpPMWTop+tmpPMWHeight)>(GetClientTop()+GetClientHeight()))
  {
    tmpPMWTop=tmpPMWTop-tmpPMWHeight;
  }
  if (tmpPMWLeft<GetClientLeft())
  {
    tmpPMWLeft=GetClientLeft();
  }
  if (tmpPMWTop<GetClientTop())
  {
    tmpPMWTop=GetClientTop();
  }
  document.getElementById("PnlMsgWinFrm").style.width=tmpPMWWidth;
  document.getElementById("PnlMsgWinFrm").style.height=tmpPMWHeight;
  document.getElementById("PnlMsgWinFrm").style.left=tmpPMWLeft;
  document.getElementById("PnlMsgWinFrm").style.top=tmpPMWTop;
  PnlMsgWinDiv.style.width=tmpPMWWidth;
  PnlMsgWinDiv.style.height=tmpPMWHeight;
  PnlMsgWinDiv.style.left=tmpPMWLeft;
  PnlMsgWinDiv.style.top=tmpPMWTop;
  PnlMsgHead.innerHTML=tmpPMHead;
  PnlMsgBoxLeft.innerHTML=tmpPMBLeft;
  PnlMsgBoxRight.innerHTML=tmpPMBRight;
  PnlMsgFoot.innerHTML=tmpPMFoot;
  document.getElementById("PnlMsgWinFrm").style.display="";
  PnlMsgWinDiv.style.display="";
}

function OpenPnlMsgBoxTim(aPnlMsgBoxRight, aPnlMsgTim)
{
  if ((aPnlMsgBoxRight!="") && (aPnlMsgTim>0))
  {
    tmpPMWWidth=350;
    tmpPMWHeight=150;
    tmpPMWLeft=GetClientLeft()+Math.floor(GetClientWidth()/2)-Math.floor(tmpPMWWidth/2);
    tmpPMWTop=GetClientTop()+Math.floor(GetClientHeight()/2)-Math.floor(tmpPMWHeight/2);
    tmpPMHead="系統訊息";
    tmpPMBLeft="<img src='" + a4ceecd8c3e9682c + "img/gears.gif' border='0' align='absmiddle' alt='傳輸中，請待候…'>";
    tmpPMBRight="<span style='font-size: 11pt; color: #FF0000;'>" + aPnlMsgBoxRight + "</span>";
    tmpPMFoot="如果未在&nbsp;<span style='color: #750F0F;'>" + aPnlMsgTim + "</span>&nbsp;秒後自動關閉，請按<span style='font-family: Arial, Helvetica, sans-serif; color: #0F0FFF; cursor: hand;' onClick='ClosePnlMsgWin()' onKeyPress='ClosePnlMsgWin()'>這裡</span>!!";
    OpenPnlMsgWin();
    setTimeout("ClosePnlMsgWin()", aPnlMsgTim*1000);
  }
}

function OpenPnlMsgCopyTim(aPnlMsgCopySrc, aPnlMsgCopyDes, aOverWrite, aPnlMsgTim)
{
  if ((aPnlMsgCopySrc!="") && (aPnlMsgCopyDes!="") && (aPnlMsgTim>0))
  {
    tmpPMWWidth=350;
    tmpPMWHeight=150;
    tmpPMWLeft=GetClientLeft()+Math.floor(GetClientWidth()/2)-Math.floor(tmpPMWWidth/2);
    tmpPMWTop=GetClientTop()+Math.floor(GetClientHeight()/2)-Math.floor(tmpPMWHeight/2);
    tmpPMHead="複製檔案";
    tmpPMBLeft="<img src='" + a4ceecd8c3e9682c + "img/gears.gif' border='0' align='absmiddle' alt='傳輸中，請待候…'>";
    tmpPMBRight="<iframe src='" + a4ceecd8c3e9682c + "cfg/copyfile.asp?CSF=" + aPnlMsgCopySrc + "&CDF=" + aPnlMsgCopyDes + "&COW=" + aOverWrite + "&DoCopy=1' id='WinCopy' name='WinCopy' width='100%' height='100%' frameborder='0'></iframe>";
    tmpPMFoot="如果未在&nbsp;<span style='color: #750F0F;'>" + aPnlMsgTim + "</span>&nbsp;秒後自動關閉，請按<span style='font-family: Arial, Helvetica, sans-serif; color: #0F0FFF; cursor: hand;' onClick='ClosePnlMsgWin()' onKeyPress='ClosePnlMsgWin()'>這裡</span>!!";
    OpenPnlMsgWin();
    setTimeout("ClosePnlMsgWin()", aPnlMsgTim*1000);
  }
}

function OpenPnlMsgDeleteTim(aPnlMsgDelete, aPnlMsgTim)
{
  if ((aPnlMsgDelete!="") && (aPnlMsgTim>0))
  {
    tmpPMWWidth=350;
    tmpPMWHeight=150;
    tmpPMWLeft=GetClientLeft()+Math.floor(GetClientWidth()/2)-Math.floor(tmpPMWWidth/2);
    tmpPMWTop=GetClientTop()+Math.floor(GetClientHeight()/2)-Math.floor(tmpPMWHeight/2);
    tmpPMHead="刪除檔案";
    tmpPMBLeft="<img src='" + a4ceecd8c3e9682c + "img/gears.gif' border='0' align='absmiddle' alt='傳輸中，請待候…'>";
    tmpPMBRight="<iframe src='" + a4ceecd8c3e9682c + "cfg/delfile.asp?DF=" + aPnlMsgDelete + "&DoDelete=1' id='WinDelete' name='WinDelete' width='100%' height='100%' frameborder='0'></iframe>";
    tmpPMFoot="如果未在&nbsp;<span style='color: #750F0F;'>" + aPnlMsgTim + "</span>&nbsp;秒後自動關閉，請按<span style='font-family: Arial, Helvetica, sans-serif; color: #0F0FFF; cursor: hand;' onClick='ClosePnlMsgWin()' onKeyPress='ClosePnlMsgWin()'>這裡</span>!!";
    OpenPnlMsgWin();
    setTimeout("ClosePnlMsgWin()", aPnlMsgTim*1000);
  }
}

function OpenPnlMsgMoveTim(aPnlMsgMoveSrc, aPnlMsgMoveDes, aPnlMsgTim)
{
  if ((aPnlMsgMoveSrc!="") && (aPnlMsgMoveDes!="") && (aPnlMsgTim>0))
  {
    tmpPMWWidth=350;
    tmpPMWHeight=150;
    tmpPMWLeft=GetClientLeft()+Math.floor(GetClientWidth()/2)-Math.floor(tmpPMWWidth/2);
    tmpPMWTop=GetClientTop()+Math.floor(GetClientHeight()/2)-Math.floor(tmpPMWHeight/2);
    tmpPMHead="搬移檔案";
    tmpPMBLeft="<img src='" + a4ceecd8c3e9682c + "img/gears.gif' border='0' align='absmiddle' alt='傳輸中，請待候…'>";
    tmpPMBRight="<iframe src='" + a4ceecd8c3e9682c + "cfg/movefile.asp?MSF=" + aPnlMsgMoveSrc + "&MDF=" + aPnlMsgMoveDes + "&DoMove=1' id='WinMove' name='WinMove' width='100%' height='100%' frameborder='0'></iframe>";
    tmpPMFoot="如果未在&nbsp;<span style='color: #750F0F;'>" + aPnlMsgTim + "</span>&nbsp;秒後自動關閉，請按<span style='font-family: Arial, Helvetica, sans-serif; color: #0F0FFF; cursor: hand;' onClick='ClosePnlMsgWin()' onKeyPress='ClosePnlMsgWin()'>這裡</span>!!";
    OpenPnlMsgWin();
    setTimeout("ClosePnlMsgWin()", aPnlMsgTim*1000);
  }
}

function OpenPnlMsgUpload(aForm, aInput, aUploadPath, aTotalMaxFileSize, aMaxFileSize, aAllowedFilesList, aDeniedFilesList, aUploadType)
{
  tmpPMWWidth=550;
  tmpPMWHeight=500;
  tmpPMWLeft=GetClientLeft()+event.x;
  tmpPMWTop=GetClientTop()+event.y;
  tmpPMHead="上載檔案";
  tmpPMBLeft="";
  tmpPMBRight="<iframe src='" + a4ceecd8c3e9682c + "cfg/upload.asp?FRM=" + aForm + "&IPT=" + aInput + "&UP=" + aUploadPath + "&TMFS=" + aTotalMaxFileSize + "&MFS=" + aMaxFileSize + "&AFL=" + aAllowedFilesList + "&DFL=" + aDeniedFilesList + "&UT=" + aUploadType + "' id='WinUpload' name='WinUpload' width='100%' height='100%' frameborder='0'></iframe>";
  tmpPMFoot="關閉，請按<span style='font-family: Arial, Helvetica, sans-serif; color: #0F0FFF; cursor: hand;' onClick='ClosePnlMsgWin()' onKeyPress='ClosePnlMsgWin()'>這裡</span>!!";
  OpenPnlMsgWin();
}

function OpenPnlMsgImg(aPnlMsgImg)
{
  var tmpPnlMsgImgRPF;
  var tmpPnlMsgImg;
  tmpPnlMsgImgRPF=JRealPathFile(aPnlMsgImg, "");
  tmpPnlMsgImg=new Image();
  tmpPnlMsgImg.src=tmpPnlMsgImgRPF;
  tmpPMWWidth=tmpPnlMsgImg.width+42;
  tmpPMWHeight=tmpPnlMsgImg.height+92;
  tmpPMWLeft=GetClientLeft()+event.x;
  tmpPMWTop=GetClientTop()+event.y;
  tmpPMHead="預覽圖片";
  tmpPMBLeft="";
  tmpPMBRight="<img src='" + tmpPnlMsgImgRPF + "' border='0' align='absmiddle' alt='預覽圖片'>";
  tmpPMFoot="關閉，請按<span style='font-family: Arial, Helvetica, sans-serif; color: #0F0FFF; cursor: hand;' onClick='ClosePnlMsgWin()' onKeyPress='ClosePnlMsgWin()'>這裡</span>!!";
  OpenPnlMsgWin();
}
