/* * jQuery Functions Main for Wordpress Theme "Photoblog by Steffen Hollstein" * @requires jQuery v1.3.2 or later */ if(!window.console){window.console={log:function(){},error:function(){},warn:function(){}};}function jQueryDebugOutput(a){var a=jQuery.extend({msg:null,debugOuputMessagePrefix:"[Wordpress Theme Debug Output] "},a||{});if(a.msg){if(typeof(a.msg)=="object"){console.debug(a.msg);}else{if(a.msg!=""&&a.msg!=" "){console.debug(a.debugOuputMessagePrefix+a.msg);}else{console.debug(a.msg);}}}}function initModalboxContent(){jQuery("a.eCM, a.nEM").click(function(a){a.preventDefault();var c=jQuery(this);var d="";if(c.hasClass("eCM")){d=base64Decode(fse);}else{if(c.hasClass("nEM")){d=fse;}}var b=jsLocalizedStrings["eCmText"]+' '+d+".";jQuery.fn.modalBox({directCall:{data:b},customClassName:"small"});});jQuery("#pageWrapper #content div.globalTableLayout.contentLayoutWrapper div.globalTableLayout-Row div.globalTableLayout-Cell.cell-1 .entry-content img").parent("a").click(function(c){c.preventDefault();var b=jQuery(this).attr("href");var a=b.toLowerCase();if(b!=""&&(a.indexOf(".gif")!=-1||a.indexOf(".jpg")!=-1||a.indexOf(".png")!=-1)){c.preventDefault();jQuery.fn.modalBox({directCall:{image:b}});}else{location.href=b;}});}function initReplaceValueOnBlur(a){var a=jQuery.extend({selector:"input.replaceValueOnBlur",currentValue:"",isKeyPressed:false},a||{});jQuery(a.selector).unbind("focusin focusout keypress").bind("focusin focusout keypress",function(c){var d=jQuery(this);var b=d.val();if(c.type=="focusin"&&!a.isKeyPressed){if(b!=""){a.currentValue=b;}d.val("");}else{if(c.type=="focusout"&&b==""){d.val(a.currentValue);a.isKeyPressed=false;}else{if(c.type=="keypress"){if(b==""){a.isKeyPressed=false;}else{a.isKeyPressed=true;}}}}});}function initBase64TextDecoder(a){var a=jQuery.extend({selector:".base64encoded"},a||{});if(jQuery(a.selector).length>0){jQuery(a.selector).each(function(){var c=jQuery(this);var b=c.text();if(b!=""){c.text(base64Decode(b));}});}}function prepareHeaderNavi(){var d=jQuery("#header .headerNavi");var h=d.find("ul.navi li ul li ul").parent("li");var g=d.find("ul.navi li.search_item");if(!g.hasClass("startAnimation")){if(typeof(g.attr("searchitemlastwidth"))=="undefined"){g.attr({"searchitemlastwidth":g.width()});}var f=g.attr("searchitemlastwidth");var a=60;d.find("ul.navi li:visible").each(function(){if(!jQuery(this).hasClass("search_item")){a+=jQuery(this).width();}});var e=(d.width()-f);var c=((e-a)<=10);var b=(c?50:f);g.addClass("startAnimation").animate({width:b+"px"},400,function(){var k=jQuery(this);var j=k.find("#searchformHeader");if(c){k.find("#searchformHeader").hide();if(jQuery(".searchformHeaderShowHide").length==0){k.append('
');}var i=k.find(".searchformHeaderShowHide");i.fadeIn("fast").mouseover(function(){jQuery(this).fadeOut("fast",function(){j.fadeIn("fast",function(){g.width(f);d.find("ul.navi li:visible:not('.search_item, .iconHome')").fadeOut("fast");}).unbind("mouseleave").bind("mouseleave",function(){jQuery(this).fadeOut("fast",function(){i.fadeIn("fast");d.find("ul.navi li:not('.search_item, .iconHome')").fadeIn("fast");});});});});}else{k.find(".searchformHeaderShowHide").fadeOut("fast",function(){j.fadeIn("fast");});}k.removeClass("startAnimation");});}if(!h.hasClass("hasSubmenue")){h.addClass("hasSubmenue");}}function prepareHeaderLogo(){var a=jQuery("#header .logo:not('.customLogo')");a.css({minWidth:(a.find(".logoLeft").outerWidth(true)+a.find(".logoRight").outerWidth(true))});}function preparePhotoGrid(){var d=jQuery("#content .photoGridCell");var e=d.find(".photoGridCellInner .photoGridCellInnerBody");var c="";var b=false;d.css({visibility:"hidden"}).removeClass("microBox smallBox mediumBox bigBox");var a=[e.width(),e.height()];if(a[0]>270){c="bigBox";b=false;}else{if(a[0]>190){c="mediumBox";b=true;}else{if(a[0]>55){c="smallBox";b=true;}else{c="microBox";b=false;}}}e.find(".photoGridHover").css({visibility:"hidden"});d.addClass(c).css({visibility:"visible"});e.each(function(){var j=jQuery(this);var k=j.find(".photoGridCellImage input[type='hidden'][name='photogridimage_src_medium']").val();var f=j.find(".photoGridCellImage input[type='hidden'][name='photogridimage_src_large']").val();j.find(".photoGridCellImage img.wp-post-image").attr({src:(b?f:k)});if(!j.hasClass("prepareSuccessful")){var i=j.find(".photoGridCellContent .entry-title a").attr("href");var g=j.find(".photoGridCellImage input[type='hidden'][name='photogridimage_src_full']").val();var h="";if(typeof(g)!="undefined"){j.find(".photoGridCellContent").addClass("photoGridCellContentFadeinFadeOut").find(".calendar").css({visibility:"visible",display:"none"});}h+='";j.append(h).addClass("prepareSuccessful");}}).unbind("mouseenter mouseleave").bind("mouseenter mouseleave",function(g){var i=jQuery(this);if(!d.hasClass("microBox")){var f=i.find(".photoGridHover");var h=[f.width(),i.height()];if(g.type=="mouseenter"){if(!i.hasClass("animationLeftDone")){i.addClass("animationLeftDone").removeClass("animationRightDone").find(".photoGridHover").css({top:(h[1]-80)+"px",left:"-"+h[0]+"px",visibility:"visible"}).animate({left:"+="+h[0]+"px"},"fast",function(){}).prev(".photoGridCellContentFadeinFadeOut").find(".calendar").fadeIn("fast");}}else{if(g.type=="mouseleave"){if(!i.hasClass("animationRightDone")){i.addClass("animationRightDone").removeClass("animationLeftDone").find(".photoGridHover").animate({left:"-="+h[0]+"px"},"fast",function(){}).prev(".photoGridCellContentFadeinFadeOut").find(".calendar").fadeOut("fast");}}}}}).find(".photoGridHoverDetailview, .photoGridHoverZoom").die("click mouseover mouseout").live("click mouseover mouseout",function(h){var j=jQuery(this);var i="";var g=55;if(h.type=="click"){if(j.is(".photoGridHoverDetailview")){i=j.find("input[type='hidden'][name='photoblock_postlink']").val();if(i!=""){window.location.href=i;}}else{if(j.is(".photoGridHoverZoom")){var f=parseInt(jQuery(window).width()/1.5);i=j.find("input[type='hidden'][name='photoblock_zoomimage_link']").val();if(i!=""){jQuery.fn.modalBox({directCall:{image:i}});}}}}else{if(h.type=="mouseover"){j.addClass("hoverEvent");}else{if(h.type=="mouseout"){j.removeClass("hoverEvent");}}}});}function checkDimensionsOfViewport(){var a=jQuery("body");var b=jQuery(window).width();if(b<=900){a.removeClass("mediumViewport largeViewport").addClass("smallViewport");}else{if(b<=1180){a.removeClass("smallViewport largeViewport").addClass("mediumViewport");}else{a.removeClass("smallViewport mediumViewport").addClass("largeViewport");}}}jQuery(document).ready(function(){initModalboxContent();initReplaceValueOnBlur();initBase64TextDecoder();});jQuery(window).load(function(){prepareHeaderNavi();prepareHeaderLogo();preparePhotoGrid();checkDimensionsOfViewport();}).resize(function(){prepareHeaderNavi();preparePhotoGrid();checkDimensionsOfViewport();});