$(function(){function F(a,c){$("#jquery_jplayer_1").jPlayer("destroy");$("#jquery_jplayer_1").jPlayer({ready:function(){$(this).jPlayer("setMedia",{mp3:a,oga:c}).jPlayer("play")},ended:function(){$(this).jPlayer("play")},swfPath:"js",solution:"flash, html",supplied:"mp3, oga"})}function w(){bgImg=$("#fp_gallery").children("img:first");var a=bgImg.width(),c=bgImg.height(),s=$(window).width(),b=$(window).height(),d=b/c*a;a=s/a*c;a>b?bgImg.css({width:s+"px",height:a+"px"}):bgImg.css({width:d+"px",height:b+
"px"});bgImg.css("z-index","0")}function x(){y=parseInt($(window).width()/6)-10;G=parseInt(y/22);var a=$(window).height(),c=$("#outer_container").offset().top;h=parseInt(c/2)-70;h>y&&(h=y);h<40?(h=40,$("#text").css("top",60)):$("#text").css("top",100);breite3=h*5;G=parseInt(h/22);$("#preview").css("width",breite3);$(".resize").css("margin",G);$(".resize").css("width",h);hoch2=parseInt(c-120);$(".viewport").css("height",hoch2);$("#boxL1").length>0&&($("#boxL1").css("height",hoch2),$("#boxL1").tinyscrollbar_update());
$("#boxR1").length>0&&($("#boxR1").css("height",hoch2),$("#boxR1").tinyscrollbar_update());$("#kontaktF").length>0&&($("#kontaktF").css("left",$(window).width()-580),$dif=c-470,$dif<-20&&($dif=-20),a<=680?($("#text").css("top","0px"),$("#kontaktF").css("top",$dif+"px")):($("#text").css("top","100px"),$("#kontaktF").css("top","10px")))}function H(a){var c;j.css("opacity",0.2);t=!1;clearInterval(b);z();$("#fp_gallery").children("img:first").stop(!0,!0);$.get("loadhtml.php?art="+a,function(a){a!==""&&
(c=a)}).success(function(){$("#text").html(c);j.stop().fadeTo(100,0.7);$("input").clearDefault();$("textarea").clearDefault();x()})}function I(a){var c;t=!1;clearInterval(b);z();j.css("opacity",0.5);$("#fp_gallery").children("img:first").stop(!0,!0);$.get("session2.php?art="+a,function(a){a!==""&&(c=a)}).success(function(){c!==""?($("#text").html(c),Cufon.replace("h2",{hover:!0}),Cufon("h2 a",{hover:{color:"#67D0C2"}}),$("#boxL1").tinyscrollbar(),$("#boxR1").tinyscrollbar(),x(),j.fadeTo(100,0.7),
u==!0?($(".overview").css("background-color","#FFF"),$("#boxR1").css("background-color","#FFF"),$("#boxL1").css("background-color","#FFF")):$(".overview").css("background-color","transparent")):j.hide()})}function A(){J();f<3&&l==!1&&d.stop().fadeTo(600,0)}function T(){sliderLeft=e.position().left;sliderWidth=$(window).width();$("#thumbScroller").css("width",sliderWidth);d.mousemove(function(a){l==!1&&clearInterval(b);if($weite>sliderWidth){a=a.pageX;var c=-parseInt((totalContent-sliderWidth-sliderWidth)*
(a/sliderWidth)),s=a-c,d=c-a;a==c?e.stop():a>c?u==!0?e.css("left",-s):e.stop().animate({left:-s},O,P):a<c&&(u==!0?$("#thumbScroller .container").scrollLeft(d):e.stop().animate({left:d},O,P))}});u==!1?(q.live("mouseenter",function(){$(this).stop().fadeTo(60,1)}),q.live("mouseleave",function(){$(this).attr("alt")!==k.attr("alt")&&$(this).stop().fadeTo(60,0.4)})):(q.live("mouseenter",function(){$(this).css("filter","alpha(opacity = 100)")}),q.live("mouseleave",function(){$(this).attr("alt")!==k.attr("alt")&&
$(this).css("filter","alpha(opacity = 40)")}))}function K(a){$("#outer_container").stop().animate({bottom:"-25px"},a)}function L(a){$PROZESS=!0;clearInterval(b);z();e.empty();totalContent=0;e.css("width",0);o=!1;$.get("ajax/thumbs.php?album="+a,function(a){d.hide();e.html(a);q=$("#thumbScroller .container img");q.each(function(){totalContent+=$(this).width();e.css("width",totalContent);$(this).stop().fadeTo(1,0.4)});$weite=e.width();T();e.stop().animate({left:0});totalContent>100&&(f=0,J());clearInterval(b);
b=setInterval(A,5E3);l==!1?(K(),d.css("background-color","#FFF"),d.stop().fadeTo(400,1)):d.hide()});$PROZESS=!1}function z(){document.getElementById("text").innerHTML="&nbsp;"}function Q(a){t=!1;o=!0;n.show();$('<img class="fp_preview"/>').load(function(){var a=$(this),b=$("#fp_gallery").children("img:first");a.insertBefore(b);n.hide();b.fadeOut(600,function(){$(this).remove()});w()}).attr("src",a);n.hide();return!1}function J(){t=!0;o=!1;++f;var a=$(".container").find("a:nth-child("+f+")");a.length==
0&&(f=1,a=$(".container").find("a:nth-child("+f+")"));f>1&&k.stop().fadeTo(60,0.4);n.show();$('<img class="fp_preview"/>').load(function(){var c=$(this),b=$("#fp_gallery").children("img:first");c.insertBefore(b);n.hide();b.stop().fadeOut(900,function(){$(this).remove()});k=a.find("img");k.stop().fadeTo(60,1);w()}).attr("src",a.find("img").attr("alt"))}$(document).bind("contextmenu",function(){return!1});var U=[];$.preLoadImages=function(){for(var a=arguments.length;a--;){var c=document.createElement("img");
c.src=arguments[a];U.push(c)}};jQuery.fn.clearDefault=function(){return this.each(function(){var a=$(this).val();$(this).focus(function(){$(this).val()==a&&$(this).val("")});$(this).blur(function(){$(this).val()==""&&$(this).val(a)})})};F("music/start.mp3","music/start.ogg");var y,G,B,t=!0,k,l=!0,M,p,N=null,R;$("#mini a").livequery("mouseenter",function(){B=$(this).parent();$label=$("#label");$gal=B.children().children("img:first").attr("src");if(N!==$gal||N==null)$label.css("opacity","0"),$label.css("filter",
"alpha(opacity =0)");else return!1;N=$gal;R=B.children();$tpos1=B.children().children().offset();$lhoch=h/3;$tpos2=$tpos1.top+h/2-$lhoch/2;$garr=$gal.split("/");$nameg=$garr[$garr.length-2];$nl=$nameg.length;label1=$nameg.substring(4,$nl);$za=h/2.7;$za+="px";$fa=parseInt(h/10)+"px";$label.css("height",$lhoch);$label.css("width",h);$label.css("top",$tpos2);$label.css("left",$tpos1.left+2);$label.css("line-height",$za);$label.css("font-size",$fa);$label.empty();$imghoehe=parseInt($lhoch/3);$label.append('<img src="buttons/'+
label1+'.png" height="'+$imghoehe+'px">');$label.fadeTo(400,0.6)});$("#label").live("click",function(){R.trigger("click")});$("#mini a").live("mouseleave",function(){clearInterval(void 0)});$("#kontaktF").live("submit",function(){message="";if($("#Name").val()=="Dein Name"||$("#Name").val()=="")message+="Bitte geben Sie einen Namen an!\n";if($("#E-Mail").val()==""||$("#E-Mail").val()=="Deine E-Mail Adresse")message+="Bitte geben Sie eine E-Mail Adresse an!\n";$("#Anfrage").val()==""&&(message+="Bitte geben Sie eine Nachricht ein!\n");
$("#Anfrage").val().length>660&&(message+="Ihre Nachricht hat mehr als 600 Zeichen!\n");message==""?($.get("ajax/mail.php?name="+$("#Name").val()+"&telefon="+$("#Telefon").val()+"&email="+$("#E-Mail").val()+"&termin="+$("#Hochzeit").val()+"&anfrage="+$("#Anfrage").val(),function(a){$(".result").html(a)}),$("#kontaktF").fadeOut(1E3)):alert(message);return!1});var h;$(window).resize(function(){w();$("#label").hide();$("#thumbScroller .container").stop().animate({left:sliderLeft},400,"easeOutCirc");
$("#thumbScroller").css("width",$(window).width());sliderWidth=$(window).width();$l=$(window).width()/2-65;$t=$(window).height()/2-25;$("#login").css("left",$l);$("#login").css("top",$t);x()});var f=0,o=!1,b,r="",e=$("#thumbScroller .container"),O=500,P="easeOutCirc",u;u=navigator.userAgent.toLowerCase().indexOf("msie")>-1?!0:!1;var d=$("#thumbScroller"),j=$("#text");j.hide();$("form").submit(function(){r=$("#login form input:password").val();$("#login").hide();$.loadSubNavB(i,r,function(a){if(a!==
"")return!1});return!1});$("#logout").bind("click",function(){$("#logout").hide();$("#login form input:password").val("");r=""});$.extend({loadSubNavB:function(a,c,b){$.get("subnav2.php?navid="+a+"&pass="+c,function(a){j.hide();j.html(a);$OKI=a!==""?!0:!1;j.stop(!0,!0).fadeTo(900,1);a.indexOf("pass")!=-1&&$("#logout").show();o=a.indexOf("mini")!=-1?!0:!1;x();typeof b=="function"&&b.call(this,a)})}});f=-1;var v=$("#fp_thumbtoggle"),n=$("#fp_loading"),C=$("#fp_next"),D=$("#fp_prev"),V=d.find(".content").length,
q=$("#thumbScroller .container img");setTimeout(function(){K(600)},2E3);d.mouseleave(function(a){a.pageY<d.offset().top&&d.hide();o==!1&&(clearInterval(b),b=setInterval(A,6E3))});d.mouseenter(function(){l==!1&&(d.show(),clearInterval(b))});$("#navi").livequery("mouseleave",function(a){a.pageY<$("#navi").offset().top&&d.stop().fadeTo(600,0)});$("#navi").livequery("mouseenter",function(){l==!1&&d.stop().fadeTo(600,1)});d.find("a").live("click",function(a){o=!1;j.stop().fadeTo(600,0);var b=$(this),d=
b.find("img");f>1&&k.stop().fadeTo(60,0.4);k=d;k.stop().fadeTo(60,1);f=b.index()+1;d.offset();d.offset();var e=d.clone();$(window).width();$(window).height();e.stop().animate({},10,function(){var a=$(this);e.width();n.show();$('<img class="fp_preview"/>').load(function(){var b=$(this),c=$("#fp_gallery").children("img:first");b.insertBefore(c);n.hide();a.remove();c.stop().fadeOut(1E3,function(){$(this).remove()});w()}).attr("src",d.attr("alt"))});a.preventDefault()});v.bind("mouseenter",function(){K(500)});
C.bind("click",J);D.bind("click",function(){--f;var a=$(".container").find("a:nth-child("+f+")");a.length==0&&(f=V,a=$(".container").find("a:nth-child("+f+")"));f>1&&k.stop().fadeTo(60,0.4);n.show();$('<img class="fp_preview"/>').load(function(){var b=$(this),d=$("#fp_gallery").children("img:first");b.insertBefore(d);n.hide();d.stop().fadeOut(2E3,function(){$(this).remove()});k=a.find("img");k.stop().fadeTo(60,1)}).attr("src",a.find("img").attr("alt"))});C.mousemove(function(){clearInterval(b)});
D.mousemove(function(){clearInterval(b)});C.mouseout(function(){clearInterval(b);b=setInterval(A,6E3)});D.mouseout(function(){clearInterval(b);b=setInterval(A,6E3)});v=$("#starte").html();startalbum=v.split(" ")[0];typ=v.split(" ")[1];p=M=v.split(" ")[2];typ=="gallery"&&(l=!0,L(startalbum));typ=="datei"&&(z(),$("#imageWrapper").empty(),$("#thumbsWrapper").hide(),$("#text").show(),H(startalbum));typ=="text"&&(e.empty(),o=!1,clearInterval(b),C.stop().animate({right:"-50px"},500),D.stop().animate({left:"-50px"},
500),I(startalbum));var g,i,m,S,E;$("h1").bind("click",function(){});$("#navi > ul > li > a > img").hover(function(){if(this.src.indexOf(p)==-1)this.src=this.src.replace("X","Y")},function(){this.src=this.src.indexOf(p)==-1?this.src.replace("Y","X"):this.src.replace("X","Y")});$("#navi > ul > li > a").bind("click",function(){$("#text").css("top","100px");e.empty();$("#label").fadeTo(200,0);pass="";var a=$(this).parent();g=a.find("a").attr("class").split(" ")[0];i=a.find("a").attr("class").split(" ")[1];
m=a.find("a").attr("class").split(" ")[2];pass=a.find("a").attr("class").split(" ")[4];S=a.find("a").attr("class").split(" ")[5];$("#navi img").each(function(){if(this.src.indexOf(i)==-1)this.src=this.src.replace("Y","X")});E="texte/"+g.substr(0,g.length-4)+".jpg";clearInterval(b);Q(E);t==!0&&$("#fp_gallery").children("img:first").stop(!0,!0).fadeTo(100,0.2);$("#navi > ul > li > a").addClass("white");$("#navi > ul > li > a").removeClass("green");a.find("a").addClass("green");a.find("a").removeClass("white");
if(pass=="")$("#login").hide(),$.loadSubNavB(i,r,function(){});else if($("#logout").is(":visible")||($l=$(window).width()/2-115,$t=$(window).height()/2-25,$("#login").css("left",$l),$("#login").css("top",$t),$("#login").show()),r!=="")return $.loadSubNavB(i,r,function(){}),!1;d.css("background-color","");if(S>0&&pass=="")return $("#jquery_jplayer_1").jPlayer("destroy"),p=i,!1;m==1&&(i==M?(l=!0,song="start"):l=!1,song!==""&&i!==p&&F("music/"+song+".mp3","music/"+song+".ogg"),L(g));p=i;m==3&&(window.open(g),
$("#jquery_jplayer_1").jPlayer("destroy"),clearInterval(b),e.empty());m==2&&($("#jquery_jplayer_1").jPlayer("destroy"),$("#thumbsWrapper").hide(),$("#text").show(),setTimeout(function(){H(g,function(){})},300));m==0&&($("#jquery_jplayer_1").jPlayer("destroy"),e.empty(),setTimeout(function(){I(g,function(){})},300))});$("#mini >a").live("click",function(){$("#label").fadeTo(400,0);d.css("background-color","");o=!1;var a=$(this).parent();g=a.find("a").attr("class").split(" ")[0];i=a.find("a").attr("class").split(" ")[1];
$('<img class="fp_preview"/>').stop(!0,!0);m=a.find("a").attr("class").split(" ")[2];hauptnav=a.find("a").attr("class").split(" ")[3];pass=a.find("a").attr("class").split(" ")[4];song2=a.find("a").attr("class").split(" ")[5];song3=song2.substr(song2.length-3,3);song=song3=="mp3"||song3=="ogg"?song2.substr(0,song2.length-4):"";mode="small";m==1&&(i==M?(l=!0,song="start"):l=!1,song!==""&&F("music/"+song+".mp3","music/"+song+".ogg"),L(g),j.stop().hide());p=i;m==2&&(clearInterval(b),$("#thumbsWrapper").hide(),
$("#text").show(),H(g));m==3&&(clearInterval(b),e.empty(),alert(g));m==0&&(clearInterval(b),e.empty(),E="texte/"+g.substr(0,g.length-4)+".jpg",I(g),Q(E))})});

