// QuickTalk Guestbook @version 1.1 build:20060912

function changeimg(cimg,ref)
{
	document.getElementById(cimg).src = ref
}

function vmail(id,part1,part2)
{
	document.getElementById('m'+id).href = 'mailto:'+part1+'@'+part2
	document.getElementById('i'+id).title = part1+'@'+part2
}

function hmail(str)
{
	document.getElementById('m'+id).href = 'mailto:'
	document.getElementById('i'+id).title = str
}

function validatemessage(theForm, maxLength, strError)
{
	var userAgent = navigator.userAgent.toLowerCase();
	var is_saf    = ((userAgent.indexOf('applewebkit') != -1) || (navigator.vendor == "Apple Computer, Inc."));
	var is_webtv  = (userAgent.indexOf('webtv') != -1);
	var is_kon    = (userAgent.indexOf('konqueror') != -1);
	
	//bypass Safari and Konqueror browsers with Javascript problems
	if (is_kon || is_saf || is_webtv)
	{
		return true;
	}

	strName = theForm.FFname.value;
	strMsg = theForm.FFmsg.value;
	strCode = theForm.FFcode.value;

	if (strName.length < 1)
	{
		alert(strError);
		return false;
	}
	if (strMsg.length < 1)
	{
		alert(strError);
		return false;
	}
	if (strCode.length < 1)
	{
		alert(strError);
		return false;
	}

	// check for minimum message length
	if (strMsg.length > maxLength)
	{
		alert("Message too long: Maxlenght < "+maxLength);
		return false;
	}
	// everything seems okay
	else
	{
		return true;
	}
}