jQuery(document).ready(function() {
	if (typeof jQuery.fn.fancybox != "undefined") {
		jQuery("a.fancybox, a.iframe").fancybox({
			'titlePosition' 	: 'over'
		});
	

		
		jQuery("p.fancybox a").fancybox({
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'titlePosition' 	: 'over'
		});
		
		 jQuery("a.fancybox, a.iframe").fancybox({
			'type'				: 'iframe',
			'width'				: 900,
			'height'			 	: 800		
		});
		

		/* This is basic - uses default settings */
		jQuery(".fancybox, a[rel=lightbox]").fancybox({
			'transitionIn'		: 'none',
			'transitionOut'	: 'none',
			'titlePosition' 	: 'over',
			'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
				return '<span id="fancybox-title-over">Bild ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
			}
		});

		
	}
	
	/**
	 * init click events for search-field
	 */
	 jQuery.searchPlaceholder = "Suchbegriff eingeben!";
	jQuery("#searchformTerm").focus(function(evt) {
		if (jQuery(this).val() == jQuery.searchPlaceholder) {
			jQuery(this).removeClass("placeholder");
			jQuery(this).val("");
		}
	});
	jQuery("#searchformTerm").blur(function(evt) {
		if (jQuery.trim(jQuery(this).val()) == '') {
			jQuery(this).addClass("placeholder");
			jQuery(this).val(jQuery.searchPlaceholder);
		}
	});
	if (jQuery.trim(jQuery("#searchformTerm").val()) == '' || jQuery("#searchformTerm").val() == jQuery.searchPlaceholder) {
		jQuery("#searchformTerm").addClass("placeholder");
		jQuery("#searchformTerm").val(jQuery.searchPlaceholder);
	}

});
/*	$(document).ready(function() {
		/* This is basic - uses default settings */
	/*$("a[rel=example_group]").fancybox({
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'titlePosition' 	: 'over',
			'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
				return '<span id="fancybox-title-over">Bild ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
			}
		});
	});

*/


/*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;
		  	}
			
	  	} // End for
	  
    } // End if
}

window.addEventListener?window.addEventListener('load',noSpam,false):window.attachEvent('onload',noSpam);
