function buildFlashObject(id, url, width, height, wmode, flashvars) {
	var html = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"';
	html += ' id="' + id + '"';
	html += ' width="' + width + '"';
	html += ' height="' + height + '"';
	html += ' align="middle" border="0">';
	html += '<param name="allowScriptAccess" value="always"/>';
	html += '<param name="movie" value="' + url + '"/>';
	if(wmode == 'opaque' || wmode == 'transparent')
		html += '<param name="wmode" value="' + wmode + '"/>';
	html += '<param name="FlashVars" value="' + flashvars + '"/>';
	html += '<embed name="' + id + '" src="' + url + '" width="' + width + '" height="' + height + '" align="middle" allowscriptaccess="always"';
	if(wmode == 'opaque' || wmode == 'transparent')
		html += ' wmode="' + wmode + '"';
	html += ' FlashVars="' + flashvars + '"';
	html += ' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/></embed>';
	html += '</object>';
	document.write(html);
}

function copyToClipboard(ctrl) {
	var tmp = eval("document." + ctrl);
	tmp.focus();
	tmp.select();
	if(document.all) {
		tr = tmp.createTextRange();
		tr.execCommand("Copy");
		alert("Code copied to clipboard! Now paste into your own page!");
	}
}

function getElement(elementName) {
	return (document.getElementById) ? document.getElementById(elementName) : document.all[elementName];
}

function getIFrameDocumentHeight(iframeName) {
	var actualHeight = null;
	var frame = getElement(iframeName);
	if(frame.contentDocument) { // Mozilla
		actualHeight = frame.contentDocument.body.offsetHeight;
	}
	else { // IE
		actualHeight = document.frames[iframeName].document.body.scrollHeight;
	}
	return actualHeight;
}

function iframeResize(iframeName) {
	var frame = getElement(iframeName);
	var actualHeight = getIFrameDocumentHeight(iframeName);
	frame.height = actualHeight;
}

function textCounter(field, countfield, maxlimit) {
	if(field.value.length > maxlimit)
		field.value = field.value.substring(0, maxlimit);
	else
		countfield.value = maxlimit - field.value.length;
}

function alertMsg(msg) {
	if(msg != null && msg.length > 0)
		alert(msg);
}