var IB,bg,ic,img,ibg,idc;$(document).ready(function(){IB=initIB();IB.iot=300;IB.ist=500;IB.bgo=0.8;IB.bgot=250});$(window).load(function(){$("a[rel^='IB[']").each(function(){var A=$(this).children();A.after('<div class="rbgi"></div>');A.next().css({width:A.width(),height:A.height(),left:A.offset().left,top:A.offset().top})});window.setTimeout("$('div.rbgi').remove();",2250)});function initIB(){var B=$("a[rel^='IB[']");var D={};var C=1;for(var A=0;A<B.length;A++){group=B.eq(A).attr("rel").replace(/IB\[([0-9a-zA-Z]*)\]/,"$1");if(D[group]===undefined){D[group]={};C=1;D[group].length=C}else{D[group].length++;C=D[group].length}D[group][C]=[B.eq(A).attr("href"),B.eq(A).attr("title")]}B.click(function(){openIB(this);return false}).css("cursor","url(/zoomin.png), url(/zoomin.cur), auto");return D}function IBKeyControl(A){if(A.keyCode==27){bg.click()}if(A.keyCode==37){pnImg(-1)}if(A.keyCode==39){pnImg(1)}}function openIB(B){B=$(B);$("body").append("<div id='bg'></div>");bg=$("div#bg");bg.css({"background-color":"#000000",width:$(document).width()+"px",height:$(document).height()+"px",position:"absolute",top:"0px",left:"0px","z-index":20,opacity:0}).animate({opacity:IB.bgo},IB.bgot);$("object").css({visibility:"hidden"});$(document).bind("keyup.bg",IBKeyControl);bg.click(function(){ic.add(bg).animate({opacity:0},IB.bgot,function(){ic.add(bg).remove();$("object").css({visibility:"visible"})});$(document).unbind("keyup.bg")});$("body").append("<div id='ic'></div>");ic=$("div#ic");ic.css({width:"100%",position:"absolute",top:$(document).scrollTop()+50+"px",left:"0px","z-index":21,"text-align":"center"}).click(function(){bg.click()});ic.append("<div id='ibg'><img id='it' src='' alt='' /></div>");ibg=$("#ibg").click(function(){return false});img=$("#it");ic.append("<div id='idc'></div>");idc=$("#idc").css({margin:"0 auto"}).click(function(){return false});IB.ig=B.attr("rel").replace(/IB\[([0-9a-zA-Z]*)\]/,"$1");IB.is=B.attr("href");for(var A=1;A<=IB[IB.ig].length;A++){if(IB[IB.ig][A][0]===IB.is){IB.isn=A;break}}img.css({opacity:0}).load(function(){showImg()});newImg()}function newImg(){loaderIB();img.attr("src",IB.is)}function showImg(){$("#loader").remove();ibg.animate({height:img.height()+"px"},(ibg.height()==img.height())?0:IB.ist).animate({width:img.width()+"px"},(ibg.width()==img.width())?0:IB.ist,function(){img.animate({opacity:1},IB.iot,function(){showIDC();addNav()})})}function showIDC(){idchtml="<table><tr><td class='tg'><div class='txt'"+(IB[IB.ig].length>1?"":"style='padding-bottom:5px;'")+">"+IB[IB.ig][IB.isn][1]+"</div>";if(IB[IB.ig].length>1){idchtml+="<div class='grp'>Bild "+IB.isn+" von "+IB[IB.ig].length+"</div>"}idchtml+="</td><td class='cl'><img src='/closelabel.gif' alt='Schließen' title='Schließen' /></td></tr></table>";idc.append(idchtml);$("#idc td.cl img").click(function(){bg.click()});idc.css({"background-color":"#ffffff",width:ibg.outerWidth()+"px"}).hide().slideDown(function(){bg.css({width:$(document).width()+"px",height:$(document).height()+"px"})})}function addNav(){if(IB[IB.ig].length>1){ibg.append("<div id='nbg'></div>");$("#nbg").css({width:ibg.css("width"),height:ibg.css("height")});if(IB.isn<IB[IB.ig].length){$("#nbg").append("<a href='' class='next' title='nächste'></a>");$("#nbg .next").css({width:img.width()/2+"px",height:img.height()+"px",right:"0px"}).hover(function(){$(this).addClass("nho")},function(){$(this).removeClass("nho")}).click(function(){return pnImg(1)})}if(IB.isn>1){$("#nbg").append("<a href='' class='prev' title='vorherige'></a>");$("#nbg .prev").css({width:img.width()/2+"px",height:img.height()+"px",left:"0px"}).hover(function(){$(this).addClass("pho")},function(){$(this).removeClass("pho")}).click(function(){return pnImg(-1)})}}}function loaderIB(){ibg.append("<img id='loader' src='/loading.gif' alt='loading' />");$("#loader").css({position:"absolute",top:ibg.outerHeight()/2-16+"px",left:ibg.outerWidth()/2-16+"px"})}function pnImg(A){if(A==-1&&pnD()&2||A==1&&pnD()&1){idc.slideUp("fast",function(){idc.empty()});$("#nbg").remove();IB.isn=IB.isn+A;IB.is=IB[IB.ig][IB.isn][0];img.animate({opacity:0},IB.iot,newImg)}return false}function pnD(){var A=0;if(IB.isn<IB[IB.ig].length){A=A|1}if(IB.isn>1){A=A|2}return A};
