function isValidDate(_1,_2){
var _3=/^(\d{1,2})(\/|-)(\d{1,2})\2(\d{2}|\d{4})$/;
var _4=_1.match(_3);
if(_4==null){
if(_2){
alert("Date is not in a valid format.");
}
return false;
}
month=_4[1];
day=_4[3];
year=_4[4];
if(month<1||month>12){
if(_2){
alert("Month must be between 1 and 12.");
}
return false;
}
if(day<1||day>31){
if(_2){
alert("Day must be between 1 and 31.");
}
return false;
}
if((month==4||month==6||month==9||month==11)&&day==31){
if(_2){
alert("Month "+month+" doesn't have 31 days!");
}
return false;
}
if(month==2){
var _5=(year%4==0&&(year%100!=0||year%400==0));
if(day>29||(day==29&&!_5)){
if(_2){
alert("February "+year+" doesn't have "+day+" days!");
}
return false;
}
}
return true;
}
function padString(_6,_7,_8){
var _9=_6.toString();
while(_9.length<_8){
_9=_7+_9;
}
return _9;
}
function StringBuilder(_a){
this.strings=new Array("");
this.append=function(_b){
if(_b){
this.strings.push(_b);
}
};
this.toString=function(){
return this.strings.join("");
};
this.clear=function(){
this.strings.length=1;
};
}
function toggle(_c){
var el=document.getElementById(_c);
if(el.style.display!="none"){
el.style.display="none";
}else{
el.style.display="";
}
}
function $(){
var _e=new Array();
for(var i=0;i<arguments.length;i++){
var _10=arguments[i];
if(typeof _10=="string"){
_10=document.getElementById(_10);
}
if(arguments.length==1){
return _10;
}
_e.push(_10);
}
return _e;
}
function AJAXInteraction(url,_12,_13){
var req=init();
req.onreadystatechange=processRequest;
function init(){
if(window.XMLHttpRequest){
return new XMLHttpRequest();
}else{
if(window.ActiveXObject){
return new ActiveXObject("Microsoft.XMLHTTP");
}
}
}
function processRequest(){
if(req.readyState==4){
if(req.status==200){
if(_12&&_12.success){
_12.success(req);
}else{
if(_12&&!_12.failure){
_12(req);
}
}
}else{
if(_12&&_12.failure){
_12.failure(req);
}else{
if(_12){
_12(req);
}
}
}
}
}
this.doGet=function(){
if(_13!=null){
req.open("GET",url,_13);
}else{
req.open("GET",url,true);
}
req.send(null);
};
this.doPost=function(_15){
if(_13!=null){
req.open("POST",url,_13);
}else{
req.open("POST",url,true);
}
req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
req.send(_15);
};
}
function Hashtable(){
this.hash=new Array();
this.keys=new Array();
this.location=0;
this.put=function(key,_17){
if(_17==null){
return;
}
if(this.hash[key]==null){
this.keys[this.keys.length]=key;
}
this.hash[key]=_17;
};
this.get=function(key){
return this.hash[key];
};
this.remove=function(key){
for(var i=0;i<this.keys.length;i++){
if(key==this.keys[i]){
this.hash[this.keys[i]]=null;
this.keys.splice(i,1);
return;
}
}
};
this.size=function(){
return this.keys.length;
};
this.next=function(){
if(++this.location<this.keys.length){
return true;
}else{
return false;
}
};
this.moveFirst=function(){
try{
this.location=-1;
}
catch(e){
}
};
this.moveLast=function(){
try{
this.location=this.keys.length-1;
}
catch(e){
}
};
this.getKey=function(){
try{
return this.keys[this.location];
}
catch(e){
return null;
}
};
this.getValue=function(){
try{
return this.hash[this.keys[this.location]];
}
catch(e){
return null;
}
};
Hashtable.prototype.getKeyOfValue=function(_1b){
for(var i=0;i<this.keys.length;i++){
if(this.hash[this.keys[i]]==_1b){
return this.keys[i];
}
}
return null;
};
Hashtable.prototype.toString=function(){
try{
var s=new Array(this.keys.length);
s[s.length]="{";
for(var i=0;i<this.keys.length;i++){
s[s.length]=this.keys[i];
s[s.length]="=";
var v=this.hash[this.keys[i]];
if(v){
s[s.length]=v.toString();
}else{
s[s.length]="null";
}
if(i!=this.keys.length-1){
s[s.length]=", ";
}
}
}
catch(e){
}
finally{
s[s.length]="}";
}
return s.join("");
};
Hashtable.prototype.add=function(ht){
try{
ht.moveFirst();
while(ht.next()){
var key=ht.getKey();
this.hash[key]=ht.getValue();
if(this.get(key)!=null){
this.keys[this.keys.length]=key;
}
}
}
catch(e){
}
finally{
return this;
}
};
}
String.prototype.lTrim=function(_22){
return this.substring(_22,this.length);
};
String.prototype.rTrim=function(_23){
return this.substring(0,this.length-_23);
};
String.prototype.lPad=function(_24,_25){
var _26="",i=0;
if(!_25){
_25=" ";
}
while(i<_24){
_26+=_25;
i++;
}
return _26+this;
};
String.prototype.equals=function(str){
return this==str;
};
String.prototype.left=function(_28){
if(_28>this.length){
_28=this.length;
}
return this.substring(0,_28);
};
String.prototype.right=function(_29){
if(_29>this.length){
_29=this.length;
}
return this.substring(this.length-_29,this.length);
};

function trimString (str) 
{
	while (str.charAt(0) == ' ')
		str = str.substring(1);
		
	while (str.charAt(str.length - 1) == ' ')
		str = str.substring(0, str.length - 1);
		
	return str;
}	