var galleryItems=0;var galleryCurrent=1;var galleryJump=0;var galleryReadMore=0;var galleryTitleTimeout=0;function showFilterInIE(){jQuery.each(jQuery.browser,function(a,b){if(jQuery.browser.msie&&parseInt(jQuery.browser.version.substr(0,1),10)<=7){$("fieldset").css("display","block")}})}function hideFilterInIE(){jQuery.each(jQuery.browser,function(a,b){if(jQuery.browser.msie&&parseInt(jQuery.browser.version.substr(0,1),10)<=7){$("fieldset").css("display","none")}})}function slideUpCallback(){hideFilterInIE()}function slideDownCallback(){showFilterInIE()}function closeGallery(){$("#gallery").css("display","none");$("#entry").css("display","block");$("#jsBackBtn").css("display","block")}function galleryNext(){if(galleryTitleTimeout){clearTimeout(galleryTitleTimeout)}for(var a=1;a<=galleryItems;a++){$("#gallery-slide-"+a).css("display","none")}if(galleryItems>0&&galleryCurrent<galleryItems){galleryCurrent=galleryCurrent+1;$("#galleryLeft").css("display","block");if(galleryJump&&galleryCurrent==(galleryItems)){$("#galleryRight").css("display","none")}}else{if(!galleryJump){galleryCurrent=1;closeGallery()}else{galleryCurrent=1}}$("#galleryLabel").text(galleryCurrent+"/"+galleryItems);$("#gallery-slide-"+galleryCurrent).css("display","block");$("#galleryTitle").css("display","none");return false}function galleryPrevious(){if(galleryTitleTimeout){clearTimeout(galleryTitleTimeout)}for(var a=1;a<=galleryItems;a++){$("#gallery-slide-"+a).css("display","none")}if(galleryItems>0&&galleryCurrent>1){galleryCurrent=galleryCurrent-1;$("#galleryRight").css("display","block");if(galleryCurrent==1){$("#galleryLeft").css("display","none")}}else{galleryCurrent=galleryItems}$("#galleryLabel").text(galleryCurrent+"/"+galleryItems);$("#gallery-slide-"+(galleryCurrent)).css("display","block");$("#galleryTitle").css("display","none");return false}$(document).ready(function(){var j=$("#footerFilter");var g=$("#filter");j.css("display","none");$("#filterForm").append(j);$("#filter input").customInput();j.slideUp(0);g.removeClass("none");$("body").addClass("js");g.css("z-index","2");g.css("position","relative");g.css("top","0px");$("#filterButton a").each(function(e,h){$(h).addClass("filterButton");$(h).click(function(){if(g){if(g.hasClass("open")){hideFilterInIE();j.slideUp("slow",slideUpCallback);g.addClass("closed");g.removeClass("open")}else{hideFilterInIE();j.slideDown("slow",slideDownCallback);g.addClass("open");g.removeClass("closed")}}})});var i=$("#header #s");$("#header #searchsubmit").css("display","none");if(i.attr("value").length===0){i.attr("value","SEARCH")}i.focus(function(){var e=i.attr("value")+"";if(e=="SEARCH"){$("#container #header .s").attr("value","")}});i.blur(function(){var e=i.attr("value")+"";if(e==""){i.attr("value","SEARCH")}});$(function(){i.keypress(function(h){if((h.which&&h.which==13)||(h.keyCode&&h.keyCode==13)){$("#header #searchform").submit();return false}else{return true}})});if($(".white-paper")){$("#whitePaperEmail a").click(function(){var e=$("title").html().substring(0,$("title").html().indexOf("|")).toLowerCase().replace(/ +/g,"-");e=e.replace(/([^a-z0-9\- ])|(-$)/ig,"");e=e.replace("--hiebing","");pageTracker._trackPageview("white-paper-click-"+e+"/");return true})}$(".cardWrapper").cardHover();var d=$(".genericBtn");d.css("cursor","pointer");d.click(function(){window.location=$(this).find("div a").attr("href");return false});$(".back #main #entry").prepend('<div id="jsBackBtn"><a href="javascript:history.go(-1);"></a></div>');$("#integratedStory").prepend('<div id="jsBackBtn"><a href="javascript:history.go(-1);"></a></div>');var a=$("#gallery");var c=$("#main");if(a.size()>0){$("#entry").css("display","block");a.css("display","none");c.append(a);c.append('<div class="break"></div>');if(($("#main #entry img:eq(0)").size()>0)!==true){galleryJump=1;$("#entry").append('<div id="galleryTitle"></div>');$("#content h1").remove().appendTo("#galleryTitle");$("#content h2").remove().appendTo("#galleryTitle");if($("#content").size()>0){galleryReadMore=1}}a.customGallery();if(galleryItems>0){if(galleryJump){$("#jsBackBtn").css("display","none");$("#entry").css("display","none");a.css("display","block");$("#seework").css("display","none");if(galleryReadMore){$(".galleryDesc").slideUp(0);$(".galleryDesc").css("display","none")}}else{$("#main #entry img:eq(0)").css("cursor","pointer").click(function(){$("#galleryLeft").css("display","none");$("#jsBackBtn").css("display","none");$("#entry").css("display","none");a.css("display","block")});$("#seework div a").click(function(){$("#galleryLeft").css("display","none");$("#jsBackBtn").css("display","none");$("#entry").css("display","none");a.css("display","block");return false});$("#seework").css("cursor","pointer").click(function(){$("#galleryLeft").css("display","none");$("#entry").css("display","none");a.css("display","block");return false});$(".galleryNext").css("cursor","pointer").click(function(){galleryNext();return false})}}else{$("#seework").css("display","none")}}else{$("#integratedStory #main #entry img:eq(0)").css("padding-bottom","11px")}if($("#subnav")){var b=$("#subnav").height()+215;if($("#simplePage").height()>b){$("#subnav").height($("#simplePage").height()-215)}}try{document.execCommand("BackgroundImageCache",false,true)}catch(f){}});function toggleGalleryRead(a){var b=0;if(jQuery.browser.msie&&parseInt(jQuery.browser.version.substr(0,1),10)<=6){b=1}if(!a.hasClass("galleryReading")){if(b){$(".gallery-slide-content").css("top","-"+($(".galleryDesc:eq(0)").height()+30)+"px");$(".galleryDesc").css("display","block")}else{$(".galleryDesc").slideDown("slow")}$(".galleryRead").addClass("galleryReading")}else{if(b){$(".gallery-slide-content").css("top","-30px");$(".galleryDesc").css("display","none")}else{a.parent().children(".galleryDesc").slideUp("slow",function(){$(".galleryDesc").css("display","none")})}$(".galleryRead").removeClass("galleryReading")}}function gallerySlideUpCallback(){$(".galleryDesc").css("display","none")}jQuery.fn.cardHover=function(){var a=$(this).find(".card");a.canhover=true;$(".card").css("cursor","pointer");a.mouseover(function(){if(a.canhover){$(this).addClass("cardHover")}});a.mouseout(function(){$(this).removeClass("cardHover")});a.click(function(){window.location=$(this).find(".cardNav a").attr("href");return false});$(".card .cardTags div:not(.cardTitle) a").mouseover(function(){a.canhover=false});$(".card .cardTags div:not(.cardTitle) a").mouseout(function(){a.canhover=true});$(".card .cardTags div a").click(function(){window.location=$(this).attr("href");return false})};jQuery.fn.customGallery=function(){var d=0;var b;var c;var a=$(this).height("538px");a.css("overflow","hidden");$(this).children().each(function(){if($(this).is("h1,h2,h3,h4,strong")){d++;b=$(this);b.css("float","left")}else{c=$(this);if(d!=1){$('<div id="gallery-slide-'+d+'" class="gallery-slide" style="display:none;"></div>').insertBefore(b).append(b,c)}else{$('<div id="gallery-slide-'+d+'" class="gallery-slide"></div>').insertBefore(b).append(b,c)}$('<div class="gallery-slide-label" id="gallery-slide-label-'+d+'"></div>').insertBefore(b).append(b);$('<div class="gallery-slide-content"></div>').insertBefore(c).append(c);if(!galleryJump){$("#gallery-slide-label-"+d).append('<a href="javascript:void(0);" class="galleryBack" onclick="javascript:closeGallery();return false;"><img src="/wp-content/themes/hiebing/images/btn-back-in-black.gif" alt="Back" /></a>')}else{if(galleryReadMore&&$("#content").children().size()>0){$("#gallery-slide-label-"+d).append('<a href="javascript:void(0);" id="galleryBack'+d+'" class="galleryRead"></a>');$("#galleryBack"+d).click(function(){toggleGalleryRead($(this));return false});$("#gallery-slide-label-"+d).append('<div class="galleryDesc"><div>'+$("#content").html()+"</div></div>")}else{$("#gallery-slide-label-"+d).append('<a href="javascript:history.go(-1);" class="galleryBack"><img src="/wp-content/themes/hiebing/images/btn-back-in-black.gif" alt="Back" /></a>')}}}});galleryItems=d;if(d>1){$("#entry #galleryTitle").remove().appendTo("#gallery");$(this).append('<div id="galleryLeft"><div id="galleryLeftBox"><div id="galleryPrev"></div><div id="galleryPrevious" onclick="javascript:galleryPrevious();"></div></div></div><div id="galleryRight"><div id="galleryRightBox"><div id="galleryNext" onclick="javascript:galleryNext();"></div><div id="galleryNex"></div></div></div>');$("#galleryLeft").css("display","none");$(this).append('<div id="galleryLabel">1/'+galleryItems+"</div>")}else{if(d==1){$("#entry #galleryTitle").remove().appendTo("#gallery")}}};$(window).load(function(){$galleryTitle=$("#galleryTitle");if($galleryTitle){if(galleryJump){$galleryTitle.css("display","block");var a=$("#galleryTitle h2").text().length;if(a>12){$("#galleryTitle h2").css({"font-size":"30px","line-height":"30px"})}else{if(a>22){$("#galleryTitle h2").css({"font-size":"14px","line-height":"14px"})}}}galleryTitleTimeout=setTimeout(function(){$galleryTitle.fadeTo("slow",0)},2500)}});jQuery.fn.customInput=function(){$(this).each(function(c){if($(this).is("[type=checkbox],[type=radio]")){var a=$(this);var b=$("label[for="+a.attr("id")+"]");var d=(a.is("[type=checkbox]"))?"checkbox":"radio";$('<div class="custom-'+d+'"></div>').insertBefore(a).append(a,b);var e=$("input[name="+a.attr("name")+"]");b.hover(function(){$(this).addClass("hover");if(d=="checkbox"&&a.is(":checked")){$(this).addClass("checkedHover")}},function(){$(this).removeClass("hover checkedHover")});a.bind("updateState",function(){if(a.is(":checked")){if(a.is(":radio")){e.each(function(){$("label[for="+$(this).attr("id")+"]").removeClass("checked")})}b.addClass("checked")}else{b.removeClass("checked checkedHover checkedFocus")}}).trigger("updateState").click(function(){$(this).trigger("updateState")}).focus(function(){b.addClass("focus");if(d=="checkbox"&&a.is(":checked")){$(this).addClass("checkedFocus")}}).blur(function(){b.removeClass("focus checkedFocus")})}})};