function fenster(name, titel, breite, hoehe) {
	var links = screen.width-breite-70;
	var oben = screen.height/2-hoehe/2-100;
	NewWin = window.open(name, titel,"width="+breite+", height="+hoehe+", top="+oben+", left="+links+", toolbar=1, location=0, status=1, scrollbars=1, resizable=1");
}

function link(url, lid) {
	

	for (var i = 0; i < document.getElementsByName("text"+lid).length ; i++) {
			if (document.getElementsByName("text"+lid)[i].style.display = "inline") {
				document.getElementsByName("text"+lid)[i].style.display = "none";
				//document.getElementsByName("code"+lid)[i].innerHTML = document.getElementsByName("code"+lid)[i].innerHTML + '<a href="#">Code Kopieren</a>'
				document.getElementsByName("code"+lid)[i].style.display = "inline";
			}
	}
		fenster(url,'',650,550);	
}

sfHover = function() {
	if (!document.getElementsByTagName) return false;
	var sfEls = document.getElementById("nav").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);

function opencoupon() {
   $("#couponbg").css("opacity",0.6).fadeIn(500,function(){
 	$("#coupondiv").css("display" , "block").animate({top : 0},500);
   });
   return false;
}

function closecoupon() {
  $("#coupondiv").animate({ top : "-50"},500).css("display" , "none"); 
  $("#couponbg").fadeOut(500); 
  return false;
}

/*
var whichElement = that.sourceIndex;

function GetElementByIndex (index) {
	if (index === undefined) {
		alert ("Your browser does not support this example!");
		return;
	}

	alert ("The position of the element: " + index);
	var elem = document.all[index];
	alert ("The tag name of the element: " + elem.tagName);
}
*/
