// Added by Michael Summers, 05/06/2009; edited by Oliver Pereira, 08/06/2009
// This function is to prefill the other info textbox with specific text supplied
// to this function.
// The function will only run if the PREFILL variable has been set in the product
// section template.
var PREFILL = '';

function setPreFillOtherText(text) {
	PREFILL = text;
}

/*
	// This could be inserted into specific sections or products if necessary.
	// In this instance, we'll set it globally.
	setPreFillOtherText("'s Room");
*/

function checkForSetPreFillOtherText(id) {
	if (PREFILL != '') {
		var d = document.getElementById(id);
		if (d != null) {
			var childElements = d.childNodes;
			if (childElements != null) {
				for (var i = 0, maxI = childElements.length; i < maxI; i++) {
					var childElement = childElements[i];
					if (childElement.type == 'text') {
						childElement.value = PREFILL;
					}
				}
/*
				var tbh = d.innerHTML;
				tbh = tbh.replace(/VALUE=""/i, '');
				tbh = tbh.replace(/<INPUT/i, '<INPUT VALUE="' + PREFILL + '"');
				d.innerHTML = tbh;
*/
			}
		}
	}
}

// ---------------------------------------------------------------------------