		// CAS Customer JS Library 

		// pads string with leading 0 
		function padElement(checkMe){
			if (checkMe.value.charAt(0)=="") return
			var tempMe=checkMe.value
			if(tempMe.length < 2){
				checkMe.value=0+tempMe
			}
		}

		// sets focus to specified field
		function setfocus(field_id) {
			$(field_id).focus()
		};

		// Needed to validate that input is a numeric value between 0-9
   		function isNumber(obj, strSize, strDefValue) {
			if (obj.value != "" && obj.value.length < strSize) {
    			for ( var i=0; i < strSize; i++) {     
      				if(obj.value.charAt(i)!="" ) {	    
        				if( obj.value.charAt(i) < "0" || obj.value.charAt(i) > "9") {
          					obj.value=strDefValue;
        				}
					}
     			}
			} else {
          		obj.value=strDefValue;
			}
    	}

		// Will make first letter caps if not already for each word separated by space
		function capitalizeMe(obj) {
        		val = obj.value;
        		newVal = '';
				trailSpace = '';
        		val = val.split(' ');
        		for(var c=0; c < val.length; c++) {
					if (c > 0) {
						trailSpace = ' ';
					}
                	newVal += trailSpace + val[c].substring(0,1).toUpperCase() + val[c].substring(1,val[c].length);
        		}
        		obj.value = newVal;
		};

		// Will make all caps for state abbrev or cap first letter of each word for provinces
		function capitalizeState(obj) {
        		val = obj.value;
        		newVal = '';
				trailSpace = '';
				if (val.length < 3) {
					newVal = val.toUpperCase();
				} else {
        			val = val.split(' ');
        			for(var c=0; c < val.length; c++) {
						if (c > 0) {
							trailSpace = ' ';
						}
                		newVal += trailSpace + val[c].substring(0,1).toUpperCase() + val[c].substring(1,val[c].length);
        			}
				}
        		obj.value = newVal;
		};

		// Will make all caps if not numeric
		function capitalizePostal(obj) {
        		val = obj.value;
				obj.value = val.toUpperCase();
		}

		function setOrCreateMetaTag(metaName, name, value) {
			var t = 'meta['+metaName+'='+name+']';
			var mt = $(t);
			if (mt.length === 0) {
				t = '<meta '+metaName+'="'+name+'" />';
				mt = $(t).appendTo('head');
			}
			mt.attr('content', value);
			return mt;
		}

