function buildHtml()
	{
	if(txtLogoUrl_timerID)
		{
		window.clearTimeout(txtLogoUrl_timerID);
		}

	txtLogoUrl_timerID = 0;

	var oForm = document.forms["oHtmlBuilderForm"];
	var sLogoName = "Secure Site";
	var sLogo = "large";
	var sCode = "SC";
	var sAutoMove = "topright";

	oForm.txtHtml.value = 
	"<!-" + "-\n" 
	+ "-------------------------------\n" 
	+ "--    HTML Code Generator    --\n" 
	+ "-- http://www.trustlogo.info --\n" 
	+ "-------------------------------\n" 
	+ "/" + "/" + "-" + "-" + ">\n"
	+ "<script type=\"text/javascript\">TrustLogo("
	+ "\"" + htmlEncode(oForm.txtLogoUrl.value) + "\"," 
	+ "\"" + oForm.selLogoType.value + "\","
	+ "\"" + oForm.selFloatType.value 
	+ "\");</script>";

	if(oForm.txtLogoUrl.value.match(/^https?\:\/\/.*\/.*/))
		{
		document.images["imgLogoUrl"].src = oForm.txtLogoUrl.value;
		}
	}

function htmlEncode(str)
	{
	return String(str)
		.replace(/\&/g, "&amp;")
		.replace(/\</g, "&lt;")
		.replace(/\>/g, "&gt;")
		.replace(/\'/g, "&#27;")
		.replace(/\"/g, "&#22;")
		;
	}

function form_onsubmit()
	{
	buildHtml();
	}

var txtLogoUrl_timerID = 0;

function txtLogoUrl_onKeyPress()
	{
	if(txtLogoUrl_timerID)
		{
		window.clearTimeout(txtLogoUrl_timerID);
		txtLogoUrl_timerID = 0;
		}
	txtLogoUrl_timerID = window.setTimeout("buildHtml();", 500);
	}

