//Check if the strings match
function IsMatch(txt,txt2){
	return (txt == txt2);
}//func

//Checks if a String is not empty
function IsNotEmpty(txt){
	return (txt != "");
}//func

//Checks if a string is below max length
function IsMaxLength(txt,v){
	return (txt.length <= v);
}//func

//checks if string is above min length
function IsMinLength(txt,v){
	return (txt.length >= v);
}//func

//Checks if form element has been selected (select,checkbox,checkbox array,radio and radio array)
function IsSelected(chk){
	var ary = (chk.length && chk.type != "select-one" && chk.type != "select-multiple")? chk:[chk]; // 		
	var isSel = false;

	for(var x=0; x < ary.length; x++){
		switch(ary[x].type){
			case "radio":
			case "checkbox":
				if(ary[x].checked) isSel = true;
				break;
				
			case "select-one":
				if(ary[x].value != "") isSel = true;
				break;
				
			case "select-multiple":
				isSel = (ary[x].selectedIndex >= 0);
				break;
		}//switch
	}//for

	return isSel;
}//func