/* Copyright 2009 marcel hauri fotografie */
$(window).load(function(){$('div.desc').each(function(){ $(this).css('opacity', 0); $(this).css('width', $(this).siblings('img').width()); $(this).parent().css('width', $(this).siblings('img').width()); $(this).css('display', 'block');});	
$('.lb-box').hover(function(){$(this).children('.desc').stop().fadeTo(500, 0.6);},function(){$(this).children('.desc').stop().fadeTo(500, 0);});});
$(document).ready(function () {$(document).keydown(function(e){switch(e.keyCode){case 40: case 63233: case 39: $("#lightbox").scrollTo('+=50px', 10, {axis:'x'}); break; case 38: case 63235: case 37: $("#lightbox").scrollTo('-=50px', 10, {axis:'x'}); break; case 35: $("#lightbox").scrollTo({top:'0px', left:'12000px'}, 10);	break; case 36: $("#lightbox").scrollTo({top:'0px', left:'0px'}, 10); break;}});
$('#lightbox').mousedown(function (event) { $(this).data('down', true).data('x', event.clientX).data('scrollLeft', this.scrollLeft); return false;}).mouseup(function (event) {	$(this).data('down', false); }).mousemove(function (event) {if ($(this).data('down') == true) {	this.scrollLeft = $(this).data('scrollLeft') + $(this).data('x') - event.clientX;}}).mousewheel(function (event, delta) {this.scrollLeft -= (delta * 60);}).css({'overflow' : 'hidden','cursor' : '-moz-grab'});});
$(window).mouseout(function (event) {if ($('#lightbox').data('down')) {try {if (event.originalTarget.nodeName == 'BODY' || event.originalTarget.nodeName == 'HTML') {$('#lightbox').data('down', false);}} catch (e) {}	}});
function clickIE() {if (document.all) {return false;}} 
function clickNS(e) {if (document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) {return false;}}} 
if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} 
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} document.oncontextmenu=new Function("return false"); 
function clearInput(txt) {if (txt.value == txt.defaultValue) {txt.value = ""}}
function mhf_window(url,breite,hoehe){var url = url; fenster = window.open(url,'MHP','scrollbars=0,width='+breite+',height='+hoehe+',toolbar=0,status=0,menubar=0,links=0,resizable=0'); fenster.moveTo(0,0); }
jQuery.preloadImages = function(){for(var i = 0; i<arguments.length; i++){jQuery("<img>").attr("src", arguments[i]);}}
var Browser = { detect: function() { var UA = navigator.userAgent; this.isKHTML = /Konqueror|Safari|KHTML/.test(UA); this.isGecko = (/Gecko/.test(UA) && !this.isKHTML); this.isOpera = /Opera/.test(UA); this.isMSIE = (/MSIE/.test(UA) && !this.isOpera); this.isMSIE7 = this.isMSIE && !(/MSIE 6\./.test(UA) && !this.isOpera); this.isMSIE6 = this.isMSIE && !this.isMSIE7;}} 
Browser.detect(); $(window).load(function(){if(Browser.isGecko) { $('#lightbox').css({'cursor' : 'auto'}); } else { $('#lightbox').css({'cursor': 'url(/img/openhand.cur)'}); }});
$(window).load(function(){if(Browser.isMSIE) { $('#menu ul.level2').css({'background-color' : '#000'}); $('#menu ul.level3').css({'background-color' : '#000'}); }});
jQuery("a").each(function () {if ( jQuery(this).attr("href").indexOf("http://") == 0 || jQuery(this).attr("href").indexOf("https://") == 0 ) {jQuery(this).attr("target","_blank");}});