
<!--
var logCounter = 0;
function log() {
	text = arguments[0];
	logCounter++;
	document.TestForm.debug.value = logCounter + ": " + text + "\n" + document.TestForm.debug.value;
}
function listProperties(obj) {
	var names = "";
	for (var i in obj) {
		names += i + " = " + obj[i] + " --- ";
	}
	return names;
}
function goTo(url) {
	document.location.href = url;
}
function ourReload() {
	if (innerWidth != originalWidth || innerHeight != originalHeight) {
		window.location.reload();
	}
}
function show(id) {
	if (ns4) {
		document.layers[id].visibility = way2show;
	} else {
		if (ie4) {
			document.all[id].style.visibility = way2show;
		} else {
			if (ns6) {
				document.getElementById(id).style.visibility = way2show;
			}
		}
	}
}
function hide(id) {
	if (ns4) {
		document.layers[id].visibility = way2hide;
	} else {
		if (ie4) {
			document.all[id].style.visibility = way2hide;
		} else {
			if (ns6) {
				document.getElementById(id).style.visibility = way2hide;
			}
		}
	}
}
function hideTags(tag) {
	if (ie4) {
		for (var i = 0; i < document.all.tags(tag).length; i++) {
			document.all.tags(tag)[i].style.visibility = way2hide;
		}
	}
}
function showTags(tag) {
	if (ie4) {
		for (var i = 0; i < document.all.tags(tag).length; i++) {
			document.all.tags(tag)[i].style.visibility = way2show;
		}
	}
}
// constructor function for UcgArray- accepts elements as an optional arguments...
function UcgArray() {
	this.length = arguments.length;
	for (var ct = 0; ct < this.length; ct++) {
		this[ct] = arguments[ct];
	}
	return this;
}
UcgArray.prototype.push = function () {
	if (arguments.length == 0) {
		return false;
	}
	for (var i = 0; i < arguments.length; i++) {
		this[this.length++] = arguments[i];
	}
	return true;
};
UcgArray.prototype.pop = function () {
	return this[this.length--];
};
function startsWith(prefix, s) {
	return s.length > prefix.length && s.substr(0, prefix.length) == prefix;
}
function trimPrefix(prefix, s) {
	if (s.length > prefix.length && s.substr(0, prefix.length) == prefix) {
		return s.substr(prefix.length, s.length);
	} else {
		return "";
	}
}
function isBlank(s) {
	match = s.match(/\S/);
  //alert("blank = [" + match + "]");
	return match == null;
}
function trim(s) {
	var ret;
	var match = s.match(/[^ ](.*[^ ])?/);
	if (match == null) {
		ret = "";
	} else {
    //alert("match = " + listProperties(match));
    //alert("match[0] = " + listProperties(match[0]));
		ret = match[0];
	}
  //alert("trim 1 = [" + ret + "]");
	return ret;
}
/*function used to ensure rtextarea limit*/
function textCounter(field) {
	if (field.value.length > 400) {
		field.value = field.value.substring(0, 400);
		alert("You have already entered the maximum number of characters allowed.");
	}
}
/*When the user check blank gift card checkbox, disable the gift message area, and vice versa. */
function diableGiftMsgTxtarea(blnkGCField, giftMsgField) {
	if (blnkGCField.checked == true) {
		giftMsgField.disabled = true;
	} else {
		giftMsgField.disabled = false;
	}
}
//-->

