MKWrapper.framework='jquery';MKWrapper.$tag=function(a,b){f=MKWrapper._tagFunc(a);tag=f(b);return tag[0]};MKWrapper.attachEvent=function(a,b,c,d){if(a==null)return;d=d?d:this;if(d!='skip')c=c.bind(d);jQuery(a).bind(b,{'scope':d},c)};MKWrapper.removeEvent=function(a,b,c){jQuery(a).unbind(b,c)};MKWrapper.stopEvent=function(a){a.stopPropagation()};MKWrapper.bindAsEventListener=function(a,b){return a.bind(b)};MKWrapper.each=function(c,f,d){jQuery.each(c,function(a,b){f(b,a)})};MKWrapper.findChilds=function(a,b){if(typeof(b)=="undefined"){return jQuery(a).children()}else{return jQuery(a).find(b)}};MKWrapper.next=function(a){return jQuery(a).next().get(0)};MKWrapper.previous=function(a){return jQuery(a).prev().get(0)};MKWrapper.setStyle=function(a,b){return jQuery(a).css(b)};MKWrapper._tagFunc=function(b){return function(){var a,children;if(arguments.length>0){if(arguments[0].nodeName||typeof arguments[0]=="string"){children=arguments}else{a=arguments[0];children=[].slice.call(arguments,1)}}return MKWrapper._create(b,a,children)}};MKWrapper._create=function(a,b,c){b=b||{};c=c||[];var d=navigator.userAgent.match(/MSIE/);var e=document.createElement((d&&b.name)?"<"+a+" name="+b.name+">":a);for(var f in b){if(typeof b[f]!='function'){if(d){IE_TRANSLATIONS={'class':'className','for':'htmlFor'};var g;if(g=IE_TRANSLATIONS[f]){e[g]=b[f]}else if(f=='style'){e.style.cssText=b[f]}else if(f.match(/^on/)){e[f]=new Function(b[f])}else{e.setAttribute(f,b[f])}}else{e.setAttribute(f,b[f])}}}for(var i=0;i<c.length;i++){if(typeof c[i]=='string')c[i]=document.createTextNode(c[i]);e.appendChild(c[i])}return jQuery(e)};MKWrapper.cloneObject=function(a){return MKWrapper.extend({},a)};MKWrapper.extend=function(a,b){var c=jQuery.extend(a,b);return c};MKWrapper.$=function(a,b){if(!a)return false;if(b==null){b=true}if(typeof a=="string"){if(a.search(/#/)==-1)a='#'+a}var c=jQuery(a);return c.length>0?(b?c.get(0):c):false};MKWrapper.id=function(a){if(typeof id!="object")a=jQuery(a);return a.attr('id')};MKWrapper.hasClass=function(a,b){return jQuery(a).hasClass(b)};MKWrapper.addClass=function(a,b){return jQuery(a).addClass(b)};MKWrapper.removeClass=function(a,b){return jQuery(a).removeClass(b)};MKWrapper.parent=function(a){return jQuery(a).parent().get(0)};MKWrapper.getDimensions=function(a,b){var c=jQuery(a);switch(b){case'inner':return{height:c.innerHeight(),width:c.innerWidth()};case'outer':return{height:c.outerHeight(),width:c.outerWidth()};case'outermargin':return{height:c.outerHeight(true),width:c.outerWidth(true)};default:return{height:c.height(),width:c.width()}}};MKWrapper.clonePosition=function(a,b,c){var c=jQuery.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetLeft:0,offsetTop:0},(c||{}));a=jQuery(a);b=jQuery(b);var d={'top':0,'left':0};if(b[0]!==document)d=jQuery.extend(d,(b.position()||{}));if(c.setLeft)a.css({'left':d.left+c.offsetLeft});if(c.setTop)a.css({'top':d.top+c.offsetTop});if(c.setWidth)a.width(b.width());if(c.setHeight)a.height(b.height());return a};MKWrapper.showParents=function(a){var b=new Array();if(!jQuery(a).is(':visible')){var c=jQuery(a).parent();var d=new Array();while(!c.is(':visible')){d.push(c);c=c.parent()}for(var c in d.reverse()){if(!d[c].is(':visible')){b.push(d[c]);d[c].show()}}}return b};MKWrapper.hideElements=function(a){if(a.length)for(var b in a)a[b].hide()};MKWrapper.$A=function(a){return jQuery.makeArray(a)};MKWrapper.$F=function(a){a=jQuery(a);if((a.is('input:checkbox')||a.is('input:radio'))&&!a.is(':checked'))return null;return a.val()};MKWrapper.$H=function(a){return jQuery.makeArray(a)};MKWrapper.onDOMReady=function(f){jQuery(document).ready(f)};MKWrapper.ajaxCall=function(c,d,e){new jQuery.ajax({url:c,type:d.method,success:function(a,b){d.onSuccess(a,e)},data:d.parameters,error:d.onFailure})};MKWrapper.loadScript=function(a,b,c){jQuery.ajax({url:a,dataType:'script',async:false,success:function(){b(c)}})};MKWrapper.strStrip=function(a){return jQuery.trim(a)};MKWrapper.domNode=function(a){return jQuery('#'+a).get(0)};MKWrapper.domRemove=function(a){if(typeof(a)=='undefined')return;if(a==null)return;jQuery(a).empty();jQuery(a).remove()};MKWrapper.domInsert=function(a,b){jQuery(a).html(b)};MKWrapper.domReplace=function(a,b){jQuery(a).replaceWith(b)};MKWrapper.bind=function(a,b){return a.bind(b)};MKWrapper.remove=function(a){return jQuery(a).hide()};MKWrapper.fxAppear=function(a,b,c){elem=MKWrapper.$(a,false);var d=0;if(elem)elem.show(d,c);if(!d&&typeof c=='function')c()};MKWrapper.fxHide=function(a,b,c){elem=MKWrapper.$(a,false);var d=0;if(elem)elem.hide(d,c);if(!d&&typeof c=='function')c()};Function.prototype.bind=function(a){var b=this,ap,concat,args,isPartial=arguments.length>1;if(!isPartial){return function(){if(arguments.length!==0){return b.apply(a,arguments)}else{return b.call(a)}}}else{ap=Array.prototype,args=ap.slice.call(arguments,1);concat=ap.concat;return function(){return b.apply(a,arguments.length===0?args:concat.apply(args,arguments))}}};String.prototype.startsWith=function(t,i){if(i==false){return(t==this.substring(0,t.length))}else{return(t.toLowerCase()==this.substring(0,t.length).toLowerCase())}};MKWrapper.delayedObserver=function(a,b,c){return jQuery(a).delayedObserver(c,b)};jQuery.extend(jQuery.fn,{delayedObserver:function(c,d,e){return this.each(function(){var a=jQuery(this);var b=e||{};a.data('oldval',a.val()).data('delay',d||0.5).data('condition',b.condition||function(){return(jQuery(this).data('oldval')==jQuery(this).val())}).data('callback',c)[(b.event||'keyup')](function(){if(a.data('condition').apply(a)){return}else{if(a.data('timer')){clearTimeout(a.data('timer'))}a.data('timer',setTimeout(function(){a.data('callback').apply(a)},a.data('delay')*1000));a.data('oldval',a.val())}})})}});RegExp.prototype.match=RegExp.prototype.test;MKWrapper.isJSON=function(a){if(a.length==0)return false;a=a.replace(/\\./g,'@').replace(/"[^"\\\n\r]*"/g,'');return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(a)};MKWrapper.evalJSON=function(a,b){var c=a.replace(/^\/\*-secure-([\s\S]*)\*\/\s*$/,'$1');try{if(!b||MKWrapper.isJSON(c))return eval('('+c+')')}catch(e){}throw new SyntaxError('Badly formed JSON string');};MKWrapper.handleValidationErrors=function(d,e,f){f=f?MKWrapper.$(f,false):false;if(f)f.empty();if(d.noErrors&&d.noErrors===true)return;var g=MKWrapper.$tag('div',{'class':'errors'});for(var h in d){var i=e.o(h);if(i!=null){if(f){var j=MKWrapper.$tag('div',{'class':'error'});jQuery(j).text(d[h]);jQuery(g).append(j)}var k=MKWrapper.$(i.config.id,false);var l=MKWrapper.$(i.getLabel(),false);var m=MKWrapper.$('showspan_'+i.config.id,false);if(l)l.addClass('hasError');if(m)m.addClass('hasError');if(k){k.addClass('hasError');k.unbind('change.errorhandler');k.bind('change.errorhandler',function(){var a=e.o(jQuery(this).attr('id'));var b=MKWrapper.$('showspan_'+a.config.id,false);var c=MKWrapper.$(a.getLabel(),false);jQuery(this).removeClass('hasError');if(c)c.removeClass('hasError');if(b)b.addClass('hasError')})}}}if(f&&jQuery(g).children().length)f.append(g)};MKWrapper._changeHandler=function(){jQuery(this).removeClass('hasError')};
