if(DWREngine==null){var DWREngine={};};DWREngine._httpSessionId="6EBF3E7A5FA4BB110568D00052E6188B.worker2;";DWREngine._scriptSessionId="D3E270C021D6E5BFFF35472A1C94AA2C;";DWREngine.setErrorHandler=function(handler){DWREngine._errorHandler=handler;};DWREngine.setWarningHandler=function(handler){DWREngine._warningHandler=handler;};DWREngine.setTimeout=function(timeout){DWREngine._timeout=timeout;};DWREngine.setPreHook=function(handler){DWREngine._preHook=handler;};DWREngine.setPostHook=function(handler){DWREngine._postHook=handler;};DWREngine.XMLHttpRequest=1;DWREngine.IFrame=2;DWREngine.ScriptTag=3;DWREngine.setMethod=function(newMethod){if(newMethod!=DWREngine.XMLHttpRequest&&newMethod!=DWREngine.IFrame&&newMethod!=DWREngine.ScriptTag){DWREngine._handleError("Remoting method must be one of DWREngine.XMLHttpRequest or DWREngine.IFrame or DWREngine.ScriptTag");return;};DWREngine._method=newMethod;};DWREngine.setVerb=function(verb){if(verb!="GET"&&verb!="POST"){DWREngine._handleError("Remoting verb must be one of GET or POST");return;};DWREngine._verb=verb;};DWREngine.setOrdered=function(ordered){DWREngine._ordered=ordered;};DWREngine.setAsync=function(async){DWREngine._async=async;};DWREngine.setPolling=function(){DWREngine._handleError("DWREngine.setPolling() has been renamed to DWREngine.setReverseAjax()");};DWREngine.setReverseAjax=function(reverseAjax){DWREngine._reverseAjax=reverseAjax;if(DWREngine._reverseAjax){DWREngine._triggerNextPoll(0);}};DWREngine.setPollUsingComet=function(pollComet){DWREngine._pollComet=pollComet;};DWREngine.setPollMethod=function(newPollMethod){if(newPollMethod!=DWREngine.XMLHttpRequest&&newPollMethod!=DWREngine.IFrame){DWREngine._handleError("Polling method must be one of DWREngine.XMLHttpRequest or DWREngine.IFrame");return;};DWREngine._pollMethod=newPollMethod;};DWREngine.setTextHtmlHandler=function(handler){DWREngine._textHtmlHandler=handler;};DWREngine.defaultMessageHandler=function(message){if(typeof message=="object"&&message.name=="Error"&&message.description){alert("Error: "+message.description);}else{if(message.toString().indexOf("0x80040111")==-1){alert(message);}}};DWREngine.beginBatch=function(){if(DWREngine._batch){DWREngine._handleError("Batch already started.");return;};DWREngine._batch={map:{callCount:0},paramCount:0,ids:[],preHooks:[],postHooks:[]};};DWREngine.endBatch=function(options){var batch=DWREngine._batch;if(batch==null){DWREngine._handleError("No batch in progress.");return;};if(options&&options.preHook)batch.preHooks.unshift(options.preHook);if(options&&options.postHook)batch.postHooks.push(options.postHook);if(DWREngine._preHook)batch.preHooks.unshift(DWREngine._preHook);if(DWREngine._postHook)batch.postHooks.push(DWREngine._postHook);if(batch.method==null)batch.method=DWREngine._method;if(batch.verb==null)batch.verb=DWREngine._verb;if(batch.async==null)batch.async=DWREngine._async;if(batch.timeout==null)batch.timeout=DWREngine._timeout;batch.completed=false;DWREngine._batch=null;if(!DWREngine._ordered){DWREngine._sendData(batch);DWREngine._batches[DWREngine._batches.length]=batch;}else{if(DWREngine._batches.length==0){DWREngine._sendData(batch);DWREngine._batches[DWREngine._batches.length]=batch;}else{DWREngine._batchQueue[DWREngine._batchQueue.length]=batch;}}};DWREngine._errorHandler=DWREngine.defaultMessageHandler;DWREngine._warningHandler=DWREngine.defaultMessageHandler;DWREngine._preHook=null;DWREngine._postHook=null;DWREngine._batches=[];DWREngine._batchQueue=[];DWREngine._handlersMap={};DWREngine._method=DWREngine.XMLHttpRequest;DWREngine._verb="POST";DWREngine._ordered=false;DWREngine._async=true;DWREngine._batch=null;DWREngine._timeout=0;DWREngine._DOMDocument=["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.5.0","Msxml2.DOMDocument.4.0","Msxml2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"];DWREngine._XMLHTTP=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];DWREngine._reverseAjax=false;DWREngine._pollComet=true;DWREngine._pollMethod=DWREngine.XMLHttpRequest;DWREngine._pollFrame=null;DWREngine._pollReq=null;DWREngine._pollCometSize=0;DWREngine._pollCometInterval=200;DWREngine._textHtmlHandler=null;DWREngine._execute=function(path,scriptName,methodName,vararg_params){var singleShot=false;if(DWREngine._batch==null){DWREngine.beginBatch();singleShot=true;};var args=[];for(var i=0;i<arguments.length-3;i++){args[i]=arguments[i+3];};if(DWREngine._batch.path==null){DWREngine._batch.path=path;}else{if(DWREngine._batch.path!=path){DWREngine._handleError("Can't batch requests to multiple DWR Servlets.");return;}};var params;var callData;var firstArg=args[0];var lastArg=args[args.length-1];if(typeof firstArg=="function"){callData={callback:args.shift()};params=args;}else if(typeof lastArg=="function"){callData={callback:args.pop()};params=args;}else if(lastArg!=null&&typeof lastArg=="object"&&lastArg.callback!=null&&typeof lastArg.callback=="function"){callData=args.pop();params=args;}else if(firstArg==null){if(lastArg==null&&args.length>2){if(DWREngine._warningHandler){DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?");}};callData={callback:args.shift()};params=args;}else if(lastArg==null){callData={callback:args.pop()};params=args;}else{if(DWREngine._warningHandler){DWREngine._warningHandler("Missing callback function or metadata object.");};return;};var random=Math.floor(Math.random()*10001);var id=(random+"_"+new Date().getTime()).toString();var prefix="c"+DWREngine._batch.map.callCount+"-";DWREngine._batch.ids.push(id);if(callData.method!=null){DWREngine._batch.method=callData.method;delete callData.method;};if(callData.verb!=null){DWREngine._batch.verb=callData.verb;delete callData.verb;};if(callData.async!=null){DWREngine._batch.async=callData.async;delete callData.async;};if(callData.timeout!=null){DWREngine._batch.timeout=callData.timeout;delete callData.timeout;};if(callData.preHook!=null){DWREngine._batch.preHooks.unshift(callData.preHook);delete callData.preHook;};if(callData.postHook!=null){DWREngine._batch.postHooks.push(callData.postHook);delete callData.postHook;};if(callData.scriptTagBase!=null){DWREngine._batch.scriptTagBase=callData.scriptTagBase;delete callData.scriptTagBase;};if(callData.errorHandler==null)callData.errorHandler=DWREngine._errorHandler;if(callData.warningHandler==null)callData.warningHandler=DWREngine._warningHandler;DWREngine._handlersMap[id]=callData;var data,prop;for(prop in callData){data=callData[prop];if(typeof data!="function"){DWREngine._batch.map[prop]=""+data;}};DWREngine._batch.map.httpSessionId=DWREngine._httpSessionId;DWREngine._batch.map.scriptSessionId=DWREngine._scriptSessionId;DWREngine._batch.map.page=window.location.pathname;DWREngine._batch.map[prefix+"scriptName"]=scriptName;DWREngine._batch.map[prefix+"methodName"]=methodName;DWREngine._batch.map[prefix+"id"]=id;for(i=0;i<params.length;i++){DWREngine._serializeAll(DWREngine._batch,[],params[i],prefix+"param"+i);};DWREngine._batch.map.callCount++;if(singleShot){DWREngine.endBatch();}};DWREngine._poll=function(overridePath){if(!DWREngine._reverseAjax){return;};var random=Math.floor(Math.random()*10001);var id=(random+"_"+new Date().getTime()).toString();var batch={completed:false,map:{callCount:1,'c0-scriptName':'DWRSystem','c0-methodName':'poll','c0-id':id,httpSessionId:DWREngine._httpSessionId,scriptSessionId:DWREngine._scriptSessionId,page:window.location.pathname},method:DWREngine._pollMethod,isPoll:true,verb:"POST",async:true,paramCount:0,ids:[id],path:(overridePath)?overridePath:DWREngine._defaultPath,preHooks:(DWREngine._preHook)?[DWREngine._preHook]:[],postHooks:(DWREngine._postHook)?[DWREngine._postHook]:[],timeout:0};if(!window.XMLHttpRequest&&DWREngine._pollMethod==DWREngine.XMLHttpRequest){batch.method=DWREngine.IFrame;};DWREngine._handlersMap[id]={errorHandler:DWREngine._errorHandler,warningHandler:DWREngine._warningHandler,callback:DWREngine._triggerNextPoll};DWREngine._sendData(batch);DWREngine._batches[DWREngine._batches.length]=batch;DWREngine._checkCometPoll();};DWREngine._triggerNextPoll=function(pause){setTimeout("DWREngine._poll()",pause);};DWREngine._checkCometPoll=function(){if(DWREngine._pollComet){if(DWREngine._pollFrame){setTimeout("DWREngine._checkCometPoll()",DWREngine._pollCometInterval);var text=DWREngine._getTextFromCometIFrame();DWREngine._processCometResponse(text);}else if(DWREngine._pollReq){setTimeout("DWREngine._checkCometPoll()",DWREngine._pollCometInterval);try{var xhrtext=DWREngine._pollReq.responseText;DWREngine._processCometResponse(xhrtext);}catch(ex){}}}};DWREngine._getTextFromCometIFrame=function(){var frameDocument;if(DWREngine._pollFrame.contentDocument){frameDocument=DWREngine._pollFrame.contentDocument.defaultView.document;}else if(DWREngine._pollFrame.contentWindow){frameDocument=DWREngine._pollFrame.contentWindow.document}else{return "";};var bodyNodes=frameDocument.getElementsByTagName("body");if(bodyNodes==null||bodyNodes.length==0)return "";if(bodyNodes[0]==null)return "";var text=bodyNodes[0].innerHTML.toString();if(text.indexOf("<PRE>")==0)text=text.substring(5,text.length-7);return text;};DWREngine._processCometResponse=function(response){if(DWREngine._pollCometSize!=response.length){var firstStartTag=response.indexOf("//@DWR-START@",DWREngine._pollCometSize);if(firstStartTag==-1){DWREngine._pollCometSize=response.length;}else{var lastEndTag=response.lastIndexOf("//@DWR-END@");if(lastEndTag!=-1){var executeString=response.substring(firstStartTag+13,lastEndTag);eval(executeString);DWREngine._pollCometSize=lastEndTag+11;}}}};DWREngine._sendData=function(batch){if(batch.map.callCount==0)return;for(var i=0;i<batch.preHooks.length;i++){batch.preHooks[i]();};batch.preHooks=null;if(batch.timeout&&batch.timeout!=0){batch.interval=setInterval(function(){clearInterval(batch.interval);DWREngine._abortRequest(batch);},batch.timeout);};var statsInfo;if(batch.map.callCount==1){statsInfo=batch.map["c0-scriptName"]+"."+batch.map["c0-methodName"]+".dwr";}else{statsInfo="Multiple."+batch.map.callCount+".dwr";};if(batch.method==DWREngine.XMLHttpRequest){if(window.XMLHttpRequest){batch.req=new XMLHttpRequest();}else if(window.ActiveXObject&&!(navigator.userAgent.indexOf('Mac')>=0&&navigator.userAgent.indexOf("MSIE")>=0)){batch.req=DWREngine._newActiveXObject(DWREngine._XMLHTTP);}};var query="";var prop;if(batch.req){if(batch.async){batch.req.onreadystatechange=function(){DWREngine._stateChange(batch);};};if(batch.isPoll)DWREngine._pollReq=batch.req;var indexSafari=navigator.userAgent.indexOf('Safari/');if(indexSafari>=0){var version=navigator.userAgent.substring(indexSafari+7);var verNum=parseInt(version,10);if(verNum<400){batch.verb=="GET";}};if(batch.verb=="GET"){batch.map.callCount=""+batch.map.callCount;for(prop in batch.map){var qkey=encodeURIComponent(prop);var qval=encodeURIComponent(batch.map[prop]);if(qval==""){if(DWREngine._warningHandler){DWREngine._warningHandler("Found empty qval for qkey="+qkey);}};query+=qkey+"="+qval+"&";};query+="jsessionid="+DWREngine._httpSessionId;try{batch.req.open("GET",batch.path+"/plainjs/"+statsInfo+"?"+query,batch.async);batch.req.send(null);if(!batch.async){DWREngine._stateChange(batch);}}catch(ex){DWREngine._handleMetaDataError(null,ex);}}else{for(prop in batch.map){if(typeof batch.map[prop]!="function"){query+=prop+"="+batch.map[prop]+"\n";}};try{batch.req.open("POST",batch.path+"/plainjs/"+statsInfo,batch.async);batch.req.setRequestHeader('Content-Type','text/plain');batch.req.send(query);if(!batch.async){DWREngine._stateChange(batch);}}catch(ex){DWREngine._handleMetaDataError(null,ex);}}}else if(batch.method!=DWREngine.ScriptTag){var idname="dwr-if-"+batch.map["c0-id"];batch.div=document.createElement('div');batch.div.innerHTML="<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='"+idname+"' name='"+idname+"'></iframe>";document.body.appendChild(batch.div);batch.iframe=document.getElementById(idname);batch.iframe.setAttribute('style','width:0px; height:0px; border:0px;');var baseUrl;if(batch.isPoll){DWREngine._pollFrame=batch.iframe;DWREngine._pollCometSize=0;baseUrl=batch.path+"/plainjs/"+statsInfo;}else{baseUrl=batch.path+"/htmljs/"+statsInfo;};if(batch.verb=="GET"){for(prop in batch.map){if(typeof batch.map[prop]!="function"){query+=encodeURIComponent(prop)+"="+encodeURIComponent(batch.map[prop])+"&";}};query=query.substring(0,query.length-1);batch.iframe.setAttribute('src',baseUrl+"?"+query);document.body.appendChild(batch.iframe);}else{batch.form=document.createElement('form');batch.form.setAttribute('id','dwr-form');batch.form.setAttribute('action',baseUrl);batch.form.setAttribute('target',idname);batch.form.target=idname;batch.form.setAttribute('method','post');for(prop in batch.map){var formInput=document.createElement('input');formInput.setAttribute('type','hidden');formInput.setAttribute('name',prop);formInput.setAttribute('value',batch.map[prop]);batch.form.appendChild(formInput);};document.body.appendChild(batch.form);batch.form.submit();}}else{if(!batch.scriptTagBase){DWREngine._handleError("Please specify the scriptTagBase property within the call data.");return;};for(prop in batch.map){if(typeof batch.map[prop]!="function"){query+=encodeURIComponent(prop)+"="+encodeURIComponent(batch.map[prop])+"&";}};query=query.substring(0,query.length-1);batch.script=document.createElement('script');batch.script.id="dwr-st-"+batch.map["c0-id"];batch.script.src=batch.scriptTagBase+batch.path+"/plainjs/"+statsInfo+"?"+query;document.body.appendChild(batch.script);}};DWREngine._stateChange=function(batch){if(!batch.completed&&batch.req.readyState==4){try{var reply=batch.req.responseText;var status=batch.req.status;if(reply==null||reply==""){DWREngine._handleMetaDataError(null,"\u670d\u52a1\u5668\u65e0\u54cd\u5e94\uff0c\u8bf7\u5237\u65b0\u9875\u9762\uff01");return;};var contentType=batch.req.getResponseHeader('Content-Type');if(DWREngine._textHtmlHandler&&contentType.match(/^text\/html/)){DWREngine._textHtmlHandler();return;};if(batch.req==DWREngine._pollReq){DWREngine._processCometResponse(reply);}else{if(reply.search("DWREngine._handle")==-1){DWREngine._handleMetaDataError(null,"\u670d\u52a1\u5668\u65e0\u54cd\u5e94\uff0c\u8bf7\u5237\u65b0\u9875\u9762\uff01");return;};eval(reply);};DWREngine._clearUp(batch);}catch(ex){if(ex==null)ex="Unknown error occured";DWREngine._handleMetaDataError(null,ex);}finally{if(DWREngine._batchQueue.length!=0){var sendbatch=DWREngine._batchQueue.shift();DWREngine._sendData(sendbatch);DWREngine._batches[DWREngine._batches.length]=sendbatch;}}}};DWREngine._handleResponse=function(id,reply){var handlers=DWREngine._handlersMap[id];DWREngine._handlersMap[id]=null;if(handlers){try{if(handlers.callback)handlers.callback(reply);}catch(ex){DWREngine._handleMetaDataError(handlers,ex);}};var responseBatch=DWREngine._batches[DWREngine._batches.length-1];if(responseBatch.method==DWREngine.IFrame){if(responseBatch.map["c"+(responseBatch.map.callCount-1)+"-id"]==id){DWREngine._clearUp(responseBatch);}}};DWREngine._handleServerError=function(id,error){var handlers=DWREngine._handlersMap[id];DWREngine._handlersMap[id]=null;if(error.message){DWREngine._handleMetaDataError(handlers,error.message,error);}else{DWREngine._handleMetaDataError(handlers,error);}};DWREngine._eval=function(script){return eval(script);};DWREngine._abortRequest=function(batch){if(batch&&batch.metadata!=null&&!batch.completed){DWREngine._clearUp(batch);if(batch.req)batch.req.abort();var handlers;var id;for(var i=0;i<batch.ids.length;i++){id=batch.ids[i];handlers=DWREngine._handlersMap[id];DWREngine._handleMetaDataError(handlers,"Timeout");}}};DWREngine._clearUp=function(batch){if(batch.completed){DWREngine._handleWarning("double complete");return;};if(batch.div)batch.div.parentNode.removeChild(batch.div);if(batch.iframe){if(batch.iframe==DWREngine._pollFrame)DWREngine._pollFrame=null;batch.iframe.parentNode.removeChild(batch.iframe);};if(batch.form)batch.form.parentNode.removeChild(batch.form);if(batch.req){if(batch.req==DWREngine._pollReq)DWREngine._pollReq=null;delete batch.req;};for(var i=0;i<batch.postHooks.length;i++){batch.postHooks[i]();};batch.postHooks=null;for(var i=0;i<DWREngine._batches.length;i++){if(DWREngine._batches[i]==batch){DWREngine._batches.splice(i,1);break;}};batch.completed=true;};DWREngine._handleError=function(reason,ex){if(DWREngine._errorHandler){DWREngine._errorHandler(reason,ex);}};DWREngine._handleWarning=function(reason,ex){if(DWREngine._warningHandler){DWREngine._warningHandler(reason,ex);}};DWREngine._handleMetaDataError=function(handlers,reason,ex){if(handlers&&typeof handlers.errorHandler=="function"){handlers.errorHandler(reason,ex);}else{DWREngine._handleError(reason,ex);}};DWREngine._serializeAll=function(batch,referto,data,name){if(data==null){batch.map[name]="null:null";return;};switch(typeof data){case "boolean":batch.map[name]="boolean:"+data;break;case "number":batch.map[name]="number:"+data;break;case "string":batch.map[name]="string:"+encodeURIComponent(data);break;case "object":if(data instanceof String){batch.map[name]="String:"+encodeURIComponent(data);}else if(data instanceof Boolean){batch.map[name]="Boolean:"+data;}else if(data instanceof Number){batch.map[name]="Number:"+data;}else if(data instanceof Date){batch.map[name]="Date:"+data.getTime();}else if(data instanceof Array){batch.map[name]=DWREngine._serializeArray(batch,referto,data,name);}else{batch.map[name]=DWREngine._serializeObject(batch,referto,data,name);};break;case "function":break;default:if(DWREngine._warningHandler){DWREngine._warningHandler("Unexpected type: "+typeof data+", attempting default converter.");};batch.map[name]="default:"+data;break;}};DWREngine._lookup=function(referto,data,name){var lookup;for(var i=0;i<referto.length;i++){if(referto[i].data==data){lookup=referto[i];break;}};if(lookup){return "reference:"+lookup.name;};referto.push({data:data,name:name});return null;};DWREngine._serializeObject=function(batch,referto,data,name){var ref=DWREngine._lookup(referto,data,name);if(ref)return ref;if(data.nodeName&&data.nodeType){return DWREngine._serializeXml(batch,referto,data,name);};var reply="Object:{";var element;for(element in data){if(element!="dwrSerialize"){batch.paramCount++;var childName="c"+DWREngine._batch.map.callCount+"-e"+batch.paramCount;DWREngine._serializeAll(batch,referto,data[element],childName);reply+=encodeURIComponent(element);reply+=":reference:";reply+=childName;reply+=", ";}};if(reply.substring(reply.length-2)==", "){reply=reply.substring(0,reply.length-2);};reply+="};";return reply;};DWREngine._serializeXml=function(batch,referto,data,name){var ref=DWREngine._lookup(referto,data,name);if(ref)return ref;var output;if(window.XMLSerializer){var serializer=new XMLSerializer();output=serializer.serializeToString(data);}else{output=data.toXml;};return "XML:"+encodeURIComponent(output);};DWREngine._serializeArray=function(batch,referto,data,name){var ref=DWREngine._lookup(referto,data,name);if(ref)return ref;var reply="Array:[";for(var i=0;i<data.length;i++){if(i!=0){reply+=",";};batch.paramCount++;var childName="c"+DWREngine._batch.map.callCount+"-e"+batch.paramCount;DWREngine._serializeAll(batch,referto,data[i],childName);reply+="reference:";reply+=childName;};reply+="]";return reply;};DWREngine._unserializeDocument=function(xml){var dom;if(window.DOMParser){var parser=new DOMParser();dom=parser.parseFromString(xml,"text/xml");if(!dom.documentElement||dom.documentElement.tagName=="parsererror"){var message=dom.documentElement.firstChild.data;message+="\n"+dom.documentElement.firstChild.nextSibling.firstChild.data;throw message;};return dom;}else if(window.ActiveXObject){dom=DWREngine._newActiveXObject(DWREngine._DOMDocument);dom.loadXML(xml);return dom;}else{var div=document.createElement('div');div.innerHTML=xml;return div;}};DWREngine._newActiveXObject=function(axarray){var returnValue;for(var i=0;i<axarray.length;i++){try{returnValue=new ActiveXObject(axarray[i]);break;}catch(ex){}};return returnValue;};if(typeof window.encodeURIComponent==='undefined'){DWREngine._utf8=function(wide){wide=""+wide;var c;var s;var enc="";var i=0;while(i<wide.length){c=wide.charCodeAt(i++);if(c>=0xDC00&&c<0xE000)continue;if(c>=0xD800&&c<0xDC00){if(i>=wide.length)continue;s=wide.charCodeAt(i++);if(s<0xDC00||c>=0xDE00)continue;c=((c-0xD800)<<10)+(s-0xDC00)+0x10000;};if(c<0x80){enc+=String.fromCharCode(c);}else if(c<0x800){enc+=String.fromCharCode(0xC0+(c>>6),0x80+(c&0x3F));}else if(c<0x10000){enc+=String.fromCharCode(0xE0+(c>>12),0x80+(c>>6&0x3F),0x80+(c&0x3F));}else{enc+=String.fromCharCode(0xF0+(c>>18),0x80+(c>>12&0x3F),0x80+(c>>6&0x3F),0x80+(c&0x3F));}};return enc;};DWREngine._hexchars="0123456789ABCDEF";DWREngine._toHex=function(n){return DWREngine._hexchars.charAt(n>>4)+DWREngine._hexchars.charAt(n&0xF);};DWREngine._okURIchars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-";window.encodeURIComponent=function(s){s=DWREngine._utf8(s);var c;var enc="";for(var i=0;i<s.length;i++){if(DWREngine._okURIchars.indexOf(s.charAt(i))==-1){enc+="%"+DWREngine._toHex(s.charCodeAt(i));}else{enc+=s.charAt(i);}};return enc;}};if(typeof Array.prototype.splice==='undefined'){Array.prototype.splice=function(ind,cnt){if(arguments.length==0)return ind;if(typeof ind!="number")ind=0;if(ind<0)ind=Math.max(0,this.length+ind);if(ind>this.length){if(arguments.length>2)ind=this.length;else return[];};if(arguments.length<2)cnt=this.length-ind;cnt=(typeof cnt=="number")?Math.max(0,cnt):0;removeArray=this.slice(ind,ind+cnt);endArray=this.slice(ind+cnt);this.length=ind;for(var i=2;i<arguments.length;i++){this[this.length]=arguments[i];};for(i=0;i<endArray.length;i++){this[this.length]=endArray[i];};return removeArray;}};if(typeof Array.prototype.shift==='undefined'){Array.prototype.shift=function(str){var val=this[0];for(var i=1;i<this.length;++i){this[i-1]=this[i];};this.length--;return val;}};if(typeof Array.prototype.unshift==='undefined'){Array.prototype.unshift=function(){var i=unshift.arguments.length;for(var j=this.length-1;j>=0;--j){this[j+i]=this[j];};for(j=0;j<i;++j){this[j]=unshift.arguments[j];}}};if(typeof Array.prototype.push==='undefined'){Array.prototype.push=function(){var sub=this.length;for(var i=0;i<push.arguments.length;++i){this[sub]=push.arguments[i];sub++;}}};if(typeof Array.prototype.pop==='undefined'){Array.prototype.pop=function(){var lastElement=this[this.length-1];this.length--;return lastElement;}};



