
Array.compare=function(a,b){
if(a<b)return -1;
if(a>b)return 1;
return 0;
}
Array.prototype.stdSort=function(desc)
{
this.sort(sortHandler);
function sortHandler(a,b){
if (a>b)return(desc) ? -1 : 1;
if (a<b)return(desc) ? 1 : -1;
return 0;
}
}
Array.compUndefined=function(a,b){
if(new String(a)=="undefined")return -1;
return 0;
}
Array.prototype.propSort=function(prop,desc)
{
this.sort(sortHandler);
function sortHandler(a,b){
if (a[prop]>b[prop])return(desc) ? -1 : 1;
if (a[prop]<b[prop])return(desc) ? 1 : -1;
return 0;
}
}
Array.compareProp=function(a,b,prop,desc){
if(desc?b[prop]>a[prop]:a<b)return -1;
if(desc?b[prop]<a[prop]:a>b)return 1;
return 0;
}
Array.prototype.copy=function(a){
var b=[];
for(var prop in this)
b[prop]=this[prop];
return b
}
try {
c.control("ArraySort","loaded");
} catch (e) {
}

