function IsvalidLoginPwd(n,t){return valstr_tmp=new String(n),rexp1=/(__)/gi,rexp2=/(--)/gi,rexp3=/(_-)/gi,rexp4=/(-_)/gi,rexp6=/^(_|-)/,temp1=/^[0-9a-zA-Z +_-]+$/,valstr_tmp.length<t?!1:valstr_tmp.match(temp1)&&!valstr_tmp.match(rexp6)&&valstr_tmp.search(rexp1)==-1&&valstr_tmp.search(rexp2)==-1&&valstr_tmp.search(rexp3)==-1&&valstr_tmp.search(rexp4)==-1?!0:!1}function Sel_DeSel_CheckBoxes(n,t,i){for(i0=n.elements,j=0;j<n.length;j++)str=new String(i0[j].name),i0[j].type=="checkbox"&&i0[j].name!=t.name&&!i0[j].disabled&&str.indexOf(i,0)>0&&(i0[j].checked=t.checked)}function ApplySelection(n,t,r,u,f,e){i=n.elements;c=0;var o=f;for(j=0;j<n.length;j++)i[j].type=="checkbox"&&i[j].name!=t.name&&i[j].checked&&c++;if(c){if(o=o.substring(0,7)=="custom:"?o.substring(7):"You are about to "+r+" "+c+" "+u+"(s)!",confirm(o))return!0}else return e!="1"&&alert("You did not select any "+u+" to "+r+"!"),!1;return!1}function isDate(n){var t,f;if(n=="")return!0;if(t=FormatDate(n),t=="")return!1;var i=t.split("/"),e=i[0],r=i[1],u=i[2];return u.length>4?!1:(t=r+"/"+e+"/"+u,f=new Date(t),f.getMonth()+1==r?!0:!1)}function FormatDate(n,t){var i,o,a,s,e,c,h,l;if(n=="")return"";for(t||(t="dd/mm/yyyy"),t=t.toLowerCase(),n=n.toLowerCase(),o=["January","February","March","April","May","June","July","August","September","October","November","December"];n.indexOf("st")>-1;)n=n.replace("st","");while(n.indexOf("nd")>-1)n=n.replace("nd","");while(n.indexOf("rd")>-1)n=n.replace("rd","");while(n.indexOf("th")>-1)n=n.replace("th","");for(n.indexOf(".")>-1&&(s="."),n.indexOf("-")>-1&&(s="-"),n.indexOf("/")>-1&&(s="/"),n.indexOf(" ")>-1&&(s=" "),i=n.split(s),n="",e=0;e<i.length;e++)i[e]!=""&&(n+=i[e]+s);if(n=n.substring(0,n.length-1),i=n.split(s),i.length<3)return"";var r=i[0],f=i[1],u=i[2];for(parseFloat(i[1])>12&&(r=i[1],f=i[0]),parseFloat(r)&&r.toString().length==4&&(u=i[0],r=i[2],f=i[1]),e=0;e<o.length;e++)if(c=o[e].substring(0,3).toLowerCase(),h=n.indexOf(c),h>-1){f=e+1;h==0&&(r=i[1],u=i[2]);break}l=u.toString();l.length==2&&(u=parseFloat(u)>40?"19"+u:"20"+u);parseInt(f)<10&&f.toString().length<2&&(f="0"+f);parseInt(r)<10&&r.toString().length<2&&(r="0"+r);switch(t){case"dd/mm/yyyy":return r+"/"+f+"/"+u;case"mm/dd/yyyy":return f+"/"+r+"/"+u;case"dd/mmm/yyyy":return r+" "+o[f-1].substring(0,3)+" "+u;case"mmm/dd/yyyy":return o[f-1].substring(0,3)+" "+r+" "+u;case"dd/mmmm/yyyy":return r+" "+o[f-1]+" "+u;case"mmmm/dd/yyyy":return o[f-1]+" "+r+" "+u}return r+"/"+a+"/"+u}function FormatNumber(n,t,i,r,u){var o,s,f,e;if(isNaN(parseInt(n)))return"NaN";if(o=n,s=n<0?-1:1,o*=Math.pow(10,t),o=Math.round(Math.abs(o)),o/=Math.pow(10,t),o*=s,f=new String(o),!i&&n<1&&n>-1&&n!=0&&(f=n>0?f.substring(1,f.length):"-"+f.substring(2,f.length)),u&&(n>=1e3||n<=-1e3))for(e=f.indexOf("."),e<0&&(e=f.length),e-=3;e>=1;)f=f.substring(0,e)+","+f.substring(e,f.length),e-=3;return r&&n<0&&(f="("+f.substring(1,f.length)+")"),f}function trimAll(n){while(n.substring(0,1)==" ")n=n.substring(1,n.length);while(n.substring(n.length-1,n.length)==" ")n=n.substring(0,n.length-1);return n}function OpenModalWindow(WindowURL,WindowSetting,ControlsIDs,FunctionName){var retVal=window.showModalDialog(WindowURL,null,WindowSetting),ConrolsIDs_arr,i,cntr;if(retVal!=""&&retVal!=null){for(ConrolsIDs_arr=ControlsIDs.split(","),i=0;i<ConrolsIDs_arr.length;i++)cntr=document.getElementById(ConrolsIDs_arr[i]),cntr.type=="checkbox"?cntr.checked=eval(retVal.split("|")[i]):cntr.value=decodeURI(retVal.split("|")[i]);FunctionName!=""&&FunctionName!=null&&window[FunctionName]()}}function picklistHandler(picklistType,picklistCode,ControlsIDs,FunctionName){var retVal=null,ConrolsIDs_arr,i,cntr;if(retVal=picklistType=="1"?$get("results_"+picklistCode).innerText:picklistCode,retVal!=""&&retVal!=null){for(ConrolsIDs_arr=ControlsIDs.split(","),i=0;i<ConrolsIDs_arr.length;i++)cntr=document.getElementById(ConrolsIDs_arr[i]),cntr.type=="checkbox"?cntr.checked=eval(retVal.split("|")[i]):cntr.value=decodeURI(retVal.split("|")[i]);FunctionName!=""&&FunctionName!=null&&window[FunctionName]()}}function findPosX(n){var t=0;if(n.offsetParent)for(;;){if(t+=n.offsetLeft,!n.offsetParent)break;n=n.offsetParent}else n.x&&(t+=n.x);return t}function findPosY(n){var t=0;if(n.offsetParent)for(;;){if(t+=n.offsetTop,!n.offsetParent)break;n=n.offsetParent}else n.y&&(t+=n.y);return t}function prm_InitializeRequest(n,t){var i=$get("divImage"),r=findPosX($get(t._postBackElement.id))+$get(t._postBackElement.id).offsetWidth+5,u=findPosY($get(t._postBackElement.id));i.style.display="";i.style.left=r+"px";i.style.top=u+"px";t._postBackElement!=undefined&&($get(t._postBackElement.id).disabled=!0,postBackElementID=t._postBackElement.id)}function EndRequestHandler(n,t){var i=$get("divImage"),r;i.style.display="none";t._postBackElement!=undefined&&($get(t._postBackElement.id).disabled=!1,t.get_error()!=undefined&&(r=t.get_error().message,t.set_errorHandled(!0),alert("Sorry for the inconvenience. An error has occured!. System administrator has been notified")))}function beginRequest(){prm._scrollPosition=null}function disposeTree(n,t){for(var e=t.get_panelsUpdating(),o,u,i,s,f,r=e.length-1;r>=0;r--){for(o=e[r].getElementsByTagName("*"),u=0;u<o.length;u++)if(i=o[u],i.nodeType===1)for(i.dispose&&typeof i.dispose=="function"?i.dispose():i.control&&typeof i.control.dispose=="function"&&i.control.dispose(),s=Sys.UI.Behavior.getBehaviors(i),f=s.length-1;f>=0;f--)s[f].dispose();e[r].innerHTML=""}}function parseBool2(n){var t={no:!1,NO:!1,FALSE:!1,"false":!1,yes:!0,YES:!0,TRUE:!0,"true":!0};return n in t&&t.hasOwnProperty(n)?t[n]:!!n}var postBackElementID,prm=Sys.WebForms.PageRequestManager.getInstance();prm.add_initializeRequest(prm_InitializeRequest);prm.add_endRequest(EndRequestHandler);prm.add_beginRequest(beginRequest);prm.add_pageLoading(disposeTree)