if("function"!=typeof Object.extend)
Object.extend=function(dst,src)
{for(var propName in src)
if("undefined"==typeof dst[propName])
dst[propName]=src[propName];};Object.extend(Array.prototype,{indexOf:function(val)
{for(var idxArr=this.length-1;idxArr>=0;idxArr--)
if(val==this[idxArr])
return idxArr;return-1;},remove:function(val)
{for(var idx=this.length-1;idx>=0;idx--)
if(val==this[idx])
{this.removeAt(idx);}},removeAt:function(idx)
{this.splice(idx,1);},binarySearch:function(val,fnCompare)
{var low=0;var high=this.length-1;if(!fnCompare)
fnCompare=this._defaultComparison;var mid=-1;while(low<=high)
{mid=Math.floor((low+high)/2);var midVal=this[mid];var comparison=fnCompare(midVal,val);if(0<comparison)
high=mid-1;else if(0>comparison)
low=mid+1;else
return mid;}
return~mid;},_defaultComparison:function(a,b)
{if(a<b)
return-1;else if(a>b)
return 1;else
return 0;}});Object.extend(Array,{copy:function(src,dst)
{dst=src.slice(0);}});Object.extend(Date.prototype,{toLocal:function()
{var offset=this.getTimezoneOffset();var ret=new Date(this.toString());ret.setMinutes(ret.getMinutes()-offset);return ret;},toISOString:function()
{var offset=this.getTimezoneOffset();return this.getFullYear()+"-"
+("0"+(this.getMonth()+1)).slice(-2)+"-"
+("0"+this.getDate()).slice(-2)+"T"
+("0"+this.getHours()).slice(-2)+":"
+("0"+this.getMinutes()).slice(-2)+":"
+("0"+this.getSeconds()).slice(-2)+"."
+("00"+this.getMilliseconds()).slice(-3)
+(offset>=0?"-":"+")
+("0"+Math.floor(offset/60)).slice(-2)+":"
+("0"+offset%60).slice(-2);},toShortTimeString:function()
{var hours=this.getHours();var isPm=(hours/12>0);hours%=12;if(0==hours)
hours=12;return hours+":"+("0"+this.getMinutes()).slice(-2)+(isPm?" pm":" am");},toNewTimezone:function(newUtcOffset)
{var newTime=this.toUTC();newTime.setHours(newTime.getHours()+newUtcOffset);return newTime;},toUTC:function()
{return new Date(this.getTime()+(60000*this.getTimezoneOffset()));},copy:function()
{return new Date(this.valueOf());}});Object.extend(String.prototype,{trim:function()
{return this.replace(/(?:^\s*|\s*$)/g,"");},endsWith:function(toFind)
{var idx=this.lastIndexOf(toFind);return(idx==this.length-toFind.length);},compareTo:function(b)
{if(this==b)
return 0;else if(this<b)
return-1;else
return 1;},containsClass:function(className)
{var re=new RegExp("(?:^| )"+className+"(?: |$)");return re.test(this);},replaceClass:function(cn,rv)
{var ss=this.split(' ');for(var idxSS=ss.length-1;idxSS>=0;idxSS--)
if(cn==ss[idxSS])
{if(rv)
ss[idxSS]=rv;else
ss.removeAt(idxSS);break;}
return ss.join(' ');}});Object.extend(Math,{rad:function(deg)
{return(deg*this.PI)/180;},deg:function(rad)
{return(rad*180)/this.PI;}});function BrowserDetectionFn()
{if("undefined"==typeof BrowserDetectionFn._initialized)
{BrowserDetectionFn.prototype.compareVersions=function(sVersion1,sVersion2)
{var arrVersion1=sVersion1.split(".");var arrVersion2=sVersion2.split(".");if(arrVersion1.length>arrVersion2.length)
{for(var i=0;i<arrVersion1.length-arrVersion2.length;i++)
arrVersion2.push("0");}
else if(arrVersion1.length<arrVersion2.length)
{for(var i=0;i<arrVersion2.length-arrVersion1.length;i++)
arrVersion1.push("0");}
for(var i=0;i<arrVersion1.length;i++){if(arrVersion1[i]<arrVersion2[i])
return-1;else if(arrVersion1[i]>arrVersion2[i])
return 1;}
return 0;};}
var sUserAgent=navigator.userAgent;var fAppVersion=parseFloat(navigator.appVersion);this.isOpera=(sUserAgent.indexOf("Opera")>-1);this.isMinOpera4=this.isMinOpera5=this.isMinOpera6=this.isMinOpera7=this.isMinOpera7_5=false;if(this.isOpera){var fOperaVersion;if(navigator.appName=="Opera"){fOperaVersion=fAppVersion;}else{var reOperaVersion=new RegExp("Opera (\\d+\\.\\d+)");reOperaVersion.test(sUserAgent);fOperaVersion=parseFloat(RegExp["$1"]);}
this.isMinOpera4=fOperaVersion>=4;this.isMinOpera5=fOperaVersion>=5;this.isMinOpera6=fOperaVersion>=6;this.isMinOpera7=fOperaVersion>=7;this.isMinOpera7_5=fOperaVersion>=7.5;}
this.isKHTML=(-1<sUserAgent.indexOf("KHTML")||-1<sUserAgent.indexOf("Konqueror")||-1<sUserAgent.indexOf("AppleWebKit"));this.isMinSafari1=this.isMinSafari1_2=false;this.isMinKonq2_2=this.isMinKonq3=this.isMinKonq3_1=this.isMinKonq3_2=false;if(this.isKHTML){this.isSafari=(sUserAgent.indexOf("AppleWebKit")>-1);this.isKonq=(sUserAgent.indexOf("Konqueror")>-1);if(this.isSafari){var reAppleWebKit=new RegExp("AppleWebKit\\/(\\d+(?:\\.\\d*)?)");reAppleWebKit.test(sUserAgent);var fAppleWebKitVersion=parseFloat(RegExp["$1"]);this.isMinSafari1=fAppleWebKitVersion>=85;this.isMinSafari1_2=fAppleWebKitVersion>=124;}else if(this.isKonq){var reKonq=new RegExp("Konqueror\\/(\\d+(?:\\.\\d+(?:\\.\\d)?)?)");reKonq.test(sUserAgent);this.isMinKonq2_2=this.compareVersions(RegExp["$1"],"2.2")>=0;this.isMinKonq3=this.compareVersions(RegExp["$1"],"3.0")>=0;this.isMinKonq3_1=this.compareVersions(RegExp["$1"],"3.1")>=0;this.isMinKonq3_2=this.compareVersions(RegExp["$1"],"3.2")>=0;}}
this.isIE=(sUserAgent.indexOf("compatible")>-1&&sUserAgent.indexOf("MSIE")>-1&&!this.isOpera);this.isMinIE4=this.isMinIE5=this.isMinIE5_5=this.isMinIE6=false;if(this.isIE){var reIE=new RegExp("MSIE (\\d+\\.\\d+);");reIE.test(sUserAgent);var fIEVersion=parseFloat(RegExp["$1"]);this.isMinIE4=fIEVersion>=4;this.isMinIE5=fIEVersion>=5;this.isMinIE5_5=fIEVersion>=5.5;this.isMinIE6=fIEVersion>=6;this.isMinIE7=fIEVersion>=7;this.isMaxIE6=fIEVersion<=6;}
this.isMoz=(sUserAgent.indexOf("Gecko")>-1&&!this.isKHTML);this.isMinMoz1=this.sMinMoz1_4=this.isMinMoz1_5=false;if(this.isMoz){var reMoz=new RegExp("rv:(\\d+\\.\\d+(?:\\.\\d+)?)");reMoz.test(sUserAgent);this.isMinMoz1=this.compareVersions(RegExp["$1"],"1.0")>=0;this.isMinMoz1_4=this.compareVersions(RegExp["$1"],"1.4")>=0;this.isMinMoz1_5=this.compareVersions(RegExp["$1"],"1.5")>=0;}
this.isNS4=(!this.isIE&&!this.isOpera&&!this.isMoz&&!this.isKHTML&&(sUserAgent.indexOf("Mozilla")==0)&&(navigator.appName=="Netscape")&&(fAppVersion>=4.0&&fAppVersion<5.0));this.isMinNS4=this.isMinNS4_5=this.isMinNS4_7=this.isMinNS4_8=false;if(this.isNS4){this.isMinNS4=true;this.isMinNS4_5=fAppVersion>=4.5;this.isMinNS4_7=fAppVersion>=4.7;this.isMinNS4_8=fAppVersion>=4.8;}
this.isWin=(navigator.platform=="Win32")||(navigator.platform=="Windows");this.isMac=(navigator.platform=="Mac68K")||(navigator.platform=="MacPPC")||(navigator.platform=="Macintosh");this.isUnix=((navigator.platform=="X11")&&!this.isWin&&!this.isMac);this.isWin95=this.isWin98=this.isWinNT4=this.isWin2K=this.isWinME=this.isWinXP=false;this.isMac68K=this.isMacPPC=false;this.isSunOS=this.isMinSunOS4=this.isMinSunOS5=this.isMinSunOS5_5=false;if(this.isWin){this.isWin95=(sUserAgent.indexOf("Win95")>-1||sUserAgent.indexOf("Windows 95")>-1);this.isWin98=(sUserAgent.indexOf("Win98")>-1||sUserAgent.indexOf("Windows 98")>-1);this.isWinME=(sUserAgent.indexOf("Win 9x 4.90")>-1||sUserAgent.indexOf("Windows ME")>-1);this.isWin2K=(sUserAgent.indexOf("Windows NT 5.0")>-1||sUserAgent.indexOf("Windows 2000")>-1);this.isWinXP=(sUserAgent.indexOf("Windows NT 5.1")>-1||sUserAgent.indexOf("Windows XP")>-1);this.isWinNT4=(sUserAgent.indexOf("WinNT")>-1||sUserAgent.indexOf("Windows NT")>-1||sUserAgent.indexOf("WinNT4.0")>-1||sUserAgent.indexOf("Windows NT 4.0")>-1&&(!this.isWinME&&!this.isWin2K&&!this.isWinXP));}
if(this.isMac){this.isMac68K=(sUserAgent.indexOf("Mac_68000")>-1||sUserAgent.indexOf("68K")>-1);this.isMacPPC=(sUserAgent.indexOf("Mac_PowerPC")>-1||sUserAgent.indexOf("PPC")>-1);}
if(this.isUnix){this.isSunOS=(sUserAgent.indexOf("SunOS")>-1);if(this.isSunOS){var reSunOS=new RegExp("SunOS (\\d+\\.\\d+(?:\\.\\d+)?)");reSunOS.test(sUserAgent);this.isMinSunOS4=this.compareVersions(RegExp["$1"],"4.0")>=0;this.isMinSunOS5=this.compareVersions(RegExp["$1"],"5.0")>=0;this.isMinSunOS5_5=this.compareVersions(RegExp["$1"],"5.5")>=0;}}}
var BrowserDetection=new BrowserDetectionFn();function Delegate(fn,fnThis)
{this._fn=fn;this._t=fnThis;}
Delegate.prototype={call:function()
{if(!this._fn)return false;return this._fn.apply(this._t,Array.prototype.slice.apply(arguments,[0]));}};function Event(node)
{if("undefined"==typeof node)
node=null;this._head=node;}
Object.extend(Event.prototype,{addEventListener:function(func,This)
{if(null==func)
return;this._addNode(new this._functionNode(func,This));},removeEventListener:function(func,This)
{if(null==func)
return;this._removeNode(new this._functionNode(func,This));},addChainedEvent:function(evt)
{this._addNode(new this._evtNode(evt));},removeChainedEvent:function(evt)
{this._removeNode(new this._evtNode(evt));},dispatchEvent:function(args)
{if(!args)
args=[];var nodes=[];var node=this._head;while(!this._isTail(node))
{nodes.push(node);node=this._moveNext(node);};var retVals=[];var lenNodes=nodes.length;for(var idxNodes=0;idxNodes<lenNodes;idxNodes++)
retVals=retVals.concat(nodes[idxNodes].dispatch(args));return retVals;},_addNode:function(node)
{node.next=this._head;this._head=node;},_removeNode:function(nodeToRemove)
{var prevNode=null;var node=this._head;while(!this._isTail(node))
{if(node.fn==nodeToRemove.fn&&node.This==nodeToRemove.This)
{if(prevNode==null)
this._head=node.next;else
prevNode.next=node.next;}
prevNode=node;node=this._moveNext(node);};},_moveNext:function(node)
{return node.next;},_isTail:function(node)
{return(null==node);},_isEmpty:function()
{return(null==this._head);},_length:function()
{var length=0;var node=this._head;while(!this._isTail(node))
{length++;node=this._moveNext(node);}
return length;},_functionNode:function(fn,This)
{this.fn=fn;this.This=This;this.next=null;},_evtNode:function(evt)
{this.evt=evt;this.next=null;}});Event.prototype._functionNode.prototype={dispatch:function(args)
{return[this.fn.apply(this.This,args)];}}
Event.prototype._evtNode.prototype={dispatch:function(args)
{return this.evt.dispatchEvent(args);}}
Object.extend(Event,{_prefix:"_evt-",addEventsToObject:function(obj,events)
{for(var idxEvents=events.length-1;idxEvents>=0;idxEvents--)
{obj[Event._prefix+events[idxEvents]]=null;}
obj.addEventListener=this._addEventListener;obj.removeEventListener=this._removeEventListener;obj.dispatchEvent=this._dispatchEvent;},chainEvents:function(dstObj,dstEvtName,srcObj,srvEvtName)
{var srcEvt;if(null==(srcEvt=srcObj[Event._prefix+srvEvtName]))
srcEvt=srcObj[Event._prefix+srvEvtName]=new Event();var dstEvt;if(null==(dstEvt=dstObj[Event._prefix+dstEvtName]))
dstEvt=dstObj[Event._prefix+dstEvtName]=new Event();dstEvt.addChainedEvent(srcEvt);},_addEventListener:function(evtName,func,This)
{var evt;if(null==(evt=this[Event._prefix+evtName]))
evt=this[Event._prefix+evtName]=new Event();evt.addEventListener(func,This);},_removeEventListener:function(evtName,func,This)
{var evt;if(null!=(evt=this[Event._prefix+evtName]))
evt.removeEventListener(func,This);},_dispatchEvent:function(evtName)
{var evt;var retVals=null;if(null!=(evt=this[Event._prefix+evtName]))
{var args=Array.prototype.slice.apply(arguments,[1]);retVals=evt.dispatchEvent(args);}
else
retVals=[];retVals.isAllTrue=Event._isAllTrue;return retVals;},_isAllTrue:function()
{var retVal=true;for(var idxThis=this.length-1;idxThis>=0;idxThis--)
retVal&=("undefined"==typeof this[idxThis]||this[idxThis]);return retVal;},addDomEventListener:function(domObj,evtName,fn,This)
{var evt;if(!(evt=domObj[Event._prefix+evtName]))
evt=domObj[this._prefix+evtName]=new Event();evt.addEventListener(fn,This);if(1==evt._length())
this._xbAddEventListener(domObj,evtName,this._getFnFromFactory(evtName));},removeDomEventListener:function(domObj,evtName,fn,This)
{var evt;if(evt=domObj[Event._prefix+evtName])
{evt.removeEventListener(fn,This);if(evt._isEmpty())
this._xbRemoveEventListener(domObj,evtName,this._getFnFromFactory(evtName));}},_getFnFromFactory:function(evtName)
{var fn;if(null==(fn=this._getFnFromFactory[evtName]))
{fn=new Function("var evt=Event._xbGetEvent();Event._callEventFromDomEvent(evt,'"+evtName+"')");this._getFnFromFactory[evtName]=fn;}
return fn;},_callEventFromDomEvent:function(evt,evtName)
{evtName=Event._prefix+evtName;var evtInst;if(evtName.endsWith("scroll")||evtName.endsWith("load"))
{evtInst=this._getInstFromTree(window,evtName);}
else
{var srcs=[evt.explicitOriginalTarget,evt.target,evt.currentTarget];for(var idxSrcs=srcs.length-1;idxSrcs>=0;idxSrcs--)
if(srcs[idxSrcs])
{evtInst=this._getInstFromTree(srcs[idxSrcs],evtName);if(evtInst)
break;}}
if(!evtInst)
return;var retVals=evtInst.dispatchEvent([evt]);if(!retVals||0==retVals.length)
return;else
return retVals[retVals.length-1];},_getInstFromTree:function(e,n)
{var r;do
r=e[n];while(!r&&null!=(e=e.parentNode));return r;},_xbAddEventListener:function(oTarget,sEventType,fnHandler){if(oTarget.addEventListener){oTarget.addEventListener(sEventType,fnHandler,false);}else if(oTarget.attachEvent){oTarget.attachEvent("on"+sEventType,fnHandler);}else{oTarget["on"+sEventType]=fnHandler;}},_xbAddDomContentLoadedEvent:function(fnHandler)
{if(document.addEventListener){document.addEventListener("DOMContentLoaded",fnHandler,false);}
/*@cc_on@*/
/*@if(@_win32)
document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");var script=document.getElementById("__ie_onload");script.onreadystatechange=function(){if(this.readyState=="complete"){fnHandler();}};@end@*/
if(/WebKit/i.test(navigator.userAgent)){this._timer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){fnHandler();}},10);}
window.onload=fnHandler;},_xbRemoveEventListener:function(oTarget,sEventType,fnHandler){if(oTarget.removeEventListener){oTarget.removeEventListener(sEventType,fnHandler,false);}else if(oTarget.detachEvent){oTarget.detachEvent("on"+sEventType,fnHandler);}else{oTarget["on"+sEventType]=null;}},_ieFormatEvent:function(oEvent)
{if(BrowserDetection.isIE&&BrowserDetection.isWin)
{oEvent.charCode=(oEvent.type=="keypress")?oEvent.keyCode:0;oEvent.eventPhase=2;oEvent.isChar=(oEvent.charCode>0);oEvent.pageX=oEvent.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;oEvent.pageY=oEvent.clientY+document.body.scrollTop+document.documentElement.scrollTop;oEvent.preventDefault=function()
{this.returnValue=false;};if(oEvent.type=="mouseout")
oEvent.relatedTarget=oEvent.toElement;else if(oEvent.type=="mouseover")
oEvent.relatedTarget=oEvent.fromElement;oEvent.stopPropagation=function()
{this.cancelBubble=true;};oEvent.target=oEvent.srcElement;oEvent.currentTarget=oEvent.target;oEvent.time=(new Date).getTime();}
return oEvent;},_xbGetEvent:function(){if(window.event){return this._ieFormatEvent(window.event);}else{return this._xbGetEvent.caller.arguments[0];}}});var FormUtil={selectSelectOption:function(select,optionValue)
{for(var idxOptions=select.childNodes.length-1;idxOptions>=0;idxOptions--)
{var option=select.childNodes[idxOptions];if(option.value==optionValue)
{option.selected=true;}}},hideSelect:function(select)
{if("undefined"==typeof select._refCount)
select._refCount=0;if(1==++select._refCount)
select.style.visibility='hidden';},showSelect:function(select)
{if(0>=--select._refCount)
select.style.visibility='visible';},checkFirstRadioIfNoneChecked:function(radioContainer,name)
{var radios=radioContainer.getElementsByTagName("input");var firstRadio,checkedFound=false;for(var idxRadios=0,length=radios.length;idxRadios<length;idxRadios++)
{var radio=radios[idxRadios];if(DataType.isParam(name)&&name!=radio.name)
continue;if("radio"==radio.type&&!radio.disabled&&!firstRadio)
firstRadio=radio;checkedFound|=(radio.checked&&!radio.disabled);}
if(!checkedFound&&firstRadio)
firstRadio.checked=true;return!checkedFound;}};var TextUtil={isNotMax:function(oTextArea){return oTextArea.value.length<=oTextArea.getAttribute("maxlength");},preventOverMax:function()
{var evt=Event._xbGetEvent();var elem=evt.currentTarget;var maxLength=parseInt(elem.getAttribute("maxlength"));if(isNaN(maxLength))
return;var currLength=elem.value.length;if("key"==evt.type.slice(0,3))
currLength++;if(currLength>maxLength)
{evt.preventDefault();alert("You may not enter more than "+elem.getAttribute("maxlength")+" characters.");}},clickOnEnter:function()
{var evt=Event._xbGetEvent();var toClick=evt.currentTarget.elemToClick;if((13==evt.charCode||13==evt.keyCode)&&DataType.isObject(toClick)&&DataType.isFunction(toClick.click))
{toClick.click();evt.preventDefault();return false;}
return true;},blockChars:function(oTextbox,oEvent,bBlockPaste)
{oEvent=Event._ieFormatEvent(oEvent);var sInvalidChars=oTextbox.getAttribute("invalidchars");var sChar=String.fromCharCode(oEvent.charCode);var bIsValidChar=sInvalidChars.indexOf(sChar)==-1;if(bBlockPaste){return bIsValidChar&&!(oEvent.ctrlKey&&sChar=="v");}else{return bIsValidChar||oEvent.ctrlKey;}},allowChars:function(oTextbox,oEvent,bBlockPaste){oEvent=Event._ieFormatEvent(oEvent);var sValidChars=oTextbox.getAttribute("validchars");var sChar=String.fromCharCode(oEvent.charCode);var bIsValidChar=sValidChars.indexOf(sChar)>-1;if(bBlockPaste){return bIsValidChar&&!(oEvent.ctrlKey&&sChar=="v");}else{return bIsValidChar||0==oEvent.charCode||oEvent.ctrlKey;}},blurBlock:function(oTextbox){var sInvalidChars=oTextbox.getAttribute("invalidchars");var arrInvalidChars=sInvalidChars.split("");for(var i=0;i<arrInvalidChars.length;i++){if(oTextbox.value.indexOf(arrInvalidChars[i])>-1){alert("Character '"+arrInvalidChars[i]+"' not allowed.");oTextbox.focus();oTextbox.select();return;}}},blurBlock2:function(oTxt)
{var exp=oTxt.getAttribute("validationexpression");var regEx=new RegExp(exp);if(!regEx.test(oTxt.value))
{var errormessage=oTxt.getAttribute("errormessage");if(errormessage&&""!=errormessage)
alert(errormessage);oTxt.focus();return false;}
return true;},blurAllow:function(oTextbox){var sValidChars=oTextbox.getAttribute("validchars");var arrTextChars=oTextbox.value.split("");for(var i=0;i<arrTextChars.length;i++){if(sValidChars.indexOf(arrTextChars[i])==-1){alert("Character '"+arrTextChars[i]+"' not allowed.");oTextbox.focus();oTextbox.select();return;}}},numericScroll:function(oTextbox,evt){evt=Event._ieFormatEvent(evt);var iValue=oTextbox.value.length==0?0:parseInt(oTextbox.value);var iMax=oTextbox.getAttribute("max");var iMin=oTextbox.getAttribute("min");if(evt.keyCode==38||38==evt.charCode){if(iMax==null||iValue<iMax){oTextbox.value=(iValue+1);}}else if(evt.keyCode==40||40==evt.charCode){if(iMin==null||iValue>iMin){oTextbox.value=(iValue-1);}}},autosuggestMatch:function(sText,arrValues){var arrResult=new Array;if(sText!=""){for(var i=0;i<arrValues.length;i++){if(arrValues[i].indexOf(sText)==0){arrResult.push(arrValues[i]);}}}
return arrResult;},autosuggest:function(oTextbox,arrValues,sListboxId){var oListbox=document.getElementById(sListboxId);var arrMatches=this.autosuggestMatch(oTextbox.value,arrValues);ListUtil.clear(oListbox);for(var i=0;i<arrMatches.length;i++){ListUtil.add(oListbox,arrMatches[i]);}}};function XmlDom(){if(window.ActiveXObject){var arrSignatures=["MSXML2.DOMDocument.6.0","MSXML2.DOMDocument.4.0","MSXML2.DOMDocument.3.0","MSXML2.DOMDocument","Microsoft.XmlDom"];for(var i=0;i<arrSignatures.length;i++){try{var oXmlDom=new ActiveXObject(arrSignatures[i]);return oXmlDom;}catch(oError){}}
throw new Error("MSXML is not installed on your system.");}else if(document.implementation&&document.implementation.createDocument){var oXmlDom=document.implementation.createDocument("","",null);oXmlDom.parseError={valueOf:function(){return this.errorCode;},toString:function(){return this.errorCode.toString()}};oXmlDom._initError();oXmlDom.addEventListener("load",function(){this._checkForErrors();this._changeReadyState(4);},false);return oXmlDom;}else{throw new Error("Your browser doesn't support an XML DOM object.");}}
if(BrowserDetection.isMoz)
{Object.extend(Document.prototype,{readyState:0,onreadystatechange:null,_changeReadyState:function(iReadyState)
{this.readyState=iReadyState;if(typeof this.onreadystatechange=="function"){this.onreadystatechange();}},_initError:function()
{this.parseError.errorCode=0;this.parseError.filepos=-1;this.parseError.line=-1;this.parseError.linepos=-1;this.parseError.reason=null;this.parseError.srcText=null;this.parseError.url=null;},_checkForErrors:function()
{if(this.documentElement.tagName=="parsererror"){var reError=/>([\s\S]*?)Location:([\s\S]*?)Line Number (\d+), Column (\d+):<sourcetext>([\s\S]*?)(?:\-*\^)/;reError.test(this.xml);this.parseError.errorCode=-999999;this.parseError.reason=RegExp.$1;this.parseError.url=RegExp.$2;this.parseError.line=parseInt(RegExp.$3);this.parseError.linepos=parseInt(RegExp.$4);this.parseError.srcText=RegExp.$5;}},loadXML:function(sXml)
{this._initError();this._changeReadyState(1);var oParser=new DOMParser();var oXmlDom=oParser.parseFromString(sXml,"text/xml");while(this.firstChild){this.removeChild(this.firstChild);}
for(var i=0;i<oXmlDom.childNodes.length;i++){var oNewNode=this.importNode(oXmlDom.childNodes[i],true);this.appendChild(oNewNode);}
this._checkForErrors();this._changeReadyState(4);},_load:Document.prototype.load,load:function(sURL)
{this._initError();this._changeReadyState(1);this._load(sURL);}});Node.prototype.__defineGetter__("xml",function(){var oSerializer=new XMLSerializer();return oSerializer.serializeToString(this,"text/xml");});}
function StringBuilder(txt)
{this._sArr=[];if(DataType.isString(txt))
this.append(txt);};StringBuilder.prototype={append:function(str)
{this._sArr.push(str);return this;},toString:function()
{return this._sArr.join("");},undoLast:function()
{var arr=this._sArr;if(arr.length>0)
{arr.pop();return true;}
else
{return false;}},getLength:function()
{return this.toString().length;}};function QueryStringMap(queryPortion)
{if(!DataType.isString(queryPortion))
queryPortion=window.location.search.slice(1);if(0==queryPortion.length)
return;var params=queryPortion.split("&");for(var idxParams=params.length-1;idxParams>=0;idxParams--)
{var param=params[idxParams];if(0!=param.length)
{var nameValue=param.split('=');if(2==nameValue.length)
this[nameValue[0]]=unescape(nameValue[1]);}}}
QueryStringMap.prototype={toString:function()
{var keys=[];for(var key in this)
keys.push(key);keys.sort();var sb=new StringBuilder();var len=keys.length;for(var idxKey=0;idxKey<len;idxKey++)
{var key=keys[idxKey];if(DataType.isFunction(this[key]))
continue;sb.append("&").append(key).append("=");var val=this[key];if(DataType.isUndefined(val)||DataType.isNull(val))
val="";else if(DataType.isBoolean(val))
val=val?1:0;sb.append(encodeURIComponent(val));}
return sb.toString().slice(1);}};var bXmlHttpSupport=("undefined"!=typeof XMLHttpRequest||window.ActiveXObject);function httpPost(sURL,sParams){var oURL=new java.net.URL(sURL);var oConnection=oURL.openConnection();oConnection.setDoInput(true);oConnection.setDoOutput(true);oConnection.setUseCaches(false);oConnection.setRequestProperty("Content-Type","application/x-www-form-urlencoded");var oOutput=new java.io.DataOutputStream(oConnection.getOutputStream());oOutput.writeBytes(sParams);oOutput.flush();oOutput.close();var sLine="",sResponseText="";var oInput=new java.io.DataInputStream(oConnection.getInputStream());sLine=oInput.readLine();while(sLine!=null){sResponseText+=sLine+"\n";sLine=oInput.readLine();}
oInput.close();return sResponseText;}
function addPostParam(sParams,sParamName,sParamValue){if(sParams.length>0){sParams+="&";}
return sParams+encodeURIComponent(sParamName)+"="
+encodeURIComponent(sParamValue);}
function addURLParam(sURL,sParamName,sParamValue){sURL+=(sURL.indexOf("?")==-1?"?":"&");sURL+=encodeURIComponent(sParamName)+"="+encodeURIComponent(sParamValue);return sURL;}
function httpGet(sURL){var sResponseText="";var oURL=new java.net.URL(sURL);var oStream=oURL.openStream();var oReader=new java.io.BufferedReader(new java.io.InputStreamReader(oStream));var sLine=oReader.readLine();while(sLine!=null){sResponseText+=sLine+"\n";sLine=oReader.readLine();}
oReader.close();return sResponseText;}
if(typeof XMLHttpRequest=="undefined"&&window.ActiveXObject){var XMLHttpRequest=function(){var arrSignatures=["MSXML2.XMLHTTP","MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","Microsoft.XMLHTTP"];for(var i=0;i<arrSignatures.length;i++){try{var oRequest=new ActiveXObject(arrSignatures[i]);return oRequest;}catch(oError){}}
throw new Error("MSXML is not installed on your system.");}}
var Http={get:function(sURL,fnCallback){if(bXmlHttpSupport)
{var oRequest=new XMLHttpRequest();oRequest.open("get",sURL,true);oRequest.onreadystatechange=function()
{if(oRequest.readyState==4)
{fnCallback(oRequest.responseText);}}
oRequest.send(null);}
else if(navigator.javaEnabled()&&typeof java!="undefined"&&typeof java.net!="undefined")
{setTimeout(function()
{fnCallback(httpGet(sURL));},10);}
else
{alert("Your browser doesn't support HTTP requests.");}},post:function(sURL,sParams,fnCallback)
{if(bXmlHttpSupport){var oRequest=new XMLHttpRequest();oRequest.open("post",sURL,true);oRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");oRequest.onreadystatechange=function()
{if(oRequest.readyState==4)
{fnCallback(oRequest.responseText);}}
oRequest.send(sParams);}
else if(navigator.javaEnabled()&&typeof java!="undefined"&&typeof java.net!="undefined")
{setTimeout(function()
{fnCallback(httpPost(sURL,sParams));},10);}
else
{alert("Your browser doesn't support HTTP requests.");}},scriptGet:function(sUrl,noCache)
{var script=document.createElement("script");script.type="text/javascript";if(noCache)
sUrl+="&dt="+(new Date()).toUTCString();script.src=sUrl;document.getElementsByTagName('head')[0].appendChild(script);}};var XBrowser={childNode:function(parent,idxOfNode)
{if(!parent)
return null;var children=parent.childNodes;if(!children)
return null;var childrenLength=children.length;if(idxOfNode>=childrenLength)
return null;var idxActual=0;var idxVirtual=0;var found=false;var child=null;while(!found&&idxActual<childrenLength)
{child=children[idxActual++];if(1==child.nodeType)
{if(idxOfNode==idxVirtual)
{found=true;break;}
idxVirtual++;}}
if(!found)
return null;else
return child;},nodeByPath:function(start,arrPaths)
{var node=start;var elem;while(!DataType.isUndefined(elem=arrPaths.shift())&&null!=node)
{if(".."==elem)
node=node.parentNode;else
node=this.childNode(node,elem);}
return node;},previousSibling:function(element)
{var found=false;var prev=element;while(true)
{if(!prev||!prev.previousSibling)
break;prev=prev.previousSibling;if(1==prev.nodeType)
{found=true;break;}}
if(!found)
return null;else
return prev;},childNodeById:function(parent,id)
{if(!parent)
return null;var children=parent.childNodes;if(!children)
return null;for(var idxChildren=children.length-1;idxChildren>=0;idxChildren--)
{var childNode=children[idxChildren];if(1==childNode.nodeType&&id==childNode.id)
{return childNode;}}
return null;},getElementsByClassName:function(parent,className,tagName)
{var found=[];if(!parent)
return found;var children=(tagName?parent.getElementsByTagName(tagName):parent.childNodes);if(!children||0==children.length)
return found;var re=new RegExp("(^| )"+className+"( |$)");for(var idxChildren=children.length-1;idxChildren>=0;idxChildren--)
{var child=children[idxChildren];if(!child.className)
continue;if(re.test(child.className))
found.push(child);}
return found;},getStyle:function(oElm,strCssRule){var strValue="";if(document.defaultView&&document.defaultView.getComputedStyle)
{var style=document.defaultView.getComputedStyle(oElm,"");if(null==style)
{if("display"==strCssRule)
strValue="none";else
{oElm.style.display='block';style=document.defaultView.getComputedStyle(oElm,"");strValue=style.getPropertyValue(strCssRule);oElm.style.display='none';}}
else
strValue=style.getPropertyValue(strCssRule);}
else if(oElm.currentStyle){strCssRule=strCssRule.replace(/-(w)/g,function(strMatch,p1){return p1.toUpperCase();});strValue=oElm.currentStyle[strCssRule];}
return strValue;},processXsl:function(xml,xsl)
{var oXml=new XmlDom();var oXsl=new XmlDom();oXml.loadXML(xml);oXsl.loadXML(xsl);if(window.ActiveXObject)
{return oXml.transformNode(oXsl);}
else if(window.XSLTProcessor)
{var processor=new XSLTProcessor();processor.importStylesheet(oXsl);var result=processor.transformToDocument(oXml);return result.documentElement.childNodes[0].xml;}
else
{throw new Error(0,"Browser does not support XSLT");}},setHeight:function(elemId)
{if(BrowserDetection.isMaxIE6)
{var elem=document.getElementById(elemId);window.setTimeout(function(){elem.style.height=elem.parentNode.clientHeight+'px';},50);}}};function Point(x,y)
{if("undefined"==typeof x)
x=0;if("undefined"==typeof y)
y=0;this.x=Math.round(x);this.y=Math.round(y);};Point.prototype={toString:function()
{return"("+this.x.toString()+","+this.y.toString()+")";}};function Rectangle(pt1,pt2)
{this.pt1=pt1;this.pt2=pt2;}
Rectangle.prototype={toString:function()
{return"["+this.pt1.toString()+", "+this.pt2.toString()+"]";}};var UI={getDocumentElement:function()
{if(!document.documentElement)
return document.body;else
return document.documentElement;},getViewportHeight:function(de)
{if(window.innerHeight)
return window.innerHeight;else
return de.offsetHeight;},getViewportWidth:function(de)
{if(window.innerWidth)
return window.innerWidth;else
return de.offsetWidth;},getViewportYOffset:function(de)
{if(window.pageYOffset)
return window.pageYOffset;else
return de.scrollTop;},getViewportXOffset:function(de)
{if(window.pageXOffset)
return window.pageXOffset;else
return de.scrollLeft;},getViewportRect:function(de)
{if("object"!=typeof de)
de=this.getDocumentElement();var pt1=new Point(this.getViewportXOffset(de),this.getViewportYOffset(de));var pt2=new Point(pt1.x+this.getViewportWidth(de),pt1.y+this.getViewportHeight(de));return new Rectangle(pt1,pt2);},getYCoord:function(node)
{var y=0;while(node)
{y+=node.offsetTop;node=node.offsetParent;}
return y;},getXCoord:function(node)
{var x=0;while(node)
{x+=node.offsetLeft;node=node.offsetParent;}
return x;},getAbsolutePos:function(node)
{var pt=new Point(node.offsetLeft,node.offsetTop);pt.xAdjust=0;pt.yAdjust=0;pt.scrollX=node.scrollLeft;pt.scrollY=node.scrollTop;node=node.offsetParent;while(node)
{pt.x+=node.offsetLeft;pt.y+=node.offsetTop;pt.scrollX+=node.scrollLeft;pt.scrollY+=node.scrollTop;var pos=null;if(0!=pt.xAdjust||0!=pt.yAdjust||"absolute"==(pos=XBrowser.getStyle(node,"position").toLowerCase())||"relative"==pos)
{pt.xAdjust+=node.offsetLeft;pt.yAdjust+=node.offsetTop;}
node=node.offsetParent;}
pt.adjustedX=pt.x-pt.xAdjust;pt.adjustedY=pt.y-pt.yAdjust;return pt;},onevent:function(element,eventName)
{var eventFunctionName=eventName+'Fn';var fnBodyAttrib;var fnBody;if((fnBodyAttrib=element.attributes[eventName])&&(fnBody=fnBodyAttrib.value))
{if(!element[eventFunctionName])
eval('element.'+eventFunctionName+' = function(){'+fnBody+'};');element[eventFunctionName](element);}},getDisplacement:function(pt1,pt2,m)
{var x=(m*pt2.x+(1-m)*pt1.x);var y=(m*pt2.y+(1-m)*pt1.y);return new Point(x,y);},fitInScreen:function(dstRect,noOverlapRect)
{var de=this.getDocumentElement();var viewport=this.getViewportRect(de);var yDelta=0,xDelta=0;if(dstRect.pt2.x>viewport.pt2.x&&dstRect.pt1.x>=viewport.pt1.x)
xDelta=dstRect.pt2.x-viewport.pt2.x;if(dstRect.pt2.y>viewport.pt2.y&&dstRect.pt1.y>=viewport.pt1.y)
yDelta=dstRect.pt2.y-viewport.pt2.y;this._transformRect(dstRect,"x",xDelta);this._transformRect(dstRect,"y",yDelta);yDelta=0;xDelta=0;var xIsOverlapping=(dstRect.pt2.x>noOverlapRect.pt1.x&&dstRect.pt1.x<noOverlapRect.pt2.x);var yIsOverlapping=(dstRect.pt2.y>noOverlapRect.pt1.y&&dstRect.pt1.y<noOverlapRect.pt2.y);if(xIsOverlapping&&yIsOverlapping)
{if(yIsOverlapping)
yDelta=dstRect.pt2.y-noOverlapRect.pt1.y;}
this._transformRect(dstRect,"x",xDelta);this._transformRect(dstRect,"y",yDelta);return{rect:dstRect,moveOrigin:(0!=xDelta||0!=yDelta)};},_transformRect:function(rect,ptMember,delta)
{if(0!=delta)
{rect.pt1[ptMember]-=delta;rect.pt2[ptMember]-=delta;}}};var Callback={_nextId:1,_freeList:[],addValue:function(val)
{if(null==val||"undefined"==typeof val)
throw new Error(0,"addValue must have a val.");var key;if(0<this._freeList.length)
key=this._freeList.pop();else
key=this._nextId++;this["__value-"+key]=val;return key;},getValue:function(key)
{return this["__value-"+key];},getParentValue:function(key)
{if(window.parent&&window.parent.Callback)
return window.parent.Callback.getValue(key);},removeValue:function(key)
{if(null!=this["__value-"+key])
{var ret=this["__value-"+key];this["__value-"+key]=null;this._freeList.push(key);return ret;}},startTimeout:function(period,sender,args,delegate)
{return this._start(1,setTimeout,period,sender,args,delegate);},startInterval:function(period,sender,args,delegate)
{return this._start(2,setInterval,period,sender,args,delegate);},endTimeout:function(timeoutId)
{this._end(timeoutId,clearTimeout);},endInterval:function(intervalId)
{this._end(intervalId,clearInterval);},onload:function(delegate)
{var cbId=this.addValue(delegate);var fn=this._getFn("Callback._onLoadBack(Event._xbGetEvent(),"+cbId+")",cbId);Event._xbAddEventListener(window,"load",fn);},getCallback:function(delegate)
{var cbId=this.addValue(delegate);var fn=this._getFn("Callback._callback.apply(Callback, ["+cbId+"].concat(Array.prototype.slice.apply(arguments, [0])))",cbId);return[fn,cbId];},cleanupCallback:function(cbId)
{this.removeValue(cbId);},_fnFact:new Object,_getFn:function(sMethodOrBody,cbId)
{var fnRet=null;var k=sMethodOrBody+cbId;if(null==(fnRet=this._fnFact[k]))
{if(0!=sMethodOrBody.indexOf("Callback."))
sMethodOrBody="Callback."+sMethodOrBody+"("+cbId+")"
fnRet=new Function(sMethodOrBody);this._fnFact[k]=fnRet;}
return fnRet;},_start:function(type,startFn,period,sender,args,delegate)
{var objInternal={s:sender,a:args,d:delegate,type:type};var cbId=this.addValue(objInternal);var fnInternal=this._getFn("_timerCallback",cbId);objInternal.timerId=startFn(fnInternal,period);return cbId;},_end:function(cbId,clearFn)
{var o=this.getValue(cbId);if(this._isIntValid(o))
{clearFn(o.timerId);this.removeValue(cbId);}},_isIntValid:function(o)
{return DataType.isObject(o)&&DataType.isFunction(o.fn)&&DataType.isNumber(o.timerId);},_callback:function(cbId)
{var del=this.getValue(cbId);del._fn.apply(del._t,Array.prototype.slice.apply(arguments,[0]));},_onLoadBack:function(evt,cbId)
{this.getValue(cbId).call(evt);this.removeValue(cbId);},_timerCallback:function(cbId)
{var o=this.getValue(cbId);o.d.call(o.s,o.a,cbId);if(1==o.type)
this.endTimeout(cbId);}};var Server={call:function(component,forceRefresh,delegate,cbIdParam,args)
{var cbId=Callback.addValue(delegate);var sb=new StringBuilder(component);sb.append("?");sb.append(encodeURIComponent(cbIdParam)).append("=").append(cbId);if(args&&0==args.length%2)
{for(var idxArg=0;idxArg<args.length;idxArg+=2)
{var param=args[idxArg];var value=args[idxArg+1];if(DataType.isUndefined(param)||DataType.isUndefined(value))
continue;sb.append("&").append(encodeURIComponent(param)).append("=").append(encodeURIComponent(value));}}
Http.scriptGet(sb.toString(),forceRefresh);}};function Cookies()
{this._cookies=[];this.refresh();}
Object.extend(Cookies,{setValue:function(name,value,expires,path,domain,secure)
{var today=new Date();if(expires)
expires=Math.round(expires*86400000);var expires_date=new Date(today.getTime()+expires);var cookieVal=name+"="+escape(value)
+((expires)?";expires="+expires_date.toGMTString():"")
+((path)?";path="+path:"")
+((domain)?";domain="+domain:"")
+((secure)?";secure":"");document.cookie=cookieVal;}});Cookies.prototype={getValue:function(cookieName)
{var cookie=this._cookies[cookieName];if("undefined"==typeof cookie||null==cookie)
return;return cookie.value;},getNames:function()
{var names=[];for(var name in this._cookies)
if("length"!=name)
names.push(name);return names;},setValue:function(name,value,expires,path,domain,secure)
{Cookies.setValue(name,value,expires,path,domain,secure);this._append(name,value);},getCookies:function()
{return this._cookies;},refresh:function()
{var sValue=document.cookie;if(!sValue||""==sValue)
return;var cookies=sValue.split(';');for(var idxCookies=cookies.length-1;idxCookies>=0;idxCookies--)
{var cookieParts=cookies[idxCookies].split('=');if(2!=cookieParts.length)
continue;this._append(cookieParts[0],cookieParts[1]);}},_append:function(name,value)
{var cookie={name:name,value:value};this._cookies.push(cookie);this._cookies[cookie.name]=cookie;}};function BitCollection(intOrArrInts)
{if(DataType.isNumber(intOrArrInts))
this._arr=[intOrArrInts];else
this._arr=intOrArrInts;this.length=this._arr.length*32;}
BitCollection.prototype={getVal:function(idx)
{return 0x1&(this._arr[Math.floor(idx/8)]>>(idx%8));},setVal:function(idx,val)
{var arrIdx=Math.floor(idx/8);var operand=1<<(idx%8);if(val)
this._arr[arrIdx]|=operand;else
this._arr[arrIdx]&=~operand;},toString:function()
{var sb=new StringBuilder("0x").append(this._arr[0].toString(16));for(var idxArr=1;idxArr<this._arr.length;idxArr++)
sb.append(",0x").append(this._arr[idxArr].toString(16));}};var Build={image:function(parent,className,src,alt)
{var ret=document.createElement("img");if(this._validP(className))
ret.className=className;if(this._validP(src))
ret.src=src;if(this._validP(alt))
ret.alt=alt;parent.appendChild(ret);return ret;},imageButton:function(parent,className,src,alt,id,name,isDisabled)
{var ret=document.createElement("input");ret.type="image";this._setFormProps(ret,className,id,name,isDisabled);if(this._validP(src))
ret.src=src;if(this._validP(alt))
ret.alt=alt;parent.appendChild(ret);return ret;},button:function(parent,className,value,id,name,isDisabled)
{return this._newInput("button",parent,className,value,id,name,isDisabled);},a:function(parent,className,href,innerHtml)
{var ret=this._newInner("a",parent,className,innerHtml);if(this._validP(href))
ret.href=href;return ret;},textBox:function(parent,className,value,id,name,isDisabled)
{return this._newInput("text",parent,className,value,id,name,isDisabled);},radio:function(parent,className,value,id,name,isChecked,isDisabled)
{var ret;if(BrowserDetection.isIE)
{var s=new StringBuilder("<input type='radio");if(this._validP(className))
s.append("' class='").append(className);if(this._validP(id))
s.append("' id='").append(id);if(this._validP(name))
s.append("' name='").append(name);if(this._validP(value))
s.append("' value='").append(value);if(this._validP(isChecked)&&isChecked)
s.append("' checked='checked");if(this._validP(isDisabled)&&isDisabled)
s.append("' disabled='disabled");s.append("' />");ret=document.createElement(s.toString());parent.appendChild(ret);}
else
{ret=this._newInput("radio",parent,className,value,id,name,isDisabled);if(this._validP(isChecked))
ret.checked=isChecked;}
return ret;},checkBox:function(parent,className,value,id,name,isChecked,isDisabled)
{var ret=this._newInput("checkbox",parent,className,value,id,name,isDisabled);if(this._validP(isChecked))
ret.checked=isChecked;return ret;},select:function(parent,className,innerHtml,id,name,isDisabled)
{var ret=this._newInner("select",parent,className,innerHtml);this._setFormProps(ret,className,id,name,isDisabled);return ret;},option:function(parent,className,innerHtml,value,isSelected,maxLength)
{var ret=document.createElement("option");if(this._validP(className))
ret.className=className;var textIsValid=this._validP(innerHtml);if(textIsValid)
{if(DataType.isNumber(maxLength)&&innerHtml.length>maxLength)
innerHtml=innerHtml.slice(0,maxLength);ret.innerHTML=innerHtml;}
if(this._validP(value))
ret.value=value;else if(textIsValid)
ret.value=innerHtml;if(this._validP(isSelected))
ret.selected=isSelected;parent.appendChild(ret);return ret;},textArea:function(parent,className,value,id,name,isDisabled)
{var ret=document.createElement("textarea");this._setFormProps(ret,className,id,name,isDisabled);if(this._validP(value))
ret.value=value;parent.appendChild(ret);return ret;},span:function(parent,className,innerHtml)
{return this._newInner("span",parent,className,innerHtml);},div:function(parent,className,innerHtml)
{return this._newInner("div",parent,className,innerHtml);},p:function(parent,className,innerHtml)
{return this._newInner("p",parent,className,innerHtml);},ul:function(parent,className,innerHtml)
{return this._newInner("ul",parent,className,innerHtml);},li:function(parent,className,innerHtml)
{return this._newInner("li",parent,className,innerHtml);},br:function(parent,className)
{return this._newInner("br",parent,className);},h1:function(parent,className,val)
{return this._newInner("h1",parent,className,val);},h2:function(parent,className,val)
{return this._newInner("h2",parent,className,val);},h3:function(parent,className,val)
{return this._newInner("h3",parent,className,val);},h4:function(parent,className,val)
{return this._newInner("h4",parent,className,val);},h5:function(parent,className,val)
{return this._newInner("h5",parent,className,val);},h6:function(parent,className,val)
{return this._newInner("h6",parent,className,val);},label:function(parent,className,bindingElem,val)
{var ret=this._newInner("label",parent,className,val);if(this._validP(bindingElem))
{if(!bindingElem.id)
bindingElem.id=this.nextId();ret.htmlFor=bindingElem.id;}
return ret;},text:function(parent,value)
{var ret=document.createTextNode(value);parent.appendChild(ret);return ret;},table:function(parent,className)
{return this._newInner("table",parent,className);},tHead:function(parent,className)
{return this._newInner("thead",parent,className);},th:function(parent,className,val)
{return this._newInner("th",parent,className,val);},tBody:function(parent,className)
{return this._newInner("tbody",parent,className);},tr:function(parent,className)
{return this._newInner("tr",parent,className);},td:function(parent,className,val)
{return this._newInner("td",parent,className,val);},nextId:function()
{if(DataType.isUndefined(Build._id))
Build._id=(new Date()).getTime();return"A"+Build._id++;},_newInner:function(eName,parent,className,innerHtml)
{var ret=document.createElement(eName);parent.appendChild(ret);if(this._validP(className))
ret.className=className;if(this._validP(innerHtml))
ret.innerHTML=innerHtml;return ret;},_newInput:function(type,parent,className,value,id,name,isDisabled)
{var ret=document.createElement("input");ret.type=type;if(this._validP(value))
ret.value=value;this._setFormProps(ret,className,id,name,isDisabled);parent.appendChild(ret);return ret;},_setFormProps:function(formElem,className,id,name,isDisabled)
{if(this._validP(className))
formElem.className=className;if(this._validP(id))
formElem.id=id;if(this._validP(name))
formElem.name=name;if(this._validP(isDisabled))
formElem.disabled=isDisabled;},_validP:function(val)
{return DataType.isParam(val);}};var DataType={isUndefined:function(ref)
{return"undefined"==typeof ref;},isObject:function(ref)
{return"object"==typeof ref;},isFunction:function(ref)
{return"function"==typeof ref||(BrowserDetection.isIE&&"object"==typeof ref);},isArray:function(ref)
{return"array"==typeof ref||("object"==typeof ref&&this.isNumber(ref.length));},isNumber:function(ref)
{return"number"==typeof ref;},isString:function(ref)
{return"string"==typeof ref;},isBoolean:function(ref)
{return"boolean"==typeof ref;},isNull:function(ref)
{return null==ref;},isEmpty:function(ref)
{return""==ref;},isTag:function(ref,tagName)
{return(this.isObject(ref)&&!this.isNull(ref)&&this.isString(this.tagName)&&this.tagName.toLowerCase()==tagName);},isParam:function(val)
{return!this.isUndefined(val)&&!this.isNull(val);},_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode64:function(input)
{var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;do
{chr1=input.charCodeAt(i++);chr2=input.charCodeAt(i++);chr3=input.charCodeAt(i++);enc1=chr1>>2;enc2=((chr1&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2))
enc3=enc4=64;else if(isNaN(chr3))
enc4=64;output=output+this._keyStr.charAt(enc1)+this._keyStr.charAt(enc2)+
this._keyStr.charAt(enc3)+this._keyStr.charAt(enc4);}while(i<input.length);return output;},decode64:function(input)
{var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");do
{enc1=this._keyStr.indexOf(input.charAt(i++));enc2=this._keyStr.indexOf(input.charAt(i++));enc3=this._keyStr.indexOf(input.charAt(i++));enc4=this._keyStr.indexOf(input.charAt(i++));chr1=(enc1<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64)
output=output+String.fromCharCode(chr2);if(enc4!=64)
output=output+String.fromCharCode(chr3);}while(i<input.length);return output;},isCatIdValid:function(id)
{var re=this._makeRegEx("^([a-f\\d]{32};(:[a-f\\d]{32};)?)(;([a-f\\d]{32};(:[a-f\\d]{32};)?))*$");return(id&&this.isString(id)&&re.test(id));},isQuantityValid:function(qty)
{return((this.isNumber(qty)&&!isNaN(qty))||(this.isString(qty)&&!isNaN(Number(qty))));},isOrIdValid:function(id)
{var re=this._makeRegEx("^[a-f\\d]{8};-[a-f\\d]{4};-[a-f\\d]{4};-[a-f\\d]{4};-[a-f\\d]{12};$");return(id&&"string"==typeof id&&re.test(id));},formatDollarString:function(number,places)
{return"$"+number.toFixed(places);},formatPercentageString:function(number,places)
{return number.toFixed(places)+"%";},_encodeRegEx:function(regExExpression)
{return regExExpression.replace(/\};/g,"}");},_makeRegEx:function(regExExpression)
{return new RegExp(this._encodeRegEx(regExExpression),"gi");}};function Zip()
{}
Zip.prototype={_WSIZE:32768,_lbits:9,_dbits:6,_slide:null,_wp:undefined,_fixed_tl:null,_fixed_td:undefined,_fixed_bl:undefined,_bit_buf:undefined,_bit_len:undefined,_method:undefined,_eof:undefined,_copy_leng:undefined,_copy_dist:undefined,_tl:undefined,_td:undefined,_bl:undefined,_bd:undefined,_inflate_data:undefined,_inflate_pos:undefined,_MASK_BITS:new Array(0x0000,0x0001,0x0003,0x0007,0x000f,0x001f,0x003f,0x007f,0x00ff,0x01ff,0x03ff,0x07ff,0x0fff,0x1fff,0x3fff,0x7fff,0xffff),_cplens:new Array(3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0),_cplext:new Array(0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,99,99),_cpdist:new Array(1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577),_cpdext:new Array(0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13),_border:new Array(16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15),_HuftBuild:function
(b,n,s,d,e,mm)
{this.BMAX=16;this.N_MAX=288;this.status=0;this.root=null;this.m=0;{var a;var c=new Array(this.BMAX+1);var el;var f;var g;var h;var i;var j;var k;var lx=new Array(this.BMAX+1);var p;var pidx;var q;var r=new this._HuftNode();var u=new Array(this.BMAX);var v=new Array(this.N_MAX);var w;var x=new Array(this.BMAX+1);var xp;var y;var z;var o;var tail;tail=this.root=null;for(i=0;i<c.length;i++)
c[i]=0;for(i=0;i<lx.length;i++)
lx[i]=0;for(i=0;i<u.length;i++)
u[i]=null;for(i=0;i<v.length;i++)
v[i]=0;for(i=0;i<x.length;i++)
x[i]=0;el=n>256?b[256]:this.BMAX;p=b;pidx=0;i=n;do
{c[p[pidx]]++;pidx++;}while(--i>0);if(c[0]==n)
{this.root=null;this.m=0;this.status=0;return;}
for(j=1;j<=this.BMAX;j++)
if(c[j]!=0)
break;k=j;if(mm<j)
mm=j;for(i=this.BMAX;i!=0;i--)
if(c[i]!=0)
break;g=i;if(mm>i)
mm=i;for(y=1<<j;j<i;j++,y<<=1)
if((y-=c[j])<0)
{this.status=2;this.m=mm;return;}
if((y-=c[i])<0)
{this.status=2;this.m=mm;return;}
c[i]+=y;x[1]=j=0;p=c;pidx=1;xp=2;while(--i>0)
x[xp++]=(j+=p[pidx++]);p=b;pidx=0;i=0;do
{if((j=p[pidx++])!=0)
v[x[j]++]=i;}while(++i<n);n=x[g];x[0]=i=0;p=v;pidx=0;h=-1;w=lx[0]=0;q=null;z=0;for(;k<=g;k++)
{a=c[k];while(a-->0)
{while(k>w+lx[1+h])
{w+=lx[1+h];h++;z=(z=g-w)>mm?mm:z;if((f=1<<(j=k-w))>a+1)
{f-=a+1;xp=k;while(++j<z)
{if((f<<=1)<=c[++xp])
break;f-=c[xp];}}
if(w+j>el&&w<el)
j=el-w;z=1<<j;lx[1+h]=j;q=new Array(z);for(o=0;o<z;o++)
{q[o]=new this._HuftNode();}
if(tail==null)
tail=this.root=new this._HuftList();else
tail=tail.next=new this._HuftList();tail.next=null;tail.list=q;u[h]=q;if(h>0)
{x[h]=i;r.b=lx[h];r.e=16+j;r.t=q;j=(i&((1<<w)-1))>>(w-lx[h]);u[h-1][j].e=r.e;u[h-1][j].b=r.b;u[h-1][j].n=r.n;u[h-1][j].t=r.t;}}
r.b=k-w;if(pidx>=n)
r.e=99;else if(p[pidx]<s)
{r.e=(p[pidx]<256?16:15);r.n=p[pidx++];}
else
{r.e=e[p[pidx]-s];r.n=d[p[pidx++]-s];}
f=1<<(k-w);for(j=i>>w;j<z;j+=f)
{q[j].e=r.e;q[j].b=r.b;q[j].n=r.n;q[j].t=r.t;}
for(j=1<<(k-1);(i&j)!=0;j>>=1)
i^=j;i^=j;while((i&((1<<w)-1))!=x[h])
{w-=lx[h];h--;}}}
this.m=lx[1];this.status=((y!=0&&g!=1)?1:0);}},_GET_BYTE:function()
{if(this._inflate_data.length==this._inflate_pos)
return-1;return this._inflate_data.charCodeAt(this._inflate_pos++)&0xff;},_NEEDBITS:function(n)
{while(this._bit_len<n)
{this._bit_buf|=this._GET_BYTE()<<this._bit_len;this._bit_len+=8;}},_GETBITS:function(n)
{return this._bit_buf&this._MASK_BITS[n];},_DUMPBITS:function(n)
{this._bit_buf>>=n;this._bit_len-=n;},_inflate_codes:function(buff,off,size)
{var e;var t;var n;if(size==0)
return 0;n=0;for(;;)
{this._NEEDBITS(this._bl);t=this._tl.list[this._GETBITS(this._bl)];e=t.e;while(e>16)
{if(e==99)
return-1;this._DUMPBITS(t.b);e-=16;this._NEEDBITS(e);t=t.t[this._GETBITS(e)];e=t.e;}
this._DUMPBITS(t.b);if(e==16)
{this._wp&=this._WSIZE-1;buff[off+n++]=this._slide[this._wp++]=t.n;if(n==size)
return size;continue;}
if(e==15)
break;this._NEEDBITS(e);this._copy_leng=t.n+this._GETBITS(e);this._DUMPBITS(e);this._NEEDBITS(this._bd);t=this._td.list[this._GETBITS(this._bd)];e=t.e;while(e>16)
{if(e==99)
return-1;this._DUMPBITS(t.b);e-=16;this._NEEDBITS(e);t=t.t[this._GETBITS(e)];e=t.e;}
this._DUMPBITS(t.b);this._NEEDBITS(e);this._copy_dist=this._wp-t.n-this._GETBITS(e);this._DUMPBITS(e);while(this._copy_leng>0&&n<size)
{this._copy_leng--;this._copy_dist&=this._WSIZE-1;this._wp&=this._WSIZE-1;buff[off+n++]=this._slide[this._wp++]=this._slide[this._copy_dist++];}
if(n==size)
return size;}
this._method=-1;return n;},_inflate_stored:function(buff,off,size)
{var n;n=this._bit_len&7;this._DUMPBITS(n);this._NEEDBITS(16);n=this._GETBITS(16);this._DUMPBITS(16);this._NEEDBITS(16);if(n!=((~this._bit_buf)&0xffff))
return-1;this._DUMPBITS(16);this._copy_leng=n;n=0;while(this._copy_leng>0&&n<size)
{this._copy_leng--;this._wp&=this._WSIZE-1;this._NEEDBITS(8);buff[off+n++]=this._slide[this._wp++]=this._GETBITS(8);this._DUMPBITS(8);}
if(this._copy_leng==0)
this._method=-1;return n;},_inflate_fixed:function(buff,off,size)
{if(this._fixed_tl==null)
{var i;var l=new Array(288);var h;for(i=0;i<144;i++)
l[i]=8;for(;i<256;i++)
l[i]=9;for(;i<280;i++)
l[i]=7;for(;i<288;i++)
l[i]=8;this._fixed_bl=7;h=new this._HuftBuild(l,288,257,this._cplens,this._cplext,this._fixed_bl);if(h.status!=0)
{alert("HufBuild error: "+h.status);return-1;}
this._fixed_tl=h.root;this._fixed_bl=h.m;for(i=0;i<30;i++)
l[i]=5;zip_fixed_bd=5;h=new this._HuftBuild(l,30,0,this._cpdist,this._cpdext,zip_fixed_bd);if(h.status>1)
{this._fixed_tl=null;alert("HufBuild error: "+h.status);return-1;}
this._fixed_td=h.root;zip_fixed_bd=h.m;}
this._tl=this._fixed_tl;this._td=this._fixed_td;this._bl=this._fixed_bl;this._bd=zip_fixed_bd;return this._inflate_codes(buff,off,size);},_inflate_dynamic:function(buff,off,size)
{var i;var j;var l;var n;var t;var nb;var nl;var nd;var ll=new Array(286+30);var h;for(i=0;i<ll.length;i++)
ll[i]=0;this._NEEDBITS(5);nl=257+this._GETBITS(5);this._DUMPBITS(5);this._NEEDBITS(5);nd=1+this._GETBITS(5);this._DUMPBITS(5);this._NEEDBITS(4);nb=4+this._GETBITS(4);this._DUMPBITS(4);if(nl>286||nd>30)
return-1;for(j=0;j<nb;j++)
{this._NEEDBITS(3);ll[this._border[j]]=this._GETBITS(3);this._DUMPBITS(3);}
for(;j<19;j++)
ll[this._border[j]]=0;this._bl=7;h=new this._HuftBuild(ll,19,19,null,null,this._bl);if(h.status!=0)
return-1;this._tl=h.root;this._bl=h.m;n=nl+nd;i=l=0;while(i<n)
{this._NEEDBITS(this._bl);t=this._tl.list[this._GETBITS(this._bl)];j=t.b;this._DUMPBITS(j);j=t.n;if(j<16)
ll[i++]=l=j;else if(j==16)
{this._NEEDBITS(2);j=3+this._GETBITS(2);this._DUMPBITS(2);if(i+j>n)
return-1;while(j-->0)
ll[i++]=l;}
else if(j==17)
{this._NEEDBITS(3);j=3+this._GETBITS(3);this._DUMPBITS(3);if(i+j>n)
return-1;while(j-->0)
ll[i++]=0;l=0;}
else
{this._NEEDBITS(7);j=11+this._GETBITS(7);this._DUMPBITS(7);if(i+j>n)
return-1;while(j-->0)
ll[i++]=0;l=0;}}
this._bl=this._lbits;h=new this._HuftBuild(ll,nl,257,this._cplens,this._cplext,this._bl);if(this._bl==0)
h.status=1;if(h.status!=0)
{if(h.status==1);return-1;}
this._tl=h.root;this._bl=h.m;for(i=0;i<nd;i++)
ll[i]=ll[i+nl];this._bd=this._dbits;h=new this._HuftBuild(ll,nd,0,this._cpdist,this._cpdext,this._bd);this._td=h.root;this._bd=h.m;if(this._bd==0&&nl>257)
{return-1;}
if(h.status==1)
{;}
if(h.status!=0)
return-1;return this._inflate_codes(buff,off,size);},_inflate_start:function()
{var i;if(this._slide==null)
this._slide=new Array(2*this._WSIZE);this._wp=0;this._bit_buf=0;this._bit_len=0;this._method=-1;this._eof=false;this._copy_leng=this._copy_dist=0;this._tl=null;},_inflate_internal:function(buff,off,size)
{var n,i;n=0;while(n<size)
{if(this._eof&&this._method==-1)
return n;if(this._copy_leng>0)
{if(this._method!=zip_STORED_BLOCK)
{while(this._copy_leng>0&&n<size)
{this._copy_leng--;this._copy_dist&=this._WSIZE-1;this._wp&=this._WSIZE-1;buff[off+n++]=this._slide[this._wp++]=this._slide[this._copy_dist++];}}
else
{while(this._copy_leng>0&&n<size)
{this._copy_leng--;this._wp&=this._WSIZE-1;this._NEEDBITS(8);buff[off+n++]=this._slide[this._wp++]=this._GETBITS(8);this._DUMPBITS(8);}
if(this._copy_leng==0)
this._method=-1;}
if(n==size)
return n;}
if(this._method==-1)
{if(this._eof)
break;this._NEEDBITS(1);if(this._GETBITS(1)!=0)
this._eof=true;this._DUMPBITS(1);this._NEEDBITS(2);this._method=this._GETBITS(2);this._DUMPBITS(2);this._tl=null;this._copy_leng=0;}
switch(this._method)
{case 0:i=this._inflate_stored(buff,off+n,size-n);break;case 1:if(this._tl!=null)
i=this._inflate_codes(buff,off+n,size-n);else
i=this._inflate_fixed(buff,off+n,size-n);break;case 2:if(this._tl!=null)
i=this._inflate_codes(buff,off+n,size-n);else
i=this._inflate_dynamic(buff,off+n,size-n);break;default:i=-1;break;}
if(i==-1)
{if(this._eof)
return 0;return-1;}
n+=i;}
return n;},inflate:function(str)
{var out,buff;var i,j;this._inflate_start();this._inflate_data=str;this._inflate_pos=0;buff=new Array(1024);out="";while((i=this._inflate_internal(buff,0,buff.length))>0)
{for(j=0;j<i;j++)
out+=String.fromCharCode(buff[j]);}
this._inflate_data=null;return out;}};Zip.prototype._HuftBuild.prototype={_HuftList:function()
{this.next=null;this.list=null;},_HuftNode:function()
{this.e=0;this.b=0;this.n=0;this.t=null;}};
function AjaxPanel(elemDiv,replacementExpression,replacementValue)
{this._div=elemDiv;this._replacementExpression=replacementExpression;this._replacementValue=replacementValue;}
Object.extend(AjaxPanel,{newO:function(idOrElem,regEx,replacementValue)
{var elem=PopupCommon._domFromIdOrElem(idOrElem);if(elem)
elem.ap=new AjaxPanel(elem,regEx,replacementValue);},load:function(This,ids)
{for(var idxId=ids.length-1;idxId>=0;idxId--)
{var child=document.getElementById(ids[idxId]);if(child&&child.ap)
child.ap.load();}}});AjaxPanel.prototype={load:function()
{if(this._loaded)
return;this._loaded=true;var div=this._div;div.style.display='block';div.innerHTML='Loading ...';this._callbackKey=Callback.addValue(this);Http.get(div.attributes['url'].value,new Function("result","Callback.getValue("+this._callbackKey+").finishLoad(result);"));},finishLoad:function(result)
{if(this._replacementExpression)
{result=result.replace(this._replacementExpression,this._replacementValue);}
var reScripts=/<script[^>]*>\r\n\/\/<!\[CDATA\[\r\n((\r\n|.)*)\/\/\]\]>(?:\r\n)*<\/script>/im;var scripts=result.match(reScripts);if(scripts)
result=result.replace(reScripts,"");this._div.innerHTML=result;if(scripts)
for(var idxScripts=1;idxScripts<scripts.length;idxScripts++)
eval(scripts[idxScripts]);Callback.removeValue(this._callbackKey);UI.onevent(this._div,'onloadfinished');}};function PopupCommon()
{}
Object.extend(PopupCommon,{_domFromIdOrElem:function(idOrElem)
{if(null==idOrElem)
return null;var elem=null;if("object"==typeof idOrElem)
elem=idOrElem;else if("string"==typeof idOrElem)
elem=document.getElementById(idOrElem);return elem;},_hideSelects:function(divExclude)
{var allSelects=document.getElementsByTagName('select');var selectsToHide=[];for(var idxAll=allSelects.length-1;idxAll>=0;idxAll--)
{var select=allSelects[idxAll];if(!this._inParentChain(select,divExclude))
selectsToHide.push(select);}
for(var idxToHide=selectsToHide.length-1;idxToHide>=0;idxToHide--)
FormUtil.hideSelect(selectsToHide[idxToHide]);return selectsToHide;},_showSelects:function(selects)
{for(var idxSelects=selects.length-1;idxSelects>=0;idxSelects--)
FormUtil.showSelect(selects[idxSelects]);},_inParentChain:function(child,parent)
{var pn=child.parentNode;do
{if(pn==parent)
return true;}while(null!=(pn=pn.parentNode));return false;}});function PopupPanel(elemDiv,tOutDelay,doNotIncludeMargin)
{this._div=elemDiv;if("number"!=typeof tOutDelay)
tOutDelay=300;this._tOutDelay=tOutDelay;this._includeMargin=(!doNotIncludeMargin);this._isAnimationShowing=false;this._isShowing=false;this._timeoutId=-1;this._timeoutCbId=-1;this._hiddenSelects=null;this._shadow=Build.div(elemDiv.parentNode,"PopupShadow");}
Object.extend(PopupPanel,{newO:function(idOrElem,delay,doNotIncludeMargin)
{var elem=PopupCommon._domFromIdOrElem(idOrElem);if(elem)
return(elem.popupPanel=new PopupPanel(elem,delay,doNotIncludeMargin));},show:function(idOrElem,srcElem)
{var elem=PopupCommon._domFromIdOrElem(idOrElem);if(elem&&elem.popupPanel)
elem.popupPanel.show(srcElem);},hide:function(idOrElem,srcElem)
{var elem=PopupCommon._domFromIdOrElem(idOrElem);if(elem&&elem.popupPanel)
elem.popupPanel.hide(srcElem);},_showTransform:function(x)
{return Math.pow(x,2);},_hideTransform:function(x)
{return Math.pow(x-1,2);}});PopupPanel.prototype={show:function(elem)
{this._transitionWhileShown(elem);if(this._div!=elem||null==this._startElem)
this._startElem=elem;UI.onevent(this._div,'onshow');this._delayCall(true);},hide:function(elem)
{this._undoTransitions(elem);if(this._div!=elem||null==this._startElem)
this._startElem=elem;UI.onevent(this._div,'onhide');this._delayCall(false);},resize:function(key)
{if("number"==typeof key)
Callback.removeValue(key);if(!this._animation)
{var divs=[this._div,this._startElem];var rectangles=[];for(var idx=0;idx<divs.length;idx++)
{var div=divs[idx];var pt=UI.getAbsolutePos(div);rectangles.push(new Rectangle(pt,new Point(pt.x+div.offsetWidth,pt.y+div.offsetHeight)));}
var fisRet=UI.fitInScreen(rectangles[0],rectangles[1]);var leftFinal=(fisRet.rect.pt1.x-rectangles[0].pt1.xAdjust);var topFinal=(fisRet.rect.pt1.y-rectangles[0].pt1.yAdjust);divs[0].style.left=leftFinal+'px';divs[0].style.top=topFinal+'px';var shadowStyle=this._shadow.style;shadowStyle.left=leftFinal+5+'px';shadowStyle.top=topFinal+5+'px';shadowStyle.width=divs[0].clientWidth+'px';shadowStyle.height=divs[0].clientHeight+'px';}},_delayCall:function(show)
{if(0==this._tOutDelay)
{this._postDelay(show);return;}
if(-1==this._timeoutCbId)
this._timeoutCbId=Callback.addValue(this);if(-1!=this._timeoutId)
window.clearTimeout(this._timeoutId);this._timeoutId=window.setTimeout("Callback.getValue("+this._timeoutCbId+")._postDelay("+show+")",this._tOutDelay);},_postDelay:function(show)
{if(-1!=this._timeoutCbId)
{Callback.removeValue(this._timeoutCbId);this._timeoutCbId=-1;}
this._timeoutId=-1;var showSameAsShowing=!(show^this._isShowing);var showSameAsAnimating=!(show^this._isAnimationShowing);var isAnimating=null!=this._animation;if((isAnimating&&showSameAsAnimating)||(!isAnimating&&showSameAsShowing))
return;if(!show)
this._shadow.style.display='none';if(isAnimating)
{if(show&&!this._isAnimationShowing)
this._animation.reverse(PopupPanel._showTransform,"_finishShow");else if(!show&&this._isAnimationShowing)
this._animation.reverse(PopupPanel._hideTransform,"_finishHide");}
else
{if(show)
this._animation=new AnimateObject(this,this._startElem,this._div,30,7,PopupPanel._showTransform,"_finishShow",this._includeMargin);else
this._animation=new AnimateObject(this,this._startElem,this._div,30,7,PopupPanel._hideTransform,"_finishHide",this._includeMargin);}
this._isAnimationShowing=show;},_transitionWhileShown:function(elem)
{if(elem&&"IMG"==elem.nodeName.toUpperCase())
{elem.alt_orig=elem.alt;elem.alt="";}
if(BrowserDetection.isMaxIE6)
this._hiddenSelects=PopupCommon._hideSelects(this._div);},_undoTransitions:function(elem)
{if(elem&&"IMG"==elem.nodeName.toUpperCase())
{elem.alt=elem.alt_orig;elem.alt_orig="";}
if(BrowserDetection.isMaxIE6)
PopupCommon._showSelects(this._hiddenSelects);},_finishShow:function()
{this._animation=null;this._isShowing=true;var key=Callback.addValue(this);setTimeout("Callback.getValue("+key+").resize("+key+");",10);this._shadow.style.display='block';},_finishHide:function()
{this._animation=null;this._isShowing=false;this._div.style.display='none';}};function AnimateObject(obj,startElem,animateElem,periodLength,periods,mTransform,onFinishMethod,includeMargin)
{this._currentPeriod=0;this._obj=obj;this._startElem=startElem;this._animateElem=animateElem;this._periods=periods;this._onFinishMethod=onFinishMethod;this._mTransform=mTransform;this._includeMargin=includeMargin;this._init(periodLength);}
AnimateObject.prototype={resize:function()
{var pt=UI.getAbsolutePos(this._startElem);var x,y;x=pt.x;y=pt.y+this._startElem.offsetHeight+(this._includeMargin?2:0);this._ptOrig1=new Point(x-pt.xAdjust,y-pt.yAdjust);var ptNew1=new Point(x,y);x+=Math.max(10,this._animateElem.offsetWidth);y+=Math.max(10,this._animateElem.offsetHeight);var ptNew2=new Point(x,y);var fisRet=UI.fitInScreen(new Rectangle(ptNew1,ptNew2),new Rectangle(pt,new Point(pt.x+this._startElem.offsetWidth,pt.y+this._startElem.offsetHeight)));this._ptNew1=new Point(fisRet.rect.pt1.x-pt.xAdjust,fisRet.rect.pt1.y-pt.yAdjust);this._ptNew2=new Point(fisRet.rect.pt2.x-pt.xAdjust,fisRet.rect.pt2.y-pt.yAdjust);if(fisRet.moveOrigin)
this._ptOrig1=new Point(pt.adjustedX-1,pt.adjustedY-10);},animate:function()
{var elem=this._animateElem;var style=elem.style;var ptNew1=this._ptNew1;var currentPeriod=this._currentPeriod++;var periods=this._periods;var m=this._mTransform(currentPeriod/periods);if(currentPeriod>=periods)
{clearInterval(this._intervalId);this._intervalId=0;Callback.removeValue(this._callbackId);style.left=ptNew1.x+'px';style.top=ptNew1.y+'px';style.width=this._origWidth;style.height=this._origHeight;style.overflow=this._origOverflow;this._obj[this._onFinishMethod]();}
else
{var pt1=UI.getDisplacement(this._ptOrig1,ptNew1,m);var pt2=UI.getDisplacement(this._ptOrig1,this._ptNew2,m);style.left=pt1.x+'px';style.top=pt1.y+'px';style.width=pt2.x-pt1.x+'px';style.height=pt2.y-pt1.y+'px';}},reverse:function(newMTransform,newOnFinishMethod)
{this._mTransform=newMTransform;this._onFinishMethod=newOnFinishMethod;this._currentPeriod=this._periods-this._currentPeriod;},_init:function(periodLength)
{var animStyle=this._animateElem.style;this._origWidth=animStyle.width;this._origHeight=animStyle.height;this._origOverflow=XBrowser.getStyle(this._animateElem,"overflow");var origZIndex=XBrowser.getStyle(this._animateElem,"zIndex");animStyle.zIndex=-1;animStyle.display='block';animStyle.overflow='hidden';this.resize();this.animate();animStyle.zIndex=origZIndex;this._callbackId=Callback.addValue(this);this._intervalId=setInterval("Callback.getValue("+this._callbackId.toString()+").animate()",periodLength);}};function ModalPopupPanel(elemDiv,shouldFloat)
{this._div=elemDiv;this._shouldFloat=shouldFloat;var offset=parseInt(XBrowser.getStyle(elemDiv,"top"));if(isNaN(offset)||0>=offset)
offset=20;this._floatOffset=offset;this._alphaBlend=Build.div(elemDiv.parentNode,"modalPopupAlphaBlendBackground");}
Object.extend(ModalPopupPanel,{newO:function(idOrElem,shouldFloat,showOnStartup)
{var elem=PopupCommon._domFromIdOrElem(idOrElem);if(elem)
{elem.modalPopupPanel=new ModalPopupPanel(elem,shouldFloat);if(showOnStartup)
Event.addDomEventListener(window,'load',elem.modalPopupPanel.show,elem.modalPopupPanel);return elem.modalPopupPanel;}},show:function(idOrElem)
{var elem=PopupCommon._domFromIdOrElem(idOrElem);if(elem&&elem.modalPopupPanel)
elem.modalPopupPanel.show();},hide:function(idOrElem)
{var elem=PopupCommon._domFromIdOrElem(idOrElem);if(elem&&elem.modalPopupPanel)
elem.modalPopupPanel.hide();}});ModalPopupPanel.prototype={show:function()
{var de=UI.getDocumentElement();var div=this._div;var dStyle=div.style;var vpHeight=UI.getViewportHeight(de),vpWidth=UI.getViewportWidth(de);dStyle.display='block';var divPos=UI.getAbsolutePos(div);var vpCenter=(vpWidth-div.offsetWidth)/2;dStyle.left=(vpCenter+UI.getViewportXOffset(de)-divPos.xAdjust)+'px';dStyle.top=(UI.getViewportYOffset(de)+this._floatOffset-divPos.yAdjust)+'px';if((this._floatOffset+div.offsetHeight+20)>vpHeight)
{dStyle.height=(vpHeight-50-this._floatOffset)+'px';if(BrowserDetection.isIE&&!BrowserDetection.isMinIE7)
dStyle.overflow="scroll";else
dStyle.overflowX="scroll";}
var aStyle=this._alphaBlend.style;aStyle.display='block';aStyle.width=Math.max(de.scrollWidth,vpWidth)+'px';aStyle.height=Math.max(de.scrollHeight,vpHeight)+'px';aStyle.left=(divPos.xAdjust*-1)+'px';aStyle.top=(divPos.yAdjust*-1)+'px';UI.onevent(div,'onshow');if(this._shouldFloat)
{Event.addDomEventListener(window,'scroll',this._doScroll,this);}},hide:function()
{var div=this._div;div.style.display='none';this._alphaBlend.style.display='none';if(this._shouldFloat)
Event.removeDomEventListener(window,'scroll',this._doScroll,this);UI.onevent(div,'onhide');},_doScroll:function(evt)
{var de=UI.getDocumentElement();this._div.style.top=(UI.getViewportYOffset(de)+this._floatOffset-UI.getAbsolutePos(this._div).yAdjust)+'px';}};function ErrorPanel(parent,className,title,closeDelegate,isChecked)
{this._div=Build.div(parent,(className+" ErrorModalPopup").trim());this._closeFn=closeDelegate;this._init(title,isChecked);}
Object.extend(ErrorPanel,{_queue:[],_show:function(ep)
{this._queue.push(ep);if(1==this._queue.length)
ModalPopupPanel.show(ep._div);},_close:function()
{var currEp=this._queue.shift();ModalPopupPanel.hide(currEp._div);if(0<this._queue.length)
ModalPopupPanel.show(this._queue[0]._div);}});ErrorPanel.prototype={show:function(){ErrorPanel._show(this);},set_Content:function(val)
{if(DataType.isString(val))
this._content.innerHTML=val.replace(/\n/g,"<br />");},get_Content:function()
{return this._content.innerHTML;},setNoShowContent:function(val)
{var labels=this._div.getElementsByTagName("label");if(0<labels.length)
labels[0].innerHTML=val;},_init:function(title,isChecked)
{ModalPopupPanel.newO(this._div,true);Build.div(this._div,"divErrorPanelTitle",title);var body=Build.div(this._div,"divErrorPanelBody");this._content=Build.div(body,"divErrorPanelContent");var footer=Build.div(body,"divErrorPanelFooter");if(DataType.isObject(this._closeFn))
{var noShow=Build.div(footer,"divErrorPanelFooterNoShow");this._chk=Build.checkBox(noShow,"inputErrorPanelFooterNoShow",null,Build.nextId(),null,isChecked);Build.label(noShow,"labelErrorPanelFooterNoShow",this._chk," Do not show this again");}
var buttonLine=Build.div(footer,"divErrorPanelFooterButton");var button=Build.button(buttonLine,"inputErrorPanelFooterButton","Close");Event.addDomEventListener(button,"click",this._close_click,this);},_close_click:function(evt)
{evt.preventDefault();if(this._closeFn)
this._closeFn.call(this._chk.checked);ErrorPanel._close();}};
function newPopupWindow(url,height,width,name)
{if(!DataType.isParam(height))
height=400;if(!DataType.isParam(width))
width=780;var options=new StringBuilder('status=0,scrollbars=1,resizable=1,width=')
options.append(width);options.append(',height=').append(height);window.open(url,name,options.toString());return false;}
function extLink(url)
{window.open(url);return false;}
function pagePrint(evt)
{if(evt)
evt.preventDefault();if(window.print)
window.print();else
alert("We're sorry but your browser doesn't support dynamic printing. Please find and use the browser's print button to print this page.");}
function CheckBoxValidatorEvaluateIsValid(val)
{var control=document.getElementById(val.controltovalidate);var mustBeChecked=Boolean(val.mustBeChecked);return control.checked==mustBeChecked;}
function Banner(popupId,iframeId,mapUrl)
{this._popup=document.getElementById(popupId);this._ifrm=document.getElementById(iframeId);this._mapUrl=mapUrl;}
Banner.prototype={showMap:function(src,evt,rid)
{var url=this._mapUrl+"Re="+rid;if(BrowserDetection.isIE&&"https:"==window.location.protocol)
{var sb=new StringBuilder("http://");sb.append(window.location.host);sb.append(url);newPopupWindow(sb.toString(),479,475);}
else
{if(!this._isInit)
{this._ifrm.src=url;this._isInit=true;}
ModalPopupPanel.show(this._popup,src);}
if(evt)
evt.preventDefault();}};function Master(modalPopupId,ifrmId)
{this._popupElem=document.getElementById(modalPopupId);this._ifrm=document.getElementById(ifrmId);}
Master.prototype={show:function(elem)
{this._ifrm.src=elem.href;ModalPopupPanel.show(this._popupElem);return false;},addBookmark:function(url,title)
{if("string"!=url||!url||""==url)
url=window.location.href;if("string"!=title||!title||""==title)
title=document.getElementsByTagName('title')[0].innerHTML
if(document.all)
window.external.AddFavorite(url,title);else if(window.sidebar)
window.sidebar.addPanel(title,url,'');else alert('We were unable to automatically create a bookmark in your browser. Please press Ctrl + D to bookmark this page.');},copyToClipboard:function(elem)
{if(!confirm('The link is about to be copied to your clipboard; after that you may paste it in your site. If you see a security dialog after this please say allow or yes.'))
return;window.clipboardData.setData('Text',elem.value);}};function RestFavorites(favoriteHelperId,firstTimeId,notLoggedInId,useLarge)
{this._divFavoriteHelper=document.getElementById(favoriteHelperId);this._divFirstTime=document.getElementById(firstTimeId);this._divNotLoggedIn=document.getElementById(notLoggedInId);this._useLarge=useLarge;this._init();}
RestFavorites.prototype={_AddBtnSrc:"/Images/Standard/small-fav.gif",_AddBtnSrcLg:"/Images/Standard/big-thumbsup.gif",_AddBtnAlt:"Thumbs up icon for Favorite Restaurant. Click to add this restaurant as one of your favorite restaurants.",_RemoveBtnSrc:"/Images/Standard/small-unfav.gif",_RemoveBtnSrcLg:"/Images/Standard/big-thumbsdown.gif",_RemoveBtnAlt:"Thumbs down icon for Favorite Restaurant. Click to remove this restaurant from your favorite restaurants.",checkFirstTimeDismissed:function(chk)
{if(chk&&chk.checked&&chk.checked.toString()!=chk.originalValue)
{Handlers.FavoriteRestaurants.DismissFavoriteRestaurantHelper(chk.checked);}},_init:function()
{if(!this._getFavorites())
return;var elements=XBrowser.getElementsByClassName(document,"FavoriteRestaurant","div");if(!elements||0==elements.length)
return;for(var idxElements=elements.length-1;idxElements>=0;idxElements--)
{var div=elements[idxElements];var restId=div.innerHTML.trim();div.restaurantId=restId;div.innerHTML="";var src,alt;if(div.isFavorite=this._isFavorite(restId))
{src=this._useLarge?this._RemoveBtnSrcLg:this._RemoveBtnSrc;alt=this._RemoveBtnAlt;}
else
{src=this._useLarge?this._AddBtnSrcLg:this._AddBtnSrc;alt=this._AddBtnAlt;}
var button=Build.imageButton(div,null,src,alt);button.setAttribute("isModal","true");Event.addDomEventListener(button,"mouseover",this._showHelper,this);Event.addDomEventListener(button,"mouseout",this._hideHelper,this);Event.addDomEventListener(button,"click",this._toggle,this);div.style.display='block';}},_isFavorite:function(restId)
{if(!this._favs||0==this._favs.length)
return false;if(-1==this._favs.indexOf(restId))
return false;return true;},_isFavoriteSearch:function()
{if(DataType.isUndefined(this._isFavSrch))
{var qsMap=new QueryStringMap();this._isFavSrch=("1"==qsMap["F"]);}
return this._isFavSrch;},_getFavorites:function()
{if(DataType.isUndefined(this._favs))
{var ajaxRet=Handlers.FavoriteRestaurants.GetJsonFavoriteRestaurants();if(ajaxRet.error)
return false;else
this._favs=ajaxRet.value}
return true;},_add:function(restaurantId)
{var ajaxRet=Handlers.FavoriteRestaurants.AddFavoriteRestaurant(restaurantId);if(ajaxRet.error)
{return;}
else
{switch(ajaxRet.value)
{case-1:alert('We are sorry, an error has occurred while attempting to add your favorite. Please notify support@2goclub.com about this.');return;case-2:ModalPopupPanel.show(this._divNotLoggedIn);return;default:if(ajaxRet.value<0)
ModalPopupPanel.show(this._divFirstTime);break;}}
this._favs.push(restaurantId);},_remove:function(restaurantId)
{var ajaxRet=Handlers.FavoriteRestaurants.DeleteFavoriteRestaurant(restaurantId);this._favs.remove(restaurantId);},_toggle:function(evt)
{evt.preventDefault();var div,input;if(evt.currentTarget.tagName.toLowerCase()=="input")
{input=evt.currentTarget;div=input.parentNode;}
else
{div=evt.currentTarget;input=div.childNodes[0];}
if(div.isFavorite)
{this._remove(div.restaurantId);input.src=this._useLarge?this._AddBtnSrcLg:this._AddBtnSrc;input.alt=this._AddBtnAlt;if(this._isFavoriteSearch())
div.parentNode.parentNode.style.display='none';}
else
{this._add(div.restaurantId);input.src=this._useLarge?this._RemoveBtnSrcLg:this._RemoveBtnSrc;input.alt=this._RemoveBtnAlt;}
div.isFavorite=!div.isFavorite;},_showHelper:function(evt)
{PopupPanel.show(this._divFavoriteHelper,evt.currentTarget);},_hideHelper:function(evt)
{PopupPanel.hide(this._divFavoriteHelper,evt.currentTarget);}};var InputHelperPopup={toggleOpenClose:function(imgElem,id)
{if(imgElem.isOpen)
{PopupPanel.hide(id,imgElem);imgElem.isOpen=false;}
else
{PopupPanel.show(id,imgElem);imgElem.isOpen=true;}},toggleDetails:function(button)
{}};function OneTimeHelper(mpuId,sFnDismiss,closeId,origVal)
{this._mpu=document.getElementById(mpuId);this._sFnDismiss=sFnDismiss;this._origVal=origVal;this._init(closeId);}
OneTimeHelper.prototype={_init:function(cId)
{var btnClose=document.getElementById(cId);Event.addDomEventListener(btnClose,"click",this._close,this);},_close:function(evt)
{evt.preventDefault();var e=evt.target;if(!this._origVal)
{var shouldDismiss=false;var inputs=e.parentNode.getElementsByTagName("input");if(inputs&&0<inputs.length)
for(var idxI=inputs.length-1;idxI>=0;idxI--)
if("checkbox"==inputs[idxI].type&&inputs[idxI].checked)
shouldDismiss=true;if(shouldDismiss)
eval(this._sFnDismiss+"()");}
ModalPopupPanel.hide(this._mpu);}};function LoginSupport(popupId,ifrmId,baseHref,successUrl,emailId,panelId)
{this._popup=document.getElementById(popupId);this._ifrm=document.getElementById(ifrmId);this._baseHref=baseHref;this._successUrl=successUrl;this._email=document.getElementById(emailId);this._panel=document.getElementById(panelId);Callback.onload(new Delegate(this._init,this));}
LoginSupport.prototype={_init:function()
{this._cs=0;var qsMap=new QueryStringMap();if("1"==qsMap["snu"])
this.showNewUser();else if("1"==qsMap["sfp"])
this.showForgotPassword();},setDefaultButton:function(buttonId)
{if(buttonId)
{this._defaultButtonId=buttonId;this._panel.onkeypress=null;Event.addDomEventListener(this._panel,"keypress",this._handleDefaultButton,this);this._panel=null;}},_handleDefaultButton:function(evt)
{if(!WebForm_FireDefaultButton(evt,this._defaultButtonId))
evt.preventDefault();},_redirectIfNotSsl:function(qsAddition)
{if("https:"!=window.location.protocol.toLowerCase())
{var url=this._baseHref+"Support/Login.aspx?"+qsAddition;window.location.assign(url);}},showNewUser:function(evt)
{if(evt)
evt.preventDefault();this._redirectIfNotSsl("snu=1");if(1!=this._cs)
{var cbId=Callback.addValue(this);this._ifrm.src=this._baseHref+"Support/ForceLogout.aspx?"
+"Ruwf="+encodeURIComponent(this._baseHref+"Account/NewAccount.aspx?"
+"key="+cbId);this._cs=1;}
ModalPopupPanel.show(this._popup);},showForgotPassword:function(evt,email)
{if(evt)
evt.preventDefault();this._redirectIfNotSsl("sfp=1");if(this._email)
{if(email)
this._email.value=email;else if(this._email.value)
email=this._email.value;}
var cbId=Callback.addValue(this);this._ifrm.src=this._baseHref+"Support/ForgotPassword.aspx?"
+"key="+cbId
+(email?"&E="+email:"");this._cs=2;ModalPopupPanel.show(this._popup);},close:function(cbId,shouldRefresh)
{if(shouldRefresh)
{Callback.removeValue(cbId);this._ifrm.src='';this._cs=0;if(this._successUrl)
window.location.assign(this._successUrl);}
ModalPopupPanel.hide(this._popup);}};
