﻿$(function() {

	/* IE sonderbehandlung: */
	if($.browser.msie) {
		$('img[alt]').removeAttr('alt'); /* alt-Tags entfernen, damit sie nicht als Mouseover auftauchen */
		$('#navi ul li:first-child').addClass('first-child'); /* first-class nachrüsten */
	}
	
	/* Überschriften mit weissen Hintergrund */
	$('#content h1, #content h2, #content h3').wrapInner('<span></span>');

	/* Text Markieren unterbinden */
	if ($('body.nocopy').length) {
		
		document.onselectstart = function(){ return false; };
		if (window.sidebar){
			document.onmousedown=function(){ return false; };
			document.onclick=function(){ return true; };
			document.onkeydown = function(e) { 
				if (!e) e=window.event;
				if (e.ctrlKey && (e.keyCode==65)) return false;
			};
		};	
	}

	/* Lightbox aktivieren */
	if (jQuery.isFunction($.fn.lightBox )) $('.aircraftpics a, .perf_compare a').lightBox({
		overlayBgColor: '#000000',
		overlayOpacity: 0.8,
		imageLoading: '/images/lightbox/loading.gif',
		imageBtnClose: '/images/lightbox/close.gif',
		imageBtnPrev: '/images/lightbox/prev.gif',
		imageBtnNext: '/images/lightbox/next.gif',
		imageBlank: '/images/lightbox/blank.gif',
		containerBorderSize:   10,
		containerResizeSpeed: 400,
		containerResizeSpeed: 350,
		txtImage: 'Image',
		txtOf: 'of',
		keyToClose: 'c',
		keyToPrev: 'p',
		keyToNext: 'n'
    });
	
	/* Klapp Mechanismus */
	$('ul.klapp').css({listStyleType:'none'});
	$('ul.klapp>li>div').hide();
	$('ul.klapp>li').css({marginLeft:0,paddingLeft:20,background:'url(/images/layout/plusminus.gif) no-repeat 0 4px'});
	$('ul.klapp>li>strong').css({cursor:'pointer'}).toggle(function() { 
		$(this).parent().css({backgroundPosition:'-1000px 4px'});
		$(this).siblings('div').slideDown('fast'); 
	} , function() {
		$(this).parent().css({backgroundPosition:'0px 4px'});
		$(this).siblings('div').slideUp('fast'); 
	});

});
