var JKPlatform={DocumentReady:function(){$(".form-row > LABEL:not(.req)").prepend('<span class="not-required">&nbsp;</span>');$(".form-row > LABEL.req").prepend('<span class="required-star">*</span>')},Data:{cookieLifeTime:365,updateMemberProfile:false,memberId:null,Save:function(A,B){$.cookie(A,B,{expires:this.cookieLifeTime,path:"/"});if(this.updateMemberProfile){}}},Utilities:{StringAfterUnderscore:function(A){return A.substr(A.indexOf("_")+1)}},Customise:{currentColor:null,currentBackground:null,selectedColor:null,selectedBackground:null,Setup:function(){var A=new String($("body").attr("class"));var B=A.split(" ");for(var C=0;C<B.length;C++){if(B[C].substr(0,3)=="co-"){this.currentColor=B[C].substr(3)}else{if(B[C].substr(0,3)=="bg-"){this.currentBackground=B[C].substr(3)}}}$("#customise-link").click(function(){$("#customise-modal").modal({close:false,onShow:JKPlatform.Customise.ModalShow});return false});$("#color-choices a").click(function(){var D=JKPlatform.Customise;D.selectedColor=$(this).attr("rel").substr(3);$("body").attr("class","co-"+D.selectedColor+" bg-"+D.selectedBackground);$("#color-choices a").removeClass("active");$(this).addClass("active");return false});$("#background-choices a").click(function(){var D=JKPlatform.Customise;D.selectedBackground=$(this).attr("rel").substr(3);$("body").attr("class","co-"+D.selectedColor+" bg-"+D.selectedBackground);$("#background-choices a").removeClass("active");$(this).addClass("active");return false});$("#customise-cancel-button").click(function(){var D=JKPlatform.Customise;$("body").attr("class","co-"+D.currentColor+" bg-"+D.currentBackground);$.modal.close();return false});$("#customise-apply-button").click(function(){var D=JKPlatform.Customise;D.currentColor=D.selectedColor;D.currentBackground=D.selectedBackground;$("body").attr("class","co-"+D.currentColor+" bg-"+D.currentBackground);$.modal.close();JKPlatform.Data.Save("theme-color","co-"+D.currentColor);JKPlatform.Data.Save("theme-background","bg-"+D.currentBackground);return false})},ModalShow:function(){var A=JKPlatform.Customise;A.selectedColor=A.currentColor;A.selectedBackground=A.currentBackground;$("#color-choices a").removeClass("active");$("#color-choices a#color-"+A.selectedColor).addClass("active");$("#background-choices a").removeClass("active");$("#background-choices a#backg-"+A.selectedBackground).addClass("active")}}};function tabnav_select_tab(A){var C=$(A).parents(".tabnav");C.find("li").removeClass("tab_active");$($(A).parent()[0]).addClass("tab_active");var B=$($(A).parents()[1]).attr("id");$.each($.find(".tabs_holder"),function(){if($(this).hasClass(B)){$(this).hide()}});$("#"+$($(A).parent()[0]).attr("id")+"_holder").show()}function tabnav_add_behaviour(){$(".tabnav a").click(function(){tabnav_select_tab(this);return false})};

function scrollScreenTo(selector, offset) {
  var targetOffset = $(selector).offset().top;
  var topOffset = (offset) ? offset : 0;
  $('html,body').animate({scrollTop: (targetOffset - topOffset)}, 1200);
}

function alertBox(selector, msg) {
  $(selector+' .close a').click(function(){ $(this).parents('.alert_box').hide(); });
  $(selector+' .html').html(msg);
  $(selector).show();
  scrollScreenTo(selector, 70);
}
