/*
 * Copyright (c) 2007 VoiceQuilt. All Rights Reserved.
 */
var scheme = "&#109;&#97;&#105;&#108;&#116;&#111;&#58;";
var d1 = "&#64;&#118;&#111;&#105;&#99;&#101;&#113;&#117;&#105;&#108;&#116;";
var d2 = "&#46;&#99;&#111;&#109;";

function Contact(linkText, hoverText, who, sbj, bdy) {
	var sep = '?';
	
	document.write('<a href="' + scheme);
	if (who != null && who.length > 0)
	    document.write(who + d1 + d2);
	if (sbj != null && sbj.length > 0) {
		document.write(sep + 'subject=' + sbj);
		sep = '&';
	}
	if (bdy != null && bdy.length > 0) {
		document.write(sep + 'body=' + bdy);
		sep = '&';
	}
	document.write('"');
	if (hoverText != null && hoverText.length > 0)
		document.write(' title="' + hoverText + '"');
	document.write('>');
	if (linkText != null && linkText.length > 0)
		document.write(linkText);
	else
		document.write(who + d1 + d2);
	document.write('</a>');
}

function ContactImg(imgSrc, hoverText, who, sbj, bdy) {
	var sep = '?';
	
	document.write('<a href="' + scheme);
	if (who != null && who.length > 0)
	    document.write(who + d1 + d2);
	if (sbj != null && sbj.length > 0) {
		document.write(sep + 'subject=' + sbj);
		sep = '&';
	}
	if (bdy != null && bdy.length > 0) {
		document.write(sep + 'body=' + bdy);
		sep = '&';
	}
	document.write('"');
	if (hoverText != null && hoverText.length > 0)
		document.write(' title="' + hoverText + '"');
	document.write('>');
	if (imgSrc != null && imgSrc.length > 0)
		document.write('<img src="' + imgSrc + '" alt="" align="absbottom" />');
	else
		document.write(who + d1 + d2);
	document.write('</a>');
}

function mailTo(to, subj, bdy, d1, d2) {
	var sep = "?";
	var uri = unescape("%6D%61%69%6C%74%6F%3A");
	if (to != null && to.length > 0) {
		uri += to;
		if (d1 != null && d1.length > 0) {
			uri += unescape("%40") + d1;
			if (d2 != null && d2.length > 0)
				uri += unescape("%2E") + d2;
		}
		else
			uri += unescape("%40") + unescape("%76%6F%69%63%65%71%75%69%6C%74") + unescape("%2E") + unescape("%63%6F%6D");
	}
	if (subj != null && subj.length > 0) {
		uri += sep + "subject=" + escape(subj);
		sep = "&";
	}
	if (bdy != null && bdy.length > 0)
		uri += sep + "body=" + escape(bdy);
	// alert("uri is " + uri);
	w = window.open("", "", "width=1,height=1,location=0,status=0,toolbar=0,menubar=0,directories=0,resizable=0,scrollbars=0");
	w.blur();
	w.location = uri;
	w.close();
}
