(function($) {
	
	var hasPlaceholderSupport = !!('placeholder' in document.createElement('input'));
	
	function fakePlaceholder() {
		$('input[type=text], input[type=password], textarea').each(function(index, el) {
			var $el = $(el), placeholder = $el.attr('placeholder');
			if(!placeholder) return;
			
			if($el.val() == '') {
				$el.val(placeholder);
			}
			$el.focus(function(e) {
				if($el.val() == placeholder) {
					$el.val('');
				}
			});
			$el.blur(function(e) {
				if($el.val() == '') {
					$el.val(placeholder);
				}
			});
		});
	}
	
	// DomContentLoaded
	$(function() {
		
		if(!hasPlaceholderSupport) {
			fakePlaceholder();
		}
		
		// Klappmenü
		$('#nav-main').supersubs({
			minWidth:6,
			maxWidth:27,
			extraWidth:1
		}).superfish({
			pathClass: 'active',
			autoArrows: false,
			dropShadows: false,
			//animation: {height:'show'},
			speed: 'fast',
			disableHI:true,
			delay:500,
			pathLevels:3      
		}).find('ul').bgIframe({opacity:false});
		
		
		// Lightbox
		$('a.imgLink').lightBox({
			imageLoading: js_href + 'lightbox/images/lightbox-ico-loading.gif',
			imageBtnPrev: js_href + 'lightbox/images/lightbox-btn-prev.gif',
			imageBtnNext: js_href + 'lightbox/images/lightbox-btn-next.gif',
			imageBtnClose: js_href + 'lightbox/images/lightbox-btn-close.gif',
			imageBlank: js_href + 'lightbox/images/lightbox-blank.gif',
			txtImage: 'Bild',
			txtOf: 'von'
		});
		
	});
	
})(jQuery);
