<!--

function LTrim(str){
	var i=0;
	var L=str.length;
	
	if(str==null){
		return(false);
	}
	
	for(i=0; i < L-1; i++){
		if(str.substr(i,1)!=' '){
			break;		
		}
	}
	
	if(i <= L-1){
		return (str.substr(i, L-i));
	}
	else{
		return ('');
	}
}

function RTrim(str){
	var i=0;
	var L=str.length;
	
	if(str==null){
		return(false);
	}
	
	for(i = L-1; i >= 0; i--){
		if(str.substr(i,1)!=' '){
			break;		
		}
	}
	
	if(i <= L-1){
		return (str.substr(0, i+1));
	}
	else{
		return ('');
	}
}

function Trim(str){
	return(RTrim(LTrim(str)));
}

function AW_getCookie(Name,newVar) {	
	   var search = Name + "="	
	   if (document.cookie.length > 0) { // if there are any cookies	
	      offset = document.cookie.indexOf(search) 	
	      if (offset != -1) { // if cookie exists 	
	         offset += search.length 	
	         // set index of beginning of value	
	         end = document.cookie.indexOf(";", offset) 	
	         // set index of end of cookie value	
	         if (end == -1) 	
	            end = document.cookie.length	
	         eval(newVar+" = unescape(document.cookie.substring(offset, end))")	
	      } 	
	   }	
	}

function AW_setCookie(name, value, days) {     
	millisecs = 1000 * 60 * 60 * 24 * eval(days);
	expire = new Date();     
 	expire.setTime (expire.getTime() + millisecs);     
   document.cookie = name + "=" + escape(value) +  "; expires=" + expire.toGMTString();
}

function verify_sh(name,pw){
	var sh_name = "CAHolder";
	var sh_pw = "share999";
	
	if(name==sh_name&&pw==sh_pw){
		AW_setCookie("caShare","name=CAHolder&pa=share999",".0002");
		window.location="shareholders.htm";
	}
	else{
		window.location="invalid.htm";
	}
}

function verify_bd(name,pw){
	var bd_name = "CABOD";
	var bd_pw = "direct888";
	
	if(name==bd_name&&pw==bd_pw){
		AW_setCookie("caBOD","name=CABOD&pa=direct888",".0002");
		window.location="bod.htm";
	}
	else{
		window.location="invalid.htm";
	}
}

function verify_ba(name,pw){
	var ba_name = "CABOA";
	var ba_pw = "advise555";
	
	if(name==ba_name&&pw==ba_pw){
		AW_setCookie("caBOA","name=CABOA&pa=advise555",".0002");
		window.location="boa.htm";
	}
	else{
		window.location="invalid.htm";
	}
}
//-->
