
/* The function hide_email
 * 
 * This function uses both special HTML characters and JavaScript to hide 
 * email addresses from address harvesters.
 *
 * It can take 1 or 3 arguments. If there's only one argument it defaults
 * to Tanner de Witt's domain name. Otherwise it assumes arg0@arg1.arg2.
 *
 * Written by Andy Bell, 1 June 2003.
 */
function hide_email(address)
{
	var args = hide_email.arguments;

	if (args.length == 1)
	{
		/* This writes "email: "
		document.write('&#101;&#109;&#97;&#105;&#108;&#58; ');
		*/
		/* mailto: */
		document.write('<a class="email" href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;');
		document.write(address);
		document.write('&#64;&#116;&#97;&#110;&#110;&#101;&#114;&#100;&#101;&#119;&#105;&#116;&#116;&#46;&#99;&#111;&#109;?Subject=Enquiry from Tanner De Witt Website">');
		document.write(address);
		document.write('&#64;&#116;&#97;&#110;&#110;&#101;&#114;&#100;&#101;&#119;&#105;&#116;&#116;&#46;&#99;&#111;&#109;</a>');
	}
	else
	{
		document.write('<a class="email" href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;');
		document.write(args[0]);
		document.write('&#64;'); /* at */
		document.write(args[1]);
		document.write('&#46;'); /* dot */
		document.write(args[2]);
		document.write('">');
		document.write(args[0]);
		document.write('&#64;');
		document.write(args[1]);
		document.write('&#46;');
		document.write(args[2]);
		document.write('</a>');
	}
}

/*
 * Version of the above for contact info for local mail client
 */
function hide_contact_email(name, address)
{
		document.write('<a alt="Email" title="Send an email to ');
		document.write(name);
		document.write('" href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;');
		document.write(address);
		document.write('&#64;&#116;&#97;&#110;&#110;&#101;&#114;&#100;&#101;&#119;&#105;&#116;&#116;&#46;&#99;&#111;&#109;?Subject=Enquiry from Tanner De Witt Website">');
		document.write('<img src="/images/email.gif" style="clear: both; float: left; margin:0px 4px 0px 0px;"></a>');

		document.write('<a class="email" title="Send an email to ');
		document.write(name);
		document.write('" href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;');
		document.write(address);
		document.write('&#64;&#116;&#97;&#110;&#110;&#101;&#114;&#100;&#101;&#119;&#105;&#116;&#116;&#46;&#99;&#111;&#109;?Subject=Enquiry from Tanner De Witt Website">');
		document.write('Email</a>');
}

function hide_contact_email_zh(name, address)
{
		document.write('<a alt="&#38651;&#37109;" title="&#23492;&#38651;&#37109;&#21040;');
		document.write(name);
		document.write('" href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;');
		document.write(address);
		document.write('&#64;&#116;&#97;&#110;&#110;&#101;&#114;&#100;&#101;&#119;&#105;&#116;&#116;&#46;&#99;&#111;&#109;?Subject=Enquiry from Tanner De Witt Website">');
		document.write('<img src="/images/email.gif" style="clear: both; float: left; margin:0px 4px 0px 0px;"></a>');

		document.write('<a class="email" title="&#23492;&#38651;&#37109;&#21040;');
		document.write(name);
		document.write('" href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;');
		document.write(address);
		document.write('&#64;&#116;&#97;&#110;&#110;&#101;&#114;&#100;&#101;&#119;&#105;&#116;&#116;&#46;&#99;&#111;&#109;?Subject=Enquiry from Tanner De Witt Website">');
		document.write('&#38651;&#37109;</a>');
}

function Popup(page, name, width, height, scroll) 
{
	var left = (screen.width - width) / 2;
	var top = (screen.height - height) / 2;
	features = 'height=' + height + ',width=' + width + ',top=' + top + ',left=' + left + ',scrollbars=' + scroll + ',resizable=yes toolbar=no'
	win = window.open(page, name, features)
	if (parseInt(navigator.appVersion) >= 4) 
	{ 
		win.window.focus(); 
	}
}

function preLoadImages()
{
  var t = '<layer top="-100" left="0" visibility="hide"><div style="position:absolute; top:-100px; left:0px; visibility:hidden">';
  
  for (i = 0; i < arguments.length; i++)
	  t += '<img src="' + arguments[i] + '" height="10" width="10">';

  t += '</div></layer>';
  
  document.write(t);
}

function swapImage(imgN,imgU)
{
  if (document.images)
	  document.images[imgN].src = imgU;
}

function showImage(imgN)
{
  if (document.images)
	  document.images[imgN].style.visibility='visible';
}

function hideImage(imgN)
{
  if (document.images)
	  document.images[imgN].style.visibility='hidden';
}

function show(id)
{
	if (document.getElementById)
		document.getElementById(id).style.display = "block";
	else if (document.all)
		document.all[id].style.display = "block";
	else if (document.layers)
		document.layers[id].style.display = "block";
}

function hide(id)
{
	if (document.getElementById)
		document.getElementById(id).style.display = "none";
	else if (document.all)
		document.all[id].style.display = "none";
	else if (document.layers)
		document.layers[id].style.display = "none";
}

function jumpto(select) 
{
	var URL = select.options[select.selectedIndex].value ;
	if (URL!="")
		document.location.href = URL;
}

var cleared = false;

function ClearSearch()
{
	if (!cleared)
	{
		var input = document.getElementsByName('zoom_query')[0];
		  input.value='';
	}

	cleared = true;
}

function show_hidden()
{
	var hidden = document.getElementById("hidden");
	hidden.style.display = "block";
	
	var show = document.getElementById("show");
	show.style.display = "none";
}
