function WriteFlash (strFile, strId, strClass, intWidth, intHeight, objParams, strAltHTML)
{
	document.write ('<object ');
	document.write ('id="' + strId + '"');
	document.write ('class="' + strClass + '"');
	document.write ('width="' + intWidth + '"');
	document.write ('height="' + intHeight + '"');

	if (navigator.userAgent.indexOf("MSIE") != -1) {
		document.write ('classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"');
		document.write ('codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0">');
	} else {
		document.write ('data="' + strFile + '"');
		document.write ('type="application/x-shockwave-flash">');
	}

	if (objParams) {
		for (var i in objParams) {
			document.write('<param name="' + i + '" value="' + objParams[i] + '" />');
		}
	}

	document.write ('<param name="movie" value="' + strFile + '" />');

	if (strAltHTML) {
		document.write(strAltHTML);
	}

	document.write ('</object>');
}

function go(loc)
{
	document.location.href = loc;
}

function goBack()
{
	history.back();
}

function goHide(obj)
{
	obj.style.display = 'none';
}

function goFocus(obj)
{
	obj.focus();
}

function goShow(obj)
{
	obj.style.display = 'block';
}

function goDisable(obj)
{
	obj.disabled = true;
}

function goEnable(obj)
{
	obj.disabled = false;
}

function goClearField(obj, text)
{
	if (obj.value == text) obj.value = '';
}

function goFillField(obj, text)
{
	if (obj.value == '') obj.value = text;
}

function goClearFieldBg(elem)
{
	if (elem.value == '') {
		elem.style.backgroundImage = 'none';
	}
}

function goFillFieldBg(elem, bg)
{
	if (elem.value == '') {
		elem.style.backgroundImage = 'url(' + bg + ')';
	}
}
	
function goPopup(where)
{
	window.open(where);
}

function goPopupMinimal(loc,w,h)
{
	var leftVal = (screen.width / 2) - (w/2);
	var topVal = (screen.height / 2) - (h/2);
	window.open (loc, 'new_window', 'left=' +leftVal+ ',top=' + topVal + ',toolbar=no,width=' + w + ',height=' + h + ',status=no,resizable=yes,menubar=no,location=no,scrollbars=yes');
}

function goPopupImage(loc)
{
	var w = 640;
	var h = 480;
	var leftVal = (screen.width / 2) - (w/2);
	var topVal = (screen.height / 2) - (h/2);
	window.open (loc, 'new_window', 'left=' +leftVal+ ',top=' + topVal + ',toolbar=no,width=' + w + ',height=' + h + ',status=no,resizable=yes,menubar=no,location=no,scrollbars=no');
}

function doAjaxRequest(strUrl, elem)
{
	ajax = new sack();
	ajax.method = "GET";
	ajax.requestFile = strUrl;
	ajax.element = elem;
	ajax.runAJAX();
}

function getFormFields(objForm)
{
	/* Return false if the form could not be found */
	if (! objForm) return false;

	/* Create object for storing form fields and their values */
	objParams = new Object;

	/* Get all input fields */		
	inputFields = objForm.getElementsByTagName("input");

	/* Loop input fields */
	for (i=0;i<inputFields.length;i++) {

		strName = inputFields[i].name;
		strType = inputFields[i].type;
		strValue = inputFields[i].value;

		switch (strType) {
			case 'text':
			case 'hidden':
			case 'password':
			case 'button':
			case 'submit':
			case 'reset':
			case 'image':
			case 'file':
				objParams[strName] = strValue;
			break;
			case 'checkbox':
			case 'radio':
				if (inputFields[i].checked)
					objParams[strName] = strValue;
			break;
		}
	}
	
	/* Get all single/multiple select fields */
	selectFields = objForm.getElementsByTagName("select");

	/* Loop select fields */
	for (i=0;i<selectFields.length;i++) {

		strName = selectFields[i].name;
		strType = '';
		strValue = '';

		for (j=0;j<selectFields[i].options.length;j++) {
			if (selectFields[i].options[j].selected) {
				if (strValue.length)
					strValue += ',';
				strValue += selectFields[i].options[j].value;
			}
		}
		objParams[strName] = strValue;
	}
	
	/* Return object of form field/value pairs */
	return objParams;
}

function goSwapImage(strId, strImage, strAlt)
{
	var theElem = document.getElementById(strId);
	
	if (! theElem) {
		return;
	}
	
	if (theElem.tagName.toLowerCase() == 'img') {
		theElem.src = strImage;
		if (strAlt !== null) {
			theElem.alt = strAlt;
		}
	}
}