<!-- Hiding script
var gChanged = 0
var gURL = server_path
var gSURL = "https://" + gURL.substr(7)
var gRURL = (gIsSSL) ? gSURL : gURL
var isNN = (navigator.appName.indexOf("Netscape")!=-1);
var gIsIE3 = (navigator.appVersion.indexOf("MSIE 3") != -1) ? true : false
var gIsIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false
var iLastActiveRow = 0;
var cLastActiveRowBG = '';
function go(where){
	document.body.change.value=gChanged
	document.body.to.value=where
	document.body.action= gRURL + "/moveperks.php"
	document.body.method="POST"
	document.body.submit();
}
function goHash(form, where, hash){
	document.body.hash_to.value = hash
	go(form, where)
}
function goSecure(form, where){
	document.body.change.value=gChanged
	document.body.action= gSURL + "/" + where
	document.body.method="POST"
	document.body.submit();
}
function goUnSecure(form, where){
	document.body.change.value=gChanged
	document.body.action= gURL + "/" + where
	document.body.method="POST"
	document.body.submit();
}
function makeArray(n){
	this.length = n;
  	for (i=1;i<=n;i++){
	    this[i]="";
	}
  	return this;
}
function isEmpty(field){
	var x = field
    if (x == "" || x == null){
    	return true
	}
    return false
}
function isNotEmpty(field){
	var x = field
    if (x != "" && x != null){
    	return true
	}
    return false
}
function selectedItem(selectObject){
	var x = selectObject
	var key = ""
	for (var i = 0; i < x.length; i++){
		if (x.options[i].selected){
			key = x.options[i].value
			i = x.length
		}
	}
	return key
}
function checkedItem(selectObject){
	var x = selectObject
	var key = "";
	for (var i = 0; i < x.length; i++){
		if (x[i].checked){
			key = x[i].value;
			i = x.length;
		}
	}
	return key
}
function selectItem(selectObject, item2Select){
	var key = ""
	for (var i = 0; i < selectObject.length; i++){
		if (selectObject.options[i].value == item2Select){
			key = i
			i = selectObject.length
		}
	}
	return key
}
function fieldFocus(field){
	field.focus();
}
function fieldSelect(field){
	field.select();
	fieldFocus(field);
}
function inRange(x, low, hi){
	var z = parseInt(x, 10)
    if (z < low || z > hi){return false}
    return true
}
function stripAlpha(x){
	var rn = ""
	if (x != null){
		for (var i = 0; i < x.length; i++){
			var c = x.charCodeAt(i)
			if (c > 47 && c < 58){rn += x.charAt(i)}
		}
	}
	return rn
}
function stripQuotes(rawx){
	var x = rawx.value
    while ((' ' + x).indexOf("'") > 0){x=x.replace("'", "");}	
    while ((' ' + x).indexOf('"') > 0){x=x.replace('"', "");}	
	return x
}
function stripDollarSign(rawx){
	var x = rawx.value
    while ((' ' + x).indexOf(",") > 0){x=x.replace(",", "");}	
    while ((' ' + x).indexOf("$") > 0){x=x.replace("$", "");}	
    if (isNaN(parseFloat(x))){
        x = 0
    }
	return x
}
function stripDollarSignValue(x){
    while ((' ' + x).indexOf(",") > 0){x=x.replace(",", "");}	
    while ((' ' + x).indexOf("$") > 0){x=x.replace("$", "");}	
    if (isNaN(parseFloat(x))){
        x = 0
    }
	return x
}
function formatNumber(expr, decplaces){
	var neg = false;
    var str  = "" + Math.round(eval(expr) * Math.pow(10, decplaces), decplaces)
    if (str.indexOf("NaN") > -1){str = "0";}
    if (str.indexOf("-") == 0){str = str.substr(1); neg = true;}
	while (str.length <= decplaces){str = "0" + str;}
	var decpoint = str.length - decplaces;
	if (decplaces > 0){
		str = str.substring(0,decpoint) + "." + str.substring(decpoint, str.length);
	}else{str = str.substring(0,decpoint);}
	if (neg){str = "-" + str;}
	return str;
}
function dollarize(expr){
	return "$" + formatNumber(expr, 2);
}
function percentage(expr){
	return "" + formatNumber(expr, 2) + "%";
}
function padNum(num) {
	return (num	< 10)? '0' + num : num ;
}
function setNumeric(y){
	if (y == ""){y = "0"}
	if (y == "f"){y = "0"}
	if (y == "t"){y = "1"}
	if (isNaN(y)){y = "0"}
	if (y.substr(".")){
		var x = parseFloat(y);
	}else{
		var x = parseInt(y, 10);
	}
	return x
}
function requiredOK(required, x){
	if (required && isEmpty(x.value)){return false}
	var badnames = new Array("SELF EMPLOYED")
	for (var i = 0; i < badnames.length; i++){
		if (x.value.toUpperCase().indexOf(badnames[i]) > -1){
			return false
		}
	}
	return true
}
// End script hiding -->

