/**
*	CryptMail
*
*	Simple Javascript Email-Address crypter / uncrypter.
*	(C) 2005 KLITSCHE.DE // DIRK ALBAN ADLER
*	http://cryptmail.klitsche.org
*	
*	CryptMail is published under the CC-GNU LGPL
*	http://creativecommons.org/licenses/LGPL/2.1/
*
*	It is provided as is. No warrenties. No support.	
*/
function mailto (s)	
{
	document.location.href =  "mailto:" + unCryptMail(s);
}
function unCryptMail (r)  
{
	r = unescape (r);
	var l = r.length;
	var o = "";
	for (i = 0; i < l; i++)
	{
		o += String.fromCharCode (r.charCodeAt (i) - 1);
	}
	return o; 
}
function cryptMail (r) 
{
	var l = r.length;
	var o = "";
	for (i = 0; i < l; i++)
	{
		o += String.fromCharCode (r.charCodeAt (i) + 1);
	}
	return escape (o);
}

function enableActiveX (containerID)
{
	if (getInternetExplorerVersion () != -1)
	{
		// get container
		var container = document.getElementById (containerID);
		// get html in noscript
		var html = container.innerHTML;
		// place html direct in container
		container.innerHTML = html;
	}
}

function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}

// simple browser switch
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
W3C = (document.getElementById) ? 1 : 0;

function setVisibility (name, value)
{
	var css = getCSS (name);
	if (css == null) return;
	
	css.display = value;
}

function getElement (name)
{
	var elem = null; 

	if ( W3C ) 
	{
		elem = document.getElementById (name);
	} 
	else if ( NS4 ) 
	{
		elem = document.layers[name];
	} 
	else 
	{        
		// meant for IE4
		elem = document.all[name];
	}
	
	return elem;
}
function getCSS (name)
{
	var css = null; 
	var elem = getElement (name);
	
	if (elem != null)
	{
		if ( !NS4 ) 
		{
			css = elem.style;
		} 
		else 
		{      
			css = elem;
		}
	}
	return css;
}
