function restoreField(a,b){field=jQuery("#"+a);if(field&&field.val()==""){field.val(b)}}function clearField(a,b){field=jQuery("#"+a);if(field&&field.val()==b){field.val("")}}function moveBack(a){jQuery("#videoMask").css("zIndex","-1")}jQuery(document).ready(function(){if(jQuery(".lof-slidecontent").html()){jQuery(".lof-slidecontent").append('<span class="mask">mask</span>')}if(jQuery(".unit .photo").html()){jQuery(".unit .photo").append('<span class="mask">mask</span>')}jQuery(".single .entry-content img").wrap('<div class="photo" />');jQuery(".featuredpost img").wrap('<div class="photo" />');var a='<span class="mask-tl">mask</span><span class="mask-tr">mask</span><span class="mask-bl">mask</span><span class="mask-br">mask</span>';if(jQuery(".single .entry-content .photo").html()||jQuery(".featuredpost .photo").html()){jQuery(".single .entry-content .photo").append(a);jQuery(".featuredpost .photo").append(a)}jQuery(".featuredpost .photo img").each(function(a){var b=jQuery(this).width();jQuery(this).parent().width(b+4)});jQuery(".single .entry-content img").each(function(a){var b=jQuery(this).width();jQuery(this).parent().width(b+4)});if(jQuery("#sidebar-home .tubepress_single_video").html()){jQuery("#sidebar-home .tubepress_single_video").append('<span class="mask" style="pointer-events:none">mask</span>')}if(jQuery("#sidebar-home .ngg-widget").html()){jQuery("#sidebar-home .ngg-widget").append('<span class="mask" style="pointer-events:none">mask</span>')}if(jQuery("#sidebar-home").html()){var b=jQuery("#sidebar-home .widget");var c=b.eq(2).find(".post");var d=b.eq(3).find("li");var e=b.eq(4).find("li");c.find(".post-info").replaceWith('<div class="more">'+c.find(".post-info").text()+"</div>");d.find(".rss-date").replaceWith('<div class="more">'+d.find(".rss-date").text()+"</div>");e.find(".rss-date").replaceWith('<div class="more">'+e.find(".rss-date").text()+"</div>");var f=b.eq(2).find("h4:first").html();b.eq(2).remove();b.eq(3).remove();b.eq(4).remove();var g='<li><span class="wordpress"></span><div class="text">'+c.html()+"</div></li>";var h='<li><span class="twitter"></span><div class="text">'+d.html()+"</div></li>";var i='<li><span class="facebook"></span><div class="text">'+e.html()+"</div></li>";var j='<div id="latest-news"><h4>'+f+'</h4><div class="box"><div class="holder"><div class="frame"><ul class="news">';j=j+g;j=j+h;j=j+i;j=j+"</div></div></div></div>";jQuery("#sidebar-home").append(j)}if(jQuery("#sidebar-right .widget_categories").html()){jQuery("#sidebar-right .widget_categories .widget-wrap ul").wrap('<div class="box" />');jQuery("#sidebar-right .widget_categories .widget-wrap ul").wrap('<div class="holder" />');jQuery("#sidebar-right .widget_categories .widget-wrap ul").wrap('<div class="frame" />')}if(jQuery("#sidebar-right .widget_archive").html()){jQuery("#sidebar-right .widget_archive .widget-wrap ul").wrap('<div class="box" />');jQuery("#sidebar-right .widget_archive .widget-wrap ul").wrap('<div class="holder" />');jQuery("#sidebar-right .widget_archive .widget-wrap ul").wrap('<div class="frame" />')}if(jQuery("#sidebar-right .latest-tweets").html()){jQuery("#sidebar-right .latest-tweets .widget-wrap ul").wrap('<div class="box" />');jQuery("#sidebar-right .latest-tweets .widget-wrap ul").wrap('<div class="holder" />');jQuery("#sidebar-right .latest-tweets .widget-wrap ul").wrap('<div class="frame" />')}if(jQuery("#sidebar-right .widget_better_rss_widget").html()){jQuery("#sidebar-right .widget_better_rss_widget .widget-wrap ul").wrap('<div class="box" />');jQuery("#sidebar-right .widget_better_rss_widget .widget-wrap ul").wrap('<div class="holder" />');jQuery("#sidebar-right .widget_better_rss_widget .widget-wrap ul").wrap('<div class="frame" />')}jQuery(".post").wrapInner('<div class="frame" />');jQuery(".post").wrapInner('<div class="holder" />');jQuery(".post").wrapInner('<div class="box" />');jQuery(".content-twosidebars #inner .widget-area").wrapAll('<div class="main-holder">');if(jQuery(".page-id-132").html()){jQuery("#menu-item-24").addClass("current-menu-item")}jQuery(".map").click(function(a){jQuery.modal('<iframe src="'+this.href+'&output=embed"></iframe>');return false});jQuery("#shShutter").click(function(a){alert("here");shutterReloaded.hideShutter()});jQuery("form#cm_ajax_form_3 input:submit").click(function(){var a=jQuery("#cm-ajax-email").val();var b=/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;if(!b.test(a)){alert("Please enter a valid email address.");jQuery("#cm-ajax-email").focus();return false}jQuery.ajax({type:"POST",data:jQuery("form#cm_ajax_form_3").serialize()+"&cm_ajax_response=ajax",success:function(a){if(a=="SUCCESS"){alert("Thanks - you've subscribed to our newsletter.");jQuery("#cm-ajax-email").val("");jQuery("#cm-ajax-email").blur()}else{alert("Sorry, subscribing that email address failed. Please double check that it's correct, and try again.")}}});return false})})
