//===========================================================================
// JavaScript for masquerade any links in the page
// ©2007 Ingo Statezni - www.dotnetdevelop.de
//===========================================================================

// text templates for the replacement. Use 'DndCryptedJSText.html' to decode
var prefix  = String.fromCharCode(109, 97, 105, 108, 116, 111, 58);
var address = String.fromCharCode(109, 97, 105, 108);
var suffix  = String.fromCharCode(64, 97, 110, 100, 114, 101, 97, 115, 115, 99, 104, 110, 97, 116, 122);
var tld     = String.fromCharCode(100, 101);
var subject = String.fromCharCode();

// ID of the element for the replacement
var strLnk = "lnk";

// text sample where to find in the url for determing the replacement pages
var strArrayPages = new Array("DndTest.html", "kontakt", "impressum"); 

//===========================================================================
// don't change anything below
//===========================================================================
var ad = 0;
var mprefix  = String.fromCharCode(60, 97, 32, 104, 114, 101, 102, 61, 34);
var msuffix1 = String.fromCharCode(34, 62);
var msuffix2 = String.fromCharCode(60, 47, 97, 62);
var mpoint   = String.fromCharCode(46);
function DndCreateLink()
{
	var iTimeout = 8000;
	var iStep    = 200;
	while (null == document.getElementById(strLnk) && ad < (iTimeout/iStep))
	{
		ad++;
		setTimeout("DndCreateLink();", iStep);
		return;
	}	
	var blnIsInArray = false
	for (var i = 0; i < strArrayPages.length; i++)
	{
		blnIsInArray = (this.location.href.indexOf(strArrayPages[i]) > -1 && !blnIsInArray) ? true : blnIsInArray;
	}
	if (!blnIsInArray || null == document.getElementById(strLnk))
	{
		return;
	}
	document.getElementById(strLnk).innerHTML = mprefix + prefix + address + suffix + mpoint + tld + subject + msuffix1 + address + suffix + mpoint + tld + msuffix2;
}
window.document.onload = DndCreateLink();

