var sInvalidChars
sInvalidChars = "1234567890";
var iTotalChecked = 0;

var vowelRegx = /[a|e|i|o|u]/
var iAllowPlus  = 1;
var iAllowSpace = 1;

function strtrim() {
    return this.replace(/^\s+/,'').replace(/\s+$/,'');
}
	
String.prototype.trim = strtrim;



var chkBoxCount = 0;

function createXMLHttpRequest() {
		var ua;
		if(window.XMLHttpRequest) {
			try {
				ua = new XMLHttpRequest();
			} catch(e) {
				ua = false;
			}
		} else if(window.ActiveXObject) {
			try {
				ua = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e) {
				ua = false;
			}
		}
		return ua;
	}

function AddToOptionList(OptionList, OptionValue, OptionText) { 
		OptionList[eval(OptionList.length)] = new Option(OptionText, OptionValue);
	}

function ClearOptions(OptionList) { 
		for(x=eval(OptionList.length); x>=0; x--) {
			OptionList[x] = null;
		}
	}


/* custom function for universal replace  */
function replace(argvalue, x, y) {

  if ((x == y) || (parseInt(y.indexOf(x)) > -1)) {
    errmessage = "replace function error: \n";
    errmessage += "Second argument and third argument could be the same ";
    errmessage += "or third argument contains second argument.\n";
    errmessage += "This will create an infinite loop as it's replaced globally.";
    alert(errmessage);
    return false;
  }
    
  while (argvalue.indexOf(x) != -1) {
    var leading = argvalue.substring(0, argvalue.indexOf(x));
    var trailing = argvalue.substring(argvalue.indexOf(x) + x.length, 
	argvalue.length);
    argvalue = leading + y + trailing;
  }

  return argvalue;

}



