//Load Event //
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

//credits to webmatze
//mouseover submitbn 
function submit_mo() {
var inputs = document.getElementsByTagName("input");
for (var i = 0; i < inputs.length; i++) {
	if (inputs[i].type == "button" || inputs[i].type == "submit") {
		inputs[i].style.backgroundColor = "#EB6F19";
    inputs[i].style.color = "#fff";
		inputs[i].onmouseover = function() {
			this.style.backgroundColor = "#F7BF47";
      this.style.color = "#E75107";
		}
		inputs[i].onmouseout = function() {
			this.style.backgroundColor = "#EB6F19";
      this.style.color = "#fff";
		}
		inputs[i].onmousedown = function() {
			this.style.backgroundColor = "#F7BF47";
      this.style.color = "#E75107";
		}
		inputs[i].onmouseup = function() {
			this.style.backgroundColor = "#EB6F19";
      this.style.color = "#fff";
		}
	}
}
}



function externLink() {

	links = document.getElementsByTagName('a');

	for(i=0; i<links .length; i++) {
		
		/* Links in neuen Fenstern öffnen, bei validem Markup */	
    	if(links[i].className.match(/extern/)) {
			links[i].target = '_blank';
    	}
    	
		/* Bild wird in Popup geöffnet, das Markup bleibt valide */
    	if(links[i].className.match(/popup/)) {
			links[i].onclick=function() { 
				window.open(this.href,'Foto','scrollbars=no,width=680,height=520,left=250, top=200'); 
				return false;
			}
    	}
   	}
}

// mail verschl&uuml;sselung 

     	 function setMailLink(An, Dn, En) {
     		 var LinkText = An + "@" + Dn + "." + En;
     		 document.open();
 		     document.write("<a href=\"mailto:" + LinkText + "\">" + LinkText + "<\/a>");
     		 document.close();
     	   }

addLoadEvent(externLink);
addLoadEvent(submit_mo);