﻿
var isIE=navigator.appName.indexOf("Microsoft")!=-1;var _ShowDash=false;var MonthFName=new Array("","JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC","===");var MonthEName=new Array("","January","February","March","April","May","June","July","August","September","October","November","December","======= ");var MonthCName=new Array("","一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月","======");function setDateByDate(sID,sDate,lang,ShowDash,previousYear,nextYear){try{if(ShowDash==null){ShowDash=false;};if(previousYear==null){previousYear="1";};if(nextYear==null){nextYear="1";};if(sDate.length!=8){throw "Date Format Error, It should be 'YYYYMMDD'.";};if(!Number(sDate)){throw "Date Format Error, It should be 'YYYYMMDD'.";};var mYear=sDate.substring(0,4);var mMonth=sDate.substring(4,6);if(Number(mMonth)>12){throw "Month is between 1 to 12.";};var mDay=sDate.substring(6);if(Number(mDay)>31){throw "Day is between 1 to 31.";};if(lang.toUpperCase()!='E'&&lang.toUpperCase()!='C'&&lang.toUpperCase()!='F'){throw "Parameter 3(lang) must be 'C','E','F'.";};_ShowDash=ShowDash;_setDateChangeEvent(sID,ShowDash);_setDateElementValue(sID,lang,mYear,mMonth,mDay,previousYear,nextYear);_createHiddenField(sID);}catch(exception){alert(exception);return "";}};function setDateByOffset(sID,offset,lang,ShowDash,previousYear,nextYear){if(ShowDash==null){ShowDash=false;};if(previousYear==null){previousYear="1";};if(nextYear==null){nextYear="1";};var sOffset=0;if(Number(offset)){sOffset=offset;};try{var mDate=new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate()-(0-sOffset));var mYear=mDate.getFullYear();var mMonth=mDate.getMonth()+1;var mDay=mDate.getDate();if(lang.toUpperCase()!='E'&&lang.toUpperCase()!='C'&&lang.toUpperCase()!='F'){throw "Parameter 3(lang) must be 'C','E','F'.";};_ShowDash=ShowDash;_setDateChangeEvent(sID,ShowDash);_setDateElementValue(sID,lang,mYear,mMonth,mDay,previousYear,nextYear);_createHiddenField(sID);if(offset=="="){resetDateDash(sID);}}catch(exception){alert(exception);return "";}};function resetDateDash(sID){getChildred(sID+'Year')[0].selected=true;getChildred(sID+'Month')[0].selected=true;getChildred(sID+'Day')[0].selected=true;};function _setDateChangeEvent(sID,ShowDash){getId(sID+'Year').onchange=function(){_DateChange(sID,ShowDash);};getId(sID+'Month').onchange=function(){_DateChange(sID,ShowDash);};getId(sID+"Day").onchange=function(){_DateChange(sID,ShowDash);}};function _DateChange(sID,ShowDash){var mDayObj=getId(sID+"Day");var nodes=getChildred(sID+"Day");if(ShowDash){if(getId(sID+'Month').value==""){var t=nodes-1;for(i=0;i<t;i++){if(isIE){var oOption=mDayObj.children[1];}else{var oOption=mDayObj[1];};mDayObj.removeChild(oOption);};oParentId=getId(sID+"Date");oParentId.value=_getDateValue(sID);return;}};var nodesNo=nodes.length;var dayno=_getDays(getId(sID+'Month').value,getId(sID+'Year').value);if(nodesNo<dayno||nodesNo==dayno){var offset=dayno-nodesNo;if(ShowDash){for(i=0;i<=offset;i++){appChild(sID+"Day",new Array((nodesNo+i),(nodesNo+i)));}}else{for(i=0;i<offset;i++){appChild(sID+"Day",new Array((nodesNo+i+1),(nodesNo+i+1)));}}}else if(nodesNo>dayno){if(ShowDash){for(i=nodesNo;i>dayno+1;i--){var ochild=nodes[i-1];mDayObj.removeChild(ochild);}}else{for(i=nodesNo;i>dayno;i--){var ochild=nodes[i-1];mDayObj.removeChild(ochild);}}};oParentId=getId(sID+"Date");oParentId.value=_getDateValue(sID);if(ShowDash){try{if(isIE){for(i=1;i<mDayObj.children.length;i++){if(mDayObj.children[i].selected){mDayObj.children[i].selected=true;return;}}}else{for(i=1;i<mDayObj.length;i++){if(mDayObj[i].selected){mDayObj[i].selected=true;return;}}}}catch(ex){;}}};function _setDateElementValue(sID,lang,mYear,mMonth,mDay,beforeYear,afterYear){try{var cNodes=getChildred(sID+'Year');var oText,oValue;if(cNodes.length==0){if(_ShowDash){oText="=== ";oValue="";appChild(sID+'Year',new Array(oValue,oText));};for(i=beforeYear;i>0;i--){oText=Number(mYear)-i;appChild(sID+"Year",new Array(oText,oText));};appChild(sID+"Year",new Array(mYear,mYear));for(i=1;i<=afterYear;i++){oText=Number(mYear)+i;appChild(sID+"Year",new Array(oText,oText));}};if(!_ShowDash){for(var i=0;i<cNodes.length;i++){var nodeValue=cNodes[i].value;if(nodeValue==mYear){cNodes[i].selected=true;}}};cNodes=getChildred(sID+'Month');if(cNodes.length==0){if(_ShowDash){if(lang.toUpperCase()=='E'){oText=MonthEName[13];}else if(lang.toUpperCase()=='C'){oText=MonthCName[13];}else if(lang.toUpperCase()=='F'){oText=MonthFName[13];};oValue="";appChild(sID+'Month',new Array(oValue,oText));};for(i=1;i<13;i++){if(lang.toUpperCase()=='E'){oText=MonthEName[i];}else if(lang.toUpperCase()=='C'){oText=MonthCName[i];}else if(lang.toUpperCase()=='F'){oText=MonthFName[i];};oValue=(i<10)?"0"+i:i;appChild(sID+'Month',new Array(oValue,oText));}};cNodes[Number(mMonth)-(_ShowDash?0:1)].selected=true;cNodes=getChildred(sID+"Day");if(cNodes.length==0){if(_ShowDash){oText=" =";oValue="";appChild(sID+"Day",new Array(oValue,oText));};var dayno=_getDays(mMonth,mYear)+1;for(i=1;i<dayno;i++){oText=(i<10)?"0"+i:i;appChild(sID+"Day",new Array(oText,oText));}};var oDay=_getDays(mMonth,mYear);if(Number(mDay)>Number(oDay)){cNodes[Number(oDay)-(_ShowDash?0:1)].selected=true;}else{cNodes[Number(mDay)-(_ShowDash?0:1)].selected=true;}}catch(err){alert(err);}};function getId(v){return document.getElementById(v);};function getChildred(id){if(isIE){return document.getElementById(id).children;}else{return document.getElementById(id);}};function appChild(id,tmpArr){if(isIE){var oOption=document.createElement("OPTION");oOption.value=tmpArr[0];oOption.text=tmpArr[1];getId(id).add(oOption);}else{var oOption=new Option(tmpArr[1],tmpArr[0]);getId(id).appendChild(oOption);}};function _getDays(month,year){var _daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31];if(2==month){return((0==year%4)&&(0!=(year%100)))||(0==year%400)?29:28;}else{return _daysInMonth[month-1];}};function _createHiddenField(sID){var oInput=document.createElement("INPUT");oInput.setAttribute("type","hidden");oInput.setAttribute("value",_getDateValue(sID));oInput.setAttribute("name",sID+"Date");oInput.setAttribute("id",sID+"Date");var oParentObj=getId(sID+'Year').parentNode;oParentObj.appendChild(oInput);};function _getDateValue(sID){return getId(sID+'Year').value+getId(sID+'Month').value+getId(sID+'Day').value;}

