var userAgent=navigator.userAgent.toLowerCase();var is_opera=((userAgent.indexOf("opera")!=-1)||(typeof(window.opera)!="undefined"));var is_saf=((userAgent.indexOf("applewebkit")!=-1)||(navigator.vendor=="Apple Computer, Inc."));var is_webtv=(userAgent.indexOf("webtv")!=-1);var is_ie=((userAgent.indexOf("msie")!=-1)&&(!is_opera)&&(!is_saf)&&(!is_webtv));var is_ie4=((is_ie)&&(userAgent.indexOf("msie 4.")!=-1));var is_ie6=((is_ie)&&(userAgent.indexOf("msie 6.")!=-1));var is_ie7=((is_ie)&&(userAgent.indexOf("msie 7.")!=-1));var is_moz=((navigator.product=="Gecko")&&(!is_saf));var is_kon=(userAgent.indexOf("konqueror")!=-1);var is_ns=((userAgent.indexOf("compatible")==-1)&&(userAgent.indexOf("mozilla")!=-1)&&(!is_opera)&&(!is_webtv)&&(!is_saf));var is_ns4=((is_ns)&&(parseInt(navigator.appVersion)==4));var is_mac=(userAgent.indexOf("mac")!=-1);var JsWebURL="";var JsURL="";var aPsImgURL="";var aPsJSImgURL="";var aPsImgURLs="";$$=function(c){var c=document.getElementById(c)?document.getElementById(c):c;return c};$=function(c){return document.getElementById(c)};$S=function(c){return $(c).style};trim=function(c){ptntrim=/(^\s*)|(\s*$)/g;return c.replace(ptntrim,"")};ltrim=function(c){ptnltrim=/^\s*/g;return c.replace(ptnltrim,"")};rtrim=function(c){ptnrtrim=/\s$/g;return c.replace(ptnrtrim,"")};function ArrayindexOf(d,c){for(var e=d.length;e--&&d[e].toLowerCase()!==c;){}return e}function $getcookie(j){try{var c=document.cookie.split("; ");for(var d=0;d<c.length;d++){var f=c[d].split("=");if(j==f[0]){return unescape(f[1])}}}catch(g){return"err"}return null}function getFlashVer(){var f=0;if(navigator.plugins&&navigator.mimeTypes.length){var c=navigator.plugins["Shockwave Flash"];if(c&&c.description){var d=c.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split(".");if(d&&d.length>0){f=d[0]}}}else{try{var j=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");for(var g=3;j!=null;g++){j=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+g);f=g}}catch(k){}try{var d=j.GetVariable("$version").split(" ")[1].split(",");if(d&&d.length>0){f=d[0]}}catch(k){}}return f}function getPageSize(){var c,e;if(window.innerHeight&&window.scrollMaxY){c=document.body.scrollWidth;e=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){c=document.body.scrollWidth;e=document.body.scrollHeight}else{c=document.body.offsetWidth;e=document.body.offsetHeight}}var d,f;if(self.innerHeight){d=self.innerWidth;f=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){d=document.documentElement.clientWidth;f=document.documentElement.clientHeight}else{if(document.body){d=document.body.clientWidth;f=document.body.clientHeight}}}arrayPageSize=new Array(c,e,d,f);return arrayPageSize}function getEvent(){var d=0;if(document.all){return window.event}func=getEvent.caller;while(func!=null){var c=func.arguments[0];if(c){if(c.constructor==MouseEvent){return c}}func=func.caller}return null}function getElementsByType(c,g){var e=g.getElementsByTagName("*");var f=new Array();for(var d=0;d<e.length;d++){if(e[d].type==c){f.push(e[d])}}return f}String.prototype.find=function(c){return(this.indexOf(c)>=0?true:false)};function getParentBk(d){var e=d.parentNode,f;while(e.tagName.toUpperCase()!="HTML"&&(f=getBackground(e))=="transparent"){e=e.parentNode}if(f=="transparent"){f="#FFFFFF"}return(f)}function getBackground(d){var e=getStyleProp(d,"backgroundColor");if(e==null||e=="transparent"||e.find("rgba(0, 0, 0, 0)")){return("transparent")}if(e.find("rgb")){e=rgb2hex(e)}return(e)}function getPadding(c,d){var e=getStyleProp(c,"padding"+d);if(e==null||!e.find("px")){return(0)}return(parseInt(e))}function getStyleProp(c,d){if(c.currentStyle){return(c.currentStyle[d])}if(document.defaultView.getComputedStyle){return(document.defaultView.getComputedStyle(c,"")[d])}return(null)}function rgb2hex(j){var f="",c,e,d;var g=/([0-9]+)[, ]+([0-9]+)[, ]+([0-9]+)/;var e=g.exec(j);for(d=1;d<4;d++){c=parseInt(e[d]).toString(16);if(c.length==1){f+="0"+c}else{f+=c}}return("#"+f)}function Mix(j,g){var f,e,d,c,l,k=new Array(3);if(j.length==4){e=1}else{e=2}if(g.length==4){d=1}else{d=2}for(f=0;f<3;f++){c=parseInt(j.substr(1+e*f,e),16);if(e==1){c=16*c+c}l=parseInt(g.substr(1+d*f,d),16);if(d==1){l=16*l+l}k[f]=Math.floor((c*50+l*50)/100);k[f]=k[f].toString(16);if(k[f].length==1){k[f]="0"+k[f]}}return("#"+k[0]+k[1]+k[2])}Date.prototype.formatDate=function(g){var d=this;if(!g){g="MM/dd/yyyy"}var f=d.getMonth()+1;var e=d.getFullYear();g=g.replace("MM",f.toString().padL(2,"0"));if(g.indexOf("yyyy")>-1){g=g.replace("yyyy",e.toString())}else{if(g.indexOf("yy")>-1){g=g.replace("yy",e.toString().substr(2,2))}}g=g.replace("dd",d.getDate().toString().padL(2,"0"));var c=d.getHours();if(g.indexOf("t")>-1){if(c>11){g=g.replace("t","pm")}else{g=g.replace("t","am")}}if(g.indexOf("HH")>-1){g=g.replace("HH",c.toString().padL(2,"0"))}if(g.indexOf("hh")>-1){if(c>12){c-12}if(c==0){c=12}g=g.replace("hh",c.toString().padL(2,"0"))}if(g.indexOf("mm")>-1){g=g.replace("mm",d.getMinutes().toString().padL(2,"0"))}if(g.indexOf("ss")>-1){g=g.replace("ss",d.getSeconds().toString().padL(2,"0"))}return g};String.prototype.padL=function(c,e){if(!c||c<1){return this}if(!e){e=" "}var d=c-this.length;if(d<1){return this.substr(0,c)}return(String.repeat(e,d)+this).substr(0,c)};String.prototype.padR=function(c,e){if(!c||c<1){return this}if(!e){e=" "}var d=c-this.length;if(d<1){this.substr(0,c)}return(this+String.repeat(e,d)).substr(0,c)};String.repeat=function(d,e){var f="";for(var c=0;c<e;c++){f+=d}return f};function replaceAll(e,c,f){var d=new String(e);while(d.indexOf(c)!=-1){d=d.replace(c,f)}return d}_capwin=function(c){_addEvent(c,"click",_parentEvent);_addEvent(c,"mousedown",_parentEvent);_addEvent(c,"focus",_parentEvent)};_relwin=function(c){_removeEvent(c,"click",_parentEvent);_removeEvent(c,"mousedown",_parentEvent);_removeEvent(c,"focus",_parentEvent)};_parentEvent=function(c){var c=getEvent();if(Dialog&&!Dialog.closed){_stopEvent(c);Dialog.focus()}};_addEvent=function(c,e,d){if(is_ie){c.attachEvent("on"+e,d)}else{c.addEventListener(e,d,true)}};_removeEvent=function(c,e,d){if(is_ie){c.detachEvent("on"+e,d)}else{c.removeEventListener(e,d,true)}};_stopEvent=function(c){try{if(is_ie){c.cancelBubble=true;c.returnValue=false;return false}else{c.preventDefault();c.stopPropagation()}}catch(d){}};_createHttpRequestg=function(){if(window.XMLHttpRequest){return new XMLHttpRequest()}if(window.ActiveXObject){try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(c){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(c){}}return null};var xmlHttp=_createHttpRequestg();_go=function(d){if(!d.data.replace(/\s/g,"")){d.parentNode.removeChild(d)}};_clean=function(e){var c=e.getElementsByTagName("*");for(i=0;i<c.length;i++){a=c[i].previousSibling;if(a&&a.nodeType==3){_go(a)}b=c[i].nextSibling;if(b&&b.nodeType==3){_go(b)}}return e};_getText=function(e){var c="";if(is_ie){c=e.text}else{for(var d=0;d<e.childNodes.length;d++){if(e.childNodes[d].hasChildNodes()){c+=_getText(e.childNodes[d])}else{c+=e.childNodes[d].nodeValue}}}return c};_getPos=function(j){var f=-1;var e=0;var c=0,k=0,g;g=j;if(g.offsetParent){while(g.offsetParent){c+=g.offsetLeft;g=g.offsetParent}}else{if(g.x){c+=g.x}}g=j;if(g.offsetParent){while(g.offsetParent){k+=g.offsetTop;g=g.offsetParent}}else{if(g.y){k+=g.y}}if(is_ie){return{x:c+e,y:k+f}}else{return{x:c,y:k}}};function MoveBox(f,c){var e=(is_ie)?document.documentElement.scrollTop:self.pageYOffset;var d=(is_ie)?document.documentElement.scrollLeft:self.pageXOffset;f.style.top=e+"px";f.style.left=d+"px";if(c){MoveBoxWH(f)}}function MoveBoxWH(e){var d=(is_ie)?document.documentElement.clientHeight:self.innerHeight;var c=(is_ie)?document.documentElement.clientWidth:self.innerWidth-16;e.style.height=d+"px";e.style.width=c+"px"}function winStyle(c){switch(c){case 0:return"";break;case 1:return"status=yes";break;case 2:return"scrollbars=yes,status=yes";break;case 3:return"status=yes,personalbar=yes,scrollbars=yes,resizable=yes";break;case 4:return"toolbar=no,menubar=no";break;case 5:return"toolbar=no,menubar=no,status=yes";break;default:""}}var winarray=new Array();function WinIncident(v,s,t,d,x,l,o,y){try{var f=winStyle(parseInt(t));var j=1;var u=1;var g=window.screen.availWidth;var n=window.screen.availHeight;if(d==0){w=g}else{w=d;j=(g/2)-(d/2)}if(x==0){h=(is_ie)?n-50:n}else{h=x;u=(n/2)-(x/2)}if(f!=""){f+=",width="+w+",height="+h+",left="+j+",top="+u}var q,c;if(winarray.length==0){q=new Array();q[0]=s;c=window.open(v,s,f);q[1]=c}else{var m=-1;for(i=0;i<winarray.length;i++){if(winarray[i][0]==s){m=i;break}}if(m==-1){q=new Array();q[0]=s;c=window.open(v,s,f);q[1]=c}else{c=winarray[m][1];if(c.closed){q=new Array();c=window.open(v,s,f);winarray[m][1]=c}}}if(!l&&y){c.moveTo(0,0);c.resizeTo(screen.availWidth,screen.availHeight)}c.focus();if(l){Dialog=c;_capwin(window)}if(o){winarray.push(q)}}catch(r){window.status=window.status+" er:WinIncident-"+r}}function closeAllwin(){try{for(i=0;i<winarray.length;i++){if(winarray[i][1]&&!winarray[i][1].closed){winarray[i][1].close()}}}catch(c){window.status=window.status+" er:closeAllwin-"+c}}function aPsWarButton(d,c){var e;switch(d){case 0:e="<span></span>";break;case 1:e="<a href='javascript:void(0)' onclick=\"document.getElementById('aPswindow').style.display='none';return false;\" id='aPsWarCenter' onFocus='this.blur()' ><span>確定</span></a>";break;case 2:e="<a href='javascript:void(0)' onclick=\"document.getElementById('aPswindow').style.display='none';return false;\" id='aPsWarCenter' onFocus='this.blur()'><span>關閉訊息</span></a>";break;case 3:e="<a href='javascript:void(0)' onclick=\"returnTrue('"+c+"');return false;\"  onFocus='this.blur()'><span>確定</span></a>";e+="<a href='javascript:void(0)' onclick=\"returnFalse('"+c+"');return false;\" id='aPsWarCenter' onFocus='this.blur()'><span>取消</span></a>";break;case 4:e="<a href='javascript:void(0)' onclick=\"document.getElementById('aPswindow').style.display='none';"+c+";return false;\" id='aPsWarCenter' onFocus='this.blur()'><span>確定</span></a>";break;case 5:e="<a href='javascript:void(0)' onclick=\"document.getElementById('aPswindow').style.display='none';"+c+";return false;\" onFocus='this.blur()'><span>確定</span></a>";e+="<a href='javascript:void(0)' onclick=\"document.getElementById('aPswindow').style.display='none';return false;\" id='aPsWarCenter' onFocus='this.blur()'><span>取消</span></a>";break;default:""}return e}function returnTrue(returnid){if(!$(returnid)){return}var funStr=$(returnid).getAttribute("returnTrue");if(typeof(funStr)=="function"){eval(funStr);return}eval(funStr)}function returnFalse(returnid){if(!$(returnid)){return}var funStr=$(returnid).getAttribute("returnFalse");if(typeof(funStr)=="function"){eval(funStr);return}eval(funStr)}function closeWar(){if($("aPswindow")){$("aPswindow").style.display="none"}}function aPsWar(g,e,k,f){if($("tooltip")){hideTip()}var c=document.getElementById("aPsWarning");if(!c){c=document.createElement("link");c.setAttribute("type","text/css");c.setAttribute("rel","stylesheet");c.setAttribute("href",JsURL+"/aPsMoveWindow/aPsWarning.css");c.id="aPsWarning";document.getElementsByTagName("head")[0].appendChild(c)}if(!k){k="提示"}var d="";if(e){d=aPsWarButton(e,f)}var j="<table id='aPsWarning' style='height:60px;width:300px;' border='0' CELLSPACING='0' CELLPADDING='0'>";j+="<tr><td class='warHead'>"+k+"</td></tr>";j+="<tr><td class='warbody'>"+g+"</td></tr>";if(d!=""){j+="<tr><td class='warFooter'>"+d+"</td></tr>"}j+="</table>";aPswindow(j);if($("aPsWarCenter")){$("aPsWarCenter").focus()}}function aPswindow(d){var e=document.getElementById("aPswindow");if(!e){return}var c=document.getElementById("aPswindowDiv");c.innerHTML=d;c.style.width=parseInt(c.childNodes[0].style.width)+"px";aPswindowBeng(e)}var loadingRun=false;var loadingInterval=null;function aPswindowBeng(g){if(g){var f=(is_ie)?document.documentElement.scrollTop:self.pageYOffset;var e=(is_ie)?document.documentElement.clientHeight:self.innerHeight;var d=(is_ie)?document.documentElement.clientWidth:self.innerWidth-16;g.style.display="list-item";g.style.left="0px";g.style.top=f+"px";g.style.height=e+"px";g.style.width=d+"px";g.style.zindex=999;var c=document.getElementById("aPswindowDiv");c.style.top=((e/2)-(parseInt(c.offsetHeight)/2))-50+"px";loadingRun=true;loadingInterval=window.setInterval("aPswindowBengInterval(document.getElementById('aPswindow'),true)",1)}}function aPswindowBengInterval(d,c){if(loadingRun){MoveBox(d,c)}else{window.clearInterval(loadingInterval);return}}window.onload=allload;window.onunload=allonunload;function allload(){var d=$("aPswindow");if(!d){d=document.createElement("div");d.style.display="none";d.id="aPswindow";d.innerHTML="<iframe src='about:blank' scrolling='no' frameborder='0' ></iframe><div id='aPswindowDiv' ></div><div class='aPswindowfilter' ></div>";var c=document.getElementsByTagName("body")[0];c.appendChild(d)}if(typeof(PageOnload)=="function"){PageOnload()}if(typeof(aPsFrameworkOnload)=="function"){aPsFrameworkOnload()}if($("packetload")){$("packetload").style.display="none"}}function allonunload(){if(typeof(closeAllwin)=="function"){closeAllwin()}}window.onerror=function(e,d,c){window.status=window.status+" Script Error: "+e+", Ln: "+c;return true};function $validateEmail(c){return(new RegExp(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/).test(c))}function Search(c){var d=document.getElementById("sctext").value;if(d.replace(/(\s+)$/g,"")!=""&&d.replace(/^\s+/g,"")!=""){location.href=""+JsWebURL+"/Common/search.aspx?sctext="+encodeURIComponent(d)+"&.ty="+c}else{aPsWar("必須有搜尋字串",1,"提示")}}function pointrate(d,c){try{var g=JsWebURL+"/s/AD/ADpageset.asmx/pointrate?a="+d+"&c="+c;xmlHttp.open("GET",g,true);xmlHttp.send(null)}catch(f){aPsWar("出現錯誤"+f,1,"xmlHttp 錯誤")}};