﻿function fDragging(obj,e,limit){if(typeof(obj)=="string")obj=document.getElementById(obj);if(!e)e=window.event;var x=parseInt(obj.style.left);var y=parseInt(obj.style.top);var x_=e.clientX-x;var y_=e.clientY-y;if(document.addEventListener){document.addEventListener('mousemove',inFmove,true);document.addEventListener('mouseup',inFup,true);document.addEventListener('selectstart',notSelect,true);}else if(document.attachEvent){document.attachEvent('onmousemove',inFmove);document.attachEvent('onmouseup',inFup);document.attachEvent('onselectstart',notSelect);}inFstop(e);inFabort(e);function notSelect(e){return false;}function inFmove(e){var evt;if(!e)e=window.event;if(limit){var op=obj.parentNode;var opX=parseInt(op.style.left);var opY=parseInt(op.style.top);if((e.clientX-x_)<0)return false;else if((e.clientX-x_+obj.offsetWidth+opX)>(opX+op.offsetWidth))return false;if((e.clientY-y_)<0)return false;else if((e.clientY-y_+obj.offsetHeight+opY)>(opY+op.offsetHeight))return false;}obj.style.left=e.clientX-x_+'px';obj.style.top=e.clientY-y_+'px';inFstop(e);}function inFup(e){var evt;if(!e)e=window.event;if(document.removeEventListener){document.removeEventListener('mousemove',inFmove,true);document.removeEventListener('mouseup',inFup,true);document.removeEventListener('onselectstart',notSelect,true);}else if(document.detachEvent){document.detachEvent('onmousemove',inFmove);document.detachEvent('onmouseup',inFup);document.detachEvent('onselectstart',notSelect);}inFstop(e);}function inFstop(e){if(e.stopPropagation)return e.stopPropagation();else return e.cancelBubble=true;}function inFabort(e){if(e.preventDefault)return e.preventDefault();else return e.returnValue=false;}};function SFCS_Class_WaterMask_ShowData(){this._isIE=false;this._myShowMask_ing=false;this._embadObject_HiddenType=2;this._SFCS_MaskDIV=null;this._SFCS_DataDiv=null;this._SFCS_DataDiv_IMG=null;this._SFCS_DataDiv_DIV=null;this._SFCS_DataDiv_TABLE=null;this._SFCS_loadDiv=null;this._SFCS_loadDiv_IMG=null;this._SFCS_DataDiv_frame=null;this._SFCS_loadDiv_frame=null;this._SFCS_ShowHiddenTag=new Array("applet","select","object","embed");this._SFCS_MoveData_WithScroll=true;this._SFCS_CloseData_Then_Relocation=false;this.showViewer=function(_dataID,data_type){if(data_type==1){this.displayLoadingDiv();this.imageShow(this._SFCS_loadDiv);this._SFCS_DataDiv_DIV.style.display="none";this._SFCS_DataDiv_IMG.style.display="block";this._SFCS_DataDiv_IMG.src=_dataID;}else if(data_type==2){if(document.getElementById(_dataID)){this._SFCS_DataDiv_IMG.style.display="none";this._SFCS_DataDiv_DIV.innerHTML=document.getElementById(_dataID).innerHTML;this._SFCS_DataDiv_DIV.style.display="inline";this.imageOnloaded();}else {alert("找不到TagID : [ "+_dataID+" ]\n請檢查該標籤是否存在");}}else {alert("未知的參數");}};this.showViewer_DirecShowTAG=function(HTML_Tag){this._SFCS_DataDiv_DIV.innerHTML=HTML_Tag;this._SFCS_DataDiv_IMG.style.display="none";this._SFCS_DataDiv_DIV.style.display="inline";this.imageOnloaded();};this.showViewerWithIframe=function(div_dataID,iframe_DivID,iframeData){document.getElementById(iframe_DivID).innerHTML=iframeData;this._SFCS_DataDiv_DIV.innerHTML=document.getElementById(div_dataID).innerHTML;this._SFCS_DataDiv_IMG.style.display="none";this._SFCS_DataDiv_DIV.style.display="inline";this.imageOnloaded();};this.showViewer_DirectShowHtmlParemater=function(iframeData){this._SFCS_DataDiv_DIV.innerHTML=iframeData;this._SFCS_DataDiv_IMG.style.display="none";this._SFCS_DataDiv_DIV.style.display="inline";this.imageOnloaded();};this.imageOnloaded=function(){this.imageShow(this._SFCS_DataDiv);this.imageHidden('_SFCS_loadDiv');this.displayWaterMaskDiv();};this.imageHidden=function(objid){this._myShowMask_ing=false;document.getElementById(objid).style.display='none';this._SFCS_MaskDIV.style.display='none';if(objid=='_SFCS_DataDiv'){if(this._SFCS_DataDiv_DIV){this._SFCS_DataDiv_DIV.innerHTML="";window.status='';if(this._SFCS_CloseData_Then_Relocation){window.location=window.location;}}}this.objectShowHidden('visible');};this.imageShow=function(myobj){this._myShowMask_ing=true;myobj.style.display='block';this._SFCS_MaskDIV.style.display='block';};this.displayLoadingDiv=function(){this._myShowMask_ing=true;this.scrollPosition('_SFCS_loadDiv','_SFCS_loadDiv_IMG',true);this._SFCS_MaskDIV.style.top="0px";this._SFCS_MaskDIV.style.left="0px";this._SFCS_MaskDIV.style.display="block";this.objectShowHidden('hidden');};this.displayWaterMaskDiv=function(){this._myShowMask_ing=true;this.scrollPosition('_SFCS_DataDiv','_SFCS_DataDiv_TABLE',true);this._SFCS_MaskDIV.style.top="0px";this._SFCS_MaskDIV.style.left="0px";this._SFCS_MaskDIV.style.display="block";this.objectShowHidden('hidden');};this.resizePosition=function(T_Table,T_close,T_frame){document.getElementById(T_close).style.left=T_Table.clientWidth-23;if(this._embadObject_HiddenType==1){FrameA=document.getElementById(T_frame);if(_isIE){if(FrameA){FrameA.style.width=T_Table.clientWidth;FrameA.style.height=T_Table.clientHeight;}}else {}}};this.scrollPosition=function(objid,obj_dataid,fristShow_NeedMove){if(this._myShowMask_ing){x1=document.getElementById(obj_dataid).clientWidth/2;y1=document.getElementById(obj_dataid).clientHeight/2;if(typeof(document.getElementById(obj_dataid).height)=='number'){x2=document.getElementById(obj_dataid).width/2;y2=document.getElementById(obj_dataid).height/2;ShowData_Width=Math.max(x1,x2);ShowData_Height=Math.max(y1,y2);}else {ShowData_Width=x1;ShowData_Height=y1;}if(!this._isIE){if((x1*2)>23)document.getElementById('_SFCS_DataDiv_Close').style.left=((x1*2)-23)+"px";}_mypageSize=this.getBowserSize();screen_view_width=_mypageSize[2]/2;screen_view_height=_mypageSize[3]/2;if(document.body.scrollTop&&document.body.scrollTop!=0){dbst=document.body.scrollTop;dbsl=document.body.scrollLeft;}else {dbst=document.getElementsByTagName("html")[0].scrollTop;dbsl=document.getElementsByTagName("html")[0].scrollLeft;}WaterMask_obj=document.getElementById(objid).style;if(fristShow_NeedMove||this._SFCS_MoveData_WithScroll){if(screen_view_height>ShowData_Height)WaterMask_obj.top=(screen_view_height-ShowData_Height+dbst)+"px";else WaterMask_obj.top="0px";if(screen_view_width>ShowData_Width)WaterMask_obj.left=(screen_view_width-ShowData_Width+dbsl)+"px";else WaterMask_obj.left="0px";}this._SFCS_MaskDIV.style.height=Math.max((ShowData_Height*2),Math.max(_mypageSize[1],_mypageSize[3]))+"px";this._SFCS_MaskDIV.style.width=Math.max((ShowData_Width*2),Math.max(_mypageSize[0],_mypageSize[2]))+"px";}};this.objectShowHidden=function(visible_hidden){if(this._embadObject_HiddenType==2){var tags=this._SFCS_ShowHiddenTag;for(var k=0;k<tags.length;k++){var ar=document.getElementsByTagName(tags[k]);var cc=null;for(var i=ar.length;i>0;){cc=ar[--i];cc.style.visibility=visible_hidden;}}}};this.getBowserSize=function(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=document.body.scrollWidth;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else {xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}var windowWidth,windowHeight;if(self.innerHeight){windowWidth=self.innerWidth;windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}if(yScroll<windowHeight){pageHeight=windowHeight;y=pageHeight;}else {pageHeight=yScroll;y=pageHeight;}if(xScroll<windowWidth){pageWidth=windowWidth;}else {pageWidth=xScroll;}arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);return arrayPageSize;};this.WriteWaterMask_Html=function(){document.writeln('<div id="_SFCS_MaskDIV" style="DISPLAY:none;Z-INDEX:100;FILTER:alpha(opacity=70); opacity:0.7; -moz-opacity:0.7; LEFT:0px;WIDTH:100px;POSITION:absolute;TOP:0px;HEIGHT:100px;BACKGROUND-COLOR:black"></div>');document.writeln('<div id="_SFCS_DataDiv" style="DISPLAY: none; Z-INDEX: 109; LEFT: 0px; POSITION: absolute; TOP: 0px">');document.writeln('    <DIV style="Z-INDEX: 104; POSITION: absolute"><iframe id="_SFCS_DataDiv_frame" frameBorder="0" width="50" scrolling="no" height="50"></iframe></DIV>');document.writeln('    <DIV style="Z-INDEX: 105; POSITION: absolute">');document.writeln('        <table id="_SFCS_DataDiv_TABLE" onresize="_SFCS_WaterMask.resizePosition(this,\'_SFCS_DataDiv_Close\', \'_SFCS_DataDiv_frame\'); " border=0 cellspacing="0" cellpadding="0">');document.writeln('        <tr><td>');document.writeln('            <img id="_SFCS_DataDiv_IMG" onload="_SFCS_WaterMask.imageOnloaded()">');document.writeln('            <div id="_SFCS_DataDiv_DIV"></div>');document.writeln('        </td></tr>');document.writeln('        </table>');document.writeln('    </DIV>');document.writeln('    <DIV id="_SFCS_DataDiv_Close" style="Z-INDEX: 106; POSITION: absolute; width:10px; height:10px; TOP:2px; LEFT: 10px;" onclick="_SFCS_WaterMask.imageHidden(\'_SFCS_DataDiv\'); _SFCS_WaterMask.imageHidden(\'_SFCS_loadDiv\');"><img src="images/WaterMask_close.gif"></DIV>');document.writeln('</div>');document.writeln('<div id="_SFCS_loadDiv" style="DISPLAY: none; Z-INDEX: 109; LEFT:0px; POSITION: absolute; TOP:0px">');document.writeln('    <DIV style="Z-INDEX: 104; POSITION: absolute"><iframe id="_SFCS_loadDiv_frame" frameBorder="0" width="187" scrolling="no" height="79"></iframe></DIV>');document.writeln('    <DIV style="Z-INDEX: 105; POSITION: absolute"><IMG id="_SFCS_loadDiv_IMG" height="79" src="images/waterMask_loading_001.gif" width="187"></DIV>');document.writeln('    <DIV id="_SFCS_loadDiv_Close" style="Z-INDEX: 106; POSITION: absolute; width:10px; height:10px; TOP:2px; LEFT: 164px;" onclick="_SFCS_WaterMask.imageHidden(\'_SFCS_DataDiv\'); _SFCS_WaterMask.imageHidden(\'_SFCS_loadDiv\');"><img src="images/WaterMask_close.gif"></DIV>');document.writeln('</div>');};this.change_ShowHiddenTag=function(myTagType_Array){this._SFCS_ShowHiddenTag=myTagType_Array;};this.init=function(){if(window.navigator.appName=="Microsoft Internet Explorer"&&window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE")+5,window.navigator.appVersion.indexOf("MSIE")+8)>=5.5){_isIE=true;}this.WriteWaterMask_Html();this._SFCS_MaskDIV=document.getElementById("_SFCS_MaskDIV");this._SFCS_DataDiv=document.getElementById("_SFCS_DataDiv");this._SFCS_DataDiv_IMG=document.getElementById("_SFCS_DataDiv_IMG");this._SFCS_DataDiv_DIV=document.getElementById("_SFCS_DataDiv_DIV");this._SFCS_DataDiv_TABLE=document.getElementById("_SFCS_DataDiv_TABLE");this._SFCS_loadDiv=document.getElementById("_SFCS_loadDiv");this._SFCS_loadDiv_IMG=document.getElementById("_SFCS_loadDiv_IMG");this._SFCS_DataDiv_frame=document.getElementById("_SFCS_DataDiv_frame");this._SFCS_loadDiv_frame=document.getElementById("_SFCS_loadDiv_frame");if(this._embadObject_HiddenType==2){this._SFCS_DataDiv_frame.style.display="None";this._SFCS_loadDiv_frame.style.display="None";}this.setWindowOnscroll();this.setWindowOnresize();};this.setWindowOnscroll=function(){var self=this;if(window.attachEvent){window.attachEvent('onscroll',function(){self.scrollPosition('_SFCS_DataDiv','_SFCS_DataDiv_TABLE',false);});}else if(window.addEventListener){function FF_Onscroll(evt){self.scrollPosition('_SFCS_DataDiv','_SFCS_DataDiv_TABLE',false);}window.addEventListener('scroll',FF_Onscroll,false);}};this.setWindowOnresize=function(){var self=this;if(window.attachEvent){window.attachEvent('onresize',function(){self.scrollPosition('_SFCS_DataDiv','_SFCS_DataDiv_TABLE',false);});}else if(window.addEventListener){function FF_Onresize(evt){self.scrollPosition('_SFCS_DataDiv','_SFCS_DataDiv_TABLE',false);}window.addEventListener('resize',FF_Onresize,false);}};this.init();}var _SFCS_WaterMask=new SFCS_Class_WaterMask_ShowData();

