function $(id) { return document.getElementById(id); }
function addSWF(filename, width, height, settings) {
	if (settings == undefined || settings == null) settings = {};
	
	output = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '+
						'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" '+
						'width="'+ width+ '" height="'+ height+ '" ';
	for (var property in settings) {
		output += property+ '="'+ settings[property]+ '" ';
	}
	output += '>'+
			'<param name="movie" value="'+ filename+ '" />'+
			'<param name="quality" value="high" />';
	for (var property in settings) {
		output += '<param name="'+ property+ '" value="'+ settings[property]+ '" />';
	}
	
	output += '<embed src="'+ filename+ '" quality="high" '+
					'pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" '+
					'type="application/x-shockwave-flash" width="'+ width+ '" height="'+ height+ '" ';
	for (var property in settings) {
		output += property+ '="'+ settings[property]+ '" ';
	}
	output += '></embed></object>';
	document.write(output);
}

function requireText(id, message) {
	if ($(id).value == '') {
		alert(message);
		$(id).focus();
		return false;
	}
	return true;
}
function requireDropdown(id, message) {
	if ($(id).selectedIndex < 1) {
		alert(message);
		$(id).focus();
		return false;
	}
	return true;
}

function changeCaptcha(id) {
	$(id).src = $(id).src.split('?')[0] + '?x=' + new Date().toUTCString();
}
