
var RuntimeVersion="0.100305.0";if(!document.head)document.head=document.getElementsByTagName("HEAD")[0];function registerNamespace(p_namespacePath){var rootObject=window;var namespaceParts=p_namespacePath.split('.');for(var i=0;i<namespaceParts.length;i++){var currentPart=namespaceParts[i];if(!rootObject[currentPart]){rootObject[currentPart]=new Object();}
rootObject=rootObject[currentPart];}}
registerNamespace("Web.Debug.Performance");if(!Web.Debug.enabled)
{Web.Debug.enabled=false;Web.Debug.trace=function(){};Web.Debug.ASSERT=function(){return(Web.Debug.ASSERT)};Web.Debug.Performance.start=function()
{this.end=function(){};return this;}}
String.prototype.lTrim=function(){return this.replace(/^\s*/,"");}
String.prototype.rTrim=function(){return this.replace(/\s*$/,"");}
String.prototype.trim=function(){return this.rTrim().lTrim();}
String.prototype.endsWith=function(sEnd){return(this.substr(this.length-sEnd.length)==sEnd);}
String.prototype.startsWith=function(sStart){return(this.substr(0,sStart.length)==sStart);}
String.prototype.format=function()
{var s=this;for(var i=0;i<arguments.length;i++)
{s=s.replace("{"+(i)+"}",arguments[i]);}
return(s);}
String.prototype.removeSpaces=function()
{return this.replace(/ /gi,'');}
String.prototype.removeExtraSpaces=function()
{return(this.replace(String.prototype.removeExtraSpaces.re," "));}
String.prototype.removeExtraSpaces.re=new RegExp("\\s+","g");String.prototype.removeSpaceDelimitedString=function(r)
{var s=" "+this.trim()+" ";return s.replace(" "+r,"").rTrim();}
String.prototype.encodeURI=function()
{var returnString;returnString=escape(this)
returnString=returnString.replace(/\+/g,"%2B");return returnString}
String.prototype.decodeURI=function(){return unescape(this)}
Web.StringBuilder=function(p_strInitial){var arrParts=new Array();this.append=function(p_strText)
{if(!((p_strText==null)||(typeof(p_strText)=='undefined')||(typeof(p_strText)=='string')&&(p_strText.length==0)))
{arrParts.push(p_strText);}}
this.appendLine=function(p_strText)
{this.append(p_strText);arrParts.push('\r\n');}
this.clear=function()
{arrParts.clear();}
this.isEmpty=function()
{return(arrParts.length==0);}
this.toString=function(p_strDelim)
{return arrParts.join(p_strDelim||"");}
this.append(p_strInitial);return this;}
registerNamespace("Web.Type");Web.Type.resolve=function(p_vType)
{try
{if(typeof(p_vType)=="string")
{p_vType=eval(p_vType);}
else if(typeof(p_vType)=="object")
{p_vType=p_vType.constructor;}
else if(typeof(p_vType)!="function")
{p_vType=null;}}
catch(ex)
{return(null);}
return(p_vType);}
Web.Type.compare=function(p_vTypeA,p_vTypeB)
{var fncTypeA=Web.Type.resolve(p_vTypeA);var fncTypeB=Web.Type.resolve(p_vTypeB);return(fncTypeA&&(fncTypeA==fncTypeB));}
Web.Type.IsString=function(p_var)
{return(typeof(p_var)=="string")}
Web.Type.isArray=function(p_obj)
{return p_obj instanceof Array;}
Web.Type.isBoolean=function(p_var)
{return(typeof(p_var)=="boolean")}
Object.getFromName=function(p_strPath)
{var obj;try
{eval("obj = "+p_strPath);}
catch(ex)
{return(undefined);}
return(obj);}
Function.prototype.registerBaseMethod=function(instance,methodName){if(!instance._baseMethods){instance._baseMethods={};}
var methodKey=this._typeName+'.'+methodName;instance._baseMethods[methodKey]=instance[methodName];}
Function.prototype.getBaseMethod=function(p_objInstance,p_strMethod,p_strClass){if(p_strClass)
{if(p_objInstance)
{if(p_objInstance._baseMethods)
{var strKey=p_strClass+"."+p_strMethod;return(p_objInstance._baseMethods[strKey]);}}
else
{var fncClass=Function.parse(p_strClass);return(fncClass.prototype[p_strMethod]);}}
return null;}
Function.prototype.inheritsFrom=function(p_fncType)
{if(this==p_fncType)
{return(true);}
else if(this.bases)
{for(var i=0;i<this.bases.length;i++)
{if(this.bases[i].inheritsFrom(p_fncType))
{return(true);}}}
return(false);}
Function.prototype.implementsInterface=function(interfaceType){var interfaces=this._interfaces;if(interfaces){if(interfaces.contains(interfaceType))
{return true;}}
else if(this.bases)
{for(var i=0;i<this.bases.length;i++)
{if(this.bases[i].implementsInterface(interfaceType))
{return true;}}}
return false;}
Function.prototype.applyClass=function(blnEvents)
{function generateClass(o)
{var str=(o._typeName&&o._typeName.replace(/\./g,"_"))||"";if(o.bases)
for(var i=0;i<o.bases.length;i++)
{str+=" "+generateClass(o.bases[i]);if(blnEvents)
o.Events=Web.Enum.extend(o.Events,o.bases[i].Events);}
return str;}
if(!this._className)
{this._className=generateClass(this);}
return this._className;}
Function.prototype.removeClass=function(p_strClass)
{if(this.constructor._className)
{if(!this.constructor._arrClasses)
this.constructor._arrClasses=this.constructor._className.split(" ");for(var intApplied=0;intApplied<this.constructor._arrClasses.length;intApplied++)
{p_strClass=p_strClass.removeSpaceDelimitedString(this.constructor._arrClasses[intApplied]);}
return p_strClass;}
else
return p_strClass;}
Function.parse=function(functionName){if(!Function._htClasses)
{Function._htClasses=new Object();}
var fncClass=Function._htClasses[functionName];if(!fncClass)
{fncClass=Function._htClasses[functionName]=Object.getFromName(functionName);}
return(fncClass);}
Function.prototype._copyProps=function(p_objFnc)
{for(var strName in p_objFnc.prototype)
{var vValue=p_objFnc.prototype[strName];if(!this.prototype[strName])
{this.prototype[strName]=vValue;}}}
Function.prototype._setBases=function(p_objRoot)
{var astrPending=this.prototype._astrPendingInherits;if(astrPending)
{for(var i=0;i<astrPending.length;i++)
{var fncType=Function.parse(astrPending[i]);if(!fncType._parentBase)
{fncType._parentBase=new Array();}
fncType._parentBase.push(p_objRoot._typeName);p_objRoot._childBase.push(fncType._typeName);if(fncType&&(this!=fncType)&&(!this.inheritsFrom(fncType))&&(!fncType.inheritsFrom(this))&&!fncType._sealed)
{if(!fncType._typeName)
fncType._typeName=typeof(astrPending[i])=="function"?astrPending[i]._typeName:astrPending[i];if(!this.bases)
{this.bases=new Array();}
this.bases.push(fncType);fncType._setBases(p_objRoot);this._copyProps(fncType);}}}
this.prototype._astrPendingInherits=null;}
Function.prototype._callBaseConstructors=function(p_objInstance,p_objArgs)
{if(this.bases)
{for(var i=0;i<this.bases.length;i++)
{if(p_objArgs)
{this.bases[i].apply(p_objInstance,p_objArgs);}
else
{this.bases[i].apply(p_objInstance);}}}}
Function.prototype.initializeBase=function(p_objInstance,p_objArgs){if(!this._parentBase)
{this._parentBase=new Array();this._parentBase.push(this._typeName);this._childBase=new Array();this._childBase.push(this._typeName);}
this._setBases(this);if(this._interfaces){for(var i=0;i<this._interfaces.length;i++){this._interfaces[i].apply(p_objInstance);}}
this._callBaseConstructors(p_objInstance,p_objArgs);return p_objInstance;}
Function.abstractMethod=function(){throw'Abstract method should be implemented';}
Function.emptyFunction=function(){}
Function.prototype.registerClass=function(typeName,baseType,firstInterface)
{this._typeName=typeName;if(baseType){this._baseType=baseType;if(!Web.Type.isArray(baseType))
baseType=[baseType];if(!this.prototype._astrPendingInherits)
{this.prototype._astrPendingInherits=new Array();}
for(var i=0;i<baseType.length;i++)
{this.prototype._astrPendingInherits.push(baseType[i]);}
this._basePrototypePending=true;}
if(firstInterface){this._interfaces=[];for(var i=2;i<arguments.length;i++){var interfaceType=arguments[i];this._interfaces.add(interfaceType);}}
return this;}
Function.prototype.registerAbstractClass=function(typeName,baseType)
{this.registerClass.apply(this,arguments);this._abstract=true;return this;}
Function.prototype.registerSealedClass=function(typeName,baseType)
{this.registerClass.apply(this,arguments);this._sealed=true;return this;}
Function.prototype.registerInterface=function(typeName)
{this._typeName=typeName;this._interface=true;this._abstract=true;this._sealed=true;return this;}
Array.prototype.indexOf=function(p_var)
{for(var i=0;i<this.length;i++)
{if(this[i]==p_var)
{return(i);}}
return(-1);}
Array.prototype.exists=function(p_var){return(this.indexOf(p_var)!=-1);}
Array.prototype.add=Array.prototype.queue=function(p_var){this.push(p_var);}
Array.prototype.addRange=function(items){var length=items.length;if(length!=0){for(var index=0;index<length;index++){this.push(items[index]);}}}
Array.prototype.contains=function(item){var index=this.indexOf(item);return(index>=0);}
Array.prototype.dequeue=function(){return(this.shift());}
Array.prototype.insert=function(p_iIndex,p_objItem){this.splice(p_iIndex,0,p_objItem);}
Array.prototype.clone=function(){var clonedArray=[];var length=this.length;for(var index=0;index<length;index++){clonedArray[index]=this[index];}
return clonedArray;}
Array.prototype.removeAt=function(p_iIndex){return this.splice(p_iIndex,1);}
Array.prototype.remove=function(o)
{var i=this.indexOf(o);if(i>-1)this.splice(i,1);return(i>-1)}
Array.prototype.clear=function()
{if(this.length>0){this.splice(0,this.length);}}
Web.Event=function(p_blnRunOnce)
{this.afncCallbacks=new Array();this.vPackage=undefined;this.blnRunOnce=p_blnRunOnce;this.blnExecuteImmediately=false;this.isActive=function()
{return(this.afncCallbacks.length!=0)}
Web.Event.registerBaseMethod(this,'isActive');return this;}
Web.Event.prototype.isActive=function()
{return(this.afncCallbacks.length!=0)}
Web.Event.prototype.dispose=function()
{this.clear();}
Web.Event.prototype.initialize=function(){}
Web.Event.create=function(p_blnRunOnce)
{return(new Web.Event(p_blnRunOnce));}
Web.Event.prototype.reset=function()
{this.blnExecuteImmediately=false;}
Web.Event.prototype.add=Web.Event.prototype.attach=function(p_fnc)
{var objEvent=this;function Run()
{if(p_fnc)
p_fnc(objEvent.vPackage);}
if(this.blnExecuteImmediately)
{window.setTimeout(Run,1);return(true);}
else if(p_fnc&&(!this.afncCallbacks.exists(p_fnc)))
{this.afncCallbacks.queue(p_fnc);return(true);}
return(false);}
Web.Event.prototype.remove=Web.Event.prototype.detach=function(p_fnc)
{return(this.afncCallbacks.remove(p_fnc));}
Web.Event.prototype.invoke=function(sender,eventArgs){if(this.isActive()){var handlers=this.afncCallbacks;for(i=0;i<handlers.length;i++){handlers[i](sender,eventArgs);}}}
Web.Event.prototype.fire=function(p_vPackage,p_fncAsyncCallback)
{var objEvent=this;function Done()
{if(objEvent.blnRunOnce)
{objEvent.clear();objEvent.vPackage=p_vPackage;objEvent.blnExecuteImmediately=true;}
if(p_fncAsyncCallback)
p_fncAsyncCallback();}
function Fire(p_fnc)
{if(p_fnc)
{{p_fnc(p_vPackage);}}}
Web.Utility.applyFunctionOverArray(Fire,objEvent.afncCallbacks,p_fncAsyncCallback?Done:null);if(!p_fncAsyncCallback)
{Done();}}
Web.Event.prototype.clear=function()
{this.afncCallbacks.clear();this.afncCallbacks=new Array();}
Web.Event.registerClass("Web.Event");Web.EventArgs=function(){}
Web.EventArgs.registerClass("Web.EventArgs");Web.EventArgs.Empty=new Web.EventArgs();Web.CancelEventArgs=function(){Web.CancelEventArgs.initializeBase(this);var _canceled=false;this.getCanceled=function(){return _canceled;}
this.setCanceled=function(value){_canceled=value;}}
Web.CancelEventArgs.registerClass("Web.CancelEventArgs",Web.EventArgs);Web.Conversion=function(){}
Web.Conversion.coerceInt=function(p_i)
{p_i=parseInt(p_i);return(isNaN(p_i)?0:p_i);}
Web.Conversion.coerceFloat=function(p_f)
{p_f=parseFloat(p_f);return(isNaN(p_f)?0.0:p_f);}
registerNamespace("Web.Enum");Web.Enum=function(p_arguments)
{this.parse=function(s){for(var f in this){if(f==s){return this[f];}}
throw'Invalid Enumeration Value';}
this.toString=function(value){for(var i in this){if(this[i]==value){return i;}}
throw'Invalid Enumeration Value';}
this.getValues=function(){if(!this._values){var values={};for(var f in this){if(typeof(this[f])!='function'){values[f]=this[f];}}
this._values=values;}
return this._values;}
for(var i=0;i<p_arguments.length;i++)
{this[p_arguments[i]]=Web.Enum._value(this,p_arguments[i],p_arguments[i],"Enum");}}
Web.Enum.getValue=function(p_enumType,p_str)
{if(p_enumType&&p_str)
{for(var strName in p_enumType)
{if(strName.toLowerCase()==p_str.toLowerCase())
{return(p_enumType[strName]);}}}
return(null);}
Web.Enum.create=function()
{return(new Web.Enum(arguments));}
Web.Enum.createEnumeration=Web.Enum.create;Web.Enum.extend=function(p_srcEnum,p_addEnum)
{if(!p_srcEnum)p_srcEnum=Web.Enum.create();if(p_addEnum)
{for(var i in p_addEnum.getValues())
{p_srcEnum[i]=Web.Enum._value(this,i,i,"Enum");}}
return p_srcEnum;}
Web.Enum._value=function(p_enum,p_iValue,p_strName,p_strType)
{var obj=new Object(p_iValue);obj.e=p_enum;obj.strType=p_strType;obj.strName=p_strName;obj.is=function(p_strValue)
{Web.Debug.ASSERT(this.e[p_strValue],p_strValue+" is invalid for this enum")();return(this.e[p_strValue]==this);}
return(obj);}
registerNamespace("Web.Flags");Web.Flags=function(p_arguments)
{this.parse=function(s){var parts=s.split('|');var value=0;for(var i=parts.length-1;i>=0;i--){var part=parts[i].trim();var found=false;for(var f in this){if(f==part){value|=this[f];found=true;break;}}
if(found==false){throw'Invalid Enumeration Value';}}
return value;}
this.toString=function(value){var sb=new Web.StringBuilder();for(var i in this){if((this[i]&value)!=0){if(sb.isEmpty()==false){sb.append(' | ');}
sb.append(i);}}
return sb.toString();}
for(var i=0;i<p_arguments.length;i+=2){var name=p_arguments[i].toString();var value=p_arguments[i+1];this[name]=Web.Flags._value(this,Web.Conversion.coerceInt(value,"EnumFlag"));}
return this;}
Web.Flags.create=function()
{return(new Web.Flags(arguments));}
Web.Flags.prototype.or=function(p_arguments)
{return(Web.Enum._value(this,this._orValue(arguments)));}
Web.Flags.prototype._orValue=function(p_arguments)
{var iFlags=0;var i=0;for(i=0;i<p_arguments.length;i++)
{Web.Debug.ASSERT(this[p_arguments[i]],p_arguments[i]+" is invalid for this enum")();iFlags|=this[p_arguments[i]];}
return(iFlags);}
Web.Flags._value=function(p_enum,p_iValue,p_strName,p_strType)
{var obj=Web.Enum._value(p_enum,p_iValue,p_strName,p_strType);obj.containsAll=function()
{var iOrArgs=this.e._orValue(arguments);return((this&iOrArgs)==iOrArgs);}
obj.containsAny=function()
{return((this&this.e._orValue(arguments))!=0);}
return(obj);}
registerNamespace("Web.Browser");if(!Web.Browser.isMozilla)Web.Browser.isMozilla=function(){return false};Web.Browser._isOpera=(navigator.userAgent.indexOf("Opera")>=0);Web.Browser._isIE=(!Web.Browser.isMozilla()&&!Web.Browser._isOpera);Web.Browser.isOpera=function()
{return Web.Browser._isOpera;}
Web.Browser.isIE=function()
{return(Web.Browser._isIE);}
if(!Web.Browser.isMozilla())
{Web.Browser.Button={LEFT:1,RIGHT:2,MIDDLE:4};}
if(!window.XMLHttpRequest){window.XMLHttpRequest=function()
{var xmlHttp;try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP.4.0");return xmlHttp;}catch(ex){}
try{xmlHttp=new ActiveXObject("MSXML2.XMLHTTP");return xmlHttp;}catch(ex){}
try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");return xmlHttp;}catch(ex){}
return null;}}
if(Web.Debug.enabled)Web.Debug.initEvents();Web.Runtime=new function()
{var objRuntime=this;this.readyStateType=Web.Enum.create("Uninitialized","Init","InitComplete");this._readyState=this.readyStateType.Uninitialized;this.oninit=Web.Event.create(true);this.onunload=Web.Event.create(true);this.getReadyState=function()
{return(this._readyState);}
function UnwirePage()
{window.detachEvent("onunload",UnwirePage);objRuntime.onunload.fire();}
function VerifyHookupsCalled()
{if(objRuntime._readyState.is("Uninitialized"))
{alert("You failed to call Web.Runtime.init() at the bottom of your page");}
window.detachEvent("onload",VerifyHookupsCalled);}
window.attachEvent("onload",VerifyHookupsCalled);window.attachEvent("onunload",UnwirePage)
function BuildEventInvoker(p_objEvent,p_strPreState,p_strRunState,p_strPostState)
{function Invoke()
{if(objRuntime._readyState!=objRuntime.readyStateType[p_strPreState])
{throw("Invalid state for event to fire");}
else
{objRuntime._readyState=objRuntime.readyStateType[p_strRunState];p_objEvent.fire();objRuntime._readyState=objRuntime.readyStateType[p_strPostState];}}
return(Invoke);}
this.init=BuildEventInvoker(objRuntime.oninit,"Uninitialized","Init","InitComplete");}
registerNamespace("Web.Utility");Web.Utility.Prioritizer=function()
{var pList=new Object();this.queue=function(obj,priority)
{if(!priority)priority=Web.Utility.Prioritizer.Priorities.Medium;if(pList[priority.strName])
pList[priority.strName].queue(obj);else
throw"Error: Invalid Priority Specified";}
this.dequeue=function()
{for(var p in pList)
{if(pList[p].length>0)
return pList[p].dequeue();}
return null;}
this.removeItem=function(obj)
{var bRemoved=false;for(var p in pList)
{bRemoved=pList[p].remove(obj)||bRemoved;}
return bRemoved;}
this.findByProperty=function(p_strProperty,p_strValue)
{for(var p in pList)
{for(var item in pList[p])
if(pList[p][item][p_strProperty]==p_strValue)
return pList[p][item];}
return null;}
this.getList=function()
{return pList;}
this.clear=function()
{for(var p in Web.Utility.Prioritizer.Priorities.getValues())
{pList[p]=new Array();}}
this.clear();return this;}
Web.Utility.Prioritizer.Priorities=Web.Enum.create("High","Medium","Low","Lowest");Web.Utility.applyFunctionOverArray=function(p_fnc,p_a,p_fncAsyncCallback)
{var i=0;function RunNext()
{if(i<p_a.length)
{p_fnc(p_a[i++]);window.setTimeout(RunNext,1);}
else
{if(p_fncAsyncCallback)
p_fncAsyncCallback();}}
if(p_fncAsyncCallback)
{RunNext();}
else
{while(i<p_a.length)
{p_fnc(p_a[i++]);}
if(p_fncAsyncCallback)
p_fncAsyncCallback();}}
Web.Utility.extractHost=function(p_strUrl,p_blnIncludePrototcol)
{if(p_blnIncludePrototcol)
{Web.Utility.extractHost.reProtocolAndHost.lastIndex=0;var rMatch=Web.Utility.extractHost.reProtocolAndHost.exec(p_strUrl);return(rMatch?rMatch[1]:"");}
else
{Web.Utility.extractHost.reHost.lastIndex=0;var rMatch=Web.Utility.extractHost.reHost.exec(p_strUrl);return(rMatch?rMatch[2]:"");}}
Web.Utility.extractHost.reProtocolAndHost=new RegExp("((http|https|ftp)://[^\\/]*)\.*","ig");Web.Utility.extractHost.reHost=new RegExp("(http|https|ftp)://([^\\/]*)\.*","ig");Web.Utility.resolveUrl=function(str)
{if(str==null)return"";if(!Web.Utility.resolveUrl.Base)
{var elBases=document.getElementsByTagName("base");if(elBases.length>0&&elBases[0].href!="")
Web.Utility.resolveUrl.Base=elBases[0].href;else
Web.Utility.resolveUrl.Base=location.href.substring(0,location.href.lastIndexOf("/")+1);}
if(str.startsWith("/"))str=location.protocol+"//"+location.host+str;if(str.indexOf("//")==-1)str=Web.Utility.resolveUrl.Base+str;function DeleteDoubleDots(p_strPath)
{while(DeleteDoubleDots.reDoubleDot.test(p_strPath))
{p_strPath=p_strPath.replace(DeleteDoubleDots.reDoubleDot,"");}
return(p_strPath);}
DeleteDoubleDots.reDoubleDot=/\/[^\/]*\/\.\./;return DeleteDoubleDots(str);}
function FindUrl(p_arCol,p_strProp,p_strMatch)
{if(p_strMatch)
{var iCount=p_arCol.length;var strSource=Web.Utility.resolveUrl(p_strMatch).toLowerCase();var i=0;for(i=0;i<iCount;i++)
{var strCompare=p_arCol[i]["__"+p_strProp];if(!strCompare)
{strCompare=p_arCol[i]["__"+p_strProp]=Web.Utility.resolveUrl(p_arCol[i].getAttribute(p_strProp)).toLowerCase();}
if(strCompare==strSource)
{return p_arCol[i];}}}
return null;}
Web.Utility.CSS=new function()
{var objCSS=this;objCSS.findElement=function(p_strSrc)
{return FindUrl(document.getElementsByTagName("link"),"href",p_strSrc);}}
Web.Utility.loadSources=function(p_astrSources,p_astrStyles,p_ePriority,p_fncAsyncCallback)
{function SourcesRetrieved(p_htScripts)
{var aelScriptToAttach=new Array();for(var i=0;i<p_htScripts.length;i++)
{if(p_htScripts[i].resource)
{aelScriptToAttach.push(p_htScripts[i].resource)}}
Web.Utility.Script.attachBulkScript(aelScriptToAttach,document.head,p_fncAsyncCallback);}
if(p_astrSources.length==0&&p_astrStyles.length==0)
{p_fncAsyncCallback();}
else
{var objRequest=Web.Network.createBatch(p_ePriority);var blnFetch=false;for(var i=0;i<p_astrSources.length;i++)
{var el=null;if(Web.Browser.isIE())
el=Web.Utility.Script.findElement(p_astrSources[i]);if(p_astrSources[i]!=""&&(!el))
{blnFetch=true;objRequest.add(Web.Network.Type.Script,p_astrSources[i],null,null);}}
for(var i=0;i<p_astrStyles.length;i++)
{var el=Web.Utility.CSS.findElement(p_astrStyles[i]);if(!el)
{blnFetch=true;objRequest.add(Web.Network.Type.CSS,p_astrStyles[i],null,null);}}
if(blnFetch)
{objRequest.execute(SourcesRetrieved);}
else
{objRequest=null;p_fncAsyncCallback();}}}
Web.Utility.Script=new function()
{var objScript=this;objScript.findElement=function(p_strSrc)
{return FindUrl(document.scripts,"src",p_strSrc);}
objScript.attachBulkScript=function(p_arrScripts,p_elAttachElement,p_fnCallback)
{var cnt=0;var locked=true;function DoComplete()
{cnt--;if(!locked&&cnt==0)
{p_fnCallback();}}
for(var i=0;i<p_arrScripts.length;i++)
{if(p_arrScripts[i].tagName=="SCRIPT")
{cnt++;objScript.attachScript(p_arrScripts[i],p_elAttachElement,DoComplete)}}
locked=false;if(cnt==0&&p_fnCallback)
{p_fnCallback();}}
objScript.attachScript=function(p_elAttachScript,p_elAttachElement,p_fnCallback)
{var el=Web.Utility.Script.findElement(p_elAttachScript.src)
if(!el)
{if(Web.Browser.isMozilla())
{p_elAttachScript.onload=EvalTest;}
p_elAttachElement.appendChild(p_elAttachScript)
if(!Web.Browser.isMozilla()&&p_fnCallback)
{p_fnCallback();}}
else
{if(p_fnCallback)
if(Web.Browser.isMozilla()&&el.onload!=null)
{if(el.callbacks==null)el.callbacks=Web.Event.create(true);el.callbacks.attach(p_fnCallback);}
else
p_fnCallback();}
function EvalTest()
{if(p_elAttachScript.onload)
{p_elAttachScript.onload=null;p_elAttachScript.readyState="complete";if(p_fnCallback)
p_fnCallback();if(p_elAttachScript.callbacks)
{p_elAttachScript.callbacks.fire();p_elAttachScript.callbacks=null;};}
else
p_fnCallback();}
return p_elAttachScript.readyState=="complete";}}
registerNamespace("Web.Network");Web.Network=new function()
{var objNetwork=this;var objDomains=new Object();var strCurrentDomain=Web.Utility.extractHost(document.location,false);this.oninvoke=Web.Event.create();this.onfinished=Web.Event.create();this.onabort=Web.Event.create();this.onhttperror=Web.Event.create();this.onerror=Web.Event.create();this.ontimeout=Web.Event.create();this.onrequest=Web.Event.create();this.defaultTimeout=null;function RunList(p_strDomain)
{var intActive=0;var objList=new Object();var objParallel=new Web.Utility.Prioritizer();var objSerializer=new Web.Utility.Prioritizer();var boolSerRequest=false;var blnCrossDomain=(strCurrentDomain!=p_strDomain)
function FetchImage(o)
{var img=new Image();img.onload=doCallback;img.onerror=doError;img.blnError=false;img.src=o.url;function doError()
{img.blnError=true;doCallback();}
function doCallback()
{img.onerror=img.onload=null;Finished(img,o);}
return img;}
function FetchCSS(o)
{var el=Web.Utility.CSS.findElement(o.url)
if(!el)
{el=document.createElement("link");el.rel="stylesheet"
el.type="text/css";el.onreadystatechange=doCallback;el.href=o.url;document.head.appendChild(el);if(Web.Browser.isMozilla())
{el.readyState="complete";doCallback();}}
else
{doCallback();}
function doCallback()
{if(el&&("loaded"==el.readyState||"complete"==el.readyState))
{el.onreadystatechange=null;Finished(el,o);}}
return el;}
function FetchScript(o)
{var el=Web.Utility.Script.findElement(o.url)
if(!el)
{el=document.createElement("script");el.onreadystatechange=doCallback;el.src=o.url;if(!Web.Browser.isIE())
{el.readyState="loaded";doCallback();}}
else
{if(Web.Browser.isMozilla())
el.readyState="loaded";doCallback();}
function doCallback()
{if(el&&("loaded"==el.readyState||"complete"==el.readyState))
{el.onreadystatechange=null;Finished(el,o);}}
return el;}
function FetchXML(o,method)
{var xml=new XMLHttpRequest();if(o.timeout)
o.timer=setTimeout(TimedOut,o.timeout);xml.onreadystatechange=doCallback;objNetwork.oninvoke.fire(o);if(method)
{xml.open("POST",o.url,true);if(Web.Browser.isIE())
{xml.setRequestHeader("Accept-Encoding","gzip, deflate");}}
else
{xml.open("GET",o.url,true);}
if(o.headers)
{for(var h in o.headers)
{xml.setRequestHeader(h,o.headers[h]);}}
try
{xml.send(o.postString);}
catch(ex)
{objNetwork.onhttperror.fire(xml);}
function doCallback()
{if(4==xml.readyState)
{xml.onreadystatechange=Function.emptyFunction;if(o.timer)
clearTimeout(o.timer);Finished(xml,o);xml=o=null;}}
function TimedOut()
{xml.onreadystatechange=Function.emptyFunction;xml.abort();Finished(null,o);xml=o=null;}
return xml;}
function Continue()
{var o=null;if(intActive<Web.Network.MAXACTIVE)
{if(!boolSerRequest)
{o=objSerializer.dequeue();if(o)boolSerRequest=true;}
if(!o)
{o=objParallel.dequeue();}
if(o)
{intActive++;switch(o.type)
{case Web.Network.Type.XMLGet:case Web.Network.Type.XML:o.executing=FetchXML(o,false);break;case Web.Network.Type.XMLPost:o.executing=FetchXML(o,true);break;case Web.Network.Type.Image:o.executing=FetchImage(o);break;case Web.Network.Type.Script:o.executing=FetchScript(o);break;case Web.Network.Type.CSS:o.executing=FetchCSS(o);break;default:intActive--;}}}}
function Finished(el,obj)
{if(obj.flags&Web.Network.Flags.SERIALIZE)
{boolSerRequest=false;}
intActive--;if(objList[obj.key])
{for(var i=objList[obj.key].length-1;i>=0;i--)
{var objItem=objList[obj.key][i];if(objItem.callback)
objItem.callback(el,objItem.context);}
var objItem=objList[obj.key].pop();while(objItem)
{objItem=objItem.callback=objItem.context=objItem.executing=null;objItem=objList[obj.key].pop();}
delete objList[obj.key];}
obj=obj.executing=el=null;setTimeout(Continue,1);}
function IndexInList(objCheck)
{var boolMatch=false;var intIndex=0;var objCheckList=objList[objCheck.key];if(objCheckList)
while(!boolMatch&&objCheckList&&intIndex<objCheckList.length)
{var objItem=objCheckList[intIndex];boolMatch=objItem&&(objItem.callback==objCheck.callback);if(!boolMatch)
intIndex++;}
return((boolMatch)?intIndex:-1);}
function Remove(obj)
{var objItem=null;if(objList[obj.key])
{var intIndex=IndexInList(obj);if(intIndex>-1)
objItem=objList[obj.key].splice(intIndex,1)[0];}
return objItem;}
function AbortRequest(objMatch)
{objMatch.callback=null;if(objMatch.executing)
{if(objMatch.flags&Web.Network.Flags.SERIALIZE)
{boolSerRequest=false;}
objNetwork.onabort.fire(objMatch);switch(objMatch.type)
{case Web.Network.Type.XML:case Web.Network.Type.XMLPost:case Web.Network.Type.XMLGet:objMatch.executing.onreadystatechange=Function.emptyFunction;objMatch.executing.abort();break;case Web.Network.Type.Image:case Web.Network.Type.Script:case Web.Network.Type.CSS:objMatch.onload=objMatch.onerror=objMatch.onreadystatechange=null;objMatch.executing.src="";break;}
intActive--;}
objMatch.context=objMatch.executing=null;}
this.abort=function(obj)
{var objMatch=Remove(obj);while(objMatch!=null)
{AbortRequest(objMatch);objMatch=Remove(obj);}
Continue();}
function AbortObjectKey(p_objList,p_strKey)
{var o=p_objList[p_strKey];if(o)
{var objItem=o.pop();while(objItem)
{AbortRequest(objItem);objItem=o.pop();}}
delete o;}
this.abortGroup=function(p_strGroup)
{var objFound=objParallel.findByProperty("strGroup",p_strGroup);while(objFound)
{objParallel.removeItem(objFound);objFound=objParallel.findByProperty("strGroup",p_strGroup);}
objFound=objSerializer.findByProperty("strGroup",p_strGroup);while(objFound)
{objSerializer.removeItem(objFound);objFound=objSerializer.findByProperty("strGroup",p_strGroup);}
for(var key in objList)
{var blnAbort=false;var intItem=0;while(intItem<objList[key].length&&!blnAbort)
{if(objList[key][intItem].strGroup==p_strGroup)
{blnAbort=true;break;}
intItem++;}
if(blnAbort)
{AbortObjectKey(objList,key);}}}
this.abortAll=function(p_boolRestart)
{if(p_boolRestart)
{objParallel.clear();objSerializer.clear();}
for(var strKey in objList)
{AbortObjectKey(objList,strKey);}
objList=new Object();}
this.add=function(obj)
{var boolQueue=false;if(objList[obj.key])
{var intIndex=IndexInList(obj);boolQueue=(intIndex==-1);}
else
{objList[obj.key]=new Array();boolQueue=true;if(obj.flags&Web.Network.Flags.SERIALIZE)
objSerializer.queue(obj,obj.priority);else
objParallel.queue(obj,obj.priority);}
if(boolQueue)
{objList[obj.key].push(obj);Continue();}}}
function Request(p_enumNetworkType,p_strUrl,p_objContext,p_fnCallback,p_enumPriority,p_postString,p_objHeaders,p_enumFlags,p_intTimeout,p_strTag)
{this.type=p_enumNetworkType;this.url=Web.Utility.resolveUrl(p_strUrl);this.context=p_objContext;this.callback=p_fnCallback;this.priority=p_enumPriority;this.postString=p_postString;this.strGroup=p_strTag;var strList="";for(var h in p_objHeaders)
{strList+=h+":"+p_objHeaders[h];}
this.strHeaders=strList;this.key=this.url+"?"+(this.postString||"")+"!"+strList;if(p_enumFlags&Web.Network.Flags.DUPLICATE)
{this.key+="!"+(Request.DupCounter++);}
this.headers=p_objHeaders;this.flags=p_enumFlags;this.executing=null;this.timeout=p_intTimeout;objNetwork.onrequest.fire(this);this.domain=Web.Utility.extractHost(this.url,false);if(this.domain=="")this.domain="local";if(!objDomains[this.domain])
{objDomains[this.domain]=new RunList(this.domain);}}
Request.DupCounter=0;this.abortAll=function(p_blnUnload)
{for(var rl in objDomains)
{objDomains[rl].abortAll();}}
this.abortGroup=function(p_strTag)
{for(var strDomain in objDomains)
{objDomains[strDomain].abortGroup(p_strTag);}}
this.createRequest=function(p_enumNetworkType,p_strUrl,p_objContext,p_fnCallback,p_enumPriority,p_strPostArgs,p_objHeaders,p_enumFlags,p_intTimeout,p_strTag)
{var objRequest=new Object();var objPrivRequest=new Request(p_enumNetworkType,p_strUrl,p_objContext,p_fnCallback,p_enumPriority,p_strPostArgs,p_objHeaders,p_enumFlags,p_intTimeout,p_strTag);var boolExecuting=false;objRequest.execute=function()
{if(!boolExecuting)
objDomains[objPrivRequest.domain].add(objPrivRequest);boolExecuting=true;}
objRequest.isExecuting=function()
{return boolExecuting;}
objRequest.abort=function()
{objDomains[objPrivRequest.domain].abort(objPrivRequest);}
return objRequest;}
this.createBatch=function(p_enumPriority,p_objContext)
{var objBatch=this;var arrBatch=new Array();var boolExecuting=false;var intReceiveCount=0;var boolLockSection=false;var arrCallback=new Array();function CheckComplete()
{if(!boolLockSection&&arrBatch.length==intReceiveCount)
{for(var i=0;i<arrCallback.length;i++)
if(arrCallback[i])
arrCallback[i](arrBatch,p_objContext);intReceiveCount=0;boolExecuting=false;}}
objBatch.add=function(p_enumNetworkType,p_strUrl,p_objContext,p_strPostArgs,p_objHeaders,p_enumFlags)
{arrBatch.push(objNetwork.createRequest(p_enumNetworkType,p_strUrl,arrBatch.length,BatchItemReceived,p_enumPriority,p_strPostArgs,p_objHeaders,p_enumFlags));}
function BatchItemReceived(p_elResource,p_intIndex)
{arrBatch[p_intIndex].resource=p_elResource;intReceiveCount++;CheckComplete();}
objBatch.execute=function(p_fnCallback)
{if(!arrCallback.exists(p_fnCallback))arrCallback.push(p_fnCallback);if(!boolExecuting)
{boolExecuting=boolLockSection=true;for(var intIndex=0;intIndex<arrBatch.length;intIndex++)
{arrBatch[intIndex].execute();}
boolLockSection=false;CheckComplete();}}
objBatch.abort=function(p_fnCallback)
{arrCallback.remove(p_fnCallback);if(arrCallback.length==0)
{for(var i=0;i<arrBatch.length;i++)
arrBatch[i].abort();boolExecuting=false;}}
return objBatch;}
function dispose()
{objNetwork.abortAll(true);objNetwork.oninvoke.clear();objNetwork.onfinished.clear();objNetwork.onabort.clear();objNetwork.onhttperror.clear();objNetwork.onerror.clear();objNetwork.ontimeout.clear();objNetwork.onrequest.clear();}
Web.Runtime.onunload.attach(dispose);}
Web.Network.Flags=Web.Flags.create("SERIALIZE",1,"DUPLICATE",2);Web.Network.Type=Web.Enum.create("XML","Image","Script","XMLPost","XMLGet","CSS");Web.Network.MAXACTIVE=2;