/* 
	 Helper JS
	------------------------------

	jansass.com Hamburg | image on- and above-the-line

	Unser City-Office: Colonnaden 15 - 20354 Hamburg
	Unser Work-Office: Semperstrasse 77 - 22303 Hamburg

	Telefon 040-300 36 844 | Telefax 040-300 36 845 
	http://www.jansass.com | City-Office: c/o Büro Pur

*/

/*MM Jumpmenu*/
function MM_jumpMenuGo(objId,targ,restore){ //v9.0
  var selObj = null;  with (document) { 
  if (getElementById) selObj = getElementById(objId);
  if (selObj) eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0; }
}

/*MM preload Images*/
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}




/*Suckerfish menu IE function*/
sfHover = function() {
	if (window.document.getElementById("suckerfish") == null)
return;
	var sfEls = window.document.getElementById("suckerfish").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}


if (window.attachEvent) window.attachEvent("onload", sfHover);


vmenu1 = function() {
	if (window.document.getElementById("vmenu1") == null)
return;
	var sfEls = window.document.getElementById("vmenu1").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", vmenu1);

vmenu2 = function() {
	if (window.document.getElementById("vmenu2") == null)
return;
	var sfEls = window.document.getElementById("vmenu2").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", vmenu2);

/*


newsbox = function() {
	if (window.document.getElementById("newsbox") == null)
return;
	var sfEls = window.document.getElementById("newsbox").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", newsbox);



*/








  function getx(node) {
    var xPos = node.offsetLeft;
    node = node.offsetParent;
    while (node != null) {
      xPos += node.offsetLeft;
      node = node.offsetParent;
    }
    return xPos;
  }

  function gety(node) {
    var yPos = node.offsetTop;
    node = node.offsetParent;
    while (node != null) {
      yPos += node.offsetTop;
      node = node.offsetParent;
    }
    return yPos;
  }

  function BubbleUp(obj) {
    var imgobj = document.getElementById('bubelement');
    document.getElementById('bubimg').src = obj.src;
    imgobj.style.top = gety(obj) + 'px';
    imgobj.style.left = getx(obj) + 'px';
    imgobj.style.visibility='visible';
  }

  function BubbleUpBig(obj) {
    var imgobj = document.getElementById('bubelement');
	var isrc = obj.src;
	isrc = isrc.substring (0, isrc.length-4) +"-big.jpg";
    document.getElementById('bubimg').src = isrc;
	imgobj.style.top = gety(obj) + 'px';
    imgobj.style.left = getx(obj) + 'px';
    imgobj.style.visibility='visible';
  }


/*  mail protect:  */
		var browserName = navigator.appName;
		var browserVer = parseInt(navigator.appVersion);
		var version = "";
		var msie4 = (browserName == "Microsoft Internet Explorer" && browserVer >= 4);
		if ((browserName == "Netscape" && browserVer >= 3) || msie4 || browserName=="Konqueror" || browserName=="Opera") {version = "n3";} else {version = "n2";}
			// Blurring links:
		function blurLink(theObject)	{	//
			if (msie4)	{theObject.blur();}
		}
		
			// decrypt helper function
		function decryptCharcode(n,start,end,offset)	{
			n = n + offset;
			if (offset > 0 && n > end)	{
				n = start + (n - end - 1);
			} else if (offset < 0 && n < start)	{
				n = end - (start - n - 1);
			}
			return String.fromCharCode(n);
		}
			// decrypt string
		function decryptString(enc,offset)	{
			var dec = "";
			var len = enc.length;
			for(var i=0; i < len; i++)	{
				var n = enc.charCodeAt(i);
				if (n >= 0x2B && n <= 0x3A)	{
					dec += decryptCharcode(n,0x2B,0x3A,offset);	// 0-9 . , - + / :
				} else if (n >= 0x40 && n <= 0x5A)	{
					dec += decryptCharcode(n,0x40,0x5A,offset);	// A-Z @
				} else if (n >= 0x61 && n <= 0x7A)	{
					dec += decryptCharcode(n,0x61,0x7A,offset);	// a-z
				} else {
					dec += enc.charAt(i);
				}
			}
			return dec;
		}
			// decrypt spam-protected emails
		function linkTo_UnCryptMailto(s)	{
			location.href = decryptString(s,-1);
		}

