function AJAX_Encode(s){if(typeof encodeURIComponent=="function"){return encodeURIComponent(s)}else{return encodeURIComponentNew(s)}}function AJAX_AddEvent(control,eventType,functionPrefix){var ev;eval("ev = control."+eventType+";");if(typeof(ev)=="function"){ev=ev.toString();ev=ev.substring(ev.indexOf("{")+1,ev.lastIndexOf("}"))}else{ev=""}var func;if(navigator.appName.toLowerCase().indexOf('explorer')>-1){func=new Function(functionPrefix+" "+ev)}else{func=new Function("event",functionPrefix+" "+ev)}eval("control."+eventType+" = func;")}function AJAX_GetXMLHttpRequest(){if(window.XMLHttpRequest){return new XMLHttpRequest()}else{if(window.AJAX_XMLHttpRequestProgID){return new ActiveXObject(window.AJAX_XMLHttpRequestProgID)}else{var progIDs=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];for(var i=0;i<progIDs.length;++i){var progID=progIDs[i];try{var x=new ActiveXObject(progID);window.AJAX_XMLHttpRequestProgID=progID;return x}catch(e){}}}}return null}var callbackFrames=new Array();function AJAX_HandleIOFrameResponse(frameid){var iframe=document.getElementById(frameid);if(iframe!=null){var doc=AJAX_ExtractIFrameDocument(iframe);if(doc.getElementsByTagName("textarea").length>0){var response={responseText:doc.getElementById("response").value.replace(/<\/ajaxarea>/,"</textarea>")};if(typeof(AJAX_DebugResponseText)=="function"){AJAX_DebugResponseText(response.responseText)}var result=AJAX_GetResult(response);if(result.error){if(typeof(AJAX_DebugError)=="function"){AJAX_DebugError(result.error)}if(typeof(window.AJAX_Error)=="function"){AJAX_Error(result)}}AJAX_UpdatePage(result);AJAX_EvalClientSideScript(result);for(var index in callbackFrames){var frame=callbackFrames[index];if(frame!=null&&frame.id==frameid){callbackFrames.splice(index,1);frame.clientCallBack(result,frame.clientCallBackArg);break}}if(typeof(window.AJAX_PostCallBack)=="function"){AJAX_PostCallBack()}}setTimeout("document.body.removeChild(document.getElementById(\""+frameid+"\"))",10)}}function AJAX_ExtractIFrameDocument(iFrameEl){var doc=null;if(iFrameEl.contentDocument){doc=iFrameEl.contentDocument}else if(iFrameEl.contentWindow){doc=iFrameEl.contentWindow.document}else if(iFrameEl.document){doc=iFrameEl.document}else{return null}return doc}function AJAX_GetForm(){var form=document.getElementById(AJAX_FormID);return form}function AJAX_GetCallBackUrl(){var form=AJAX_GetForm();var action=form.action+(form.action.indexOf('?')==-1?"?":"&")+"AJAX_CallBack=true&AJAX_T="+(new Date()).getTime().toString();return action}function AJAX_CallBack(url,target,id,method,args,clientCallBack,clientCallBackArg,includeControlValuesWithCallBack,updatePageAfterCallBack){if(typeof(window.AJAX_PreCallBack)=="function"){var preCallBackResult=AJAX_PreCallBack();if(!(typeof preCallBackResult=="undefined"||preCallBackResult)){if(typeof(window.AJAX_CallBackCancelled)=="function"){AJAX_CallBackCancelled()}return null}}var encodedData="";if(target=="Page"){encodedData+="&AJAX_PageMethod="+method}else if(target=="MasterPage"){encodedData+="&AJAX_MasterPageMethod="+method}else if(target=="Control"){encodedData+="&AJAX_ControlID="+id.split(":").join("_");encodedData+="&AJAX_ControlMethod="+method}if(args){for(var argsIndex=0;argsIndex<args.length;++argsIndex){if(args[argsIndex]instanceof Array){for(var i=0;i<args[argsIndex].length;++i){encodedData+="&AJAX_CallBackArgument"+argsIndex+"="+AJAX_Encode(args[argsIndex][i])}}else{encodedData+="&AJAX_CallBackArgument"+argsIndex+"="+AJAX_Encode(args[argsIndex])}}}if(updatePageAfterCallBack){encodedData+="&AJAX_UpdatePage=true"}var useIOFrame=false;if(includeControlValuesWithCallBack){var form=AJAX_GetForm();if(form!=null){for(var elementIndex=0;elementIndex<form.length;++elementIndex){var element=form.elements[elementIndex];if(element.name){var elementValue=null;if(element.nodeName.toUpperCase()=="INPUT"){var inputType=element.getAttribute("type").toUpperCase();if(inputType=="TEXT"||inputType=="PASSWORD"||inputType=="HIDDEN"){elementValue=element.value}else if(inputType=="CHECKBOX"||inputType=="RADIO"){if(element.checked){elementValue=element.value}}else if(inputType=="FILE"){useIOFrame=useIOFrame|!(element.value==null||element.value.length==0)}}else if(element.nodeName.toUpperCase()=="SELECT"){if(element.multiple){elementValue=[];for(var i=0;i<element.length;++i){if(element.options[i].selected){elementValue.push(element.options[i].value)}}}else if(element.length==0){elementValue=null}else{elementValue=element.value}}else if(element.nodeName.toUpperCase()=="TEXTAREA"){elementValue=element.value}if(elementValue instanceof Array){for(var i=0;i<elementValue.length;++i){encodedData+="&"+element.name+"="+AJAX_Encode(elementValue[i])}}else if(elementValue!=null){encodedData+="&"+element.name+"="+AJAX_Encode(elementValue)}}}if(typeof form.__VIEWSTATE=="undefined"){encodedData+="&__VIEWSTATE="}if(typeof form.__EVENTTARGET=="undefined"){encodedData+="&__EVENTTARGET="}}}if(encodedData.length>0){encodedData=encodedData.substring(1)}if(typeof(AJAX_DebugRequestText)=="function"){AJAX_DebugRequestText(encodedData.split("&").join("\n&"))}if(useIOFrame){var action=AJAX_GetCallBackUrl();action=action+"&AJAX_IOFrame=true";if(updatePageAfterCallBack){action=action+"&AJAX_UpdatePage=true"}var id="f"+new String(Math.floor(9999*Math.random()));if(typeof(clientCallBack)=="function"){var frame={"id":id,"clientCallBack":clientCallBack,"clientCallBackArg":clientCallBackArg};callbackFrames.push(frame)}var ioframe=null;if(window.ActiveXObject){ioframe=document.createElement("<iframe name=\""+id+"\" id=\""+id+"\" onload=\"AJAX_HandleIOFrameResponse('"+id+"');\"/>")}else{ioframe=document.createElement("iframe");ioframe.id=id;ioframe.name=id;ioframe.onload=function(){AJAX_HandleIOFrameResponse(id)}}ioframe.style.visibility="hidden";ioframe.style.height="1px";document.body.appendChild(ioframe);var theForm=AJAX_GetForm();var tempActionUri=theForm.action;theForm.action=action;theForm.target=id;try{theForm.submit()}catch(e){result={"value":null,"error":e.message};if(typeof(AJAX_DebugError)=="function"){AJAX_DebugError(e.name+": "+e.message+" ("+e.number+")")}if(typeof(window.AJAX_Error)=="function"){AJAX_Error(result)}}theForm.target="";theForm.action=tempActionUri}else{var x=AJAX_GetXMLHttpRequest();var result=null;if(!x){result={"value":null,"error":"NOXMLHTTP"};if(typeof(AJAX_DebugError)=="function"){AJAX_DebugError(result.error)}if(typeof(window.AJAX_Error)=="function"){AJAX_Error(result)}if(typeof(clientCallBack)=="function"){clientCallBack(result,clientCallBackArg)}return result}var action=AJAX_GetCallBackUrl();x.open("POST",url?url:action,clientCallBack?true:false);x.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8");x.setRequestHeader("Accept-Encoding","gzip, deflate");if(typeof(clientCallBack)=="function"){x.onreadystatechange=function(){if(x.readyState!=4){return}if(typeof(AJAX_DebugResponseText)=="function"){AJAX_DebugResponseText(x.responseText)}result=AJAX_GetResult(x);if(result.error){if(typeof(AJAX_DebugError)=="function"){AJAX_DebugError(result.error)}if(typeof(window.AJAX_Error)=="function"){AJAX_Error(result)}}if(updatePageAfterCallBack){AJAX_UpdatePage(result)}AJAX_EvalClientSideScript(result);clientCallBack(result,clientCallBackArg);x=null;if(typeof(window.AJAX_PostCallBack)=="function"){AJAX_PostCallBack()}}}x.send(encodedData);if(typeof(clientCallBack)!="function"){if(typeof(AJAX_DebugResponseText)=="function"){AJAX_DebugResponseText(x.responseText)}result=AJAX_GetResult(x);if(result.error){if(typeof(AJAX_DebugError)=="function"){AJAX_DebugError(result.error)}if(typeof(window.AJAX_Error)=="function"){AJAX_Error(result)}}if(updatePageAfterCallBack){AJAX_UpdatePage(result)}AJAX_EvalClientSideScript(result);if(typeof(window.AJAX_PostCallBack)=="function"){AJAX_PostCallBack()}}}return result}function AJAX_GetResult(x){var result={"value":null,"error":null};var responseText=x.responseText;try{result=eval("("+responseText+")")}catch(e){if(responseText.length==0){result.error="NORESPONSE"}else{result.error="BADRESPONSE";result.responseText=responseText}}return result}function AJAX_SetHiddenInputValue(form,name,value){var input=null;if(form[name]){input=form[name]}else{input=document.createElement("input");input.setAttribute("name",name);input.setAttribute("type","hidden")}input.setAttribute("value",value);var parentElement=input.parentElement?input.parentElement:input.parentNode;if(parentElement==null){form.appendChild(input);form[name]=input}}function AJAX_RemoveHiddenInput(form,name){var input=form[name];if(input!=null&&typeof(input)!="undefined"){var parentElement=input.parentElement?input.parentElement:input.parentNode;if(parentElement!=null){form[name]=null;parentElement.removeChild(input)}}}function AJAX_FireEvent(eventTarget,eventArgument,clientCallBack,clientCallBackArg,includeControlValuesWithCallBack,updatePageAfterCallBack){var form=AJAX_GetForm();AJAX_SetHiddenInputValue(form,"__EVENTTARGET",eventTarget);AJAX_SetHiddenInputValue(form,"__EVENTARGUMENT",eventArgument);AJAX_CallBack(null,null,null,null,null,clientCallBack,clientCallBackArg,includeControlValuesWithCallBack,updatePageAfterCallBack);form.__EVENTTARGET.value="";form.__EVENTARGUMENT.value=""}function AJAX_UpdatePage(result){var form=AJAX_GetForm();if(result.viewState){AJAX_SetHiddenInputValue(form,"__VIEWSTATE",result.viewState)}if(result.viewStateEncrypted){AJAX_SetHiddenInputValue(form,"__VIEWSTATEENCRYPTED",result.viewStateEncrypted)}if(result.eventValidation){AJAX_SetHiddenInputValue(form,"__EVENTVALIDATION",result.eventValidation)}if(result.controls){for(var controlID in result.controls){var containerID="AJAX_"+controlID.split("$").join("_")+"__";var control=document.getElementById(containerID);if(control){control.innerHTML=result.controls[controlID];if(result.controls[controlID]==""){control.style.display="none"}else{control.style.display=""}}}}if(result.pagescript){AJAX_LoadPageScript(result,0)}}function AJAX_LoadPageScript(result,index){if(index<result.pagescript.length){try{var script=document.createElement('script');script.type='text/javascript';if(result.pagescript[index].indexOf('src=')==0){script.src=result.pagescript[index].substring(4)}else{if(script.canHaveChildren){script.appendChild(document.createTextNode(result.pagescript[index]))}else{script.text=result.pagescript[index]}}var heads=document.getElementsByTagName('head');if(heads!=null&&typeof(heads)!="undefined"&&heads.length>0){var head=heads[0];var found=false;for(var child=0;child<head.childNodes.length;child++){var control=head.childNodes[child];if(typeof(control.tagName)=="string"){if(control.tagName.toUpperCase()=="SCRIPT"){if(script.src.length>0){if(script.src==control.src){found=true;break}}else if(script.innerHTML.length>0){if(script.innerHTML==control.innerHTML){found=true;break}}}}}if(found){head.removeChild(control)}document.getElementsByTagName('head')[0].appendChild(script);if(typeof script.readyState!="undefined"){script.onreadystatechange=function(){if(script.readyState!="complete"&&script.readyState!="loaded"){return}else{AJAX_LoadPageScript(result,index+1)}}}else{AJAX_LoadPageScript(result,index+1)}}}catch(e){if(typeof(AJAX_DebugError)=="function"){AJAX_DebugError("Error adding page script to head. "+e.name+": "+e.message)}}}}function AJAX_EvalClientSideScript(result){if(result.script){for(var i=0;i<result.script.length;++i){try{eval(result.script[i])}catch(e){alert("Error evaluating client-side script!\n\nScript: "+result.script[i]+"\n\nException: "+e)}}}}function AJAX_Clear__EVENTTARGET(){var form=AJAX_GetForm();AJAX_SetHiddenInputValue(form,"__EVENTTARGET","")}function AJAX_InvokePageMethod(methodName,args,clientCallBack,clientCallBackArg){AJAX_Clear__EVENTTARGET();return AJAX_CallBack(null,"Page",null,methodName,args,clientCallBack,clientCallBackArg,true,true)}function AJAX_InvokeMasterPageMethod(methodName,args,clientCallBack,clientCallBackArg){AJAX_Clear__EVENTTARGET();return AJAX_CallBack(null,"MasterPage",null,methodName,args,clientCallBack,clientCallBackArg,true,true)}function AJAX_InvokeControlMethod(id,methodName,args,clientCallBack,clientCallBackArg){AJAX_Clear__EVENTTARGET();return AJAX_CallBack(null,"Control",id,methodName,args,clientCallBack,clientCallBackArg,true,true)}function AJAX_PreProcessCallBack(control,e,eventTarget,causesValidation,validationGroup,imageUrlDuringCallBack,textDuringCallBack,enabledDuringCallBack,preCallBackFunction,callBackCancelledFunction,preProcessOut){var valid=true;if(causesValidation&&typeof(Page_ClientValidate)=="function"){valid=Page_ClientValidate(validationGroup)}if(typeof(WebForm_OnSubmit)=="function"){valid=WebForm_OnSubmit()}if(valid){var preCallBackResult=true;if(typeof(preCallBackFunction)=="function"){preCallBackResult=preCallBackFunction(control,e)}if(typeof(preCallBackResult)=="undefined"||preCallBackResult){var inputType=control.getAttribute("type");inputType=(inputType==null)?'':inputType.toUpperCase();if(inputType=="IMAGE"&&e!=null){var form=AJAX_GetForm();if(e.offsetX){AJAX_SetHiddenInputValue(form,eventTarget+".x",e.offsetX);AJAX_SetHiddenInputValue(form,eventTarget+".y",e.offsetY)}else{var offset=GetControlLocation(control);AJAX_SetHiddenInputValue(form,eventTarget+".x",e.clientX-offset.x+1+window.pageXOffset);AJAX_SetHiddenInputValue(form,eventTarget+".y",e.clientY-offset.y+1+window.pageYOffset)}}if(imageUrlDuringCallBack||textDuringCallBack){var nodeName=control.nodeName.toUpperCase();if(nodeName=="INPUT"){if(inputType=="CHECKBOX"||inputType=="RADIO"||inputType=="TEXT"){preProcessOut.OriginalText=GetLabelText(control.id);SetLabelText(control.id,textDuringCallBack)}else if(inputType=="IMAGE"){if(imageUrlDuringCallBack){preProcessOut.OriginalText=control.src;control.src=imageUrlDuringCallBack}else{preProcessOut.ParentElement=control.parentElement?control.parentElement:control.parentNode;if(preProcessOut.ParentElement){preProcessOut.OriginalText=preProcessOut.ParentElement.innerHTML;preProcessOut.ParentElement.innerHTML=textDuringCallBack}}}else if(inputType=="SUBMIT"||inputType=="BUTTON"){preProcessOut.OriginalText=control.value;control.value=textDuringCallBack}}else if(nodeName=="SELECT"||nodeName=="SPAN"){preProcessOut.OriginalText=GetLabelText(control.id);SetLabelText(control.id,textDuringCallBack)}else{preProcessOut.OriginalText=control.innerHTML;control.innerHTML=textDuringCallBack}}control.disabled=(typeof(enabledDuringCallBack)=="undefined")?false:!enabledDuringCallBack;return true}else{if(typeof(callBackCancelledFunction)=="function"){callBackCancelledFunction(control,e)}return false}}else{return false}}function AJAX_PreProcessCallBackOut(){this.ParentElement=null;this.OriginalText=''}function AJAX_PostProcessCallBack(result,control,e,eventTarget,clientCallBack,clientCallBackArg,imageUrlDuringCallBack,textDuringCallBack,postCallBackFunction,preProcessOut){if(typeof(postCallBackFunction)=="function"){postCallBackFunction(control,e)}control.disabled=false;var inputType=control.getAttribute("type");inputType=(inputType==null)?'':inputType.toUpperCase();if(inputType=="IMAGE"){var form=AJAX_GetForm();AJAX_RemoveHiddenInput(form,eventTarget+".x");AJAX_RemoveHiddenInput(form,eventTarget+".y")}if(imageUrlDuringCallBack||textDuringCallBack){var nodeName=control.nodeName.toUpperCase();if(nodeName=="INPUT"){if(inputType=="CHECKBOX"||inputType=="RADIO"||inputType=="TEXT"){SetLabelText(control.id,preProcessOut.OriginalText)}else if(inputType=="IMAGE"){if(imageUrlDuringCallBack){control.src=preProcessOut.OriginalText}else{preProcessOut.ParentElement.innerHTML=preProcessOut.OriginalText}}else if(inputType=="SUBMIT"||inputType=="BUTTON"){control.value=preProcessOut.OriginalText}}else if(nodeName=="SELECT"||nodeName=="SPAN"){SetLabelText(control.id,preProcessOut.OriginalText)}else{control.innerHTML=preProcessOut.OriginalText}}if(typeof(clientCallBack)=="function"){clientCallBack(result,clientCallBackArg)}}function AJAX_FireCallBackEvent(control,e,eventTarget,eventArgument,causesValidation,validationGroup,imageUrlDuringCallBack,textDuringCallBack,enabledDuringCallBack,preCallBackFunction,postCallBackFunction,callBackCancelledFunction,includeControlValuesWithCallBack,updatePageAfterCallBack){if(control.disabled)return;var preProcessOut=new AJAX_PreProcessCallBackOut();var preProcessResult=AJAX_PreProcessCallBack(control,e,eventTarget,causesValidation,validationGroup,imageUrlDuringCallBack,textDuringCallBack,enabledDuringCallBack,preCallBackFunction,callBackCancelledFunction,preProcessOut);if(preProcessResult){var eventType=e.type;AJAX_FireEvent(eventTarget,eventArgument,function(result){AJAX_PostProcessCallBack(result,control,eventType,eventTarget,null,null,imageUrlDuringCallBack,textDuringCallBack,postCallBackFunction,preProcessOut)},null,includeControlValuesWithCallBack,updatePageAfterCallBack)}}function AJAXListControl_OnClick(e,causesValidation,validationGroup,textDuringCallBack,enabledDuringCallBack,preCallBackFunction,postCallBackFunction,callBackCancelledFunction,includeControlValuesWithCallBack,updatePageAfterCallBack){var target=e.target||e.srcElement;if(target.nodeName.toUpperCase()=="LABEL"&&target.htmlFor!='')return;var eventTarget=target.id.split("_").join("$");AJAX_FireCallBackEvent(target,e,eventTarget,'',causesValidation,validationGroup,'',textDuringCallBack,enabledDuringCallBack,preCallBackFunction,postCallBackFunction,callBackCancelledFunction,true,true)}function GetControlLocation(control){var offsetX=0;var offsetY=0;var parent;for(parent=control;parent;parent=parent.offsetParent){if(parent.offsetLeft){offsetX+=parent.offsetLeft}if(parent.offsetTop){offsetY+=parent.offsetTop}}return{x:offsetX,y:offsetY}}function GetLabelText(id){var labels=document.getElementsByTagName('label');for(var i=0;i<labels.length;i++){if(labels[i].htmlFor==id){return labels[i].innerHTML}}return null}function SetLabelText(id,text){var labels=document.getElementsByTagName('label');for(var i=0;i<labels.length;i++){if(labels[i].htmlFor==id){labels[i].innerHTML=text;return}}}function utf8(wide){var c,s;var enc="";var i=0;while(i<wide.length){c=wide.charCodeAt(i++);if(c>=0xDC00&&c<0xE000)continue;if(c>=0xD800&&c<0xDC00){if(i>=wide.length)continue;s=wide.charCodeAt(i++);if(s<0xDC00||c>=0xDE00)continue;c=((c-0xD800)<<10)+(s-0xDC00)+0x10000}if(c<0x80)enc+=String.fromCharCode(c);else if(c<0x800)enc+=String.fromCharCode(0xC0+(c>>6),0x80+(c&0x3F));else if(c<0x10000)enc+=String.fromCharCode(0xE0+(c>>12),0x80+(c>>6&0x3F),0x80+(c&0x3F));else enc+=String.fromCharCode(0xF0+(c>>18),0x80+(c>>12&0x3F),0x80+(c>>6&0x3F),0x80+(c&0x3F))}return enc}var hexchars="0123456789ABCDEF";function toHex(n){return hexchars.charAt(n>>4)+hexchars.charAt(n&0xF)}var okURIchars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-";function encodeURIComponentNew(s){var s=utf8(s);var c;var enc="";for(var i=0;i<s.length;i++){if(okURIchars.indexOf(s.charAt(i))==-1)enc+="%"+toHex(s.charCodeAt(i));else enc+=s.charAt(i)}return enc}function xWidth(e,w){if(!(e=xGetElementById(e)))return 0;if(xNum(w)){if(w<0)w=0;else w=Math.round(w)}else w=-1;var css=xDef(e.style);if(e==document||e.tagName.toLowerCase()=='html'||e.tagName.toLowerCase()=='body'){w=xClientWidth()}else if(css&&xDef(e.offsetWidth)&&xStr(e.style.width)){if(w>=0){var pl=0,pr=0,bl=0,br=0;if(document.compatMode=='CSS1Compat'){var gcs=xGetComputedStyle;pl=gcs(e,'padding-left',1);if(pl!==null){pr=gcs(e,'padding-right',1);bl=gcs(e,'border-left-width',1);br=gcs(e,'border-right-width',1)}else if(xDef(e.offsetWidth,e.style.width)){e.style.width=w+'px';pl=e.offsetWidth-w}}w-=(pl+pr+bl+br);if(isNaN(w)||w<0)return;else e.style.width=w+'px'}w=e.offsetWidth}else if(css&&xDef(e.style.pixelWidth)){if(w>=0)e.style.pixelWidth=w;w=e.style.pixelWidth}return w}function xGetElementById(e){if(typeof(e)=='string'){if(document.getElementById)e=document.getElementById(e);else if(document.all)e=document.all[e];else e=null}return e}function xNum(){for(var i=0;i<arguments.length;++i){if(isNaN(arguments[i])||typeof(arguments[i])!='number')return false}return true}function xDef(){for(var i=0;i<arguments.length;++i){if(typeof(arguments[i])=='undefined')return false}return true}function xStr(s){for(var i=0;i<arguments.length;++i){if(typeof(arguments[i])!='string')return false}return true}function xGetComputedStyle(e,p,i){if(!(e=xGetElementById(e)))return null;var s,v='undefined',dv=document.defaultView;if(dv&&dv.getComputedStyle){s=dv.getComputedStyle(e,'');if(s)v=s.getPropertyValue(p)}else if(e.currentStyle){v=e.currentStyle[xCamelize(p)]}else return null;return i?(parseInt(v)||0):v}function xCamelize(cssPropStr){var i,c,a=cssPropStr.split('-');var s=a[0];for(i=1;i<a.length;++i){c=a[i].charAt(0);s+=a[i].replace(c,c.toUpperCase())}return s}function xHeight(e,h){if(!(e=xGetElementById(e)))return 0;if(xNum(h)){if(h<0)h=0;else h=Math.round(h)}else h=-1;var css=xDef(e.style);if(e==document||e.tagName.toLowerCase()=='html'||e.tagName.toLowerCase()=='body'){h=xClientHeight()}else if(css&&xDef(e.offsetHeight)&&xStr(e.style.height)){if(h>=0){var pt=0,pb=0,bt=0,bb=0;if(document.compatMode=='CSS1Compat'){var gcs=xGetComputedStyle;pt=gcs(e,'padding-top',1);if(pt!==null){pb=gcs(e,'padding-bottom',1);bt=gcs(e,'border-top-width',1);bb=gcs(e,'border-bottom-width',1)}else if(xDef(e.offsetHeight,e.style.height)){e.style.height=h+'px';pt=e.offsetHeight-h}}h-=(pt+pb+bt+bb);if(isNaN(h)||h<0)return;else e.style.height=h+'px'}h=e.offsetHeight}else if(css&&xDef(e.style.pixelHeight)){if(h>=0)e.style.pixelHeight=h;h=e.style.pixelHeight}return h}function xPageX(e){var x=0;e=xGetElementById(e);while(e){if(xDef(e.offsetLeft))x+=e.offsetLeft;e=xDef(e.offsetParent)?e.offsetParent:null}return x}function xPageY(e){var y=0;e=xGetElementById(e);while(e){if(xDef(e.offsetTop))y+=e.offsetTop;e=xDef(e.offsetParent)?e.offsetParent:null}return y}function xParent(e,bNode){if(!(e=xGetElementById(e)))return null;var p=null;if(!bNode&&xDef(e.offsetParent))p=e.offsetParent;else if(xDef(e.parentNode))p=e.parentNode;else if(xDef(e.parentElement))p=e.parentElement;return p}function xCreateElement(sTag){if(document.createElement)return document.createElement(sTag);else return null}function xMoveTo(e,x,y){xLeft(e,x);xTop(e,y)}function xLeft(e,iX){if(!(e=xGetElementById(e)))return 0;var css=xDef(e.style);if(css&&xStr(e.style.left)){if(xNum(iX))e.style.left=iX+'px';else{iX=parseInt(e.style.left);if(isNaN(iX))iX=xGetComputedStyle(e,'left',1);if(isNaN(iX))iX=0}}else if(css&&xDef(e.style.pixelLeft)){if(xNum(iX))e.style.pixelLeft=iX;else iX=e.style.pixelLeft}return iX}function xTop(e,iY){if(!(e=xGetElementById(e)))return 0;var css=xDef(e.style);if(css&&xStr(e.style.top)){if(xNum(iY))e.style.top=iY+'px';else{iY=parseInt(e.style.top);if(isNaN(iY))iY=xGetComputedStyle(e,'top',1);if(isNaN(iY))iY=0}}else if(css&&xDef(e.style.pixelTop)){if(xNum(iY))e.style.pixelTop=iY;else iY=e.style.pixelTop}return iY}function xOpacity(e,o){var set=xDef(o);if(!(e=xGetElementById(e)))return 2;if(xStr(e.style.opacity)){if(set)e.style.opacity=o+'';else o=parseFloat(e.style.opacity)}else if(xStr(e.style.filter)){if(set)e.style.filter='alpha(opacity='+(100*o)+')';else if(e.filters&&e.filters.alpha){o=e.filters.alpha.opacity/100}}else if(xStr(e.style.MozOpacity)){if(set)e.style.MozOpacity=o+'';else o=parseFloat(e.style.MozOpacity)}else if(xStr(e.style.KhtmlOpacity)){if(set)e.style.KhtmlOpacity=o+'';else o=parseFloat(e.style.KhtmlOpacity)}return isNaN(o)?1:o;}