(function(A){A.fn.fadeLater=function(){return this.each(function(){A(this).fadeIn(100);A(this).fadeTo(3000,1);A(this).fadeOut()})}})(jQuery);(function(A){A.fn.shake=function(){return this.each(function(){A(this).animate({marginLeft:"10px"},50).animate({marginLeft:"0px"},50).animate({marginLeft:"5px"},80).animate({marginLeft:"0px"},120)})}})(jQuery);(function(A){A.fn.placer=function(C,B){B=A.extend({offsetX:0,offsetY:0,relativeContainer:null,where:"top-left",debug:false},B);return this.each(function(){box=A(this);anchor=A(C);if(!anchor){alert("Could not select PlaceRel:sel="+C)}if(!B.relativeContainer){B.relativeContainer=anchor.offsetParent()}var D=anchor.position();D.rleft=D.left;D.rtop=D.top;D.height=anchor.height();D.width=anchor.width();D.zdex=parseInt(anchor.css("z-index"));box.appendTo(B.relativeContainer);switch(B.where){case"top-left":t=D.rtop+B.offsetY+"px";l=D.rleft+B.offsetX+"px";break;case"top-right":t=D.rtop+B.offsetY+"px";l=D.rleft+D.width+B.offsetX+"px";break;case"bottom-left":t=D.rtop+D.height+B.offsetY+"px";l=D.rleft+B.offsetX+"px";break;case"bottom-right":t=D.rtop+D.height+B.offsetY+"px";l=D.rleft+D.width+B.offsetX+"px";break;case"off-left":t=D.rtop+B.offsetY+"px";l=D.rleft+B.offsetX-box.outerWidth()+"px";break}if(!box.zdex){zdex=200}if(B.debug){A.trace(l+"-"+t+" in #"+A(B.relativeContainer).attr("id")+":."+A(B.relativeContainer).attr("className"))}box.css({position:"absolute",top:t,left:l,zIndex:zdex})})}})(jQuery);(function(A){A.fn.formulate=function(B){B=jQuery.extend({submitBtnSelector:".x_submit",callbacks:"",ap:".x_submit",offset:{offsetX:0,offsetY:0},formid:A(this).attr("id"),scall:true,errLoc:"before",createErrSpans:true,autoLabelFor:true,autoLabels:true,setFocusObj:A(this).find("input:first"),instant:true,validateOnly:false},B);return this.each(function(){obj=A(this);if(B.autoLabels){if(B.errLoc=="before"){obj.find("[name*='_vd']").before("<label></label>")}if(B.errLoc=="after"){obj.find("[name*='_vd']").after("<label></label>")}B.createErrSpans=true;B.autoLabelFor=true}if(B.createErrSpans||B.autoLabelFor){lbl=obj.find("label").each(function(){if(B.createErrSpans){A(this).append("<span class='vd_error'></span>")}if(B.autoLabelFor){if(B.errLoc=="before"){elem=A(this).nextAll("[name]:first")}if(B.errLoc=="after"){elem=A(this).prevAll("[name]:first")}var C=elem.attr("name");elem.attr("id",C);A(this).attr("for",C)}})}obj.find(B.submitBtnSelector).click(function(){if(A.panther.wait){return false}A("#"+B.formid).find(".vd_error").html("");opts={ap:B.ap,offset:B.offset,instant:B.instant,url:"/system/modules/pubsummit/cp/ajax.php",returnAndSubmit:B.validateOnly};if(B.scall){opts.url+="?S="+A.panther.sess}A.panther.jcall("validateForm",[A("#"+B.formid).serialize(),B.callbacks,B.formid,B.errLoc],opts);return false});B.setFocusObj.focus();B.setFocusObj.select();obj.find("[name]").not(".nsoe").keydown(function(C){if(C.keyCode==13){A(this).parents("form").find(B.submitBtnSelector).click();return false}})})}})(jQuery);jQuery.trace=function(A,B){if(B==undefined){B="body"}$(B).append(A+"<br>");return A};jQuery.panther={wait:false,store:[],jcall:function(func,params,opt){if("undefined"==typeof (opt)){opt={}}if("undefined"==typeof (opt.url)){opt.url="/system/modules/pubsummit/cp/ajax.php"}if("undefined"==typeof (params)){params=[]}jQuery.ajax({type:"POST",url:opt.url,dataType:"json",data:{func:func,parameters:jQuery.compactJSON(params)},success:function(resp){eval(resp["target"]);if("undefined"!=typeof (target)&&"undefined"!=typeof (resp["xhtml"])){target.each(function(){if(this.toString().indexOf("TableRowElement")>0){jQuery(this).trHtml(resp["xhtml"])}else{jQuery(this).html(resp["xhtml"])}})}eval(resp["js"])}})}}
