/* Author: Andreas Walter */
/* Company: Euroweb Internet GmbH */
/* Copyright: 2010 - Andreas Walter & Euroweb Internet GmbH */

/* ///////////////////////////////////////////////////////////
	=> mailmask 
/////////////////////////////////////////////////////////// */

function noSpam() {
	if (document.getElementById) {
		var at = "@";
		var links = document.getElementsByTagName('a');
		for (var i = 0; i < links.length; i++) {
			var linkElem = links[i];
			if (linkElem.className == 'escape') {
				var mail = linkElem.firstChild; var domain = linkElem.lastChild;
				mail.nextSibling.firstChild.innerHTML = at;
				linkElem.href = "mailto:" + mail.data + at + domain.data;
			}
		}
	}
}

/* ///////////////////////////////////////////////////////////
	=> smoothScroll 
/////////////////////////////////////////////////////////// */

function smoothScroll() {
	$('a[href*=#top]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')	&& location.hostname == this.hostname) {
			var $target = $(this.hash);
			$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
			if ($target.length) {
				var targetOffset = $target.offset().top;
				$('html,body').animate({scrollTop: targetOffset}, 500);
				return false;
			}
		}
	});
}


/* ///////////////////////////////////////////////////////////
	=> on load 
/////////////////////////////////////////////////////////// */

Cufon.replace(['h2','h3'],{fontFamily:'Collegia'})('h2 strong',{fontFamily:'English'});

$(function(){	   
	noSpam();
	smoothScroll();
	$('.colorbox').colorbox({maxWidth:"90%",maxHeight:"90%"});
	$("[rel='lightbox']").colorbox({maxWidth:"90%",maxHeight:"90%"});
	$('#navi-add2 .link1 a').colorbox({iframe:true,width:900,height:'90%'});
});
