function input_mask(input,mask) {
	//alert(object.value+' - '+mask);
	result = '';
	for (i=0;i<=mask.length;i++) {
		if (!input[i]) {
			break; //end if the input is shorter than the mask
		}
		ichar = input.charCodeAt(i);
		switch(mask[i]) {
			case '#': 
				if (ichar>=48 && ichar<=57) { //numeric, ascii 48-57
					result += input[i];
				} else {
					return result;			
				}
				break;
			case 'A': 
				if ((ichar>=65 && ichar<=90) || (ichar>=97 && ichar<=122)) { //alpha, ascii 65-90,97-122
					result += input[i];
				} else {
					return result;			
				}			
				break;	
			case '/': 
				if (input[i]=='/') { //must be a slash
					result += input[i];
				} else {
					return result;			
				}			
				break;	
			case '-': 
				if (input[i]=='-') { //must be a dash
					result += input[i];
				} else {
					return result;			
				}			
				break;
		}			
	}	
	return result;
}