﻿
if(window.dynamicReq==null){window.dynamicReq={};};function TUF1_DynamicReq(){this.tThread="ct_"+Math.random()*100;addThread(this);};function addThread(obj){window.dynamicReq[obj.tThread]={_modelObj:obj,_isShowLoadingBox:false,_boxOffsetLeft:0,_boxOffsetTop:0,_drMsg:null,_LoadingDIV:null,_scriptDIV:null,_afterSubmit:null,_ifm:null,_href:null,_parm:null,_call:"no set"};};TUF1_DynamicReq.prototype.getContent=function(sURL,id){var t=window.dynamicReq[this.tThread];if(t._isShowLoadingBox){this.setProgressDIVBox();};var href=null;var parm=null;var is_async=(id==null?false:true);if(sURL.indexOf("?")>0){href=sURL.substring(0,sURL.indexOf("?"));parm=sURL.substring(sURL.indexOf("?")+1);}else{href=sURL;};var xmlhttp=tdr_CreateXHR();var tThread=this.tThread;t._href=href;t._parm=parm;if(is_async){xmlhttp.onreadystatechange=function(){var t=window.dynamicReq[tThread];var obj=t._modelObj;if(xmlhttp.readyState==4){var response=xmlhttp.responseText;if(xmlhttp.status==200){try{obj.setInnerHTML(response,id);}catch(ex){alert(ex.message);return false;}}else if(xmlhttp.status=='12029'||xmlhttp.status=='12030'||xmlhttp.status=='12031'){var tdrMsg="A problem occurred with communication with the server program.\n"+"Please make sure you are connected to the Internet and try again in a few moments.";alert(tdrMsg);}else{tdr_IncludeJs('/tuf1/js/TUF1_DynamicReqErr.js');showError(response,xmlhttp.status,t._href,t._parm);};obj.cHideProgress();if(t._afterSubmit){eval(t._afterSubmit);};if(t._scriptDIV){tdr_GetBody().removeChild(t._scriptDIV);t._scriptDIV=null;}}};};xmlhttp.open('POST',href,is_async);xmlhttp.setRequestHeader("X-Requested-With","XMLHttpRequest");xmlhttp.setRequestHeader("Accept","text/javascript,text/html,application/xml,text/xml,*/*");xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlhttp.setRequestHeader("X-Requested-Call",t._call);if(href.indexOf("TUF1_ControllerServlet.do")>0){if((parm==null||parm=="")){xmlhttp.setRequestHeader("X-Requested-sURL",sURL);}else{xmlhttp.setRequestHeader("X-Requested-parm",parm.length>100?parm.substring(0,100):parm);}};xmlhttp.send(parm);if(!is_async){var html=xmlhttp.responseText;this.cHideProgress();if(t._afterSubmit){eval(t._afterSubmit);};return html.replace(/<script([^>]*)>/gi,'<script$1 defer>');}};TUF1_DynamicReq.prototype.setMsgShowType=function(sType,msg,msgId){var t=window.dynamicReq[this.tThread];if(sType=="2"){if(msg==null){alert("Error! Please give me some message.");}else{t._isShowLoadingBox=true;t._drMsg=msg;}}};TUF1_DynamicReq.prototype.setMsgBoxOffset=function(top,left){var t=window.dynamicReq[this.tThread];if(t._isShowLoadingBox){if(top==null){top=0;};if(left==null){left=0;};t._boxOffsetTop=top;t._boxOffsetLeft=left;}else{alert("Please exec cSetMsgShowType(2,Msg) first.");}};TUF1_DynamicReq.prototype.postFormData=function(fID,SpanID){var fObj=tdr_GetId(fID);var target,sUrl;try{target=fObj.action;}catch(exception){alert(exception);};tdr_IncludeJs("/tuf1/js/TUF1_GetFormValue.js");var str=getFormValue(fObj);if(target.indexOf("?")>0){sUrl=target+'&'+str;}else{sUrl=target+'?'+str;};return this.getContent(sUrl,SpanID);};TUF1_DynamicReq.prototype.setInnerHTML=function(code,id){var el=tdr_GetId(id);if(el){el.innerHTML="";var t=window.dynamicReq[this.tThread];if(tdr_isIE()){code='<div style="display:none">for IE</div>'+code;code=code.replace(/<script([^>]*)>/gi,'<script$1 defer>');el.innerHTML=code;el.removeChild(el.firstChild);}else{var el_next=el.nextSibling;var el_parent=el.parentNode;el_parent.removeChild(el);el.innerHTML=code;if(el_next){el_parent.insertBefore(el,el_next)}else{el_parent.appendChild(el);}}}};TUF1_DynamicReq.prototype.getScript=function(url,is_async){if(is_async){is_async=(is_async=="Y"?true:false);}else{is_async=true;};var t=window.dynamicReq[this.tThread];t._scriptDIV=document.createElement('DIV');t._scriptDIV.id="ScriptDIV"+this.tThread;tdr_GetBody().appendChild(t._scriptDIV);if(is_async){this.getContent(url,"ScriptDIV"+this.tThread);}else{var code=this.getContent(url);this.setInnerHTML(code,"ScriptDIV"+this.tThread);tdr_GetBody().removeChild(t._scriptDIV);t._scriptDIV=null;}};TUF1_DynamicReq.prototype.setAfterSubmit=function(n){var t=window.dynamicReq[this.tThread];t._afterSubmit=n;};TUF1_DynamicReq.prototype.setCall=function(n){var t=window.dynamicReq[this.tThread];t._call=n;};TUF1_DynamicReq.prototype.cHideProgress=function(){var t=window.dynamicReq[this.tThread];if(t._isShowLoadingBox){tdr_GetBody().removeChild(t._LoadingDIV);tdr_GetBody().removeChild(t._ifm);t._ifm=null;t._LoadingDIV=null;};tdr_GetBody().onscroll=function(){;};tdr_GetBody().onresize=function(){;}};TUF1_DynamicReq.prototype.setProgressDIVBox=function(){var t=window.dynamicReq[this.tThread];t._LoadingDIV=document.createElement('DIV');tdr_GetBody().appendChild(t._LoadingDIV);var str="<table width='200' border='0' cellspacing='2' cellpadding='2' id='msgTable"+this.tThread+"'>"+"  <tr> "+"    <td align='center' bgcolor='#3068D8'>"+"     <table width='200' border='0' cellspacing='0' cellpadding='0' bgcolor='#EBF2FF'>"+"        <tr> "+"          <td align='center' style='color: #222222; font-weight: bold; font-size:12px; font-family:Verdana,Helvetica'><BR>"+t._drMsg+"<BR><BR></td>"+"        </tr>"+"      </table></td>"+"  </tr>"+"</table>";t._LoadingDIV.innerHTML=str;t._LoadingDIV.style.position='absolute';t._LoadingDIV.style.height='200px';t._LoadingDIV.style.width='300px';t._LoadingDIV.style.zIndex=3;t._LoadingDIV.style.left=document.body.clientWidth/2-100+t._boxOffsetLeft;t._LoadingDIV.style.top=document.body.scrollTop+250+t._boxOffsetTop;if(tdr_isIE()){t._LoadingDIV.style.filter="progid:DXImageTransform.Microsoft.Shadow(color=#666666,direction=135,Strength=5)";};t._ifm=document.createElement('IFRAME');t._ifm.src="javascript:false";t._ifm.style.position='absolute';t._ifm.style.visibility='inherit';t._ifm.style.top=0;t._ifm.style.left=0;t._ifm.style.width=0;t._ifm.style.height=0;t._ifm.style.zIndex=2;t._ifm.frameBorder=0;t._ifm.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';t._ifm.id='ifm'+this.tThread;tdr_GetBody().appendChild(t._ifm);t._ifm.style.width=tdr_GetId('msgTable'+this.tThread).offsetWidth-5;t._ifm.style.height=tdr_GetId('msgTable'+this.tThread).offsetHeight-5;var thread=this.tThread;tdr_SetMsgBoxPos(thread);tdr_GetBody().onscroll=function(){tdr_SetMsgBoxPos(thread)};tdr_GetBody().onresize=function(){tdr_SetMsgBoxPos(thread)};};function tdr_isIE(){return(navigator.appName.indexOf("Microsoft")!=-1);};function tdr_SetMsgBoxPos(thread){var t=window.dynamicReq[thread];var top=document.body.scrollTop+250+t._boxOffsetTop;var left=document.body.clientWidth/2-100+t._boxOffsetLeft;t._LoadingDIV.style.top=top;t._LoadingDIV.style.left=left;t._ifm.style.top=top+2;t._ifm.style.left=left+2;};function tdr_CreateXHR(){var xmlhttp;try{xmlhttp=new XMLHttpRequest();}catch(e){try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP.4.0");}catch(e){try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xmlhttp=new ActiveXObject("microsoft.XMLHTTP");}catch(e){alert(e);throw new Error("Unable to get an HTTP request object.");}}}};return xmlhttp;};function tdr_IncludeJs(js){try{var xmlhttp=tdr_CreateXHR();xmlhttp.open('GET',js,false);xmlhttp.setRequestHeader("X-Requested-With","XMLHttpRequest");xmlhttp.send(null);window.execScript(xmlhttp.responseText);}catch(e){alert("tdr_IncludeJs - Exception : "+e);}};function tdr_GetBody(){return document.getElementsByTagName('BODY')[0];};function tdr_GetId(v){return document.getElementById(v);};if(window.execScript==null){try{window.execScript=function(script){window.eval(script);}}catch(e){alert(e);}};

function ac_getId(v){return document.getElementById(v);};function ac_isIE(){return(navigator.appName.indexOf("Microsoft")!=-1);};function initAutoComplete(){var nodes=document.getElementsByTagName("input");for(var x=0;x<nodes.length;x++){var baseNode=nodes[x];if(baseNode.getAttribute("ecType")=="AutoComplete"){if(!baseNode.getAttribute("init")){if(baseNode.getAttribute("dataHeight")==null)baseNode.setAttribute("dataHeight","10");if(baseNode.getAttribute("keyin")==null)baseNode.setAttribute("keyin","1");baseNode.style.width=(baseNode.getAttribute("dataWidth")==null?"300px":baseNode.getAttribute("dataWidth"));baseNode.setAttribute("autocomplete","off");if(!ac_getId("tuf1ac_"+baseNode.getAttribute("id")+"_iframe")&&ac_isIE()){var iframe=document.createElement("iframe");iframe.id="tuf1ac_"+baseNode.getAttribute("id")+"_iframe";iframe.style.display="none";iframe.style.position="absolute";iframe.style.zIndex=9999;iframe.frameborder=0;document.getElementsByTagName("BODY")[0].appendChild(iframe);};if(!ac_getId(baseNode.getAttribute("id")+"_hideValue")){var hidevalue=document.createElement("input");hidevalue.setAttribute("id",baseNode.getAttribute("id")+"_hideValue");hidevalue.type="hidden";hidevalue.value="";document.getElementsByTagName("BODY")[0].appendChild(hidevalue);};if(!ac_getId(baseNode.getAttribute("id")+"_visibleValue")){var visiblevalue=document.createElement("input");visiblevalue.setAttribute("id",baseNode.getAttribute("id")+"_visibleValue");visiblevalue.type="hidden";visiblevalue.value="";document.getElementsByTagName("BODY")[0].appendChild(visiblevalue);};var obj_allowNoData=(baseNode.getAttribute("allowNoData")?baseNode.getAttribute("allowNoData"):"no");baseNode.onchange=function(){ac_getId(baseNode.getAttribute("id")).value="";};if(obj_allowNoData!="yes"){ac_getId(baseNode.getAttribute("id")).onchange=function(e){if(ac_getId(this.getAttribute("id")+"_hideValue").value==""){ac_getId(this.getAttribute("id")).value="";ac_getId(this.getAttribute("id")+"_hideValue").value="";}}};baseNode.init="ok";var obj_id=(baseNode.getAttribute("id")?baseNode.getAttribute("id"):"");var obj_params=(baseNode.getAttribute("sql_params")?baseNode.getAttribute("sql_params"):"");var obj_action=(baseNode.getAttribute("action")?baseNode.getAttribute("action"):"");var obj_dataRows=(baseNode.getAttribute("dataHeight")?baseNode.getAttribute("dataHeight"):"10");var obj_keyin=(baseNode.getAttribute("keyin")?baseNode.getAttribute("keyin"):"1");var obj_scope=(baseNode.getAttribute("scope")?baseNode.getAttribute("scope"):"static");var obj_switch=(baseNode.getAttribute("switchSql")?baseNode.getAttribute("switchSql"):"");var datasource=(baseNode.getAttribute("datasource")?baseNode.getAttribute("datasource"):"");var noDataFound=(baseNode.getAttribute("multiLang")?baseNode.getAttribute("multiLang"):"Data not found.");var obj_afterComplete=(baseNode.getAttribute("afterComplete")?baseNode.getAttribute("afterComplete"):"");var obj_afterNotComplete=(baseNode.getAttribute("afterNotComplete")?baseNode.getAttribute("afterNotComplete"):"");var obj_width=baseNode.style.width;actb(obj_id,obj_dataRows,obj_keyin,obj_action,obj_afterComplete,obj_width,obj_params,obj_scope,obj_switch,obj_allowNoData,noDataFound,datasource,obj_afterNotComplete);}}}};function actb(id,height,keyin,action,afterComplete,dataWidth,params,scope,switchSql,allowNoData,noDataFound,datasource,afterNotComplete){this.actb_timeOut=-1;this.actb_lim=height;this.actb_firstText=true;this.actb_mouse=true;this.actb_delimiter=new Array(';');this.actb_startcheck=keyin;this.actb_bgColor='#DDF2FF';this.actb_textColor='#000000';this.actb_hColor='#6CA4DF';this.actb_fFamily='Verdana';this.actb_fSize='10px';this.actb_hStyle='text-decoration:underline;font-weight:bold;';var actb_delimwords=new Array();var actb_cdelimword=0;var actb_delimchar=new Array();var actb_display=false;var actb_pos=0;var actb_total=0;var actb_curr=null;var actb_rangeu=0;var actb_ranged=0;var actb_bool=new Array();var actb_pre=0;var actb_toid;var actb_tomake=false;var actb_getpre="";var actb_mouse_on_list=0;var actb_kwcount=0;var actb_caretmove=false;this.actb_keywords=new Array();var actb_curr_origin=null;var actbtemp=new Array();var actb_self=this;actb_curr=ac_getId(id);addEvent(actb_curr,"focus",actb_setup);function actb_setup(){addEvent(document,"keydown",actb_checkkey);addEvent(actb_curr,"blur",actb_clear);addEvent(document,"keypress",actb_keypress);};function actb_clear(evt){if(!evt)evt=event;removeEvent(document,"keydown",actb_checkkey);removeEvent(actb_curr,"blur",actb_clear);removeEvent(document,"keypress",actb_keypress);actb_removedisp();};function actb_parse(n){if(actb_self.actb_delimiter.length>0){var t=actb_delimwords[actb_cdelimword].trim().addslashes();var plen=actb_delimwords[actb_cdelimword].trim().length;}else{var t=actb_curr.value.addslashes();var plen=actb_curr.value.length;};var tobuild='';var i;if(actb_self.actb_firstText){var re=new RegExp("^"+t,"i");}else{var re=new RegExp(t,"i");};var p=n.search(re);for(i=0;i<p;i++){tobuild+=n.substr(i,1);};tobuild+="<font style='"+(actb_self.actb_hStyle)+"'>"
for(i=p;i<plen+p;i++){tobuild+=n.substr(i,1);};tobuild+="</font>";for(i=plen+p;i<n.length;i++){tobuild+=n.substr(i,1);};return tobuild;};function actb_generate(){if(ac_getId("tuf1ac_tat_table")){actb_display=false;document.body.removeChild(ac_getId("tuf1ac_tat_table"));};a=document.createElement('table');a.style.border='1px solid #A4A4A4';a.cellSpacing='0px';a.cellPadding='2px';a.style.position='absolute';a.style.width=dataWidth;a.style.top=eval(curTop(actb_curr)+actb_curr.offsetHeight)+"px";a.style.left=curLeft(actb_curr)+(ac_isIE()?2:0)+"px";a.style.backgroundColor=actb_self.actb_bgColor;a.id="tuf1ac_tat_table";document.body.appendChild(a);if(actb_kwcount==0){r=a.insertRow(-1);c=r.insertCell(-1);c.style.borderBottom='1px solid #A4A4A4';c.style.color=actb_self.actb_textColor;c.style.fontFamily=actb_self.actb_fFamily;c.style.fontSize=actb_self.actb_fSize;c.innerHTML=noDataFound;c.style.width=dataWidth;if(ac_isIE()){ShowLayer(id);var iframe=ac_getId("tuf1ac_"+id+"_iframe");iframe.style.display="block";iframe.style.width=dataWidth;iframe.style.height="20px";iframe.style.top=eval(curTop(actb_curr)+actb_curr.offsetHeight)+"px";iframe.style.left=curLeft(actb_curr)+2+"px";};ac_getId(id+"_hideValue").value="";ac_getId(id+"_visibleValue").value="";};var i;var first=true;var j=1;if(actb_self.actb_mouse){a.onmouseout=actb_table_unfocus;a.onmouseover=actb_table_focus;};var counter=0;for(i=0;i<actb_self.actb_keywords.length;i++){if(actb_bool[i]){counter++;r=a.insertRow(-1);if(first&&!actb_tomake){r.style.backgroundColor=actb_self.actb_hColor;first=false;actb_pos=counter;}else if(actb_pre==i){r.style.backgroundColor=actb_self.actb_hColor;first=false;actb_pos=counter;}else{r.style.backgroundColor=actb_self.actb_bgColor;};r.id="tuf1ac_tat_tr"+(j);c=r.insertCell(-1);c.style.borderBottom='1px solid #A4A4A4';c.style.color=actb_self.actb_textColor;c.style.fontFamily=actb_self.actb_fFamily;c.style.fontSize=actb_self.actb_fSize;c.innerHTML=actb_parse(actb_self.actb_keywords[i][0]);c.style.width=dataWidth;c.id="tuf1ac_tat_td"+(j);c.setAttribute("pos",j);if(actb_self.actb_mouse){c.style.cursor="pointer";c.onclick=actb_mouseclick;c.onmouseover=actb_table_highlight;};j++;};if(j-1==actb_self.actb_lim&&j<actb_total){r=a.insertRow(-1);r.style.backgroundColor=actb_self.actb_bgColor;c=r.insertCell(-1);c.style.borderBottom='1px solid #A4A4A4';c.style.color=actb_self.actb_textColor;c.style.fontFamily='arial narrow';c.style.fontSize=actb_self.actb_fSize;c.align="center";c.style.width=dataWidth;c.innerHTML='<img src=\"/tuf1/images/ico_ArrowOrangeDown.gif\">';if(actb_self.actb_mouse){c.style.cursor="pointer";c.onclick=actb_mouse_down;};break;}};a.style.zIndex=10000;a.style.display="block";if(ac_isIE()){var iframe=ac_getId("tuf1ac_"+id+"_iframe");iframe.style.display="block";iframe.style.zIndex=9999;if(a.offsetWidth==0||a.offsetHeight==0){iframe.style.width=0;iframe.style.height=0;}else{iframe.style.width=a.offsetWidth;iframe.style.height=a.offsetHeight-5;};iframe.style.left=a.offsetLeft;iframe.style.top=a.offsetTop+2;};actb_rangeu=1;actb_ranged=j-1;actb_display=true;if(actb_pos<=0)actb_pos=1;};function actb_remake(){document.body.removeChild(ac_getId("tuf1ac_tat_table"));a=document.createElement("table");a.style.border="1px solid #A4A4A4";a.cellSpacing="0px";a.cellPadding="2px";a.style.position="absolute";a.style.width=dataWidth;a.style.top=eval(curTop(actb_curr)+actb_curr.offsetHeight)+"px";a.style.left=curLeft(actb_curr)+(ac_isIE()?2:0)+"px";a.style.backgroundColor=actb_self.actb_bgColor;a.id="tuf1ac_tat_table";if(actb_self.actb_mouse){a.onmouseout=actb_table_unfocus;a.onmouseover=actb_table_focus;};document.body.appendChild(a);var i;var first=true;var j=1;if(actb_rangeu>1){r=a.insertRow(-1);r.style.backgroundColor=actb_self.actb_bgColor;c=r.insertCell(-1);c.style.borderBottom="1px solid #A4A4A4";c.style.color=actb_self.actb_textColor;c.style.fontFamily="arial narrow";c.style.fontSize=actb_self.actb_fSize;c.align="center";c.style.width=dataWidth;c.innerHTML='<img src=\"/tuf1/images/ico_ArrowOrangeUp.gif\">';if(actb_self.actb_mouse){c.style.cursor="pointer";c.onclick=actb_mouse_up;}};for(i=0;i<actb_self.actb_keywords.length;i++){if(actb_bool[i]){if(j>=actb_rangeu&&j<=actb_ranged){r=a.insertRow(-1);r.style.backgroundColor=actb_self.actb_bgColor;r.id="tuf1ac_tat_tr"+(j);c=r.insertCell(-1);c.style.color=actb_self.actb_textColor;c.style.borderBottom="1px solid #A4A4A4";c.style.fontFamily=actb_self.actb_fFamily;c.style.fontSize=actb_self.actb_fSize;c.innerHTML=actb_parse(actb_self.actb_keywords[i][0]);c.style.width=dataWidth;c.id="tuf1ac_tat_td"+(j);c.setAttribute("pos",j);if(actb_self.actb_mouse){c.style.cursor="pointer";c.onclick=actb_mouseclick;c.onmouseover=actb_table_highlight;};j++;}else{j++;}};if(j>actb_ranged)break;};if(j-1<actb_total){r=a.insertRow(-1);r.style.backgroundColor=actb_self.actb_bgColor;c=r.insertCell(-1);c.style.borderBottom='1px solid #A4A4A4';c.style.color=actb_self.actb_textColor;c.style.fontFamily='arial narrow';c.style.fontSize=actb_self.actb_fSize;c.align="center";c.style.width=dataWidth;c.innerHTML='<img src=\"/tuf1/images/ico_ArrowOrangeDown.gif\">';if(actb_self.actb_mouse){c.style.cursor="pointer";c.onclick=actb_mouse_down;}};a.style.zIndex=10000;a.style.display="block";if(ac_isIE()){var iframe=ac_getId("tuf1ac_"+id+"_iframe");iframe.style.display="block";iframe.style.zIndex=9999;if(a.offsetWidth==0||a.offsetHeight==0){iframe.style.width=0;iframe.style.height=0;}else{iframe.style.width=a.offsetWidth-5;iframe.style.height=a.offsetHeight-5;};iframe.style.left=a.offsetLeft+2;iframe.style.top=a.offsetTop;}};function actb_goup(){if(!actb_display)return;if(actb_pos==1)return;ac_getId("tuf1ac_tat_tr"+actb_pos).style.backgroundColor=actb_self.actb_bgColor;actb_pos--;if(actb_pos<actb_rangeu)actb_moveup();ac_getId("tuf1ac_tat_tr"+actb_pos).style.backgroundColor=actb_self.actb_hColor;if(actb_toid)clearTimeout(actb_toid);if(actb_self.actb_timeOut>0)actb_toid=setTimeout(function(){actb_mouse_on_list=0;actb_removedisp();},actb_self.actb_timeOut);};function actb_godown(){if(!actb_display)return;if(actb_pos==actb_total)return;ac_getId("tuf1ac_tat_tr"+actb_pos).style.backgroundColor=actb_self.actb_bgColor;actb_pos++;if(actb_pos>actb_ranged)actb_movedown();ac_getId("tuf1ac_tat_tr"+actb_pos).style.backgroundColor=actb_self.actb_hColor;if(actb_toid)clearTimeout(actb_toid);if(actb_self.actb_timeOut>0)actb_toid=setTimeout(function(){actb_mouse_on_list=0;actb_removedisp();},actb_self.actb_timeOut);};function actb_movedown(){actb_rangeu++;actb_ranged++;actb_remake();};function actb_moveup(){actb_rangeu--;actb_ranged--;actb_remake();};function actb_mouse_down(){ac_getId("tuf1ac_tat_tr"+actb_pos).style.backgroundColor=actb_self.actb_bgColor;actb_pos++;actb_movedown();ac_getId("tuf1ac_tat_tr"+actb_pos).style.backgroundColor=actb_self.actb_hColor;actb_curr.focus();actb_mouse_on_list=0;if(actb_toid)clearTimeout(actb_toid);if(actb_self.actb_timeOut>0)actb_toid=setTimeout(function(){actb_mouse_on_list=0;actb_removedisp();},actb_self.actb_timeOut);};function actb_mouse_up(evt){if(!evt)evt=event;if(evt.stopPropagation){evt.stopPropagation();}else{evt.cancelBubble=true;};ac_getId("tuf1ac_tat_tr"+actb_pos).style.backgroundColor=actb_self.actb_bgColor;actb_pos--;actb_moveup();ac_getId("tuf1ac_tat_tr"+actb_pos).style.backgroundColor=actb_self.actb_hColor;actb_curr.focus();actb_mouse_on_list=0;if(actb_toid)clearTimeout(actb_toid);if(actb_self.actb_timeOut>0)actb_toid=setTimeout(function(){actb_mouse_on_list=0;actb_removedisp();},actb_self.actb_timeOut);};function actb_mouseclick(evt){if(!evt)evt=event;if(!actb_display)return;actb_mouse_on_list=0;actb_pos=this.getAttribute("pos");actb_penter();};function actb_table_focus(){actb_mouse_on_list=1;};function actb_table_unfocus(){actb_mouse_on_list=0;if(actb_toid)clearTimeout(actb_toid);if(actb_self.actb_timeOut>0)actb_toid=setTimeout(function(){actb_mouse_on_list=0;actb_removedisp();},actb_self.actb_timeOut);};function actb_table_highlight(){actb_mouse_on_list=1;ac_getId("tuf1ac_tat_tr"+actb_pos).style.backgroundColor=actb_self.actb_bgColor;actb_pos=this.getAttribute('pos');while(actb_pos<actb_rangeu)actb_moveup();while(actb_pos>actb_ranged)actb_movedown();ac_getId("tuf1ac_tat_tr"+actb_pos).style.backgroundColor=actb_self.actb_hColor;if(actb_toid)clearTimeout(actb_toid);if(actb_self.actb_timeOut>0)actb_toid=setTimeout(function(){actb_mouse_on_list=0;actb_removedisp();},actb_self.actb_timeOut);};function actb_insertword(word,word_value,word_visible){a=ac_getId(id+"_hideValue");a.value=word_value;actb_curr.value=word;actb_mouse_on_list=0;actb_removedisp();b=ac_getId(id+"_visibleValue");b.value=word_visible;if(afterComplete){eval(afterComplete+"(actb_curr)");}};function actb_penter(){actb_display=false;var word="";var word_value="";var word_visible="";var c=0;for(var i=0;i<=actb_self.actb_keywords.length;i++){if(actb_bool[i])c++;if(c==actb_pos){word=actb_self.actb_keywords[i][0];word_value=actb_self.actb_keywords[i][1];word_visible=actb_self.actb_keywords[i][2];if(ac_isIE()){HideLayer(id);};break;}};actb_insertword(word,word_value,word_visible);l=getCaretStart(actb_curr);};function actb_removedisp(){if(actb_mouse_on_list==0){if(ac_isIE()){HideLayer(id);};actb_display=0;if(ac_getId("tuf1ac_tat_table")){document.body.removeChild(ac_getId("tuf1ac_tat_table"));};if(actb_toid)clearTimeout(actb_toid);}};function actb_keypress(e){if(actb_caretmove)stopEvent(e);return !actb_caretmove;};function actb_checkkey(evt){if(!evt)evt=event;a=evt.keyCode;caret_pos_start=getCaretStart(actb_curr);actb_caretmove=0;switch(a){case 38:actb_goup();actb_caretmove=1;return false;break;case 40:actb_godown();actb_caretmove=1;return false;break;case 13:case 9:if(actb_display){actb_caretmove=1;actb_penter();return false;}else{return true;};break;default:if(waiting){setTimeout(function(){actb_tocomplete(a)},250);waiting=false;};break;}};var waiting=true;function actb_tocomplete(kc){if(kc==38||kc==40||kc==13)return;var i;if(actb_display){var word=0;var c=0;for(var i=0;i<=actb_self.actb_keywords.length;i++){if(actb_bool[i])c++;if(c==actb_pos){word=i;break;}};actb_pre=word;}else{actb_pre=-1};var urlstr="/servlet/TUF1_AutoCompleteServlet?scope="+scope+"&search="+actb_curr.value+"&action="+action+"&switchSql="+switchSql+"&datasource="+datasource+"&"+params;var tdr=new TUF1_DynamicReq();tdr.setCall("TUF1_AutoComplete");actbtemp[id]=eval(tdr.getContent(urlstr));waiting=true;if(!actbtemp[id]){ac_getId(id+"_hideValue").value="";ac_getId(id+"_visibleValue").value="";if(afterComplete){eval(afterComplete+"(actb_curr)");}}else if(actbtemp[id]==""){actb_mouse_on_list=0;if(allowNoData!="yes"){if(ac_getId("tuf1ac_tat_table")){actb_display=false;document.body.removeChild(ac_getId("tuf1ac_tat_table"));};a=document.createElement("table");a.style.border='1px solid #A4A4A4';a.cellSpacing='0px';a.cellPadding='2px';a.style.position='absolute';a.style.width=dataWidth;a.style.top=eval(curTop(actb_curr)+actb_curr.offsetHeight)+"px";a.style.left=curLeft(actb_curr)+(ac_isIE()?2:0)+"px";a.style.backgroundColor=actb_self.actb_bgColor;a.id="tuf1ac_tat_table";document.body.appendChild(a);r=a.insertRow(-1);c=r.insertCell(-1);c.style.borderBottom='1px solid #A4A4A4';c.style.color=actb_self.actb_textColor;c.style.fontFamily=actb_self.actb_fFamily;c.style.fontSize=actb_self.actb_fSize;c.innerHTML=noDataFound;c.style.width=dataWidth;if(ac_isIE()){ShowLayer(id);var iframe=ac_getId("tuf1ac_"+id+"_iframe");iframe.style.display="block";iframe.style.width=dataWidth;iframe.style.height="20px";iframe.style.top=eval(curTop(actb_curr)+actb_curr.offsetHeight)+"px";iframe.style.left=curLeft(actb_curr)+2+"px";};ac_getId(id+"_hideValue").value="";ac_getId(id+"_visibleValue").value="";if(afterComplete){eval(afterComplete+"(actb_curr)");}}else{ac_getId(id+"_hideValue").value="";ac_getId(id+"_visibleValue").value="";if(afterNotComplete!=""){eval(afterNotComplete+"(actb_curr)");}}}else{actb_self.actb_keywords=new Array();for(var i=0;i<actbtemp[id].length;i++){tmpArr=(actbtemp[id])[i];actb_self.actb_keywords[i]=[unescape(tmpArr[0]),unescape(tmpArr[1]),unescape(tmpArr[2])];};if(actb_curr.value==""){actb_mouse_on_list=0;actb_removedisp();if(ac_isIE()){HideLayer(id);};return;};if(actb_self.actb_delimiter.length>0){caret_pos_start=getCaretStart(actb_curr);caret_pos_end=getCaretEnd(actb_curr);delim_split='';for(i=0;i<actb_self.actb_delimiter.length;i++){delim_split+=actb_self.actb_delimiter[i];};delim_split=delim_split.addslashes();delim_split_rx=new RegExp("(["+delim_split+"])");c=0;actb_delimwords=new Array();actb_delimwords[0]='';for(i=0,j=actb_curr.value.length;i<actb_curr.value.length;i++,j--){if(actb_curr.value.substr(i,j).search(delim_split_rx)==0){ma=actb_curr.value.substr(i,j).match(delim_split_rx);actb_delimchar[c]=ma[1];c++;actb_delimwords[c]='';}else{actb_delimwords[c]+=actb_curr.value.charAt(i);}};var l=0;actb_cdelimword=-1;for(i=0;i<actb_delimwords.length;i++){if(caret_pos_end>=l&&caret_pos_end<=l+actb_delimwords[i].length){actb_cdelimword=i;};l+=actb_delimwords[i].length+1;};var ot=actb_delimwords[actb_cdelimword].trim();var t=actb_delimwords[actb_cdelimword].addslashes().trim();}else{var ot=actb_curr.value;var t=actb_curr.value.addslashes();};if(ot.length==0){actb_mouse_on_list=0;actb_removedisp();};if(ot.length<actb_self.actb_startcheck)return this;if(actb_self.actb_firstText){var re=new RegExp("^"+t,"i");}else{var re=new RegExp(t,"i");};actb_total=0;actb_tomake=false;actb_kwcount=0;for(i=0;i<actb_self.actb_keywords.length;i++){actb_bool[i]=false;if(re.test(actb_self.actb_keywords[i][0])){actb_total++;actb_bool[i]=true;actb_kwcount++;if(actb_pre==i)actb_tomake=true;}};if(actb_toid)clearTimeout(actb_toid);if(actb_self.actb_timeOut>0)actb_toid=setTimeout(function(){actb_mouse_on_list=0;actb_removedisp();},actb_self.actb_timeOut);actb_generate();};return this;}};function ShowLayer(id){var layer=ac_getId("tuf1ac_tat_table");layer.style.zIndex=10000;layer.style.display="block";var iframe=ac_getId("tuf1ac_"+id+"_iframe");iframe.style.display="block";iframe.style.zIndex=9999;if(layer.offsetWidth==0||layer.offsetHeight==0){iframe.style.width=0;iframe.style.height=0;}else{iframe.style.width=layer.offsetWidth-5;iframe.style.height=layer.offsetHeight-5;};iframe.style.left=layer.offsetLeft+2;iframe.style.top=layer.offsetTop;};function HideLayer(id){var iframe=ac_getId("tuf1ac_"+id+"_iframe");iframe.style.display="none";};function addEvent(obj,event_name,func_name){if(obj.attachEvent){obj.attachEvent("on"+event_name,func_name);}else if(obj.addEventListener){obj.addEventListener(event_name,func_name,true);}else{obj["on"+event_name]=func_name;}};function removeEvent(obj,event_name,func_name){if(obj.detachEvent){obj.detachEvent("on"+event_name,func_name);}else if(obj.removeEventListener){obj.removeEventListener(event_name,func_name,true);}else{obj["on"+event_name]=null;}};function stopEvent(evt){evt||window.event;if(evt.stopPropagation){evt.stopPropagation();evt.preventDefault();}else if(typeof evt.cancelBubble!="undefined"){evt.cancelBubble=true;evt.returnValue=false;};return false;};function getElement(evt){if(window.event){return window.event.srcElement;}else{return evt.currentTarget;}};function getTargetElement(evt){if(window.event){return window.event.srcElement;}else{return evt.target;}};function stopSelect(obj){if(typeof obj.onselectstart!='undefined'){addEvent(obj,"selectstart",function(){return false;});}};function getCaretEnd(obj){if(typeof obj.selectionEnd!="undefined"){return obj.selectionEnd;}else if(document.selection&&document.selection.createRange){var M=document.selection.createRange();try{var Lp=M.duplicate();Lp.moveToElementText(obj);}catch(e){var Lp=obj.createTextRange();};Lp.setEndPoint("EndToEnd",M);var rb=Lp.text.length;if(rb>obj.value.length){return -1;};return rb;}};function getCaretStart(obj){if(typeof obj.selectionStart!="undefined"){return obj.selectionStart;}else if(document.selection&&document.selection.createRange){var M=document.selection.createRange();try{var Lp=M.duplicate();Lp.moveToElementText(obj);}catch(e){var Lp=obj.createTextRange();};Lp.setEndPoint("EndToStart",M);var rb=Lp.text.length;if(rb>obj.value.length){return -1;};return rb;}};function setCaret(obj,l){obj.focus();if(obj.setSelectionRange){obj.setSelectionRange(l,l);}else if(obj.createTextRange){m=obj.createTextRange();m.moveStart('character',l);m.collapse();m.select();}};function setSelection(obj,s,e){obj.focus();if(obj.setSelectionRange){obj.setSelectionRange(s,e);}else if(obj.createTextRange){m=obj.createTextRange();m.moveStart('character',s);m.moveEnd('character',e);m.select();}};String.prototype.addslashes=function(){return this.replace(/(["\\\.\|\[\]\^\*\+\?\$\(\)])/g,'\\$1');};String.prototype.trim=function(){return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/,"$1");};function curTop(obj){toreturn=0;while(obj){toreturn+=obj.offsetTop;obj=obj.offsetParent;};return toreturn;};function curLeft(obj){toreturn=0;while(obj){toreturn+=obj.offsetLeft;obj=obj.offsetParent;};return toreturn;};function isNumber(a){return typeof a=='number'&&isFinite(a);};function replaceHTML(obj,text){while(el=obj.childNodes[0]){obj.removeChild(el);};obj.appendChild(document.createTextNode(text));};


var Today=new Date();var month=Today.getMonth()+1;var day=Today.getDate();if(month<10)month="0"+month;if(day<10)day="0"+day;var TodayDate=Today.getFullYear()+""+month+""+day;var Next3YearDate=(Today.getFullYear()+1)+''+month+''+day;var Previous3YearDate=(Today.getFullYear()-1)+''+month+''+day;var noInclude=true;function pc_getId(v){return document.getElementById(v);};function pc_checkDateFormat(id){var _oYear=pc_getId(id+"Year");var _oMonth=pc_getId(id+"Month");var _oDay=pc_getId(id+"Day");if(!(_oMonth.value==""&&_oDay.value==""&&_oYear.value=="")){if(_oMonth.selectedIndex=="0"&&_oMonth.value==""){return _oMonth;}else if(_oDay.selectedIndex=="0"&&_oDay.value==""){return _oDay;}else if(_oYear.selectedIndex=="0"&&_oYear.value==""){return _oYear;}}else{return "";}};function PopupCalendar(mainId){this.mainId=mainId;this.previousYear="1";this.nextYear="1";var ableDay=Today.getDate();if(ableDay<10){ableDay="0"+ableDay;};var PreviousYearDate=(Today.getFullYear()-Number(this.previousYear))+""+month+""+ableDay;var NextYearDate=(Today.getFullYear()+Number(this.nextYear))+""+month+""+ableDay;this.ableDateRange=PreviousYearDate+"~"+NextYearDate;this.ableStartDate=this.ableDateRange.split("~")[0];this.ableEndDate=this.ableDateRange.split("~")[1];this.isSetDefaultDate=false;if(!this.isSetDefaultDate){this.defaultDate=TodayDate;};this.type="DropDown";this.defaultDash=false;this.yearBeforeAfter=null;this.selectedYear=Today.getFullYear();};PopupCalendar.prototype.setAbleDateRange=function(a){this.ableDateRange=a;};PopupCalendar.prototype.setDefaultDate=function(d){this.defaultDate=d;this.isSetDefaultDate=true;};PopupCalendar.prototype.setType=function(t){this.type=t;};PopupCalendar.prototype.setPreviousYear=function(p){this.previousYear=p;};PopupCalendar.prototype.setNextYear=function(n){this.nextYear=n;};PopupCalendar.prototype.setDefaultDash=function(d){this.defaultDash=d;};PopupCalendar.prototype.setYearBeforeAfter=function(y){this.yearBeforeAfter=y;};PopupCalendar.prototype.setSelectedYear=function(y){this.selectedYear=y;};PopupCalendar.prototype.init=function(){var baseNodeId=this.mainId;var aid=document.createElement("span");if(this.type=="DropDown"){aid.innerHTML="<span>"+"<select id='"+baseNodeId+"Month' name='"+baseNodeId+"Month'></select>&nbsp;"+"<select id='"+baseNodeId+"Day' name='"+baseNodeId+"Day'></select>&nbsp;"+"<select id='"+baseNodeId+"Year' name='"+baseNodeId+"Year'></select>"+"</span>&nbsp;"+"<span>"+"<img id='"+baseNodeId+"_img1' src='/tuf1/images/ico_Calendar.gif' style='cursor:pointer;' align='absmiddle'>"+"</span>";};pc_getId(baseNodeId).appendChild(aid);aid.nodeObj=this;if(this.defaultDash&&!this.isSetDefaultDate){setDateByOffset(baseNodeId,"=","E",true,this.previousYear,this.nextYear);}else{setDateByDate(baseNodeId,this.defaultDate,"E",null,this.previousYear,this.nextYear);};var r=pc_getId(baseNodeId+"Year");if(this.yearBeforeAfter=="After"){for(var i=0;i<r.childNodes.length;i++){var yearValue=r.childNodes[i].value;if(yearValue!=""&&yearValue<Today.getFullYear()){r.remove(i);}}}else if(this.yearBeforeAfter=="Before"){for(var i=0;i<r.childNodes.length;i++){var yearValue=r.childNodes[i].value;if(yearValue!=""&&yearValue>Today.getFullYear()){r.remove(i);}}};for(var i=0;i<r.childNodes.length;i++){var yearValue=r.childNodes[i].value;if(yearValue==this.selectedYear){r.selectedIndex=i;}};window.CP_targetDropDownYear=pc_getId(baseNodeId+"Year");window.CP_targetDropDownMonth=pc_getId(baseNodeId+"Month");window.CP_targetDropDownDay=pc_getId(baseNodeId+"Day");pc_getId(baseNodeId+"_img1").onclick=pc_OpenCalendarHandler;if(noInclude){var div=document.createElement("div");div.id="tuf1pc_calendarDiv";div.style.position="absolute";div.style.visibility="hidden";div.style.backgroundColor="#ffffff";document.getElementsByTagName("BODY")[0].appendChild(div);if(document.all){var iframe=document.createElement("iframe");iframe.id="tuf1pc_calendarIframe";iframe.style.visibility="hidden";iframe.width="0";iframe.height="0";iframe.style.position="absolute";iframe.style.zIndex=10004;iframe.frameborder=0;document.getElementsByTagName("BODY")[0].appendChild(iframe);};noInclude=false;}};function pc_OpenCalendarHandler(event){var thisObj=this.parentNode.parentNode.nodeObj;alert("thisObj : "+thisObj.selectedYear+" , thisObj.mainId : "+thisObj.mainId);var calendar_obj=new CalendarPopup("tuf1pc_calendarDiv");if(thisObj.yearBeforeAfter=="After"){thisObj.ableStartDate=Today.getFullYear()+thisObj.ableStartDate.substring(4,8);}else if(thisObj.yearBeforeAfter=="Before"){thisObj.ableEndDate=Today.getFullYear()+thisObj.ableEndDate.substring(4,8);};calendar_obj.select(thisObj,thisObj.mainId);calendar_obj.addDisabledDates(null,thisObj.ableStartDate);calendar_obj.addDisabledDates(thisObj.ableEndDate,null);};function checkDateFillZero(o){var m=o.getMonth();var d=o.getDate();if(o.getMonth()<10){m="0"+Number(o.getMonth());};if(o.getDate()<10){d="0"+o.getDate();};var date=o.getFullYear()+""+m+""+d;return date;};function initPopupCalendar(obj_id,defaultDash){var baseNode=getId(obj_id);if(baseNode.getAttribute("ecType")=="PopupCalendar"){var calendar_obj=new CalendarPopup("tuf1pc_calendarDiv");var InputID=baseNode.getAttribute("id");var setDefaultDate=(baseNode.getAttribute("setDefaultDate")?baseNode.getAttribute("setDefaultDate"):TodayDate);if(setDefaultDate.length>8){setDefaultDate=setDefaultDate.substring(0,8);};var type=(baseNode.getAttribute("type")?baseNode.getAttribute("type"):"DropDown");var ableDateRange=(baseNode.getAttribute("ableDateRange")?baseNode.getAttribute("ableDateRange"):Previous3YearDate+"~"+Next3YearDate);var ableStartDate=ableDateRange.split("~")[0];var ableStartDateObj=new Date(Number(ableStartDate.substring(0,4)),ableStartDate.substring(4,6),Number(ableStartDate.substring(6,8)));var ableEndDate=ableDateRange.split("~")[1];var ableEndDateObj=new Date(Number(ableEndDate.substring(0,4)),ableEndDate.substring(4,6),Number(ableEndDate.substring(6,8)));ableStartDateObj.setDate(Number(ableStartDate.substring(6,8))-1);ableStartDate=checkDateFillZero(ableStartDateObj);ableEndDateObj.setDate(Number(ableEndDate.substring(6,8))+1);ableEndDate=checkDateFillZero(ableEndDateObj);var previousYear=(baseNode.getAttribute("previousYear")?baseNode.getAttribute("previousYear"):"1");var endYear=(baseNode.getAttribute("endYear")?baseNode.getAttribute("endYear"):"1");var selectedYear=(baseNode.getAttribute("selectedYear")?baseNode.getAttribute("selectedYear"):Today.getFullYear());var displayAfterOrBefore=(baseNode.getAttribute("displayAfterOrBefore")?baseNode.getAttribute("displayAfterOrBefore"):"");baseNode.nodeObj=baseNode;var aid=document.createElement("span");if(type=="DropDown"){aid.innerHTML="<span>"+"<select id='"+InputID+"Month' name='"+InputID+"Month'></select>&nbsp;"+"<select id='"+InputID+"Day' name='"+InputID+"Day'></select>&nbsp;"+"<select id='"+InputID+"Year' name='"+InputID+"Year'></select>"+"</span>&nbsp;"+"<span>"+"<img id='"+InputID+"_img1' src='/tuf1/images/ico_Calendar.gif' style='cursor:pointer;' align='absmiddle'>"+"</span>";};baseNode.appendChild(aid);if(defaultDash=="==="&&!baseNode.getAttribute("setDefaultDate")){setDateByOffset(InputID,'=','E',true,previousYear,endYear);}else{setDateByDate(InputID,setDefaultDate,"E",null,previousYear,endYear);};var r=pc_getId(InputID+"Year");if(displayAfterOrBefore=="After"){for(var i=0;i<r.childNodes.length;i++){var yearValue=r.childNodes[i].value;if(yearValue!=""&&yearValue<Today.getFullYear()){r.remove(i);}}}else if(displayAfterOrBefore=="Before"){for(var i=0;i<r.childNodes.length;i++){var yearValue=r.childNodes[i].value;if(yearValue!=""&&yearValue>Today.getFullYear()){r.remove(i);}}};for(var i=0;i<r.childNodes.length;i++){var yearValue=r.childNodes[i].value;if(yearValue==selectedYear){r.selectedIndex=i;}};window.CP_targetDropDownYear=getId(InputID+"Year");window.CP_targetDropDownMonth=getId(InputID+"Month");window.CP_targetDropDownDay=getId(InputID+"Day");getId(InputID+"_img1").onclick=function(){var obj=getId(obj_id).nodeObj;obj.mainId=obj.id;calendar_obj.addDisabledDates(null,ableStartDate);calendar_obj.addDisabledDates(ableEndDate,null);calendar_obj.select(obj,obj.id);};if(noInclude){var div=document.createElement("div");div.id="tuf1pc_calendarDiv";div.style.position="absolute";div.style.visibility="hidden";div.style.backgroundColor="#ffffff";document.getElementsByTagName("BODY")[0].appendChild(div);if(document.all){var iframe=document.createElement("iframe");iframe.id="tuf1pc_calendarIframe";iframe.style.visibility="hidden";iframe.width="0";iframe.height="0";iframe.style.position="absolute";iframe.style.zIndex=10004;iframe.frameborder=0;document.getElementsByTagName("BODY")[0].appendChild(iframe);};noInclude=false;}}};function getAnchorPosition(anchorname){var coordinates=new Object();var x=0,y=0;var use_gebi=false;if(pc_getId){use_gebi=true;};if(use_gebi&&document.all){x=AnchorPosition_getPageOffsetLeft(anchorname);y=AnchorPosition_getPageOffsetTop(anchorname);}else if(use_gebi){x=AnchorPosition_getPageOffsetLeft(anchorname);y=AnchorPosition_getPageOffsetTop(anchorname);}else{coordinates.x=0;coordinates.y=0;return coordinates;};coordinates.x=x;coordinates.y=y;return coordinates;};function getAnchorWindowPosition(anchorname){var coordinates=getAnchorPosition(anchorname);var x=0;var y=0;if(pc_getId){if(isNaN(window.screenX)){x=coordinates.x-document.body.scrollLeft+window.screenLeft;y=coordinates.y-document.body.scrollTop+window.screenTop;}else{x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;}}else if(document.all){x=coordinates.x-document.body.scrollLeft+window.screenLeft;y=coordinates.y-document.body.scrollTop+window.screenTop;};coordinates.x=x;coordinates.y=y;return coordinates;};function AnchorPosition_getPageOffsetLeft(el){el=pc_getId(el.mainId+"_img1");var ol=el.offsetLeft;while((el=el.offsetParent)!=null){ol+=el.offsetLeft;};return ol;};function AnchorPosition_getPageOffsetTop(el){var ot=pc_getId(el.mainId).offsetTop;while((el=el.offsetParent)!=null){ot+=el.offsetTop;};return ot;};function AnchorPosition_getWindowOffsetTop(el){return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;};var MONTH_NAMES=new Array('January','February','March','April','May','June','July','August','September','October','November','December','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');var DAY_NAMES=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sun','Mon','Tue','Wed','Thu','Fri','Sat');function LZ(x){return(x<0||x>9?"":"0")+x};function isDate(val,format){var date=getDateFromFormat(val,format);if(date==0){return false;};return true;};function compareDates(date1,dateformat1,date2,dateformat2){var d1=getDateFromFormat(date1,dateformat1);var d2=getDateFromFormat(date2,dateformat2);if(d1==0||d2==0){return -1;}else if(d1>d2){return 1;};return 0;};function formatDate(date,format){format=format+"";var result="";var i_format=0;var c="";var token="";var y=date.getYear()+"";var M=date.getMonth()+1;var d=date.getDate();var E=date.getDay();var H=date.getHours();var m=date.getMinutes();var s=date.getSeconds();var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;var value=new Object();if(y.length<4){y=""+(y-0+1900);};value["y"]=""+y;value["yyyy"]=y;value["yy"]=y.substring(2,4);value["M"]=M;value["MM"]=LZ(M);value["MMM"]=MONTH_NAMES[M-1];value["NNN"]=MONTH_NAMES[M+11];value["d"]=d;value["dd"]=LZ(d);value["E"]=DAY_NAMES[E+7];value["EE"]=DAY_NAMES[E];value["H"]=H;value["HH"]=LZ(H);if(H==0){value["h"]=12;}else if(H>12){value["h"]=H-12;}else{value["h"]=H;};value["hh"]=LZ(value["h"]);if(H>11){value["K"]=H-12;}else{value["K"]=H;};value["k"]=H+1;value["KK"]=LZ(value["K"]);value["kk"]=LZ(value["k"]);if(H>11){value["a"]="PM";}else{value["a"]="AM";};value["m"]=m;value["mm"]=LZ(m);value["s"]=s;value["ss"]=LZ(s);while(i_format<format.length){c=format.charAt(i_format);token="";while((format.charAt(i_format)==c)&&(i_format<format.length)){token+=format.charAt(i_format++);};if(value[token]!=null){result=result+value[token];}else{result=result+token;}};return result;};function _isInteger(val){var digits="1234567890";for(var i=0;i<val.length;i++){if(digits.indexOf(val.charAt(i))==-1){return false;}};return true;};function _getInt(str,i,minlength,maxlength){for(var x=maxlength;x>=minlength;x--){var token=str.substring(i,i+x);if(token.length<minlength){return null;};if(_isInteger(token)){return token;}};return null;};function getDateFromFormat(val,format){val=val+"";format=format+"";var i_val=0;var i_format=0;var c="";var token="";var token2="";var x,y;var now=new Date();var year=now.getYear();var month=now.getMonth()+1;var date=1;var hh=now.getHours();var mm=now.getMinutes();var ss=now.getSeconds();var ampm="";while(i_format<format.length){c=format.charAt(i_format);token="";while((format.charAt(i_format)==c)&&(i_format<format.length)){token+=format.charAt(i_format++);};if(token=="yyyy"||token=="yy"||token=="y"){if(token=="yyyy"){x=4;y=4;};if(token=="yy"){x=2;y=2;};if(token=="y"){x=2;y=4;};year=_getInt(val,i_val,x,y);if(year==null){return 0;};i_val+=year.length;if(year.length==2){if(year>70){year=1900+(year-0);}else{year=2000+(year-0);}}}else if(token=="MM"||token=="M"){month=_getInt(val,i_val,token.length,2);if(month==null||(month<1)||(month>12)){return 0;};i_val+=month.length;}else if(token=="dd"||token=="d"){date=_getInt(val,i_val,token.length,2);if(date==null||(date<1)||(date>31)){return 0;};i_val+=date.length;}else{if(val.substring(i_val,i_val+token.length)!=token){return 0;}else{i_val+=token.length;}}};if(i_val!=val.length){return 0;};if(month==2){if(((year%4==0)&&(year%100!=0))||(year%400==0)){if(date>29){return 0;}}else{if(date>28){return 0;}}};if((month==4)||(month==6)||(month==9)||(month==11)){if(date>30){return 0;}};var newdate=new Date(year,month-1,date,hh,mm,ss);return newdate.getTime();};function parseDate(val){var preferEuro=(arguments.length==2)?arguments[1]:false;generalFormats=new Array('y-M-d','MMM d, y','MMM d,y','y-MMM-d','d-MMM-y','MMM d');monthFirst=new Array('M/d/y','M-d-y','M.d.y','MMM-d','M/d','M-d');dateFirst=new Array('d/M/y','d-M-y','d.M.y','d-MMM','d/M','d-M');var checkList=new Array('generalFormats',preferEuro?'dateFirst':'monthFirst',preferEuro?'monthFirst':'dateFirst');var d=null;for(var i=0;i<checkList.length;i++){var l=window[checkList[i]];for(var j=0;j<l.length;j++){d=getDateFromFormat(val,l[j]);if(d!=0){return new Date(d);}}};return null;};function PopupWindow_getXYPosition(anchorname){var coordinates;coordinates=getAnchorPosition(anchorname);this.x=coordinates.x;this.y=coordinates.y;};function PopupWindow_setSize(width,height){this.width=width;this.height=height;};function PopupWindow_populate(contents){this.contents=contents;this.populated=false;};function PopupWindow_refresh(){if(this.divName!=null){if(this.use_gebi){pc_getId(this.divName).innerHTML=this.contents;}}};function PopupWindow_showPopup(anchorname){this.getXYPosition(anchorname);this.x+=this.offsetX;this.y+=this.offsetY;if(!this.populated&&(this.contents!="")){this.populated=true;this.refresh();};if(this.divName!=null){if(this.use_gebi){pc_getId(this.divName).style.left=this.x+"px";pc_getId(this.divName).style.top=this.y+"px";pc_getId(this.divName).style.zIndex="10005";pc_getId(this.divName).style.visibility="visible";if(document.all){pc_getId("tuf1pc_calendarIframe").style.visibility="visible";pc_getId("tuf1pc_calendarIframe").style.left=this.x+"px";pc_getId("tuf1pc_calendarIframe").style.top=this.y+"px";pc_getId("tuf1pc_calendarIframe").width="155";pc_getId("tuf1pc_calendarIframe").height="150";}}}};function PopupWindow_hidePopup(){if(this.divName!=null){if(this.use_gebi){pc_getId(this.divName).style.visibility="hidden";if(document.all){pc_getId("tuf1pc_calendarIframe").style.visibility="hidden";}}}};function PopupWindow_isClicked(e){if(!e)e=window.event;if(this.divName!=null){if(document.all){if(typeof e=='undefined'){e=window.event;};var t=e.srcElement;while(t.parentElement!=null){if(t.id==this.divName){return true;};t=t.parentElement;};return false;}else if(this.use_gebi&&e){var t=e.originalTarget;while(t.parentNode!=null){if(t.id==this.divName){return true;};t=t.parentNode;};return false;}else if(pc_getId("tuf1pc_calendarDiv")){return true;};return false;};return false;};function PopupWindow_hideIfNotClicked(e){if(!e)e=window.event;if(this.autoHideEnabled&&!this.isClicked(e)){this.hidePopup();}else if(window.navigator.userAgent.indexOf('Firefox')>=0){document.onclick=function(event){var divObj=document.getElementById("tuf1pc_calendarDiv");if(event.pageX>(divObj.offsetLeft+divObj.offsetWidth)||event.pageX<(divObj.offsetLeft-25)||event.pageY>(divObj.offsetTop+divObj.offsetHeight)||event.pageY<(divObj.offsetTop)){document.getElementById("tuf1pc_calendarDiv").style.visibility="hidden";}}}};function PopupWindow_autoHide(){this.autoHideEnabled=true;};function PopupWindow_hidePopupWindows(e){for(var i=0;i<popupWindowObjects.length;i++){if(popupWindowObjects[i]!=null){var p=popupWindowObjects[i];p.hideIfNotClicked(e);}}};function PopupWindow_attachListener(){if(!window.PopupWindow_attachListener_flag){window.popupWindowOldEventListener=document.onmouseup;if(window.popupWindowOldEventListener!=null){document.onmouseup=new Function("window.popupWindowOldEventListener(); PopupWindow_hidePopupWindows();");}else{document.onmouseup=PopupWindow_hidePopupWindows;};window.PopupWindow_attachListener_flag=true;}};function PopupWindow(){if(!window.popupWindowIndex){window.popupWindowIndex=0;};if(!window.popupWindowObjects){window.popupWindowObjects=new Array();};window.listenerAttached=true;PopupWindow_attachListener();this.index=popupWindowIndex++;popupWindowObjects[this.index]=this;this.divName=null;this.popupWindow=null;this.width=0;this.height=0;this.populated=false;this.visible=false;this.autoHideEnabled=true;this.contents="";this.url="";this.windowProperties="toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable,alwaysRaised,dependent,titlebar=no";if(arguments.length>0){this.type="DIV";this.divName=arguments[0];};this.use_gebi=false;if(pc_getId){this.use_gebi=true;};this.offsetX=0;this.offsetY=0;this.getXYPosition=PopupWindow_getXYPosition;this.populate=PopupWindow_populate;this.refresh=PopupWindow_refresh;this.showPopup=PopupWindow_showPopup;this.hidePopup=PopupWindow_hidePopup;this.setSize=PopupWindow_setSize;this.isClicked=PopupWindow_isClicked;this.autoHide=PopupWindow_autoHide;this.hideIfNotClicked=PopupWindow_hideIfNotClicked;};function CalendarPopup(){var c;if(arguments.length>0){c=new PopupWindow(arguments[0]);}else{c=new PopupWindow();c.setSize(150,175);};c.offsetX=25;c.offsetY=5;c.autoHide();c.monthNames=new Array("January","February","March","April","May","June","July","August","September","October","November","December");c.dayHeaders=new Array("S","M","T","W","T","F","S");c.returnFunction="CP_tmpReturnFunction";c.returnMonthFunction="CP_tmpReturnMonthFunction";c.returnQuarterFunction="CP_tmpReturnQuarterFunction";c.returnYearFunction="CP_tmpReturnYearFunction";c.weekStartDay=0;c.isShowYearNavigation=false;c.displayType="date";c.disabledWeekDays=new Object();c.disabledDatesExpression="";c.yearSelectStartOffset=2;c.currentDate=null;c.todayText="";c.cssPrefix="";c.isShowNavigationDropdowns=false;c.isShowYearNavigationInput=false;window.CP_calendarObject=null;window.CP_targetInput=null;window.CP_dateFormat="yyyyMMdd";window.CP_targetDropDownYear=null;window.CP_targetDropDownMonth=null;window.CP_targetDropDownDay=null;c.CP_targetDropDownYear=null;c.CP_targetDropDownMonth=null;c.CP_targetDropDownDay=null;c.copyMonthNamesToWindow=CP_copyMonthNamesToWindow;c.setReturnFunction=CP_setReturnFunction;c.setReturnMonthFunction=CP_setReturnMonthFunction;c.setReturnQuarterFunction=CP_setReturnQuarterFunction;c.setReturnYearFunction=CP_setReturnYearFunction;c.setMonthNames=CP_setMonthNames;c.setDayHeaders=CP_setDayHeaders;c.setWeekStartDay=CP_setWeekStartDay;c.setDisplayType=CP_setDisplayType;c.setDisabledWeekDays=CP_setDisabledWeekDays;c.addDisabledDates=CP_addDisabledDates;c.setYearSelectStartOffset=CP_setYearSelectStartOffset;c.showYearNavigation=CP_showYearNavigation;c.showCalendar=CP_showCalendar;c.hideCalendar=CP_hideCalendar;c.getStyles=getCalendarStyles;c.refreshCalendar=CP_refreshCalendar;c.getCalendar=CP_getCalendar;c.select=CP_select;c.setCssPrefix=CP_setCssPrefix;c.showNavigationDropdowns=CP_showNavigationDropdowns;c.showYearNavigationInput=CP_showYearNavigationInput;c.copyMonthNamesToWindow();return c;};function CP_copyMonthNamesToWindow(){if(typeof(window.MONTH_NAMES)!="undefined"&&window.MONTH_NAMES!=null){window.MONTH_NAMES=new Array();for(var i=0;i<this.monthNames.length;i++){window.MONTH_NAMES[window.MONTH_NAMES.length]=this.monthNames[i];}}};function CP_tmpReturnFunction(y,m,d){if(window.CP_targetInput!=null){var dt=new Date(y,m-1,d,0,0,0);if(window.CP_calendarObject!=null){window.CP_calendarObject.copyMonthNamesToWindow();};var index=0;pc_getId(window.CP_targetInput+"Year").value=y;if(pc_getId(window.CP_targetInput+"Month").options[0].value==""){pc_getId(window.CP_targetInput+"Month").selectedIndex=m;}else{pc_getId(window.CP_targetInput+"Month").selectedIndex=m-1;};if(pc_getId(window.CP_targetInput+"Day").options[0].value==""){showDash=true;}else{showDash=false;};_DateChange(window.CP_targetInput,showDash);if(pc_getId(window.CP_targetInput+"Day").options[0].value==""){pc_getId(window.CP_targetInput+"Day").selectedIndex=d;}else{pc_getId(window.CP_targetInput+"Day").selectedIndex=d-1;}}else{alert('Use setReturnFunction() to define which function will get the clicked results!');}};function CP_tmpReturnMonthFunction(y,m){alert('Use setReturnMonthFunction() to define which function will get the clicked results!\nYou clicked: year='+y+' , month='+m);};function CP_tmpReturnQuarterFunction(y,q){alert('Use setReturnQuarterFunction() to define which function will get the clicked results!\nYou clicked: year='+y+' , quarter='+q);};function CP_tmpReturnYearFunction(y){alert('Use setReturnYearFunction() to define which function will get the clicked results!\nYou clicked: year='+y);};function CP_setReturnFunction(name){this.returnFunction=name;};function CP_setReturnMonthFunction(name){this.returnMonthFunction=name;};function CP_setReturnQuarterFunction(name){this.returnQuarterFunction=name;};function CP_setReturnYearFunction(name){this.returnYearFunction=name;};function CP_setMonthNames(){for(var i=0;i<arguments.length;i++){this.monthNames[i]=arguments[i];};this.copyMonthNamesToWindow();};function CP_setDayHeaders(){for(var i=0;i<arguments.length;i++){this.dayHeaders[i]=arguments[i];}};function CP_setWeekStartDay(day){this.weekStartDay=day;};function CP_showYearNavigation(){this.isShowYearNavigation=(arguments.length>0)?arguments[0]:true;};function CP_setDisplayType(type){if(type!="date"&&type!="week-end"&&type!="month"&&type!="quarter"&&type!="year"){alert("Invalid display type! Must be one of: date,week-end,month,quarter,year");return false;};this.displayType=type;};function CP_setYearSelectStartOffset(num){this.yearSelectStartOffset=num;};function CP_setDisabledWeekDays(){this.disabledWeekDays=new Object();for(var i=0;i<arguments.length;i++){this.disabledWeekDays[arguments[i]]=true;}};function CP_addDisabledDates(start,end){if(arguments.length==1){end=start;};if(start==null&&end==null){return;};if(this.disabledDatesExpression!=""){this.disabledDatesExpression+="||";};if(start==null){this.disabledDatesExpression+="(ds<="+end+")";}else if(end==null){this.disabledDatesExpression+="(ds>="+start+")";}else{this.disabledDatesExpression+="(ds>="+start+"&&ds<="+end+")";}};function CP_setCssPrefix(val){this.cssPrefix=val;};function CP_showNavigationDropdowns(){this.isShowNavigationDropdowns=(arguments.length>0)?arguments[0]:true;};function CP_showYearNavigationInput(){this.isShowYearNavigationInput=(arguments.length>0)?arguments[0]:true;};function CP_hideCalendar(){if(arguments.length>0){window.popupWindowObjects[arguments[0]].hidePopup();}else{this.hidePopup();}};function CP_refreshCalendar(index){var calObject=window.popupWindowObjects[index];if(arguments.length>1){calObject.populate(calObject.getCalendar(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]));}else{calObject.populate(calObject.getCalendar());};calObject.refresh();};function CP_showCalendar(anchorname,objId){if(arguments.length>1){if(arguments[1]==null||arguments[1]==""){this.currentDate=new Date();}else{this.currentDate=new Date(parseDate(arguments[1]));}};if(pc_getId(objId+"Year").value==""||pc_getId(objId+"Month").value==""||pc_getId(objId+"Day").value==""){this.currentDate=new Date(TodayDate.substring(0,4),TodayDate.substring(4,6)-1,TodayDate.substring(6,8));}else{this.currentDate=new Date(pc_getId(objId+"Year").value,pc_getId(objId+"Month").value-1,pc_getId(objId+"Day").value);};this.populate(this.getCalendar());this.showPopup(anchorname);};function CP_select(inputobj,obj){var selectedDate=(arguments.length>3)?arguments[3]:null;if(!window.getDateFromFormat){alert("calendar.select: To use this method you must also include 'date.js' for date formatting");return;};if(this.displayType!="date"&&this.displayType!="week-end"){alert("calendar.select: This function can only be used with displayType 'date' or 'week-end'");return;};if(inputobj.disabled){return;};window.CP_targetInput=obj;window.CP_calendarObject=this;this.currentDate=null;var time=0;if(selectedDate!=null){time=getDateFromFormat(selectedDate)}else if(inputobj.value!=""){time=getDateFromFormat(inputobj.value);};if(selectedDate!=null||inputobj.value!=""){if(time==0){this.currentDate=null;}else{this.currentDate=new Date(time);}};this.showCalendar(inputobj,obj);};function getCalendarStyles(){var result="";var p="";if(this!=null&&typeof(this.cssPrefix)!="undefined"&&this.cssPrefix!=null&&this.cssPrefix!=""){p=this.cssPrefix;};result+="<STYLE>\n";result+="."+p+"cpYearNavigation,."+p+"cpMonthNavigation { background-color:#C0C0C0; text-align:center; vertical-align:center; text-decoration:none; color:#000000; font-weight:bold; };\n";result+="."+p+"cpDayColumnHeader, ."+p+"cpYearNavigation,."+p+"cpMonthNavigation,."+p+"cpCurrentMonthDate,."+p+"cpCurrentMonthDateDisabled,."+p+"cpOtherMonthDate,."+p+"cpOtherMonthDateDisabled,."+p+"cpCurrentDate,."+p+"cpCurrentDateDisabled,."+p+"cpTodayText,."+p+"cpTodayTextDisabled,."+p+"cpText { font-family:arial; font-size:8pt; };\n";result+="TD."+p+"cpDayColumnHeader { text-align:right; border:solid thin #C0C0C0;border-width:0px 0px 1px 0px; };\n";result+="."+p+"cpCurrentMonthDate, ."+p+"cpOtherMonthDate, ."+p+"cpCurrentDate  { text-align:right; text-decoration:none; };\n";result+="."+p+"cpCurrentMonthDateDisabled, ."+p+"cpOtherMonthDateDisabled, ."+p+"cpCurrentDateDisabled { color:#D0D0D0; text-align:right; text-decoration:line-through; };\n";result+="."+p+"cpCurrentMonthDate, .cpCurrentDate { color:#000000; };\n";result+="."+p+"cpOtherMonthDate { color:#808080; };\n";result+="TD."+p+"cpCurrentDate { color:white; background-color: #C0C0C0; border-width:1px; border:solid thin #800000; };\n";result+="TD."+p+"cpCurrentDateDisabled { border-width:1px; border:solid thin #FFAAAA; };\n";result+="TD."+p+"cpTodayText, TD."+p+"cpTodayTextDisabled { border:solid thin #C0C0C0; border-width:1px 0px 0px 0px;};\n";result+="A."+p+"cpTodayText, SPAN."+p+"cpTodayTextDisabled { height:20px; };\n";result+="A."+p+"cpTodayText { color:black; };\n";result+="."+p+"cpTodayTextDisabled { color:#D0D0D0; };\n";result+="."+p+"cpBorder { border:solid thin #808080; };\n";result+="</STYLE>\n";return result;};function CP_getCalendar(){var now=new Date();var windowref="";var result="";result+='<TABLE CLASS="'+this.cssPrefix+'cpBorder" WIDTH=144 BORDER=1 BORDERWIDTH=1 CELLSPACING=0 CELLPADDING=1>\n';result+='<TR><TD ALIGN=CENTER>\n';result+='<CENTER>\n';if(this.displayType=="date"||this.displayType=="week-end"){if(this.currentDate==null){this.currentDate=now;};if(arguments.length>0){var month=arguments[0];}else{var month=this.currentDate.getMonth()+1;};if(arguments.length>1&&arguments[1]>0&&arguments[1]-0==arguments[1]){var year=arguments[1];}else{var year=this.currentDate.getFullYear();};var daysinmonth=new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);if(((year%4==0)&&(year%100!=0))||(year%400==0)){daysinmonth[2]=29;};var current_month=new Date(year,month-1,1);var display_year=year;var display_month=month;var display_date=1;var weekday=current_month.getDay();var offset=0;offset=(weekday>=this.weekStartDay)?weekday-this.weekStartDay:7-this.weekStartDay+weekday;if(offset>0){display_month--;if(display_month<1){display_month=12;display_year--;};display_date=daysinmonth[display_month]-offset+1;};var next_month=month+1;var next_month_year=year;if(next_month>12){next_month=1;next_month_year++;};var last_month=month-1;var last_month_year=year;if(last_month<1){last_month=12;last_month_year--;};var date_class;result+='<TABLE WIDTH=150 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>';result+='<TR>\n';var refresh=windowref+'CP_refreshCalendar';var refreshLink='javascript:'+refresh;if(this.isShowNavigationDropdowns){result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="78" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpMonthNavigation" name="cpMonth" onChange="'+refresh+'('+this.index+',this.options[this.selectedIndex].value-0,'+(year-0)+');">';for(var monthCounter=1;monthCounter<=12;monthCounter++){var selected=(monthCounter==month)?'SELECTED':'';result+='<option value="'+monthCounter+'" '+selected+'>'+this.monthNames[monthCounter-1]+'</option>';};result+='</select></TD>';result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10">&nbsp;</TD>';result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="56" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpYearNavigation" name="cpYear" onChange="'+refresh+'('+this.index+','+month+',this.options[this.selectedIndex].value-0);">';for(var yearCounter=year-this.yearSelectStartOffset;yearCounter<=year+this.yearSelectStartOffset;yearCounter++){var selected=(yearCounter==year)?'SELECTED':'';result+='<option value="'+yearCounter+'" '+selected+'>'+yearCounter+'</option>';};result+='</select></TD>';}else{if(this.isShowYearNavigation){result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+last_month+','+last_month_year+');">&lt;</A></TD>';result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="58"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[month-1]+'</SPAN></TD>';result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+next_month+','+next_month_year+');">&gt;</A></TD>';result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10">&nbsp;</TD>';result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="'+refreshLink+'('+this.index+','+month+','+(year-1)+');">&lt;</A></TD>';if(this.isShowYearNavigationInput){result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><INPUT NAME="cpYear" CLASS="'+this.cssPrefix+'cpYearNavigation" SIZE="4" MAXLENGTH="4" VALUE="'+year+'" onBlur="'+refresh+'('+this.index+','+month+',this.value-0);"></TD>';}else{result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><SPAN CLASS="'+this.cssPrefix+'cpYearNavigation">'+year+'</SPAN></TD>';};result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="'+refreshLink+'('+this.index+','+month+','+(year+1)+');">&gt;e</A></TD>';}else{result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+last_month+','+last_month_year+');"><img border="0" src="/tuf1/images/ico_Previous.gif"></A></TD>\n';result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="100"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[month-1]+' '+year+'</SPAN></TD>\n';result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+next_month+','+next_month_year+');"><img border="0" src="/tuf1/images/ico_Next.gif"></A></TD>\n';}};result+='</TR></TABLE>\n';result+='<TABLE WIDTH=150 BORDER=0 CELLSPACING=0 CELLPADDING=1 ALIGN=CENTER>\n';result+='<TR>\n';for(var j=0;j<7;j++){result+='<TD CLASS="'+this.cssPrefix+'cpDayColumnHeader" WIDTH="14%"><SPAN CLASS="'+this.cssPrefix+'cpDayColumnHeader">'+this.dayHeaders[(this.weekStartDay+j)%7]+'</TD>\n';};result+='</TR>\n';for(var row=1;row<=6;row++){result+='<TR>\n';for(var col=1;col<=7;col++){var disabled=false;if(this.disabledDatesExpression!=""){var ds=""+display_year+LZ(display_month)+LZ(display_date);eval("disabled=("+this.disabledDatesExpression+")");};var dateClass="";if((display_month==this.currentDate.getMonth()+1)&&(display_date==this.currentDate.getDate())&&(display_year==this.currentDate.getFullYear())){dateClass="cpCurrentDate";}else if(display_month==month){dateClass="cpCurrentMonthDate";}else{dateClass="cpOtherMonthDate";};if(disabled||this.disabledWeekDays[col-1]){result+='	<TD CLASS="'+this.cssPrefix+dateClass+'"><SPAN CLASS="'+this.cssPrefix+dateClass+'Disabled">'+display_date+'</SPAN></TD>\n';}else{var selected_date=display_date;var selected_month=display_month;var selected_year=display_year;if(this.displayType=="week-end"){var d=new Date(selected_year,selected_month-1,selected_date,0,0,0,0);d.setDate(d.getDate()+(7-col));selected_year=d.getYear();if(selected_year<1000){selected_year+=1900;};selected_month=d.getMonth()+1;selected_date=d.getDate();};result+='	<TD CLASS="'+this.cssPrefix+dateClass+'"><A HREF="javascript:'+windowref+this.returnFunction+'('+selected_year+','+selected_month+','+selected_date+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+this.cssPrefix+dateClass+'">'+display_date+'</A></TD>\n';};display_date++;if(display_date>daysinmonth[display_month]){display_date=1;display_month++;};if(display_month>12){display_month=1;display_year++;}};result+='</TR>';};var current_weekday=now.getDay()-this.weekStartDay;if(current_weekday<0){current_weekday+=7;};result+='<TR>\n';if(this.disabledDatesExpression!=""){var ds=""+now.getFullYear()+LZ(now.getMonth()+1)+LZ(now.getDate());eval("disabled=("+this.disabledDatesExpression+")");};result+='	</TR></TABLE></CENTER></TD></TR></TABLE>\n';};return result;};


