jQuery("document").ready(function() { jQuery('#nav ul li ul li:last-child > a').css("border-bottom","0"); //jQuery('.editorarea div:last-child').css("margin-bottom","0"); jQuery('#sidebar ul li:last-child').css("padding-bottom","0"); jQuery('#sidebar .widget:last-child').css("margin-bottom","0"); jQuery("#quotes_carousel").punchquotes(); jQuery('#teasers').services( { width:920, height:290, slideAmount:5 , slideSpacing:30, touchenabled:"on", mouseWheel:"Off", slideshow:0000, hoverAlpha:"off", callBack:function() { } }); jQuery('.dropdown').dropdown({}); jQuery("#socials a").punchtip({}); //Oiplayer var search_standard = jQuery("#Form_Search").val(); jQuery("#Form_Search").focus(function(){ var $this = jQuery(this); $this.val($this.val()==search_standard ? "" : $this.val()); }); jQuery("#Form_Search").blur(function(){ var $this = jQuery(this); $this.val($this.val()== "" ? search_standard : $this.val()); }); oldErrorMessageContact = jQuery("#contactform .errormessage").text(); oldErrorMessageNewsletter = jQuery("#newsletterform .errormessage").text(); /* Contact Form */ function addForm(formtype) { var formid = jQuery(formtype); var emailsend = false; formid.find("a[name=send]").click(sendemail); function validator() { var emailcheck = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; var othercheck = /.{4}/; var noerror = true; formid.find(".requiredfield").each(function () { var fieldname = jQuery(this).attr('name'); var value = jQuery(this).val(); if(fieldname == "email"){ if (!emailcheck.test(value)) { jQuery(this).addClass("formerror"); noerror = false; } else { jQuery(this).removeClass("formerror"); } }else{ if (!othercheck.test(value)) { jQuery(this).addClass("formerror"); noerror = false; } else { jQuery(this).removeClass("formerror"); } } }) if(!noerror){ formid.find(".errormessage").fadeIn(); } return noerror; } function resetform() { formid.find("input").each(function () { jQuery(this).val(""); }) formid.find("textarea").val(""); emailsend = false; } function sendemail() { jQuery("#contactform").find(".errormessage").text(oldErrorMessageContact); jQuery("#newsletterform").find(".errormessage").text(oldErrorMessageNewsletter); formid.find(".successmessage").hide(); var phpfile = ""; if(formtype=="#contactform"){ phpfile = $templateurl+"/php/contactsend.php"; }else if(formtype=="#newsletterform"){ phpfile = $templateurl+"/php/newslettersend.php"; }else{ phpfile = ""; } if (validator()) { if(!emailsend){ emailsend = true; formid.find(".errormessage").hide(); formid.find(".sendingmessage").show(); jQuery.post(phpfile, formid.serialize(), function(data) { formid.find(".sendingmessage").hide(); if(data){ formid.find("#recaptcha_response_field").addClass("formerror"); formid.find(".errormessage").text(data).fadeIn(); } else{ formid.find(".successmessage").fadeIn(); resetform(); formid.find(".errormessage").text(oldErrorMessage); } Recaptcha.reload(); addForm('#contactform'); }); } } return false; } } /* Contact Form */ if(jQuery('#contactform').length != 0){ addForm('#contactform'); } if(jQuery('#newsletterform').length != 0){ addForm('#newsletterform'); } jQuery(".lightbox").tplightboxsolo({ // Which Style should be used in the LightBox style:"dark-lightbox", // Which Social Items should be used on the Lightbox showGoogle:"yes", showFB:"yes", showTwitter:"yes", // Which Divider should be used by Deep Link http://www.yourwebsite.com?id=1 deepLink:"true", urlDivider:"?", // YOUTUBE / VIMEO MARKUP - iframe example vimeo_markup: '', youtube_markup:'', flvmarkup:' ', flvplayer:'http://www.themepunch.com/config/wp-content/themes/config/js/flowplayer_plugins/flowplayer-3.2.7.swf' }); //back button jQuery("#footer #top_button").hide(); // fade in #top_button $(function () { $(window).scroll(function () { if ($(this).scrollTop() > orig_scroll_height) { $('#top_button').fadeIn(400); } else { $('#top_button').fadeOut(50); } }); // scroll body to 0px on click $('#footer_wrapper #top_button').click(function () { $('body,html').animate({ scrollTop: 0 }, 400); return false; }); }); }); jQuery(window).load(function(){ // Function to have the footer bound to the bottom orig_content_height=jQuery("#content_wrapper").outerHeight(true); margin = jQuery("#content_wrapper").outerHeight(true) - jQuery("#content_wrapper").height(); orig_scroll_height = jQuery("#footer_wrapper").position().top - $(window).height()+120; //jQuery('body').append('
'); //footer height // jQuery("#footer .widget").equalHeights(true); jQuery("div iframe").attr("frameborder",0); jQuery(window).resize(function(){setFooter()}); setInterval(function(){setFooter();},300); (function(d, s, id) { if(jQuery(".fb-like").length) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=162252937201892"; fjs.parentNode.insertBefore(js, fjs); } }(document, 'script', 'facebook-jssdk')); }); function setFooter(){ var contop = jQuery("#content_wrapper").offset().top; var conhei = jQuery("#content_wrapper").outerHeight(true); var fh=parseInt(jQuery("#footer_wrapper").outerHeight(),0); var feh=parseInt(jQuery("#footer_end_wrapper").outerHeight(),0); var contend=contop+conhei; var dif=0; if (fh+feh+contend