window.addEventListener?window.addEventListener("load",init,false):window.attachEvent("onload",init);

//---------------------------------------------------[ initialize ]
function init()
{
	var userAgent = navigator.userAgent;
	var msIE6 = userAgent.indexOf('MSIE 6.0') != -1;
	var msIE55 = userAgent.indexOf('MSIE 5.5') != -1;
	if (msIE6 || msIE55)
	{
		findPNGs();
	}
	loadJavascript('../media/mail/elvis.js');
}

//-----------------------------------------[ find: all PNG images ]
function findPNGs()
{
	if (!document.getElementsByTagName) return; 
	var images = $A(document.getElementsByTagName("IMG")); 
	images.each( function(image)
	{ 
		var imageSrc = image.src;
		var regex = /.png/
		var foundPNG = regex.test(imageSrc);
		if (foundPNG)
		{
			fixPNG(image);
		}
	});
}

//----------------------------------------[ fix: PNG display ]
function fixPNG(imageRef)
{
	var imgID = (imageRef.id) ? "id='" + imageRef.id + "' " : "";
	var imgClass = (imageRef.className) ? "class='" + imageRef.className + "' " : "";
	var imgTitle = (imageRef.title) ? "title='" + imageRef.title + "' " : "title='" + imageRef.alt + "' ";
	var imgStyle = "display: block;" + imageRef.style.cssText;
	var strNewHTML = "<span " + imgID + imgClass + imgTitle;
	strNewHTML += " style=\"" + "width:" + imageRef.width + "px; height:" + imageRef.height + "px;" + imgStyle; // + ";";
	strNewHTML += "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
	strNewHTML += "(src=\'" + imageRef.src + "\', sizingMethod='image');\"></span>";
	imageRef.outerHTML = strNewHTML;
}

//-------------------------[ SETUP: train connection from passed index value. ]
function mystery( indexValue, subjectText )
{
	var mystery ="109,97,105,108,116,111,58,"; // setup code.
	var train = "?subject=" + subjectText; // setup subject as string.
	var coming = "&body=";
	
	mystery += return2sender(indexValue * 1); // get required code.
	var decode = mystery.split(","); // setup array from encoded.
	mystery = ""; // setup source variable as string.
	for (var e = 0; e < decode.length; e++)
	{
		mystery += String.fromCharCode(decode[e]); // decode as string.
	}
	document.location = mystery + train + coming; // Write call.
}

//------------------------------------------------[ load: JAVASCRIPT ]
function loadJavascript(fileName)
{
	var thisHTML = document.getElementsByTagName('head').item(0);
	var scriptObject = document.createElement('script');
	//scriptObject.setAttribute('language', 'javascript');
	scriptObject.setAttribute('type', 'text/javascript');
	scriptObject.setAttribute('src', 'support/' + fileName);
	thisHTML.appendChild(scriptObject);
}
