
function e(name,tag){if(!name)return null;if(name.tagName)return name;var result=document.getElementById(name);if(!result&&tag){var serverCtrlName=name.replace(/_/g,'$');var regExId=new RegExp("[_$]"+name+"$","ig");var items=document.getElementsByTagName(tag);for(var i=0;i<items.length;i++){var item=items[i];if((item.id&&item.id.match(regExId))||(item.name&&item.name==serverCtrlName))return item;}}return result;}jQuery.fn.extend({disable:function(){this.attr("disabled","true");return this.each(function(){if((this.tagName=="INPUT"&&this.type!="radio"&&this.type!="checkbox")||this.tagName=="TEXTAREA"||this.tagName=="SELECT"){this.style.backgroundColor="#e0e0e0";this.style.color="#808080";}});},enable:function(){this.removeAttr("disabled");return this.each(function(){if((this.tagName=="INPUT"&&this.type!="radio"&&this.type!="checkbox")||this.tagName=="TEXTAREA"||this.tagName=="SELECT"){this.style.backgroundColor="";this.style.color="";}});},left:function(x){if(x==null)return DePx(this.css("left"));return this.css("left",x+"px");},top:function(y){if(y==null)return DePx(this.css("top"));return this.css("top",y+"px");},right:function(x){return this.each(function(){this.style.right=x+"px";});},pos:function(x,y){if(x==null)return{left:this.left(),top:this.top()};return this.left(x).top(y);},size:function(width,height){return this.each(function(){this.style.width=width+"px";this.style.height=height+"px";});},bounds:function(x,y,width,height){return this.each(function(){this.style.left=x+"px";this.style.top=y+"px";this.style.width=width+"px";this.style.height=height+"px";});}});DeferredOperation=function(delay,context,callback){this._delay=delay;this._context=context;this._callback=callback;this._completeCallback=null;this._errorCallback=null;this._timer=null;this._callArgs=null;this._isComplete=false;this._completedSynchronously=false;this._asyncResult=null;this._exception=null;this._throwExceptions=true;this._oncomplete$delegate=createDelegate(this,this._oncomplete);this.post=createDelegate(this,this.post);};DeferredOperation.prototype={get_isPending:function(){return(this._timer!==null);},get_isComplete:function(){return this._isComplete;},get_completedSynchronously:function(){return this._completedSynchronously;},get_exception:function(){return this._exception;},get_throwExceptions:function(){return this._throwExceptions;},set_throwExceptions:function(value){this._throwExceptions=value;},get_delay:function(){return this._delay;},set_delay:function(value){this._delay=value;},post:function(args){var ar=[];for(var i=0;i<arguments.length;i++){ar[i]=arguments[i];}this.beginPost(ar,null,null);},beginPost:function(args,completeCallback,errorCallback){this.cancel();this._callArgs=(args||[]).concat();this._completeCallback=completeCallback;this._errorCallback=errorCallback;if(this._delay==-1){this._oncomplete();this._completedSynchronously=true;}else{this._timer=setTimeout(this._oncomplete$delegate,this._delay);}},cancel:function(){if(this._timer){clearTimeout(this._timer);this._timer=null;}this._callArgs=null;this._isComplete=false;this._asyncResult=null;this._completeCallback=null;this._errorCallback=null;this._exception=null;this._completedSynchronously=false;},complete:function(){if(this._timer){try{this._oncomplete();}finally{this._completedSynchronously=true;}return this._asyncResult;}else if(this._isComplete){return this._asyncResult;}},_oncomplete:function(){var args=this._callArgs;var completeCallback=this._completeCallback;var errorCallback=this._errorCallback;this.cancel();try{if(args)this._asyncResult=this._callback.apply(this._context,args);else
this._asyncResult=this._callback.call(this._context);this._isComplete=true;this._completedSynchronously=false;if(completeCallback)completeCallback(this);}catch(e){this._isComplete=true;this._completedSynchronously=false;this._exception=e;if(errorCallback&&errorCallback(this))return;if(this._throwExceptions)throw e;}}};var Browser={Check:function(){var ag=this.ag=navigator.userAgent.toLowerCase();this.isOp=ag.indexOf("opera")!=-1;this.isIE=!this.isOp&&ag.indexOf("msie")!=-1&&document.all;this.isCh=ag.indexOf("chrome")!=-1;this.isSf=!this.isCh&&ag.indexOf("safari")!=-1;this.isFF=ag.indexOf("firefox")!=-1;if(this.isOp&&ag.indexOf("sony/com1")==-1){this.ver=this.Ver(ag,"opera ");if(!this.ver)this.ver=this.Ver(ag,"opera/");}if(this.isIE&&ag.indexOf("palmsource")==-1&&ag.indexOf("regking")==-1&&ag.indexOf("windows ce")==-1&&ag.indexOf("j2me")==-1&&ag.indexOf("avantgo")==-1&&ag.indexOf(" stb")==-1)this.ver=this.Ver(ag,"msie ");if(this.isSf)this.ver=this.Ver(ag,"safari/");if(this.isFF)this.ver=this.Ver(ag,"firefox/");if(this.isCh)this.ver=this.Ver(ag,"chrome/");if(!this.ver)this.ver=0;},Supported:function(){this.Check();if(this.isOp)return this.ver>=8;if(this.isIE)return this.ver>=6;if(this.isSf)return this.ver>=312;if(this.isFF)return this.ver>=2.0;if(this.isCh)return this.ver>=0.2;},Ver:function(str,from){var i=str.indexOf(from);if(i!=-1){var v=parseFloat(str.substring(i+from.length));if(!isNaN(v))return v;}return 0;}};function createDelegate(obj,method){return function(){method.apply(obj,arguments);};}function addDelegates(el,delegates){for(var ev in delegates){var delegate=delegates[ev];addDelegate(el,ev,delegate);}}function addDelegate(el,event,delegate){if(el.addEventListener)el.addEventListener(event,delegate,false);else if(el.attachEvent){event="on"+event;el.attachEvent(event,delegate);}}function removeDelegates(el,delegated){for(var ev in delegates){var delegate=delegates[ev];removeDelegate(el,ev,delegate);}}function removeDelegate(el,event,delegate){if(el.detachEvent)el.detachEvent(event,delegate);else
el.removeEventListener(event,delegate,false);}function createElement(parent,tagName,className){var el=document.createElement(tagName);parent.appendChild(el);el.className=className;return el;}Date.prototype.getDateOnly=function Date$getDateOnly(){return new Date(this.getFullYear(),this.getMonth(),this.getDate());};function removeCssClass(el,className){if(el&&el.className){var cls=el.className.split(" ");var ar=new Array();for(var i=cls.length;i>0;)if(cls[--i]!=className)ar[ar.length]=cls[i];el.style.display="none";el.className=ar.join(" ");el.style.display="";}}function removeCssClasses(el,classNames){for(var i=0;i<classNames.length;i++)removeCssClass(el,classNames[i]);}function addCssClass(el,className){if(el){removeCssClass(el,className);el.style.display="none";el.className+=" "+className;el.style.display="";}}function hasCssClass(el,className){if(el&&el.className){var cls=el.className.split(" ");var ar=new Array();for(var i=cls.length;i>0;)if(cls[--i]==className)return true;}return false;}function dateFormat(date){if(!date)return"";var day=String(date.getDate());var month=date.getMonth()+1;if(month<10)month="0"+String(month);else{month=String(month);}var year=date.getYear();year=year<1900?String(year+1900):String(year);return day+"/"+month+"/"+year;}function dateFormatMilitary(date){if(!date)return"";var day=String(date.getDate());if(day<10)day="0"+String(day);var month=date.getMonth()+1;if(month<10)month="0"+String(month);else{month=String(month);}var year=date.getYear();year=year<1900?String(year+1900):String(year);return year+""+month+""+day;}function dateFormat2(date){if(!date)return"";var day=String(date.getDate());if(day<10)day="0"+String(day);var month=date.getMonth()+1;if(month<10)month="0"+String(month);var year=date.getYear();if(year>=2000)year-=2000;if(year>=100)year-=100;if(year<10)year="0"+String(year);return day+"/"+month+"/"+year;}function _Date(year,month,day){var result=new Date();result.setHours(0,0,0,0);result.setDate(1);if(year<100){year=(year*1)+2000;}result.setFullYear(year);result.setMonth(month);result.setDate(day);if(result.getMonth()!=month){return null;}if(result.getDate()!=day){return null;}return result;}function ParseEuroShortDate(input){if(!input)return null;var parts=input.split('/');if(parts.length!=3)return null;var year=parts[2];var month=parts[1]-1;var day=parts[0];if(month<0||month>11)return null;if(day<1||day>31)return null;return _Date(year,month,day);}function AddDays(d,n){var result=new Date(d);for(var i=0;i<Math.abs(n);i++){result.setDate(result.getDate()+(n>=0?1:-1));result=_Date(result.getFullYear(),result.getMonth(),result.getDate());}return result;}function AddMonth(dt){var day=dt.getDate();var month=dt.getMonth()+1;var year=dt.getFullYear();if(month>11){month=0;year++;}return new Date(year,month,day);}function dropDownValue(id){var element=e(id);if(!element)return"";if(!(element.options)&&(element.selectedIndex))return element.value;if(!(element.selectedIndex)&&(element.selectedIndex!=0))return"";if(!isDefined(element.options)&&isDefined(element.selectedIndex))return element.value;if(element.selectedIndex==-1)return"";var option=element.options[element.selectedIndex];return option.value!==""?option.value:option.innerHTML;}function setDropDownValue(id,value){var element=e(id);if(value===""){element.selectedIndex=0;return;}for(var i=0;i<element.options.length;i++){var option=element.options[i];if(option.value==value){element.selectedIndex=i;return;}if(option.innerHTML==value){element.selectedIndex=i;return;}}element.value=value;}function isDefined(variable){return typeof(variable)!="undefined";}function GetWindowWidth(){return window.innerWidth?window.innerWidth:document.documentElement.clientWidth;}function GetWindowHeight(){return window.innerHeight?window.innerHeight:document.documentElement.clientHeight;}function GetWindowScrollX(){return(document.documentElement&&isDefined(document.documentElement.scrollLeft))?document.documentElement.scrollLeft:window.scrollX;}function GetWindowScrollY(){return(document.documentElement&&isDefined(document.documentElement.scrollTop))?document.documentElement.scrollTop:window.scrollY;}function scrollbarWidth(){document.body.style.overflow='hidden';var width=document.body.clientWidth;document.body.style.overflow='scroll';width-=document.body.clientWidth;if(!width)width=document.body.offsetWidth-document.body.clientWidth;document.body.style.overflow='';return width;}$(function(){Browser.Check();});String.prototype.escapeHTML=function(){return this.replace(/&/g,'&amp;').replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/"/g,'&quot;');};function getScrollBarWidth(){var inner=document.createElement('p');inner.style.width="100%";inner.style.height="200px";var outer=document.createElement('div');outer.style.position="absolute";outer.style.top="0px";outer.style.left="0px";outer.style.visibility="hidden";outer.style.width="200px";outer.style.height="150px";outer.style.overflow="hidden";outer.appendChild(inner);document.body.appendChild(outer);var w1=inner.offsetWidth;outer.style.overflow='scroll';var w2=inner.offsetWidth;if(w1==w2)w2=outer.clientWidth;document.body.removeChild(outer);return w1-w2;};String.prototype.trim=function(){return trim(this);};function trim(str){var str=str.replace(/^\s\s*/,''),ws=/\s/,i=str.length;while(ws.test(str.charAt(--i)));return str.slice(0,i+1);}function ParseBool(value){if(!value)return false;value=value.toLowerCase();return value=="y"||value=="yes"||value=="true"||(""+value)=="1";}