function initModalbox(){
var nodeType=["div","span"];
var nodes,baseNode,ecType;
for(var x=0;x<nodeType.length;x++){
nodes=document.getElementsByTagName(nodeType[x]);
for(var i=0;i<nodes.length;i++){
baseNode=nodes[i];
ecType=baseNode.getAttribute("ecType");
if(ecType=="modalbox"||ecType=="modalPdf"){
if(!baseNode.getAttribute("init")){
var title=baseNode.getAttribute("title");
var width=baseNode.getAttribute("width");
var height=baseNode.getAttribute("height");
if(baseNode.getAttribute("href")==null){baseNode.setAttribute("href","/servlet/TUF1_ControllerServlet.do");}
with(baseNode){style.cssText="cursor:pointer;text-decoration:underline;color:#000099;";};
baseNode.init="ok";
baseNode.nodeObj=baseNode;
var option=(title?",title : '"+title+"'":"");
option+=(width?",width : "+width:"");
option+=(height?",height : "+height:"");
option+=",afterLoad:hideEl";
option+=",overlayOpacity:0.3";
option+=",overlayClose:false";
option+=",method:'post'";
option=option.substring(1);
baseNode.option=option;
baseNode.onclick=function(){
var obj=this.nodeObj;
if(obj.getAttribute("beforeSubmit")){
eval(obj.getAttribute("beforeSubmit")+"(this)");}
var href=obj.getAttribute("href");
var parm=obj.getAttribute("params");
var params="";
if(obj.getAttribute("ecType")=="modalPdf"){
var title=obj.getAttribute("title");
var width=getViewportWidth()-50;
var height=getViewportHeight()-30;
var option=(title?",title : '"+title+"'":"");
option+=(width?",width : "+width:"");
option+=(height?",height : "+height:"");
option+=",afterLoad:hideEl";
option+=",overlayOpacity:0.3";
option+=",method:'post'";
option=option.substring(1);
obj.option=option;
params=(parm?replaceParams("href="+href+"&"+parm):"");
if(params==""){
params=",params:{href:['"+href+"']}";}
var webID=(obj.getAttribute("webID")?obj.getAttribute("webID"):"EB");
url="/servlet/TUF1_ControllerServlet.do?action="+webID+"_ModalboxIframe";}else if(obj.getAttribute("ecType")=="modalbox"){
params=(parm?replaceParams(parm):"");
url=href;}
if(url!=""){
eval("Modalbox.show('"+url+"',{"+obj.option+params+"})");}}
baseNode.onmouseover=function(){this.nodeObj.style.color="#FF6600";}
baseNode.onmouseout=function(){this.nodeObj.style.color="#000099";}}}}}}
function hideEl(){
var e=document.getElementById("dummyModalbox");
if(e){e.style.display="none";}}
function replaceParams(v){
var result="";
if(v.indexOf("=")!=-1){
var itemArr=v.split("&");
var existIndex="";
var tmpArr=new Array();
for(var i=0;i<itemArr.length;i++){
var dataArr=itemArr[i].split("=");
for(var j=0;j<tmpArr.length;j++){
if(tmpArr[j][0]==dataArr[0]){
existIndex=j;
break;}else{
existIndex="";}}
if(existIndex!=""){
tmpArr[existIndex][1]+=",'"+dataArr[1]+"'";}else{
tmpArr[tmpArr.length]=new Array(dataArr[0],"'"+dataArr[1]+"'");}}
for(var i=0;i<tmpArr.length;i++){
if(i!=0){result+=",";}
result+=tmpArr[i][0]+":["+tmpArr[i][1]+"]";}
var diffStr=new Date().getTime();
result="{"+result+",diffTime : '"+diffStr+"'}";}else{
result="Form.serialize('"+v+"')";}
return ",params:"+result;}
function closeModalbox(){
Modalbox.hide();}
function resizeModalbox(w,h){
Modalbox.resize(w,h);}
function getViewportHeight(){
if(window.innerHeight!=window.undefined)return window.innerHeight;
if(document.compatMode=='CSS1Compat')return document.documentElement.clientHeight;
if(document.body)return document.body.clientHeight;
return window.undefined;}
function getViewportWidth(){
if(window.innerWidth!=window.undefined)return window.innerWidth;
if(document.compatMode=='CSS1Compat')return document.documentElement.clientWidth;
if(document.body)return document.body.clientWidth;
return window.undefined;}
