(function($){var baseURL="http://www.salesdnaltd.com";var themeURL=baseURL+"/wp-content/themes/salesdna";var currentURL=window.location;$("#menu-main-navigation").find("li").each(function(){var thisObj=$(this);if(thisObj.has(".sub-menu").length==1){thisObj.addClass("parent");}});$("a[href='"+currentURL+"']").addClass("active_link");$(".entrypoint:last").css("margin-right","0px");$("#top_navigation ul li:last,footer ul li:last").css("color","#fff");$("#enquiry_form_2 input[type=submit]").val("");$("#newsletter_js,#js,#js_2").val("yes");$(".course").each(function(){var thisObj=$(this);$("p:first",thisObj).addClass("first");$(".cutoff",thisObj).nextAll().not(".expand").hide();thisObj.attr("data-height",thisObj.height());$(".more_details",thisObj).hide();$("p:first",thisObj).nextAll().not(".expand").hide();thisObj.css("height",thisObj.height()+"px");});$("#course_body p:first").addClass("first");var course_top="-"+Math.ceil($("#course_top").innerHeight()+20)+"px";$("#course_right").css({"top":course_top,"margin-bottom":course_top});$(".sub-menu").each(function(){$("li:eq(1)",this).addClass("corner");});if($("#parent_left").length>0){$("#body").css("min-height",$("#parent_left").height()+"px");}
$("#generic_left form").not("#enquiry_form_2 form").each(function(){var thisForm=$(this);thisForm.css("display","inline").css("width",thisForm.width()+"px").css("margin","0px auto").css("display","block");});function you_tube(url){var youtube_id;youtube_id=url.replace(/^[^v]+v.(.{11}).*/,"$1");return youtube_id;}
$(".youtube a[href^='http://www.youtube.com']:last").each(function(){var video=you_tube($(this).attr("href"));var player='<object width="249" height="209"><param name="movie" value="http://www.youtube.com/v/'+video+'?fs=1&hl=en_GB&rel=0&hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'+video+'?fs=1&hl=en_GB&rel=0&hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="249" height="209"></embed></object>';$("#course_media").html(player);}).remove();$(".course a[href^='http://www.youtube.com']").remove();$("#homepage_success .success_post:gt(0)").hide();$("#homepage_success .success_post:first").addClass("active");$("#next_success").live("click",function(){var nextTotal=$(".active").nextAll(".success_post").length;if(nextTotal>0){$("#homepage_success .active").removeClass("active").hide().next().addClass("active").fadeIn();}else{$("#homepage_success .active").removeClass("active").hide()
$(".success_post:first").addClass("active").fadeIn();}});$("#generic_success .success_post:gt(0)").hide();$("#generic_success .success_post:first").addClass("active");if($("#generic_success").length>0){setInterval(function(){var nextTotal=$(".active").nextAll(".success_post").length;if(nextTotal>0){$("#generic_success .active").removeClass("active").hide().next().addClass("active").fadeIn();}else{$("#generic_success .active").removeClass("active").hide()
$(".success_post:first").addClass("active").fadeIn();}},5000);}
$(".blog_post:last").css("background","none");$("#parent_body h3:first").css("border","0px").css("padding","0px").css("margin","0px");$("#homepage_tabs h2").css("opacity",0.7);$("#homepage_tabs h2:first").addClass("active").css("opacity",1);i=0;$("#homepage_tabs h2").each(function(){$(this).css("margin-left",Math.ceil(i*176)+"px").nextUntil("h2").wrapAll('<div class="tab"></div>');i++;}).live("click",function(){$(".tab").hide();$("#homepage_tabs h2.active").css("opacity",0.7).removeClass("active");$(this).addClass("active").css("opacity",1).next(".tab").fadeIn();}).css("cursor","pointer");$(".tab:gt(0)").hide();$("#homepage_tabs").css("min-height",$("#homepage_tabs").height()+"px");})(this.jQuery);
