// (c) 2004-2006 Rob Rohan, Richard Applebaum, and Barney Boisvert

var COLLECTIONS_VERSION="0.2";function Collection()
{this.avalues=new Array();this.asize=-1;}
Collection.prototype.size=function col_size()
{return this.asize+1;};Collection.prototype.clear=function col_clear()
{this.avalues=new Array();this.asize=-1;};Collection.prototype.toArray=function col_toArray()
{return this.avalues;};Collection.prototype.contains=function col_contains(o)
{if(this.indexOf(o)>=0){return true;}
return false;};Collection.prototype.indexOf=function col_indexOf(o)
{var l_x=0;for(;l_x<this.size();l_x++){if(this.avalues[l_x]==o){return l_x;}}
return-1;};Collection.prototype.isEmpty=function col_isEmpty()
{if(this.asize==-1)
return true;return false;};Collection.prototype.lastIndexOf=function col_lastIndexOf(o)
{var indx=-1;var l_x=0;for(;l_x<this.size();l_x++)
{if(this.avalues[l_x]==o)
{indx=l_x;}}
return indx;};Collection.prototype.get=function col_get(index)
{if(index>this.size()||index<0)
{throw new Error("Collection.get : index is > size or < 0 can't get element");}
return this.avalues[index];};Collection.prototype.remove=function col_remove(o)
{var idx=this.indexOf(o);this.removeByIndex(idx);};Collection.prototype.removeByIndex=function col_removeByIndex(index)
{if(index>this.asize)
throw new Error("Collection.remove : index is > size can't remove element");this.avalues.splice(index,1);this.asize--;};Collection.prototype.set=function col_set(index,element)
{if(index>this.asize)
throw new Error("Collection.set : index is > size can't set element");this.avalues[index]=element;};Collection.prototype.toString=function col_toString()
{var z=0;var str="[";var con="";if(this.isEmpty())
{con="empty";}
else
{for(;z<this.size();z++)
{con+=this.avalues[z]+",";}
con=con.substring(con,con.length-1);}
str+=con+"]"
return str;};function List()
{this.avalues=new Array();this.asize=-1;}
List.prototype=new Collection();List.prototype.add=function list_add(o)
{this.asize++;this.avalues[this.asize]=o;};List.prototype.toThinList=function list_toThinList(sep)
{return this.avalues.join(sep)};List.prototype.fromThinList=function list_fromThinList(list,sep)
{this.avalues=list.split(sep);this.asize=this.avalues.length;};List.prototype.toString=function list_toString()
{var z=0;var str="[";var con="";if(this.isEmpty()){con="empty";}else{con=this.toThinList(",");}
str+=con+"]"
return str;};List.prototype.toWSArray=function list_toWSArray(varname,type)
{var wsstr="<"+varname;wsstr+=" xsi:type=\"soapenc:Array\" soapenc:arrayType=\"ns2:anyType["+this.size()+"]\">";for(v=0;v<this.size();v++)
{wsstr+="<item xsi:type=\"ns2:string\">"+this.avalues[v].toString()+"</item>";}
wsstr+="</"+varname+"> ";return wsstr;};function Set()
{this.avalues=new Array();this.asize=-1;}
Set.prototype=new Collection();Set.prototype.add=function set_add(o)
{if(!this.contains(o)&&o!=null&&typeof o!="undefined")
{this.asize++;this.avalues[this.asize]=o;}};function Map()
{this.aname=new Array();this.avalue=new Array();this.asize=-1;};Map.prototype.put=function map_put(nkey,nvalue)
{if(this.contains(nkey)){this.remove(nkey);}
this.asize++;this.aname[this.asize]=nkey;this.avalue[this.asize]=nvalue;};Map.prototype.getKeysAsArray=function map_getKeysAsArray(){return this.aname;};Map.prototype.get=function map_get(keyname)
{var m_x=0;for(;m_x<this.size();m_x++){if(this.aname[m_x]==keyname){return this.avalue[m_x];}}
return null};Map.prototype.remove=function map_remove(key)
{var idx=this.indexOf(key);this.removeByIndex(idx);};Map.prototype.contains=function map_contains(keyname)
{var s=this.size();var m_i=0;for(;m_i<s;m_i++){if(this.aname[m_i]==keyname){return true;}}
return false;};Map.prototype.containsNoCase=function map_containsNoCase(keyname)
{var s=this.size();var m_i=0;for(;m_i<s;m_i++){var re=new RegExp(this.aname[m_i],"i");var a=keyname.match(re);if(a!=null&&a.length>0){return true;}}
return false;};Map.prototype.indexOf=function map_indexOf(key)
{var l_x=0;for(;l_x<this.size();l_x++){if(this.aname[l_x]==key){return l_x;}}
return-1;};Map.prototype.removeByIndex=function map_removeByIndex(index)
{if(index>this.asize)
throw new Error("Map remove index is > size can't remove key/value");this.aname.splice(index,1);this.avalue.splice(index,1);this.asize--;};Map.prototype.size=function map_size()
{return this.asize+1;};Map.prototype.toWSStruct=function map_toWSStruct(varname,id,depth)
{var frag="<"+varname+" xsi:type=\"ns2:Map\" xmlns:ns2=\"http://xml.apache.org/xml-soap\">";frag+=this.__recurse_map();frag+="</"+varname+">";return frag;};Map.prototype.__recurse_map=function()
{var wsstr="";for(var z=0;z<this.aname.length;z++)
{wsstr+="<item>";wsstr+="<key xsi:type=\"xsd:string\">"+this.aname[z].toString()+"</key>";if(this.avalue[z]==null||typeof this.avalue==undefined)
{wsstr+="<value xsi:type=\"xsd:string\" />";}
else if(this.avalue[z]instanceof Map)
{wsstr+="<value xsi:type=\"ns2:Map\">"
wsstr+=this.avalue[z].__recurse_map();wsstr+="</value>"}
else
{wsstr+="<value xsi:type=\"xsd:string\">"+this.avalue[z].toString()+"</value>";}
wsstr+="</item>";}
return wsstr;}
Map.prototype.toString=function map_toString()
{var str="[";if(this.size()>0){var m_x=0;for(;m_x<this.size();m_x++){str+=this.aname[m_x]+"="+this.avalue[m_x]+",";}
str=str.substring(0,str.length-1);}else{str+="empty"}
str+="]";return str;};