(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context)};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1]){selector=jQuery.clean([match[1]],context)}else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3]){return jQuery().find(selector)}return jQuery(elem)}selector=[]}}else{return jQuery(context).find(selector)}}else{if(jQuery.isFunction(selector)){return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector)}}return this.setArray(jQuery.makeArray(selector))},jquery:"1.2.6",size:function(){return this.length},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num]},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this},each:function(callback,args){return jQuery.each(this,callback,args)},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this)},attr:function(name,value,type){var options=name;if(name.constructor==String){if(value===undefined){return this[0]&&jQuery[type||"attr"](this[0],name)}else{options={};options[name]=value}}return this.each(function(i){for(name in options){if(typeof options[name]!="function"){jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name))}}})},css:function(key,value){if((key=="width"||key=="height")&&parseFloat(value)<0){value=undefined}return this.attr(key,value,"curCSS")},text:function(text){if(typeof text!="object"&&text!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text))}var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8){ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this])}})});return ret},wrapAll:function(html){if(this[0]){jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild){elem=elem.firstChild}return elem}).append(this)}return this},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html)})},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html)})},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1){this.appendChild(elem)}})},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1){this.insertBefore(elem,this.firstChild)}})},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this)})},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling)})},end:function(){return this.prevObject||jQuery([])},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem)});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems)},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0]}else{return this.cloneNode(true)}});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined){this[expando]=null}});if(events===true){this.find("*").andSelf().each(function(i){if(this.nodeType==3){return }var events=jQuery.data(this,"events");for(var type in events){for(var handler in events[type]){jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data)}}})}return ret},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i)})||jQuery.multiFilter(selector,this))},not:function(selector){if(selector.constructor==String){if(isSimple.test(selector)){return this.pushStack(jQuery.multiFilter(selector,this,true))}else{selector=jQuery.multiFilter(selector,this)}}var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector})},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=="string"?jQuery(selector):jQuery.makeArray(selector))))},is:function(selector){return !!selector&&jQuery.multiFilter(selector,this).length>0},hasClass:function(selector){return this.is("."+selector)},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0){return null}for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one){return value}values.push(value)}}return values}else{return(this[0].value||"").replace(/\r/g,"")}}return undefined}if(value.constructor==Number){value+=""}return this.each(function(){if(this.nodeType!=1){return }if(value.constructor==Array&&/radio|checkbox/.test(this.type)){this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0)}else{if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0)});if(!values.length){this.selectedIndex=-1}}else{this.value=value}}})},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value)},replaceWith:function(value){return this.after(value).remove()},eq:function(i){return this.slice(i,i+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments))},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)}))},andSelf:function(){return this.add(this.prevObject)},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length){data=jQuery.data(this[0],key)}return data===undefined&&parts[1]?this.data(parts[0]):data}else{return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value)})}},removeData:function(key){return this.each(function(){jQuery.removeData(this,key)})},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse){elems.reverse()}}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr")){obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"))}var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script")){scripts=scripts.add(elem)}else{if(elem.nodeType==1){scripts=scripts.add(jQuery("script",elem).remove())}callback.call(obj,elem)}});scripts.each(evalScript)})}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src){jQuery.ajax({url:elem.src,async:false,dataType:"script"})}else{jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"")}if(elem.parentNode){elem.parentNode.removeChild(elem)}}function now(){return +new Date}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2}if(typeof target!="object"&&typeof target!="function"){target={}}if(length==i){target=this;--i}for(;i<length;i++){if((options=arguments[i])!=null){for(var name in options){if(target===options[name]){continue}if(deep&&options[name]&&typeof options[name]=="object"&&target[name]&&!options[name].nodeType){target[name]=jQuery.extend(target[name],options[name])}else{if(options[name]!=undefined){target[name]=options[name]}}}}}return target};var expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep){window.jQuery=_jQuery}return jQuery},isFunction:function(fn){return !!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"")},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie){script.text=data}else{script.appendChild(document.createTextNode(data))}head.insertBefore(script,head.firstChild);head.removeChild(script)}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase()},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id){id=elem[expando]=++uuid}if(name&&!jQuery.cache[id]){jQuery.cache[id]={}}if(data!==undefined){jQuery.cache[id][name]=data}return name?jQuery.cache[id][name]:id},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id]){break}if(!name){jQuery.removeData(elem)}}}else{try{delete elem[expando]}catch(e){if(elem.removeAttribute){elem.removeAttribute(expando)}}delete jQuery.cache[id]}},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length==undefined){for(name in object){if(callback.apply(object[name],args)===false){break}}}else{for(;i<length;){if(callback.apply(object[i++],args)===false){break}}}}else{if(length==undefined){for(name in object){if(callback.call(object[name],name,object[name])===false){break}}}else{for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}}return object},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value)){value=value.call(elem,i)}return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className)){elem.className+=(elem.className?" ":"")+className}})},remove:function(elem,classNames){if(elem.nodeType==1){elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return !jQuery.className.has(classNames,className)}).join(" "):""}},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name]}callback.call(elem);for(var name in options){elem.style[name]=old[name]}},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0});val-=Math.round(padding+border)}if(jQuery(elem).is(":visible")){getWH()}else{jQuery.swap(elem,props,getWH)}return Math.max(0,val)}return jQuery.curCSS(elem,name,force)},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari){return false}var ret=defaultView.getComputedStyle(elem,null);return !ret||ret.getPropertyValue("color")==""}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save}if(name.match(/float/i)){name=styleFloat}if(!force&&style&&style[name]){ret=style[name]}else{if(defaultView.getComputedStyle){if(name.match(/float/i)){name="float"}name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem)){ret=computedStyle.getPropertyValue(name)}else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode){stack.unshift(a)}for(;i<stack.length;i++){if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block"}}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";for(i=0;i<swap.length;i++){if(swap[i]!=null){stack[i].style.display=swap[i]}}}if(name=="opacity"&&ret==""){ret="1"}}else{if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase()});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft}}}}return ret},clean:function(elems,context){var ret=[];context=context||document;if(typeof context.createElement=="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document}jQuery.each(elems,function(i,elem){if(!elem){return }if(elem.constructor==Number){elem+=""}if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">"});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--){div=div.lastChild}if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j])}}if(/^\s/.test(elem)){div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild)}}elem=jQuery.makeArray(div.childNodes)}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select"))){return }if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options){ret.push(elem)}else{ret=jQuery.merge(ret,elem)}});return ret},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8||name=="toJSONString"){return undefined}var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari){elem.parentNode.selectedIndex}if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode){throw"type property can't be changed"}elem[name]=value}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name)){return elem.getAttributeNode(name).nodeValue}return elem[name]}if(msie&&notxml&&name=="style"){return jQuery.attr(elem.style,"cssText",value)}if(set){elem.setAttribute(name,""+value)}var attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+""=="NaN"?"":"alpha(opacity="+value*100+")")}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase()});if(set){elem[name]=value}return elem[name]},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"")},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call){ret[0]=array}else{while(i){ret[--i]=array[i]}}}return ret},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++){if(array[i]===elem){return i}}return -1},merge:function(first,second){var i=0,elem,pos=first.length;if(jQuery.browser.msie){while(elem=second[i++]){if(elem.nodeType!=8){first[pos++]=elem}}}else{while(elem=second[i++]){first[pos++]=elem}}return first},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i])}}}catch(e){ret=array}return ret},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++){if(!inv!=!callback(elems[i],i)){ret.push(elems[i])}}return ret},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null){ret[ret.length]=value}}return ret.concat.apply([],ret)}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});jQuery.each({parent:function(elem){return elem.parentNode},parents:function(elem){return jQuery.dir(elem,"parentNode")},next:function(elem){return jQuery.nth(elem,2,"nextSibling")},prev:function(elem){return jQuery.nth(elem,2,"previousSibling")},nextAll:function(elem){return jQuery.dir(elem,"nextSibling")},prevAll:function(elem){return jQuery.dir(elem,"previousSibling")},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem)},children:function(elem){return jQuery.sibling(elem.firstChild)},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes)}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string"){ret=jQuery.multiFilter(selector,ret)}return this.pushStack(jQuery.unique(ret))}});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++){jQuery(args[i])[original](this)}})}});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1){this.removeAttribute(name)}},addClass:function(classNames){jQuery.className.add(this,classNames)},removeClass:function(classNames){jQuery.className.remove(this,classNames)},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames)},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){jQuery(">*",this).remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments)}});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px")}});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2])},"#":function(a,i,m){return a.getAttribute("id")==m[2]},":":{lt:function(a,i,m){return i<m[3]-0},gt:function(a,i,m){return i>m[3]-0},nth:function(a,i,m){return m[3]-0==i},eq:function(a,i,m){return m[3]-0==i},first:function(a,i){return i==0},last:function(a,i,m,r){return i==r.length-1},even:function(a,i){return i%2==0},odd:function(a,i){return i%2},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a},"only-child":function(a){return !jQuery.nth(a.parentNode.lastChild,2,"previousSibling")},parent:function(a){return a.firstChild},empty:function(a){return !a.firstChild},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"},enabled:function(a){return !a.disabled},disabled:function(a){return a.disabled},checked:function(a){return a.checked},selected:function(a){return a.selected||jQuery.attr(a,"selected")},text:function(a){return"text"==a.type},radio:function(a){return"radio"==a.type},checkbox:function(a){return"checkbox"==a.type},file:function(a){return"file"==a.type},password:function(a){return"password"==a.type},submit:function(a){return"submit"==a.type},image:function(a){return"image"==a.type},reset:function(a){return"reset"==a.type},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button")},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},has:function(a,i,m){return jQuery.find(m[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem}).length}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r)}return cur},find:function(t,context){if(typeof t!="string"){return[t]}if(context&&context.nodeType!=1&&context.nodeType!=9){return[]}context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++){for(var c=ret[i].firstChild;c;c=c.nextSibling){if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName)){r.push(c)}}}ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0){continue}foundToken=true}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling){if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id]){break}if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~"){merge[id]=true}r.push(n)}if(m=="+"){break}}}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0]){ret.shift()}done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length)}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]]}else{re2=quickClass;m=re2.exec(t)}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2]){oid=jQuery('[@id="'+m[2]+'"]',elem)[0]}ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[]}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object"){tag="param"}r=jQuery.merge(r,ret[i].getElementsByTagName(tag))}if(m[1]=="."){r=jQuery.classFilter(r,m[2])}if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++){if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break}}r=tmp}ret=r}t=t.replace(re2,"")}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t)}}if(t){ret=[]}if(ret&&context==ret[0]){ret.shift()}done=jQuery.merge(done,ret);return done},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass){tmp.push(r[i])}}return tmp},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break}}if(!m){break}if(m[1]==":"&&m[2]=="not"){r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3])}else{if(m[1]=="."){r=jQuery.classFilter(r,m[2],not)}else{if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2])){z=jQuery.attr(a,m[2])||""}if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not){tmp.push(a)}}r=tmp}else{if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling){if(n.nodeType==1){n.nodeIndex=c++}}merge[id]=true}var add=false;if(first==0){if(node.nodeIndex==last){add=true}}else{if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0){add=true}}if(add^not){tmp.push(node)}}r=tmp}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object"){fn=fn[m[2]]}if(typeof fn=="string"){fn=eval("false||function(a,i){return "+fn+";}")}r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r)},not)}}}}}return{r:r,t:t}},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1){matched.push(cur)}cur=cur[dir]}return matched},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir]){if(cur.nodeType==1&&++num==result){break}}return cur},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem){r.push(n)}}return r}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8){return }if(jQuery.browser.msie&&elem.setInterval){elem=window}if(!handler.guid){handler.guid=this.guid++}if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments)});handler.data=data}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered){return jQuery.event.handle.apply(arguments.callee.elem,arguments)}});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener){elem.addEventListener(type,handle,false)}else{if(elem.attachEvent){elem.attachEvent("on"+type,handle)}}}}handlers[handler.guid]=handler;jQuery.event.global[type]=true});elem=null},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8){return }var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)==".")){for(var type in events){this.remove(elem,type+(types||""))}}else{if(types.type){handler=types.handler;types=types.type}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(type=="toJSONString"){return }if(events[type]){if(handler){delete events[type][handler.guid]}else{for(handler in events[type]){if(!parts[1]||events[type][handler].type==parts[1]){delete events[type][handler]}}}for(ret in events[type]){break}if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener){elem.removeEventListener(type,jQuery.data(elem,"handle"),false)}else{if(elem.detachEvent){elem.detachEvent("on"+type,jQuery.data(elem,"handle"))}}}ret=null;delete events[type]}}})}for(ret in events){break}if(!ret){var handle=jQuery.data(elem,"handle");if(handle){handle.elem=null}jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle")}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true}if(!elem){if(this.global[type]){jQuery("*").add([window,document]).trigger(type,data)}}else{if(elem.nodeType==3||elem.nodeType==8){return undefined}var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true}data[0].type=type;if(exclusive){data[0].exclusive=true}var handle=jQuery.data(elem,"handle");if(handle){val=handle.apply(elem,data)}if((!fn||(jQuery.nodeName(elem,"a")&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false){val=false}if(event){data.shift()}if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined){val=ret}}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,"a")&&type=="click")){this.triggered=true;try{elem[type]()}catch(e){}}this.triggered=false}return val},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false){val=ret}if(ret===false){event.preventDefault();event.stopPropagation()}}}return val},fix:function(event){if(event[expando]==true){return event}var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--){event[props[i]]=originalEvent[props[i]]}event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault){originalEvent.preventDefault()}originalEvent.returnValue=false};event.stopPropagation=function(){if(originalEvent.stopPropagation){originalEvent.stopPropagation()}originalEvent.cancelBubble=true};event.timeStamp=event.timeStamp||now();if(!event.target){event.target=event.srcElement||document}if(event.target.nodeType==3){event.target=event.target.parentNode}if(!event.relatedTarget&&event.fromElement){event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement}if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0)}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode)){event.which=event.charCode||event.keyCode}if(!event.metaKey&&event.ctrlKey){event.metaKey=event.ctrlKey}if(!event.which&&event.button){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)))}if(typeof event.layerX=="undefined"){event.layerX=(typeof originalEvent.layerX=="undefined")?((typeof event.offsetX=="undefined")?originalEvent.offsetX:event.offsetX):originalEvent.layerX}if(typeof event.layerY=="undefined"){event.layerY=(typeof originalEvent.layerY=="undefined")?((typeof event.offsetY=="undefined")?originalEvent.offsetY:event.offsetY):originalEvent.layerY}return event},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy},special:{ready:{setup:function(){bindReady();return },teardown:function(){return }},mouseenter:{setup:function(){if(jQuery.browser.msie){return false}jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true},teardown:function(){if(jQuery.browser.msie){return false}jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true},handler:function(event){if(withinElement(event,this)){return true}event.type="mouseenter";return jQuery.event.handle.apply(this,arguments)}},mouseleave:{setup:function(){if(jQuery.browser.msie){return false}jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true},teardown:function(){if(jQuery.browser.msie){return false}jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true},handler:function(event){if(withinElement(event,this)){return true}event.type="mouseleave";return jQuery.event.handle.apply(this,arguments)}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data)})},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments)});return this.each(function(){jQuery.event.add(this,type,one,fn&&data)})},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn)})},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn)})},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn)},toggle:function(fn){var args=arguments,i=1;while(i<args.length){jQuery.event.proxy(fn,args[i++])}return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false}))},hover:function(fnOver,fnOut){return this.bind("mouseenter",fnOver).bind("mouseleave",fnOut)},ready:function(fn){bindReady();if(jQuery.isReady){fn.call(document,jQuery)}else{jQuery.readyList.push(function(){return fn.call(this,jQuery)})}return this}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document)});jQuery.readyList=null}jQuery(document).triggerHandler("ready")}}});var readyBound=false;function bindReady(){if(readyBound){return }readyBound=true;if(document.addEventListener&&!jQuery.browser.opera){document.addEventListener("DOMContentLoaded",jQuery.ready,false)}if(jQuery.browser.msie&&window==top){(function(){if(jQuery.isReady){return }try{document.documentElement.doScroll("left")}catch(error){setTimeout(arguments.callee,0);return }jQuery.ready()})()}if(jQuery.browser.opera){document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady){return }for(var i=0;i<document.styleSheets.length;i++){if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return }}jQuery.ready()},false)}if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady){return }if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return }if(numStyles===undefined){numStyles=jQuery("style, link[rel=stylesheet]").length}if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);return }jQuery.ready()})()}jQuery.event.add(window,"load",jQuery.ready)}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,change,select,submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name)}});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem){try{parent=parent.parentNode}catch(error){parent=elem}}return parent==elem};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind()});jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!="string"){return this._load(url)}var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off)}callback=callback||function(){};var type="GET";if(params){if(jQuery.isFunction(params)){callback=params;params=null}else{params=jQuery.param(params);type="POST"}}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified"){self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText)}self.each(callback,[res.responseText,status,res])}});return this},serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val}}):{name:elem.name,value:val}}).get()}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f)}});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type})},getScript:function(url,callback){return jQuery.get(url,null,callback,"script")},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={}}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type})},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings)},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();jsre=/=(\?|%3F)/g;if(s.data&&s.processData&&typeof s.data!="string"){s.data=jQuery.param(s.data)}if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre)){s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?"}}else{if(!s.data||!s.data.match(jsre)){s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?"}}s.dataType="json"}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data){s.data=s.data.replace(jsre,"="+jsonp)}s.url=s.url.replace(jsre,"="+jsonp);s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp]}catch(e){}if(head){head.removeChild(script)}}}if(s.dataType=="script"&&s.cache==null){s.cache=false}if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"")}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null}if(s.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart")}var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset){script.charset=s.scriptCharset}if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script)}}}head.appendChild(script);return undefined}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username){xhr.open(type,s.url,s.async,s.username,s.password)}else{xhr.open(type,s.url,s.async)}try{if(s.data){xhr.setRequestHeader("Content-Type",s.contentType)}if(s.ifModified){xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default)}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false}if(s.global){jQuery.event.trigger("ajaxSend",[xhr,s])}var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter)}catch(e){status="parsererror"}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified")}catch(e){}if(s.ifModified&&modRes){jQuery.lastModified[s.url]=modRes}if(!jsonp){success()}}else{jQuery.handleError(s,xhr,status)}complete();if(s.async){xhr=null}}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0){setTimeout(function(){if(xhr){xhr.abort();if(!requestDone){onreadystatechange("timeout")}}},s.timeout)}}try{xhr.send(s.data)}catch(e){jQuery.handleError(s,xhr,null,e)}if(!s.async){onreadystatechange()}function success(){if(s.success){s.success(data,status)}if(s.global){jQuery.event.trigger("ajaxSuccess",[xhr,s])}}function complete(){if(s.complete){s.complete(xhr,status)}if(s.global){jQuery.event.trigger("ajaxComplete",[xhr,s])}if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")}}return xhr},handleError:function(s,xhr,status,e){if(s.error){s.error(xhr,status,e)}if(s.global){jQuery.event.trigger("ajaxError",[xhr,s,e])}},active:0,httpSuccess:function(xhr){try{return !xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined}catch(e){}return false},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined}catch(e){}return false},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror"){throw"parsererror"}if(filter){data=filter(data,type)}if(type=="script"){jQuery.globalEval(data)}if(type=="json"){data=eval("("+data+")")}return data},param:function(a){var s=[];if(a.constructor==Array||a.jquery){jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value))})}else{for(var j in a){if(a[j]&&a[j].constructor==Array){jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this))})}else{s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]))}}}return s.join("&").replace(/%20/g,"+")}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none"){this.style.display="block"}elem.remove()}}).end()},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none"}).end()},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]()})},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback)},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback)},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback)},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback)},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback)},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback)},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1){return false}var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden){return opt.complete.call(this)}if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow}}if(opt.overflow!=null){this.style.overflow="hidden"}opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val)){e[val=="toggle"?hidden?"show":"hide":val](prop)}else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit}if(parts[1]){end=((parts[1]=="-="?-1:1)*end)+start}e.custom(start,end,unit)}else{e.custom(start,val,"")}}});return true})},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx"}if(!type||(typeof type=="string"&&!fn)){return queue(this[0],type)}return this.each(function(){if(fn.constructor==Array){queue(this,type,fn)}else{queue(this,type).push(fn);if(queue(this,type).length==1){fn.call(this)}}})},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue){this.queue([])}this.each(function(){for(var i=timers.length-1;i>=0;i--){if(timers[i].elem==this){if(gotoEnd){timers[i](true)}timers.splice(i,1)}}});if(!gotoEnd){this.dequeue()}return this}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array){q=jQuery.data(elem,type+"queue",jQuery.makeArray(array))}}return q};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length){q[0].call(this)}})};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false){jQuery(this).dequeue()}if(jQuery.isFunction(opt.old)){opt.old.call(this)}};return opt},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig){options.orig={}}}});jQuery.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width"){this.elem.style.display="block"}},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null){return this.elem[this.prop]}var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd)}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++){if(!timers[i]()){timers.splice(i--,1)}}if(!timers.length){clearInterval(jQuery.timerId);jQuery.timerId=null}},13)}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height"){this.elem.style[this.prop]="1px"}jQuery(this.elem).show()},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(gotoEnd){var t=now();if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim){if(this.options.curAnim[i]!==true){done=false}}if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){this.elem.style.display="none"}if(this.options.hide||this.options.show){for(var p in this.options.curAnim){jQuery.attr(this.elem.style,p,this.options.orig[p])}}}if(done){this.options.complete.call(this.elem)}return false}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now},scrollTop:function(fx){fx.elem.scrollTop=fx.now},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now)},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem){with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop)}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2){border(offsetParent)}if(!fixed&&css(offsetParent,"position")=="fixed"){fixed=true}offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display"))){add(-parent.scrollLeft,-parent.scrollTop)}if(mozilla&&css(parent,"overflow")!="visible"){border(parent)}parent=parent.parentNode}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute")){add(-doc.body.offsetLeft,-doc.body.offsetTop)}if(fixed){add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop))}}results={top:top,left:left}}}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true))}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0}return results};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,"marginTop");offset.left-=num(this,"marginLeft");parentOffset.top+=num(offsetParent,"borderTopWidth");parentOffset.left+=num(offsetParent,"borderLeftWidth");results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left}}return results},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,"position")=="static")){offsetParent=offsetParent.offsetParent}return jQuery(offsetParent)}});jQuery.each(["Left","Top"],function(i,name){var method="scroll"+name;jQuery.fn[method]=function(val){if(!this[0]){return }return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val}):this[0]==window||this[0]==document?self[i?"pageYOffset":"pageXOffset"]||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method]}});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br)};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0)}})})();(function(A){this.version="(beta)(0.0.3)";this.all={};this.special_keys={27:"esc",9:"tab",32:"space",13:"return",8:"backspace",145:"scroll",20:"capslock",144:"numlock",19:"pause",45:"insert",36:"home",46:"del",35:"end",33:"pageup",34:"pagedown",37:"left",38:"up",39:"right",40:"down",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12"};this.shift_nums={"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":":","'":'"',",":"<",".":">","/":"?","\\":"|"};this.add=function(C,B,H){if(A.isFunction(B)){H=B;B={}}var D={},F={type:"keydown",propagate:false,disableInInput:false,target:A("html")[0],checkParent:true},E=this;D=A.extend(D,F,B||{});C=C.toLowerCase();var G=function(J){J=A.event.fix(J);var O=J.target;O=(O.nodeType==3)?O.parentNode:O;if(D["disableInInput"]){var S=A(O);if(S.is("input")||S.is("textarea")){return }}var L=J.which,U=J.type,R=String.fromCharCode(L).toLowerCase(),T=E.special_keys[L],M=J.shiftKey,I=J.ctrlKey,P=J.altKey,Q=true,K=null;if(A.browser.opera||A.browser.safari||D.checkParent){while(!E.all[O]&&O.parentNode){O=O.parentNode}}var V=E.all[O].events[U].callbackMap;if(!M&&!I&&!P){K=V[T]||V[R]}else{var N="";if(P){N+="alt+"}if(I){N+="ctrl+"}if(M){N+="shift+"}K=V[N+T]||V[N+R]||V[N+E.shift_nums[R]]}if(K){K.cb(J);if(!K.propagate){J.stopPropagation();J.preventDefault();return false}}};if(!this.all[D.target]){this.all[D.target]={events:{}}}if(!this.all[D.target].events[D.type]){this.all[D.target].events[D.type]={callbackMap:{}};A.event.add(D.target,D.type,G)}this.all[D.target].events[D.type].callbackMap[C]={cb:H,propagate:D.propagate};return A};this.remove=function(C,B){B=B||{};target=B.target||A("html")[0];type=B.type||"keydown";C=C.toLowerCase();delete this.all[target].events[type].callbackMap[C];return A};A.hotkeys=this;return A})(jQuery);(function(G){var A=G.fn.height,E=G.fn.width;G.fn.extend({height:function(){if(!this[0]){D()}if(this[0]==window){if(G.browser.opera||(G.browser.safari&&parseInt(G.browser.version)>520)){return self.innerHeight-((G(document).height()>self.innerHeight)?B():0)}else{if(G.browser.safari){return self.innerHeight}else{return G.boxModel&&document.documentElement.clientHeight||document.body.clientHeight}}}if(this[0]==document){return Math.max((G.boxModel&&document.documentElement.scrollHeight||document.body.scrollHeight),document.body.offsetHeight)}return A.apply(this,arguments)},width:function(){if(!this[0]){D()}if(this[0]==window){if(G.browser.opera||(G.browser.safari&&parseInt(G.browser.version)>520)){return self.innerWidth-((G(document).width()>self.innerWidth)?B():0)}else{if(G.browser.safari){return self.innerWidth}else{return G.boxModel&&document.documentElement.clientWidth||document.body.clientWidth}}}if(this[0]==document){if(G.browser.mozilla){var J=self.pageXOffset;self.scrollTo(99999999,self.pageYOffset);var I=self.pageXOffset;self.scrollTo(J,self.pageYOffset);return document.body.offsetWidth+I}else{return Math.max(((G.boxModel&&!G.browser.safari)&&document.documentElement.scrollWidth||document.body.scrollWidth),document.body.offsetWidth)}}return E.apply(this,arguments)},innerHeight:function(){if(!this[0]){D()}return this[0]==window||this[0]==document?this.height():this.is(":visible")?this[0].offsetHeight-C(this,"borderTopWidth")-C(this,"borderBottomWidth"):this.height()+C(this,"paddingTop")+C(this,"paddingBottom")},innerWidth:function(){if(!this[0]){D()}return this[0]==window||this[0]==document?this.width():this.is(":visible")?this[0].offsetWidth-C(this,"borderLeftWidth")-C(this,"borderRightWidth"):this.width()+C(this,"paddingLeft")+C(this,"paddingRight")},outerHeight:function(I){if(!this[0]){D()}I=G.extend({margin:false},I||{});return this[0]==window||this[0]==document?this.height():this.is(":visible")?this[0].offsetHeight+(I.margin?(C(this,"marginTop")+C(this,"marginBottom")):0):this.height()+C(this,"borderTopWidth")+C(this,"borderBottomWidth")+C(this,"paddingTop")+C(this,"paddingBottom")+(I.margin?(C(this,"marginTop")+C(this,"marginBottom")):0)},outerWidth:function(I){if(!this[0]){D()}I=G.extend({margin:false},I||{});return this[0]==window||this[0]==document?this.width():this.is(":visible")?this[0].offsetWidth+(I.margin?(C(this,"marginLeft")+C(this,"marginRight")):0):this.width()+C(this,"borderLeftWidth")+C(this,"borderRightWidth")+C(this,"paddingLeft")+C(this,"paddingRight")+(I.margin?(C(this,"marginLeft")+C(this,"marginRight")):0)},scrollLeft:function(I){if(!this[0]){D()}if(I!=undefined){return this.each(function(){if(this==window||this==document){window.scrollTo(I,G(window).scrollTop())}else{this.scrollLeft=I}})}if(this[0]==window||this[0]==document){return self.pageXOffset||G.boxModel&&document.documentElement.scrollLeft||document.body.scrollLeft}return this[0].scrollLeft},scrollTop:function(I){if(!this[0]){D()}if(I!=undefined){return this.each(function(){if(this==window||this==document){window.scrollTo(G(window).scrollLeft(),I)}else{this.scrollTop=I}})}if(this[0]==window||this[0]==document){return self.pageYOffset||G.boxModel&&document.documentElement.scrollTop||document.body.scrollTop}return this[0].scrollTop},position:function(I){return this.offset({margin:false,scroll:false,relativeTo:this.offsetParent()},I)},offset:function(J,P){if(!this[0]){D()}var O=0,N=0,X=0,S=0,Y=this[0],M=this[0],L,I,W=G.css(Y,"position"),V=G.browser.mozilla,Q=G.browser.msie,U=G.browser.opera,a=G.browser.safari,K=G.browser.safari&&parseInt(G.browser.version)>520,R=false,T=false,J=G.extend({margin:true,border:false,padding:false,scroll:true,lite:false,relativeTo:document.body},J||{});if(J.lite){return this.offsetLite(J,P)}if(J.relativeTo.jquery){J.relativeTo=J.relativeTo[0]}if(Y.tagName=="BODY"){O=Y.offsetLeft;N=Y.offsetTop;if(V){O+=C(Y,"marginLeft")+(C(Y,"borderLeftWidth")*2);N+=C(Y,"marginTop")+(C(Y,"borderTopWidth")*2)}else{if(U){O+=C(Y,"marginLeft");N+=C(Y,"marginTop")}else{if((Q&&jQuery.boxModel)){O+=C(Y,"borderLeftWidth");N+=C(Y,"borderTopWidth")}else{if(K){O+=C(Y,"marginLeft")+C(Y,"borderLeftWidth");N+=C(Y,"marginTop")+C(Y,"borderTopWidth")}}}}}else{do{I=G.css(M,"position");O+=M.offsetLeft;N+=M.offsetTop;if((V&&!M.tagName.match(/^t[d|h]$/i))||Q||K){O+=C(M,"borderLeftWidth");N+=C(M,"borderTopWidth");if(V&&I=="absolute"){R=true}if(Q&&I=="relative"){T=true}}L=M.offsetParent||document.body;if(J.scroll||V){do{if(J.scroll){X+=M.scrollLeft;S+=M.scrollTop}if(U&&(G.css(M,"display")||"").match(/table-row|inline/)){X=X-((M.scrollLeft==M.offsetLeft)?M.scrollLeft:0);S=S-((M.scrollTop==M.offsetTop)?M.scrollTop:0)}if(V&&M!=Y&&G.css(M,"overflow")!="visible"){O+=C(M,"borderLeftWidth");N+=C(M,"borderTopWidth")}M=M.parentNode}while(M!=L)}M=L;if(M==J.relativeTo&&!(M.tagName=="BODY"||M.tagName=="HTML")){if(V&&M!=Y&&G.css(M,"overflow")!="visible"){O+=C(M,"borderLeftWidth");N+=C(M,"borderTopWidth")}if(((a&&!K)||U)&&I!="static"){O-=C(L,"borderLeftWidth");N-=C(L,"borderTopWidth")}break}if(M.tagName=="BODY"||M.tagName=="HTML"){if(((a&&!K)||(Q&&G.boxModel))&&W!="absolute"&&W!="fixed"){O+=C(M,"marginLeft");N+=C(M,"marginTop")}if(K||(V&&!R&&W!="fixed")||(Q&&W=="static"&&!T)){O+=C(M,"borderLeftWidth");N+=C(M,"borderTopWidth")}break}}while(M)}var Z=H(Y,J,O,N,X,S);if(P){G.extend(P,Z);return this}else{return Z}},offsetLite:function(Q,L){if(!this[0]){D()}var N=0,M=0,K=0,P=0,O=this[0],J,Q=G.extend({margin:true,border:false,padding:false,scroll:true,relativeTo:document.body},Q||{});if(Q.relativeTo.jquery){Q.relativeTo=Q.relativeTo[0]}do{N+=O.offsetLeft;M+=O.offsetTop;J=O.offsetParent||document.body;if(Q.scroll){do{K+=O.scrollLeft;P+=O.scrollTop;O=O.parentNode}while(O!=J)}O=J}while(O&&O.tagName!="BODY"&&O.tagName!="HTML"&&O!=Q.relativeTo);var I=H(this[0],Q,N,M,K,P);if(L){G.extend(L,I);return this}else{return I}},offsetParent:function(){if(!this[0]){D()}var I=this[0].offsetParent;while(I&&(I.tagName!="BODY"&&G.css(I,"position")=="static")){I=I.offsetParent}return G(I)}});var D=function(){throw"Dimensions: jQuery collection is empty"};var C=function(I,J){return parseInt(G.css(I.jquery?I[0]:I,J))||0};var H=function(M,L,J,N,I,K){if(!L.margin){J-=C(M,"marginLeft");N-=C(M,"marginTop")}if(L.border&&((G.browser.safari&&parseInt(G.browser.version)<520)||G.browser.opera)){J+=C(M,"borderLeftWidth");N+=C(M,"borderTopWidth")}else{if(!L.border&&!((G.browser.safari&&parseInt(G.browser.version)<520)||G.browser.opera)){J-=C(M,"borderLeftWidth");N-=C(M,"borderTopWidth")}}if(L.padding){J+=C(M,"paddingLeft");N+=C(M,"paddingTop")}if(L.scroll&&(!G.browser.opera||M.offsetLeft!=M.scrollLeft&&M.offsetTop!=M.scrollLeft)){I-=M.scrollLeft;K-=M.scrollTop}return L.scroll?{top:N-K,left:J-I,scrollTop:K,scrollLeft:I}:{top:N,left:J}};var F=0;var B=function(){if(!F){var I=G("<div>").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1000,left:-1000}).appendTo("body");F=100-I.append("<div>").find("div").css({width:"100%",height:200}).width();I.remove()}return F}})(jQuery);if(jQuery){(function(B){function A(C){return(C==null||C=="null"||C==""||C=="undefined")}B.extend(B,{MultiFile:function(C){return B("INPUT[@type='file'].multi").MultiFile(C)}});B.extend(B.fn,{MultiFile:function(C){if(this._MultiFile){return B(this)}this._MultiFile=true;return B(this).each(function(F){var G=this;var D=B(G);var E=D.clone();G.debug=(G.className.indexOf("debug")>0);if(A(G.max)){G.max=D.attr("maxlength");if(A(G.max)){G.max=((G.className.match(/\b((max|limit)\-[0-9]+)\b/gi)||[""])[0]);if(A(G.max)){G.max=-1}else{G.max=G.max.match(/[0-9]+/gi)[0]}}}G.max=new Number(G.max);if(!G.accept){G.accept=(G.className.match(/\b(accept\-[\w\|]+)\b/gi))||"";G.accept=new String(G.accept).replace(/^(accept|ext)\-/i,"")}B.each("on,after".split(","),function(H,I){B.each("FileSelect,FileRemove,FileAppend".split(","),function(J,K){G[I+K]=function(N,M,L){}})});G.trigger=function(J,L){var K=G[J];if(K){var H=B(this).attr("value");var I=K(L,H,G);if(I!=null){return I}}return true};if(typeof C=="number"){C={max:C}}B.extend(G,G.data||{},C);B.extend(G,{STRING:G.STRING||{},n:0,k:"multi",f:function(H){return G.k+"_"+String(F)+"_"+String(H)}});G.STRING=B.extend({remove:"remove",denied:"You cannot select a $ext file.\nTry again...",selected:"File selected: $file"},G.STRING);if(String(G.accept).length>1){G.rxAccept=new RegExp("\\.("+(G.accept?G.accept:"")+")$","gi")}G.w=G.k+"multi_"+F;D.wrap('<div id="'+G.w+'"></div>');G.add=function(I,H){G.n++;I.d=G;I.i=H;I.id=G.f(I.i);I.name=(I.name||D.attr("name")||"file")+(I.i>0?I.i:"");if((G.max!=-1)&&((G.n-1)>(G.max))){I.disabled=true}G.current=I;I=B(I);I.change(function(){if(!G.trigger("onFileSelect",this,G)){return false}if(G.accept){var J=String(I.attr("value"));if(!J.match(G.rxAccept)){I.val("").attr("value","");I.get(0).value="";var K=E.clone();G.n--;G.add(K.get(0),this.i);I.parent().prepend(K);I.remove();alert(G.STRING.denied.replace("$ext",String(J.match(/\.\w{1,4}$/gi))));return false}}this.style.position="absolute";this.style.left="-1000px";var K=E.clone();B(this).parent().prepend(K);G.list(this);G.add(K.get(0),this.i+1);if(!G.trigger("afterFileSelect",this,G)){return false}})};G.list=function(M){if(!G.trigger("onFileAppend",M,G)){return false}var K=B("#"+G.w),L=B("<div></div>"),J=B(M).attr("value")+"",I=B('<span class="file" title="'+G.STRING.selected.replace("$file",J)+'">'+J.match(/[^\/\\]+$/gi)[0]+"</span>"),H=B('<a href="#'+G.w+'">'+G.STRING.remove+"</a>");K.append(L);L.append("[",H,"]&nbsp;",I);H.click(function(){if(!G.trigger("onFileRemove",M,G)){return false}G.n--;G.current.disabled=false;B("#"+G.f(M.i)).remove();B(this).parent().remove();if(!G.trigger("afterFileRemove",M,G)){return false}return false});if(!G.trigger("afterFileAppend",M,G)){return false}};if(!G.ft){G.add(G,0);G.ft=true}G.I++;G.n++})}});if(B.start){B.start(B.MultiFile)}else{B(function(){B.MultiFile()})}})(jQuery)}(function(A){A.event.special.mousewheel={setup:function(){var B=A.event.special.mousewheel.handler;if(A.browser.mozilla){A(this).bind("mousemove.mousewheel",function(C){A.data(this,"mwcursorposdata",{pageX:C.pageX,pageY:C.pageY,clientX:C.clientX,clientY:C.clientY})})}if(this.addEventListener){this.addEventListener((A.browser.mozilla?"DOMMouseScroll":"mousewheel"),B,false)}else{this.onmousewheel=B}},teardown:function(){var B=A.event.special.mousewheel.handler;A(this).unbind("mousemove.mousewheel");if(this.removeEventListener){this.removeEventListener((A.browser.mozilla?"DOMMouseScroll":"mousewheel"),B,false)}else{this.onmousewheel=function(){}}A.removeData(this,"mwcursorposdata")},handler:function(D){var B=Array.prototype.slice.call(arguments,1);D=A.event.fix(D||window.event);A.extend(D,A.data(this,"mwcursorposdata")||{});var E=0,C=true;if(D.wheelDelta){E=D.wheelDelta/120}if(D.detail){E=-D.detail/3}if(A.browser.opera){E=-D.wheelDelta}D.data=D.data||{};D.type="mousewheel";B.unshift(E);B.unshift(D);return A.event.handle.apply(this,B)}};A.fn.extend({mousewheel:function(B){return B?this.bind("mousewheel",B):this.trigger("mousewheel")},unmousewheel:function(B){return this.unbind("mousewheel",B)}})})(jQuery);if(!window.CanvasRenderingContext2D){(function(){var N=Math;var O=N.round;var L=N.sin;var U=N.cos;var A=10;var I=A/2;var G={init:function(W){var X=W||document;if(/MSIE/.test(navigator.userAgent)&&!window.opera){var V=this;X.attachEvent("onreadystatechange",function(){V.init_(X)})}},init_:function(Y){if(Y.readyState=="complete"){if(!Y.namespaces["g_vml_"]){Y.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml")}var X=Y.createStyleSheet();X.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}";var W=Y.getElementsByTagName("canvas");for(var V=0;V<W.length;V++){if(!W[V].getContext){this.initElement(W[V])}}}},fixElement_:function(X){var Z=X.outerHTML;var Y=X.ownerDocument.createElement(Z);if(Z.slice(-2)!="/>"){var V="/"+X.tagName;var W;while((W=X.nextSibling)&&W.tagName!=V){W.removeNode()}if(W){W.removeNode()}}X.parentNode.replaceChild(Y,X);return Y},initElement:function(W){W=this.fixElement_(W);W.getContext=function(){if(this.context_){return this.context_}return this.context_=new J(this)};W.attachEvent("onpropertychange",T);W.attachEvent("onresize",B);var V=W.attributes;if(V.width&&V.width.specified){W.style.width=V.width.nodeValue+"px"}else{W.width=W.clientWidth}if(V.height&&V.height.specified){W.style.height=V.height.nodeValue+"px"}else{W.height=W.clientHeight}return W}};function T(W){var V=W.srcElement;switch(W.propertyName){case"width":V.style.width=V.attributes.width.nodeValue+"px";V.getContext().clearRect();break;case"height":V.style.height=V.attributes.height.nodeValue+"px";V.getContext().clearRect();break}}function B(W){var V=W.srcElement;if(V.firstChild){V.firstChild.style.width=V.clientWidth+"px";V.firstChild.style.height=V.clientHeight+"px"}}G.init();var D=[];for(var R=0;R<16;R++){for(var Q=0;Q<16;Q++){D[R*16+Q]=R.toString(16)+Q.toString(16)}}function K(){return[[1,0,0],[0,1,0],[0,0,1]]}function E(Y,X){var W=K();for(var V=0;V<3;V++){for(var c=0;c<3;c++){var Z=0;for(var a=0;a<3;a++){Z+=Y[V][a]*X[a][c]}W[V][c]=Z}}return W}function P(W,V){V.fillStyle=W.fillStyle;V.lineCap=W.lineCap;V.lineJoin=W.lineJoin;V.lineWidth=W.lineWidth;V.miterLimit=W.miterLimit;V.shadowBlur=W.shadowBlur;V.shadowColor=W.shadowColor;V.shadowOffsetX=W.shadowOffsetX;V.shadowOffsetY=W.shadowOffsetY;V.strokeStyle=W.strokeStyle;V.arcScaleX_=W.arcScaleX_;V.arcScaleY_=W.arcScaleY_}function C(W){var Z,Y=1;W=String(W);if(W.substring(0,3)=="rgb"){var c=W.indexOf("(",3);var V=W.indexOf(")",c+1);var a=W.substring(c+1,V).split(",");Z="#";for(var X=0;X<3;X++){Z+=D[Number(a[X])]}if((a.length==4)&&(W.substr(3,1)=="a")){Y=a[3]}}else{Z=W}return[Z,Y]}function M(V){switch(V){case"butt":return"flat";case"round":return"round";case"square":default:return"square"}}function J(W){this.m_=K();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.strokeStyle="#000";this.fillStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=A*1;this.globalAlpha=1;this.canvas=W;var V=W.ownerDocument.createElement("div");V.style.width=W.clientWidth+"px";V.style.height=W.clientHeight+"px";V.style.overflow="hidden";V.style.position="absolute";W.appendChild(V);this.element_=V;this.arcScaleX_=1;this.arcScaleY_=1}var H=J.prototype;H.clearRect=function(){this.element_.innerHTML="";this.currentPath_=[]};H.beginPath=function(){this.currentPath_=[]};H.moveTo=function(W,V){this.currentPath_.push({type:"moveTo",x:W,y:V});this.currentX_=W;this.currentY_=V};H.lineTo=function(W,V){this.currentPath_.push({type:"lineTo",x:W,y:V});this.currentX_=W;this.currentY_=V};H.bezierCurveTo=function(X,V,a,Z,Y,W){this.currentPath_.push({type:"bezierCurveTo",cp1x:X,cp1y:V,cp2x:a,cp2y:Z,x:Y,y:W});this.currentX_=Y;this.currentY_=W};H.quadraticCurveTo=function(d,c,a,Z){var W=this.currentX_+2/3*(d-this.currentX_);var V=this.currentY_+2/3*(c-this.currentY_);var Y=W+(a-this.currentX_)/3;var X=V+(Z-this.currentY_)/3;this.bezierCurveTo(W,V,Y,X,a,Z)};H.arc=function(c,Z,a,Y,W,X){a*=A;var h=X?"at":"wa";var d=c+(U(Y)*a)-I;var g=Z+(L(Y)*a)-I;var V=c+(U(W)*a)-I;var f=Z+(L(W)*a)-I;if(d==V&&!X){d+=0.125}this.currentPath_.push({type:h,x:c,y:Z,radius:a,xStart:d,yStart:g,xEnd:V,yEnd:f})};H.rect=function(X,W,V,Y){this.moveTo(X,W);this.lineTo(X+V,W);this.lineTo(X+V,W+Y);this.lineTo(X,W+Y);this.closePath()};H.strokeRect=function(X,W,V,Y){this.beginPath();this.moveTo(X,W);this.lineTo(X+V,W);this.lineTo(X+V,W+Y);this.lineTo(X,W+Y);this.closePath();this.stroke()};H.fillRect=function(X,W,V,Y){this.beginPath();this.moveTo(X,W);this.lineTo(X+V,W);this.lineTo(X+V,W+Y);this.lineTo(X,W+Y);this.closePath();this.fill()};H.createLinearGradient=function(W,Y,V,X){var Z=new S("gradient");return Z};H.createRadialGradient=function(Y,a,X,W,Z,V){var c=new S("gradientradial");c.radius1_=X;c.radius2_=V;c.focus_.x=Y;c.focus_.y=a;return c};H.drawImage=function(v,Y){var l,f,n,AF,r,o,AA,AH;var m=v.runtimeStyle.width;var u=v.runtimeStyle.height;v.runtimeStyle.width="auto";v.runtimeStyle.height="auto";var g=v.width;var AD=v.height;v.runtimeStyle.width=m;v.runtimeStyle.height=u;if(arguments.length==3){l=arguments[1];f=arguments[2];r=o=0;AA=n=g;AH=AF=AD}else{if(arguments.length==5){l=arguments[1];f=arguments[2];n=arguments[3];AF=arguments[4];r=o=0;AA=g;AH=AD}else{if(arguments.length==9){r=arguments[1];o=arguments[2];AA=arguments[3];AH=arguments[4];l=arguments[5];f=arguments[6];n=arguments[7];AF=arguments[8]}else{throw"Invalid number of arguments"}}}var AG=this.getCoords_(l,f);var Z=AA/2;var X=AH/2;var AE=[];var V=10;var c=10;AE.push(" <g_vml_:group",' coordsize="',A*V,",",A*c,'"',' coordorigin="0,0"',' style="width:',V,";height:",c,";position:absolute;");if(this.m_[0][0]!=1||this.m_[0][1]){var a=[];a.push("M11='",this.m_[0][0],"',","M12='",this.m_[1][0],"',","M21='",this.m_[0][1],"',","M22='",this.m_[1][1],"',","Dx='",O(AG.x/A),"',","Dy='",O(AG.y/A),"'");var AC=AG;var AB=this.getCoords_(l+n,f);var x=this.getCoords_(l,f+AF);var q=this.getCoords_(l+n,f+AF);AC.x=Math.max(AC.x,AB.x,x.x,q.x);AC.y=Math.max(AC.y,AB.y,x.y,q.y);AE.push("padding:0 ",O(AC.x/A),"px ",O(AC.y/A),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",a.join(""),", sizingmethod='clip');")}else{AE.push("top:",O(AG.y/A),"px;left:",O(AG.x/A),"px;")}AE.push(' ">','<g_vml_:image src="',v.src,'"',' style="width:',A*n,";"," height:",A*AF,';"',' cropleft="',r/g,'"',' croptop="',o/AD,'"',' cropright="',(g-r-AA)/g,'"',' cropbottom="',(AD-o-AH)/AD,'"'," />","</g_vml_:group>");this.element_.insertAdjacentHTML("BeforeEnd",AE.join(""))};H.stroke=function(AG){var g=[];var f=false;var AJ=C(AG?this.fillStyle:this.strokeStyle);var AC=AJ[0];var Y=AJ[1]*this.globalAlpha;var X=10;var n=10;g.push("<g_vml_:shape",' fillcolor="',AC,'"',' filled="',Boolean(AG),'"',' style="position:absolute;width:',X,";height:",n,';"',' coordorigin="0 0" coordsize="',A*X," ",A*n,'"',' stroked="',!AG,'"',' strokeweight="',this.lineWidth,'"',' strokecolor="',AC,'"',' path="');var m=false;var AB={x:null,y:null};var AD={x:null,y:null};for(var AE=0;AE<this.currentPath_.length;AE++){var v=this.currentPath_[AE];if(v.type=="moveTo"){g.push(" m ");var AI=this.getCoords_(v.x,v.y);g.push(O(AI.x),",",O(AI.y))}else{if(v.type=="lineTo"){g.push(" l ");var AI=this.getCoords_(v.x,v.y);g.push(O(AI.x),",",O(AI.y))}else{if(v.type=="close"){g.push(" x ")}else{if(v.type=="bezierCurveTo"){g.push(" c ");var AI=this.getCoords_(v.x,v.y);var AA=this.getCoords_(v.cp1x,v.cp1y);var w=this.getCoords_(v.cp2x,v.cp2y);g.push(O(AA.x),",",O(AA.y),",",O(w.x),",",O(w.y),",",O(AI.x),",",O(AI.y))}else{if(v.type=="at"||v.type=="wa"){g.push(" ",v.type," ");var AI=this.getCoords_(v.x,v.y);var o=this.getCoords_(v.xStart,v.yStart);var d=this.getCoords_(v.xEnd,v.yEnd);g.push(O(AI.x-this.arcScaleX_*v.radius),",",O(AI.y-this.arcScaleY_*v.radius)," ",O(AI.x+this.arcScaleX_*v.radius),",",O(AI.y+this.arcScaleY_*v.radius)," ",O(o.x),",",O(o.y)," ",O(d.x),",",O(d.y))}}}}}if(AI){if(AB.x==null||AI.x<AB.x){AB.x=AI.x}if(AD.x==null||AI.x>AD.x){AD.x=AI.x}if(AB.y==null||AI.y<AB.y){AB.y=AI.y}if(AD.y==null||AI.y>AD.y){AD.y=AI.y}}}g.push(' ">');if(typeof this.fillStyle=="object"){var u={x:"50%",y:"50%"};var x=(AD.x-AB.x);var q=(AD.y-AB.y);var AH=(x>q)?x:q;u.x=O((this.fillStyle.focus_.x/x)*100+50)+"%";u.y=O((this.fillStyle.focus_.y/q)*100+50)+"%";var l=[];if(this.fillStyle.type_=="gradientradial"){var AF=(this.fillStyle.radius1_/AH*100);var r=(this.fillStyle.radius2_/AH*100)-AF}else{var AF=0;var r=100}var V={offset:null,color:null};var Z={offset:null,color:null};this.fillStyle.colors_.sort(function(a,W){return a.offset-W.offset});for(var AE=0;AE<this.fillStyle.colors_.length;AE++){var h=this.fillStyle.colors_[AE];l.push((h.offset*r)+AF,"% ",h.color,",");if(h.offset>V.offset||V.offset==null){V.offset=h.offset;V.color=h.color}if(h.offset<Z.offset||Z.offset==null){Z.offset=h.offset;Z.color=h.color}}l.pop();g.push("<g_vml_:fill",' color="',Z.color,'"',' color2="',V.color,'"',' type="',this.fillStyle.type_,'"',' focusposition="',u.x,", ",u.y,'"',' colors="',l.join(""),'"',' opacity="',Y,'" />')}else{if(AG){g.push('<g_vml_:fill color="',AC,'" opacity="',Y,'" />')}else{g.push("<g_vml_:stroke",' opacity="',Y,'"',' joinstyle="',this.lineJoin,'"',' miterlimit="',this.miterLimit,'"',' endcap="',M(this.lineCap),'"',' weight="',this.lineWidth,'px"',' color="',AC,'" />')}}g.push("</g_vml_:shape>");this.element_.insertAdjacentHTML("beforeEnd",g.join(""))};H.fill=function(){this.stroke(true)};H.closePath=function(){this.currentPath_.push({type:"close"})};H.getCoords_=function(W,V){return{x:A*(W*this.m_[0][0]+V*this.m_[1][0]+this.m_[2][0])-I,y:A*(W*this.m_[0][1]+V*this.m_[1][1]+this.m_[2][1])-I}};H.save=function(){var V={};P(this,V);this.aStack_.push(V);this.mStack_.push(this.m_);this.m_=E(K(),this.m_)};H.restore=function(){P(this.aStack_.pop(),this);this.m_=this.mStack_.pop()};H.translate=function(X,W){var V=[[1,0,0],[0,1,0],[X,W,1]];this.m_=E(V,this.m_)};H.rotate=function(W){var Y=U(W);var X=L(W);var V=[[Y,X,0],[-X,Y,0],[0,0,1]];this.m_=E(V,this.m_)};H.scale=function(X,W){this.arcScaleX_*=X;this.arcScaleY_*=W;var V=[[X,0,0],[0,W,0],[0,0,1]];this.m_=E(V,this.m_)};H.clip=function(){};H.arcTo=function(){};H.createPattern=function(){return new F};function S(V){this.type_=V;this.radius1_=0;this.radius2_=0;this.colors_=[];this.focus_={x:0,y:0}}S.prototype.addColorStop=function(W,V){V=C(V);this.colors_.push({offset:1-W,color:V})};function F(){}G_vmlCanvasManager=G;CanvasRenderingContext2D=J;CanvasGradient=S;CanvasPattern=F})()}var hexcase=0;var b64pad="";var chrsz=8;function hex_md5(A){return binl2hex(core_md5(str2binl(A),A.length*chrsz))}function b64_md5(A){return binl2b64(core_md5(str2binl(A),A.length*chrsz))}function str_md5(A){return binl2str(core_md5(str2binl(A),A.length*chrsz))}function hex_hmac_md5(A,B){return binl2hex(core_hmac_md5(A,B))}function b64_hmac_md5(A,B){return binl2b64(core_hmac_md5(A,B))}function str_hmac_md5(A,B){return binl2str(core_hmac_md5(A,B))}function md5_vm_test(){return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72"}function core_md5(K,F){K[F>>5]|=128<<((F)%32);K[(((F+64)>>>9)<<4)+14]=F;var J=1732584193;var I=-271733879;var H=-1732584194;var G=271733878;for(var C=0;C<K.length;C+=16){var E=J;var D=I;var B=H;var A=G;J=md5_ff(J,I,H,G,K[C+0],7,-680876936);G=md5_ff(G,J,I,H,K[C+1],12,-389564586);H=md5_ff(H,G,J,I,K[C+2],17,606105819);I=md5_ff(I,H,G,J,K[C+3],22,-1044525330);J=md5_ff(J,I,H,G,K[C+4],7,-176418897);G=md5_ff(G,J,I,H,K[C+5],12,1200080426);H=md5_ff(H,G,J,I,K[C+6],17,-1473231341);I=md5_ff(I,H,G,J,K[C+7],22,-45705983);J=md5_ff(J,I,H,G,K[C+8],7,1770035416);G=md5_ff(G,J,I,H,K[C+9],12,-1958414417);H=md5_ff(H,G,J,I,K[C+10],17,-42063);I=md5_ff(I,H,G,J,K[C+11],22,-1990404162);J=md5_ff(J,I,H,G,K[C+12],7,1804603682);G=md5_ff(G,J,I,H,K[C+13],12,-40341101);H=md5_ff(H,G,J,I,K[C+14],17,-1502002290);I=md5_ff(I,H,G,J,K[C+15],22,1236535329);J=md5_gg(J,I,H,G,K[C+1],5,-165796510);G=md5_gg(G,J,I,H,K[C+6],9,-1069501632);H=md5_gg(H,G,J,I,K[C+11],14,643717713);I=md5_gg(I,H,G,J,K[C+0],20,-373897302);J=md5_gg(J,I,H,G,K[C+5],5,-701558691);G=md5_gg(G,J,I,H,K[C+10],9,38016083);H=md5_gg(H,G,J,I,K[C+15],14,-660478335);I=md5_gg(I,H,G,J,K[C+4],20,-405537848);J=md5_gg(J,I,H,G,K[C+9],5,568446438);G=md5_gg(G,J,I,H,K[C+14],9,-1019803690);H=md5_gg(H,G,J,I,K[C+3],14,-187363961);I=md5_gg(I,H,G,J,K[C+8],20,1163531501);J=md5_gg(J,I,H,G,K[C+13],5,-1444681467);G=md5_gg(G,J,I,H,K[C+2],9,-51403784);H=md5_gg(H,G,J,I,K[C+7],14,1735328473);I=md5_gg(I,H,G,J,K[C+12],20,-1926607734);J=md5_hh(J,I,H,G,K[C+5],4,-378558);G=md5_hh(G,J,I,H,K[C+8],11,-2022574463);H=md5_hh(H,G,J,I,K[C+11],16,1839030562);I=md5_hh(I,H,G,J,K[C+14],23,-35309556);J=md5_hh(J,I,H,G,K[C+1],4,-1530992060);G=md5_hh(G,J,I,H,K[C+4],11,1272893353);H=md5_hh(H,G,J,I,K[C+7],16,-155497632);I=md5_hh(I,H,G,J,K[C+10],23,-1094730640);J=md5_hh(J,I,H,G,K[C+13],4,681279174);G=md5_hh(G,J,I,H,K[C+0],11,-358537222);H=md5_hh(H,G,J,I,K[C+3],16,-722521979);I=md5_hh(I,H,G,J,K[C+6],23,76029189);J=md5_hh(J,I,H,G,K[C+9],4,-640364487);G=md5_hh(G,J,I,H,K[C+12],11,-421815835);H=md5_hh(H,G,J,I,K[C+15],16,530742520);I=md5_hh(I,H,G,J,K[C+2],23,-995338651);J=md5_ii(J,I,H,G,K[C+0],6,-198630844);G=md5_ii(G,J,I,H,K[C+7],10,1126891415);H=md5_ii(H,G,J,I,K[C+14],15,-1416354905);I=md5_ii(I,H,G,J,K[C+5],21,-57434055);J=md5_ii(J,I,H,G,K[C+12],6,1700485571);G=md5_ii(G,J,I,H,K[C+3],10,-1894986606);H=md5_ii(H,G,J,I,K[C+10],15,-1051523);I=md5_ii(I,H,G,J,K[C+1],21,-2054922799);J=md5_ii(J,I,H,G,K[C+8],6,1873313359);G=md5_ii(G,J,I,H,K[C+15],10,-30611744);H=md5_ii(H,G,J,I,K[C+6],15,-1560198380);I=md5_ii(I,H,G,J,K[C+13],21,1309151649);J=md5_ii(J,I,H,G,K[C+4],6,-145523070);G=md5_ii(G,J,I,H,K[C+11],10,-1120210379);H=md5_ii(H,G,J,I,K[C+2],15,718787259);I=md5_ii(I,H,G,J,K[C+9],21,-343485551);J=safe_add(J,E);I=safe_add(I,D);H=safe_add(H,B);G=safe_add(G,A)}return Array(J,I,H,G)}function md5_cmn(F,C,B,A,E,D){return safe_add(bit_rol(safe_add(safe_add(C,F),safe_add(A,D)),E),B)}function md5_ff(C,B,G,F,A,E,D){return md5_cmn((B&G)|((~B)&F),C,B,A,E,D)}function md5_gg(C,B,G,F,A,E,D){return md5_cmn((B&F)|(G&(~F)),C,B,A,E,D)}function md5_hh(C,B,G,F,A,E,D){return md5_cmn(B^G^F,C,B,A,E,D)}function md5_ii(C,B,G,F,A,E,D){return md5_cmn(G^(B|(~F)),C,B,A,E,D)}function core_hmac_md5(C,F){var E=str2binl(C);if(E.length>16){E=core_md5(E,C.length*chrsz)}var A=Array(16),D=Array(16);for(var B=0;B<16;B++){A[B]=E[B]^909522486;D[B]=E[B]^1549556828}var G=core_md5(A.concat(str2binl(F)),512+F.length*chrsz);return core_md5(D.concat(G),512+128)}function safe_add(A,D){var C=(A&65535)+(D&65535);var B=(A>>16)+(D>>16)+(C>>16);return(B<<16)|(C&65535)}function bit_rol(A,B){return(A<<B)|(A>>>(32-B))}function str2binl(D){var C=Array();var A=(1<<chrsz)-1;for(var B=0;B<D.length*chrsz;B+=chrsz){C[B>>5]|=(D.charCodeAt(B/chrsz)&A)<<(B%32)}return C}function binl2str(C){var D="";var A=(1<<chrsz)-1;for(var B=0;B<C.length*32;B+=chrsz){D+=String.fromCharCode((C[B>>5]>>>(B%32))&A)}return D}function binl2hex(C){var B=hexcase?"0123456789ABCDEF":"0123456789abcdef";var D="";for(var A=0;A<C.length*4;A++){D+=B.charAt((C[A>>2]>>((A%4)*8+4))&15)+B.charAt((C[A>>2]>>((A%4)*8))&15)}return D}function binl2b64(D){var C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var F="";for(var B=0;B<D.length*4;B+=3){var E=(((D[B>>2]>>8*(B%4))&255)<<16)|(((D[B+1>>2]>>8*((B+1)%4))&255)<<8)|((D[B+2>>2]>>8*((B+2)%4))&255);for(var A=0;A<4;A++){if(B*8+A*6>D.length*32){F+=b64pad}else{F+=C.charAt((E>>6*(3-A))&63)}}}return F}if(!Object.prototype.toJSONString){Array.prototype.toJSONString=function(C){var B=[],E,A=this.length,D;for(E=0;E<A;E+=1){D=this[E];switch(typeof D){case"object":if(D){if(typeof D.toJSONString==="function"){B.push(D.toJSONString(C))}}else{B.push("null")}break;case"string":case"number":case"boolean":B.push(D.toJSONString())}}return"["+B.join(",")+"]"};Boolean.prototype.toJSONString=function(){return String(this)};Date.prototype.toJSONString=function(){function A(B){return B<10?"0"+B:B}return'"'+this.getUTCFullYear()+"-"+A(this.getUTCMonth()+1)+"-"+A(this.getUTCDate())+"T"+A(this.getUTCHours())+":"+A(this.getUTCMinutes())+":"+A(this.getUTCSeconds())+'Z"'};Number.prototype.toJSONString=function(){return isFinite(this)?String(this):"null"};Object.prototype.toJSONString=function(B){var A=[],D,E,C;if(B){for(E=0;E<B.length;E+=1){D=B[E];if(typeof D==="string"){C=this[D];switch(typeof C){case"object":if(C){if(typeof C.toJSONString==="function"){A.push(D.toJSONString()+":"+C.toJSONString(B))}}else{A.push(D.toJSONString()+":null")}break;case"string":case"number":case"boolean":A.push(D.toJSONString()+":"+C.toJSONString())}}}}else{for(D in this){if(typeof D==="string"&&Object.prototype.hasOwnProperty.apply(this,[D])){C=this[D];switch(typeof C){case"object":if(C){if(typeof C.toJSONString==="function"){A.push(D.toJSONString()+":"+C.toJSONString())}}else{A.push(D.toJSONString()+":null")}break;case"string":case"number":case"boolean":A.push(D.toJSONString()+":"+C.toJSONString())}}}}return"{"+A.join(",")+"}"};(function(s){var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};s.parseJSON=function(filter){var j;function walk(k,v){var i;if(v&&typeof v==="object"){for(i in v){if(Object.prototype.hasOwnProperty.apply(v,[i])){v[i]=walk(i,v[i])}}}return filter(k,v)}if(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/.test(this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){j=eval("("+this+")");return typeof filter==="function"?walk("",j):j}throw new SyntaxError("parseJSON")};s.toJSONString=function(){if(/["\\\x00-\x1f]/.test(this)){return'"'+this.replace(/[\x00-\x1f\\"]/g,function(a){var c=m[a];if(c){return c}c=a.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"'}return'"'+this+'"'}})(String.prototype)}mj={version:"0.5 alpha"};$(function(){mj.bd=$(document.body);if($.browser.msie){mj.bd.addClass("mj-ie mj-ie"+parseInt($.browser.version))}});$.fn.hasParent=function(B){var A;$(this[0]).parents().each(function(){if(this===B){A=this}});return A};$.fn.hasAbsoluteParent=function(){var A;$(this[0]).parents().each(function(){var B=$(this);if(B.css&&(B.css("position")=="absolute"||B.css("position")=="relative")){A=B}});return A};$.eachR=function(E,D,B){if(E.length==undefined){for(var C in E){D.apply(E[C],B||[C,E[C]])}}else{for(var C=0,A=E.length;C<A;C++){if(D.apply(E[C],B||[C,E[C]])===false){return false}}}return E};$.fn.eachR=function(B,A){return jQuery.eachR(this,B,A)};$.fn.position=function(A){return this.offset({scroll:false},A)};$.fn.swapClass=function(B,A){return this.each(function(){var C=$(this);if($.className.has(this,B)){C.removeClass(B).addClass(A)}else{if($.className.has(this,A)){C.removeClass(A).addClass(B)}}})};$.fn.replaceclass=function(B,A){return this.each(function(){var C=$(this);if($.className.has(this,B)){C.removeClass(B).addClass(A)}})};$.fn.kkresizewidth=function(A,B){if(A>0){this[0].style.width=parseInt(A)+"px";if(B!==true){this.trigger("kkresize")}}return this};$.fn.kkresizeheight=function(A,B){if(A>0){this[0].style.height=parseInt(A)+"px";if(B!==true){this.trigger("kkresize")}}return this};$.fn.extend({load:function(C,F,G){if(jQuery.isFunction(C)){return this.bind("load",C)}var E=C.indexOf(" ");if(E>=0){var A=C.slice(E,C.length);C=C.slice(0,E)}G=G||function(){};var D="GET";if(F){if(jQuery.isFunction(F)){G=F;F=null}else{F=jQuery.param(F);D="POST"}}var B=this;jQuery.ajax({url:C,type:D,data:F,complete:function(J,H){if(H=="success"||H=="notmodified"){var I=jQuery.active}B.html(A?jQuery("<div/>").append(J.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(A):J.responseText);jQuery.active=I;setTimeout(function(){B.each(G,[J.responseText,H,J])},13)}});return this}});mj.glb={modalIndex:500,menuDelay:300,messageWidth:300,messageHeight:150,imagePath:"",blankImage:"http://www.kaitek.com.tr/res/myjui/images/spacer.gif",views:[]};mj.keys={BACKSPACE:8,TAB:9,RETURN:13,ENTER:13,SHIFT:16,CONTROL:17,ESC:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,F5:116,isSpecial:function(B){var A=B.keyCode;return(B.type=="keypress"&&B.ctrlKey)||A==9||A==13||A==40||A==27||(A==16)||(A==17)||(A>=18&&A<=20)||(A>=33&&A<=35)||(A>=36&&A<=39)||(A>=44&&A<=45)}};mj.insertSpacer=function(B,A){B=B?B:1;A=A?A:1;return'<img style="width:'+B+"px;height:"+A+'px;" src="'+mj.glb.blankImage+'"/>'};mj.get=function(A){return document.getElementById(A)};mj.loaderShow=function(){if(!mj.loading){mj.loading=$(mj.NE(mj.bd,{cls:"mj-loader",html:mj.lng.glb.loadingText}))}mj.loading.show()};mj.loaderHide=function(){mj.loading.hide()};mj.load=function(D,C){var G=(typeof C=="object")?C:{url:C};var B=G.url,E=G.params,F=G.callback;var A=function(J,H,I){if(typeof F=="function"){F(J,H,I)}mj.loaderHide()};if(G.dataType=="script"){$.ajax(G)}else{$(D).load(B,E,A)}};mj.apply=function(C,A){if(C&&A&&typeof A=="object"){for(var B in A){C[B]=A[B]}}return C};mj.applyIf=function(C,A){if(typeof C!=="object"){C={}}if(A){for(var B in A){if(typeof C[B]=="undefined"){C[B]=A[B]}}}return C};mj.extend=function(D,C){var B=function(){};B.prototype=C.prototype;var A=D.prototype;var E=D.prototype=new B();E.constructor=D;if(C.prototype.constructor==Object.prototype.constructor){C.prototype.constructor=C}mj.apply(E,A);D.superclass=C.prototype};mj.idCounter=0;mj.genId=function(A){return((A?A:"")+(mj.idCounter++))};mj.NE=function(A,B){B=!B?{tag:"div"}:(B.tag?B:mj.apply(B,{tag:"div"}));var F=A?$(A):$(document.body),H=B.children;if(typeof B!=="string"){var E="";for(var I in B){if(typeof B[I]!=="function"&&I!=="cls"&&I!=="html"&&I!=="tag"&&I!=="children"&&B[I]){E+=" "+I+'="'+B[I]+'" '}}var C="</"+B.tag+">",D=">";if(B.tag=="input"||B.tag=="img"){C="/>";D=""}B="<"+B.tag+(B.cls?(' class="'+B.cls+'" '):"")+E+D+(B.html?B.html:"")+C}F.append(B);var G=F.children();G=G[G.length-1];if(H){$(H).each(function(){return mj.NE(G,this)})}return G};mj.getIndex=mj.getArrayElementIndex=function(E,C,D){if(typeof E.length!="undefined"){for(var B=0,A=E.length;B<A;B++){if(E[B][C]==D){return B}}}else{for(var B in E){if(typeof E[B]!="function"){if(E[B][C]==D){return B}}}}return -1};mj.log=function(A){window.console&&console.log&&console.log(A)};mj.escape=function(A){A=A?A:"";A=A.toString().replace(/\+/g,"<|p|>");A=A.toString().replace(/\%/g,"<|_|>");return encodeURIComponent?encodeURIComponent(A):escape(A)};mj.renderer=function(){var A=/^\s+|\s+$/g;return{bool:function(){return function(B){return mj.renderer.booleanRenderer(B)}},booleanRenderer:function(B){return B=="1"?mj.lng.titles.buttons.yes:mj.lng.titles.buttons.no},clearZero:function(C){if(C){C=C.toString().replace(".",",").split(",");if(!C[1]){return C}C[1]=C[1].replace("00000000","");for(var B=C[1].length;B>0;B--){if(C[1][B-1]!="0"){C[1]=C[1].substr(0,B);break}}return C[0]+(C[1].length>0?","+C[1]:"")}else{return"0,00"}},dateRenderer:function(B,C){if(!B){return""}if(!(B instanceof Date)){if(/^\d{8}$/.test(B)){B=new Date(Date.parse(B.substring(0,4)+"/"+B.substring(4,6)+"/"+B.substring(6,8)))}else{if(typeof B=="number"){B=new Date(B*1000)}else{B=new Date(Date.parse(B))}}}return(isNaN(B.getDay()))?"&#160;":B.formatDate(C||"d/m/Y")},date:function(B){return function(C){return mj.renderer.dateRenderer(C,B)}},timeRenderer:function(B,C){if(!B){return""}if(!(B instanceof Date)){if(typeof B=="number"){B=new Date(B*1000)}else{B=new Date(Date.parse(B))}}return(isNaN(B.getDay()))?"&#160;":B.formatDate(C||"d/m/Y H:i:s")},time:function(B){return function(C){return mj.renderer.timeRenderer(C,B)}}}}();mj.applyIf(Array.prototype,{indexOf:function(C){for(var B=0,A=this.length;B<A;B++){if(this[B]==C){return B}}return -1},remove:function(B){var A=this.indexOf(B);if(A!=-1){this.splice(A,1)}return this}});mj.apply(Array.prototype,{getIndex:function(C,D){if(typeof this.length!="undefined"){for(var B=0,A=this.length;B<A;B++){if(this[B][C]==D){return B}else{for(var B in this){if(typeof this[B]!="function"){if(this[B][C]==D){return B}}}}}}return -1},filter:function(F,C,B){var E=[];if(typeof B=="undefined"||B==-1){B=0}for(var D=0+B,A=this.length;D<A;D++){if(F(this[D])){E.push(this[D]);if(C){return E}}}return E},_sort:function(B,A,C){var D=String(A).toUpperCase()=="DESC"?-1:1;C=C?C:function(E,F){return E-F};this.sort(function(E,G){var F=C(E[B],G[B])*D;return F})}});mj.init=function(){$().ajaxStart(function(){if(!mj.dontShowLoader){mj.loaderShow()}}).ajaxStop(function(){if(!mj.dontShowLoader){mj.loaderHide()}})};mj.init();mj.bindResize=function(D,A,C){var B=$(D).parents("div.mj-resize-handle:first");if(B){window.reM=window.reM||[];window.reM.push({fp:B,el:D,cb:A});B.bind("kkresize",function(){A.call(C,arguments)})}};mj.format={float2Money:function(B,H,E,A){var C=B,G=!isNaN(H)?H:2;if(isNaN(C)){return""}sign=(C==(C=Math.abs(C)));C=Math.floor(C*Math.pow(10,G)+0.50000000001);cents=C%Math.pow(10,G);C=Math.floor(C/Math.pow(10,G)).toString();while(cents.toString().length<(Math.pow(10,G-1)).toString().length){cents="0"+cents}for(var D=0,F=Math.floor((C.length-(1+D))/3);D<F;D++){C=C.substring(0,C.length-(4*D+3))+A+C.substring(C.length-(4*D+3))}if(G>0){return(((sign)?"":"-")+C+E+cents)}else{return(((sign)?"":"-")+C)}},d2h:function(A){return A.toString(16)},h2d:function(A){return parseInt(A,16)}};if($.browser.msie){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}mj.getNumber=function(B){var A=B.split("0");if(A.length==2&&A[0]==""){return parseInt(A[1])}else{return parseInt(B)}};mj.str2date=function(B){var A=B.split("/");var C=new Date();C.setDate(mj.getNumber(A[0]));C.setMonth((mj.getNumber(A[1])-1));C.setFullYear(parseInt(A[2]));return C};mj.date2str=function(A,B){return A.formatDate(B)};mj.oLength=function(C){var A=0;for(var B in C){if(typeof C[B]!="function"){A++}}return A};mj.removeModified=function(A){if(mj.modified&&mj.modified.indexOf(A)>-1){mj.modified.pop(A)}};mj.addModified=function(A){if(!mj.modified){mj.modified=[]}if(mj.modified.indexOf(A)==-1){mj.modified.push(A)}};mj.translate=function(A){return(mj.lng.titles.modules&&mj.lng.titles.modules.general&&mj.lng.titles.modules.general[A])?mj.lng.titles.modules.general[A]:A};window.onbeforeunload=function(){if(mj.modified&&mj.modified.length>0){return mj.lng.glb.exitQuestion}};mj.newWindow=function(A){var B=mj.applyIf(A,{location:0,status:0,scrollbars:1,resizable:1,toolbar:0,width:800,height:600});return window.open(B.url||"",B.id||mj.genId("mj-window"),"location="+B.location+",toolbar="+B.toolbar+",resizable="+B.resizable+",status="+B.status+",scrollbars="+B.scrollbars+",width="+B.width+",height="+B.height)};mj.timeShow=function(B,A){var G="";var H=Math.floor(B/31536000000);B-=H*31536000000;var C=Math.floor(B/2592000000);B-=C*2592000000;var I=Math.floor(B/604800000);B-=I*604800000;var F=Math.floor(B/86400000);B-=F*86400000;var E=Math.floor(B/3600000);B-=E*3600000;var D=Math.floor(B/60000);B-=D*60000;if(H>0){G+=H+(A?" yÄ±l ":":")}if(C>0){G+=C+(A?" ay ":":")}if(I>0){G+=I+(A?" hafta ":":")}if(F>0){G+=F+(A?" gÃ¼n ":":")}if(E>0){G+=E+(A?" saat ":":")}if(D>0){G+=D+(A?" dakika ":":")}if(G[G.length-1]==":"){G=G.substring(0,G.length-1)}return G};String.prototype.ellipse=function(A){if(this.length>A){return this.substr(0,A-3)+"..."}return this};String.prototype.repeat=function(A){return new Array(A+1).join(this)};String.prototype.LTrim=function(){var A=/\s*((\S+\s*)*)/;return this.replace(A,"$1")};String.prototype.RTrim=function(){var A=/((\s*\S+)*)\s*/;return this.replace(A,"$1")};String.prototype.trim=function(){return this.LTrim().RTrim()};String.prototype.capitalize=function(){return this.replace(/\w+/g,function(A){return A.charAt(0).toUpperCase()+A.substr(1).toLowerCase()})};String.prototype.addPrefix=function(C,B){var D=C+this;var A=D.length;return D.substring(A-B,A)};mj.apply(String,{escape:function(A){return A.replace(/('|\\)/g,"\\$1")},leftPad:function(D,B,C){var A=new String(D);if(C===null||C===undefined||C===""){C=" "}while(A.length<B){A=C+A}return A},format:function(B){var A=Array.prototype.slice.call(arguments,1);return B.replace(/\{(\d+)\}/g,function(C,D){return A[D]})}});$(function(){Date.strings={daysLong:[mj.lng.glb.dayLSunday,mj.lng.glb.dayLMonday,mj.lng.glb.dayLTuesday,mj.lng.glb.dayLWednesday,mj.lng.glb.dayLThursday,mj.lng.glb.dayLFriday,mj.lng.glb.dayLSaturday],daysShort:[mj.lng.glb.daySSunday,mj.lng.glb.daySMonday,mj.lng.glb.daySTuesday,mj.lng.glb.daySWednesday,mj.lng.glb.daySThursday,mj.lng.glb.daySFriday,mj.lng.glb.daySSaturday],monthsShort:[mj.lng.glb.monthSJanuary,mj.lng.glb.monthSFebruary,mj.lng.glb.monthSMarch,mj.lng.glb.monthSApril,mj.lng.glb.monthSMay,mj.lng.glb.monthSJune,mj.lng.glb.monthSJuly,mj.lng.glb.monthSAugust,mj.lng.glb.monthSSeptember,mj.lng.glb.monthSOctober,mj.lng.glb.monthSNovember,mj.lng.glb.monthSDecember],monthsLong:[mj.lng.glb.monthLJanuary,mj.lng.glb.monthLFebruary,mj.lng.glb.monthLMarch,mj.lng.glb.monthLApril,mj.lng.glb.monthLMay,mj.lng.glb.monthLJune,mj.lng.glb.monthLJuly,mj.lng.glb.monthLAugust,mj.lng.glb.monthLSeptember,mj.lng.glb.monthLOctober,mj.lng.glb.monthLNovember,mj.lng.glb.monthLDecember]}});Date.prototype.formatDate=function(C,G){var F={a:function(){return D.getHours()>11?"pm":"am"},A:function(){return(this.a().toUpperCase())},B:function(){var J=(D.getTimezoneOffset()+60)*60;var H=(D.getHours()*3600)+(D.getMinutes()*60)+D.getSeconds()+J;var I=Math.floor(H/86.4);if(I>1000){I-=1000}if(I<0){I+=1000}if((String(I)).length==1){I="00"+I}if((String(I)).length==2){I="0"+I}return I},c:function(){return(this.Y()+"-"+this.m()+"-"+this.d()+"T"+this.h()+":"+this.i()+":"+this.s()+this.P())},d:function(){var H=String(this.j());return(H.length==1?"0"+H:H)},D:function(){return Date.strings.daysShort[self.getDay()]},F:function(){return Date.strings.monthsLong[D.getMonth()]},g:function(){return D.getHours()>12?D.getHours()-12:D.getHours()},G:function(){return D.getHours()},h:function(){var H=String(this.g());return(H.length==1?"0"+H:H)},H:function(){var H=String(this.G());return(H.length==1?"0"+H:H)},i:function(){var H=String(D.getMinutes());return(H.length==1?"0"+H:H)},I:function(){var H=new Date("January 1 "+this.Y()+" 00:00:00");return(H.getTimezoneOffset()==D.getTimezoneOffset()?0:1)},j:function(){return D.getDate()},l:function(){return Date.strings.daysLong[self.getDay()]},L:function(){var H=this.Y();if((H%4==0&&H%100!=0)||(H%4==0&&H%100==0&&H%400==0)){return 1}else{return 0}},m:function(){var H=String(this.n());return(H.length==1?"0"+H:H)},M:function(){return Date.strings.monthsShort[D.getMonth()]},n:function(){return D.getMonth()+1},N:function(){var H=this.w();return(H==0?7:H)},O:function(){var J=Math.abs(D.getTimezoneOffset());var I=String(Math.floor(J/60));var H=String(J%60);I.length==1?I="0"+I:1;H.length==1?H="0"+H:1;return D.getTimezoneOffset()<0?"+"+I+H:"-"+I+H},P:function(){var H=this.O();return(H.substr(0,3)+":"+H.substr(3,2))},r:function(){var H;H=this.D()+", "+this.d()+" "+this.M()+" "+this.Y()+" "+this.H()+":"+this.i()+":"+this.s()+" "+this.O();return H},s:function(){var H=String(D.getSeconds());return(H.length==1?"0"+H:H)},S:function(){switch(D.getDate()){case 1:return("st");case 2:return("nd");case 3:return("rd");case 21:return("st");case 22:return("nd");case 23:return("rd");case 31:return("st");default:return("th")}},t:function(){var H=[null,31,28,31,30,31,30,31,31,30,31,30,31];if(this.L()==1&&this.n()==2){return 29}return H[this.n()]},U:function(){return Math.round(D.getTime()/1000)},w:function(){return D.getDay()},W:function(){var K=this.N();var I=this.z();var H=364+this.L()-I;if(H<=2&&K<=(3-H)){return 1}if(I<=2&&K>=5){return new Date(this.Y()-1,11,31).formatDate("W")}var J=new Date(this.Y(),0,1).getDay();J=J!=0?J-1:6;if(J<=3){return(1+Math.floor((I+J)/7))}else{return(1+Math.floor((I-(7-J))/7))}},y:function(){var H=String(this.Y());return H.substring(H.length-2,H.length)},Y:function(){if(D.getFullYear){var I=new Date("January 1 2001 00:00:00 +0000");var H=I.getFullYear();if(H==2001){return D.getFullYear()}}var H=D.getYear();var J=H%100;J+=(J<38)?2000:1900;return J},z:function(){var H=new Date("January 1 "+this.Y()+" 00:00:00");var I=D.getTime()-H.getTime();return Math.floor(I/1000/60/60/24)},Z:function(){return(D.getTimezoneOffset()*-60)}};function B(H){if(F[H]!=undefined){return F[H]()}else{return H}}var D;if(G){var D=new Date(G)}else{var D=this}var A=C.split("");var E=0;while(E<A.length){if(A[E]=="\\"){A.splice(E,1)}else{A[E]=B(A[E])}E++}return A.join("")};Date.DATE_ATOM="Y-m-d\\TH:i:sP";Date.DATE_ISO8601="Y-m-d\\TH:i:sO";Date.DATE_RFC2822="D, d M Y H:i:s O";Date.DATE_W3C="Y-m-d\\TH:i:sP";Date.firstDayOfWeek=1;Date.prototype.getDayOld=Date.prototype.getDay;Date.prototype.getDay=function(){return(this.getDayOld()-Date.firstDayOfWeek+7)%7};Number.prototype.toRadian=function(){return(Math.PI/180)*this};Number.prototype.addPrefix=function(B,A){var C=this.toString();return C.addPrefix(B,A)};mj.template=function(A){if(A instanceof Array){A=A.join(" ")}this.html=A};mj.template.prototype={re:/\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,apply:function(C){var B=this.html;var A=this.re.exec(B);while(A!=null){B=B.replace(A[0],C[A[1]]);this.re.lastIndex=0;A=this.re.exec(B)}return B}};function setCookie(C,E,A,H,D,G){var B=new Date();B.setTime(B.getTime());if(A){A=A*1000*60*60*24}var F=new Date(B.getTime()+(A));document.cookie=C+"="+escape(E)+((A)?";expires="+F.toGMTString():"")+((H)?";path="+H:"")+((D)?";domain="+D:"")+((G)?";secure":"")}function getCookie(A){var F=document.cookie.split(";");var B="";var D="";var E="";var C=false;for(i=0;i<F.length;i++){B=F[i].split("=");D=B[0].replace(/^\s+|\s+$/g,"");if(D==A){C=true;if(B.length>1){E=unescape(B[1].replace(/^\s+|\s+$/g,""))}return E;break}B=null;D=""}if(!C){return null}}function getCookieArray(C){var A=[],D=document.cookie.split(";");for(i=0;i<D.length;i++){var B=D[i].split("=");if(B[0].indexOf(C)>-1){A.push(B[0])}}return A}function deleteCookie(A,C,B){if(getCookie(A)){document.cookie=A+"="+((C)?";path="+C:"")+((B)?";domain="+B:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}}mj.component=function(A){if(typeof A=="string"){var B={};B[this.defaultConfigStr]=A;A=B}if(A&&A.renderTo){A.renderTo=$(A.renderTo)}if(A&&A.store&&!A.store.componentClass){A.store=new mj.store({data:A.store})}mj.apply(this,A);this.config=A;this.on("afterdestroy",this._afterDestroy,this);this.init()};mj.component.prototype={componentClass:"mj.component",defaultConfigStr:"renderTo",ready:false,init:function(){this.ready=true;this.trigger("init",this)},addEvent:function(A){if(!this.events){this.events={}}if(!this.events[A]){this.events[A]={listeners:[]}}},on:function(C,B,A){this.addEvent(C);this.events[C].listeners.push({fn:B,scope:A?A:this})},mon:function(C,B){var D=this.events[C];if(D&&D.listeners){var A=mj.getIndex(D.listeners,"fn",B);if(A>-1){D.listeners[A].fn=function(){}}}return A>-1},onOnce:function(C,B,A){this.mon(C,B);this.on(C,B,A)},trigger:function(){var B=Array.prototype.slice.call(arguments,0);this.addEvent(B[0]);var C=this.events[B[0]],A=C.listeners;if(C&&A){return $(A).eachR(function(){return this.fn.apply(this.scope,B.slice(1))})}},_afterDestroy:function(){for(var A in this){this[A]=null}}};mj.store=function(A){mj.store.superclass.constructor.call(this,A)};mj.store.prototype={componentClass:"mj.store",defaultConfigStr:"url",showLoader:true,localSort:true,load:function(){var B=this;B.params=mj.applyIf(B.params,{query:true});this.params.toJSONString=null;var C=typeof B.success=="function"?B.success:B.callback;var A=typeof B.failure=="function"?B.failure:function(){};B.trigger("beforeload",B);if(B.url){B.params.jsoncallback="?";B.params.isStore="true";$.getJSON(B.url,B.params,function(G){if(G&&typeof G.totalProperty!="undefined"){B.recordCount=G.totalProperty;render=function(I,H){for(var M in I){var L=I[M];if(typeof L[M]!="function"){for(var J in H){var K=H[J];if(J!="toJSONString"){if(typeof L[J]!="undefined"){L[J+"_source"]=L[J];if(typeof K=="function"){L[J]=K(L[J])}else{L[J]=K}}else{L[J]="";L[J+"_source"]=""}}}}if(typeof L.data!="undefined"){render(L.data,H)}}};if(B.renderers){render(G.records,B.renderers)}if(typeof G.records!="undefined"){B.data=G.records;B.dm=[];if(B.data.length>0){for(var D in B.data[0]){if(typeof B.data[0][D]!="function"){B.dm.push(D)}}}}if(typeof G.detail!="undefined"){B.detail=[];for(var F in G.detail){if(typeof G.detail[F]!="function"){var E=G.detail[F];E.dm=[];if(E.records.length>0){for(var D in E.records[0]){if(typeof E.records[0][D]!="function"){E.dm.push(D)}}}E.data=E.records;delete E.records;B.detail.push(G.detail[F])}}}if(G.error){new mj.message({title:"Bilgi",msg:G.msg})}B.trigger("load",B,G);B.loaded=true;if(C){C.call(B.scope||B,G,arguments)}}else{if(A){A.call(B.scope||B,G,arguments)}}})}else{if(B.showLoader===true){mj.loaderShow()}B.recordCount=B.data.length;B.trigger("load",B);B.loaded=true;if(B.showLoader===true){mj.loaderHide()}}},groupItemsData:function(D){var B={};var E;for(var C=0,A=mj.oLength(this.data);C<A;C++){E=this.data[C][D];if(!B[E]){B[E]=[]}B[E].push(this.data[C])}return B},groupBy:function(A){this.gData=this.gData||{};this.gData[A]=this.groupItemsData(A)},groupItems:function(D){var B=[];var E;for(var C=0,A=mj.oLength(this.data);C<A;C++){E=this.data[C][D];if(B.indexOf(E)===-1){B.push(E)}}return B},collect:function(B,A){if(!this.collected){this.collected=[]}for(var D in B){var C=B[D];if(typeof C[D]!="function"){if(typeof C[A]!="undefined"){this.collected.push(C[A])}if(typeof C.data!="undefined"){this.collect(C.data,A)}}}},filter:function(K,A,L,B){var F=0;if(!this.oData){this.oData=[];for(var D in this.data){if(typeof this.data[D]!="function"){this.oData.push(this.data[D])}}}if(!L){this.clearFilter()}var J=this.data;this.data=[];for(var C in J){if(typeof J[C]!="function"&&typeof J[C][K]!="undefined"){if(J[C][K] instanceof Date){if(!A instanceof Date){var E=1,I=1,H=1980,G=new Date();G.setDate(E);G.setMonth(I);G.setYear(H);A=A.split("/");if(A[0]){G.setDate(A[0])}if(A[1]){G.setMonth(A[1])}if(A[2]){G.setYear(A[2])}A=G}if(J[C][K]>=A){this.data.push(J[C]);F++}}else{if(B&&J[C][K].toString().toLowerCase().indexOf(A.toString())>-1){this.data.push(J[C]);F++}else{if(J[C][K].toString().toLowerCase().substring(0,A.toString().length)===A.toString().toLowerCase()){this.data.push(J[C]);F++}}}}}this.recordCount=F;this.trigger("load",this);return this},clearFilter:function(){if(this.oData){this.data=this.oData}},sort:function(B,A){A=A||"ASC";if(this.data instanceof Array){var C=function(E,D){E=String(E).toLowerCase();D=String(D).toLowerCase();return E>D?1:(E<D?-1:0)};this.data._sort(B,A,C)}else{return false}},init:function(){var A=this;A.on("load",function(){A.isEmpty=!A.data||A.data.length==0});mj.store.superclass.init.call(this)}};mj.extend(mj.store,mj.component);mj.pager=function(A){A=A||{};this.params={limit:25,start:0,current:1,pos:"bottom"};if(A.limit<1){A.limit=1}if(A.start<0){A.start=0}mj.apply(this.params,A);this.beforePageText=mj.lng.objects.pager.beforePageText;mj.pager.superclass.constructor.call(this,this.params)};mj.pager.prototype={componentClass:"mj.pager",pos:"bottom",afterPageText:"{0}",displayMsg:"{0} - {1} / {2} ",defaultButtons:true,elements:{first:true,prev:true,next:true,last:true,refresh:true,pages:true},pageInfo:true,refreshPageBar:function(){var A=this.tbar;if(this.defaultButtons&&this.elements.pages){A.input.val(this.params.current);A.pageTotal.text("/ "+this.getPageCount())}if(this.pageInfo){A.pageInfo.text(String.format(this.displayMsg,this.params.start+1,this.params.start+this.store.data.length,this.store.recordCount))}},render:function(C){var G=C.scope,B=G.store,F=G.pbar,H=false;mj.apply(B.params,F.params);F.store=B;if(F.pos&&F.pos=="top"){G.pageBar=mj.NE(G.cnt,{tag:"div",cls:"mj-paging"});G.renderTo=mj.NE(G.cnt,{tag:"div",style:"overflow:auto;height:"+(G.cnt.height()-25)+"px;"})}else{G.renderTo=mj.NE(G.cnt,{tag:"div",style:"overflow:auto;height:"+((G.cnt.height()||parseInt(G.cnt[0].style.height))-25)+"px;"});G.pageBar=mj.NE(G.cnt,{tag:"div",cls:"mj-paging"})}F.renderTo=G.pageBar;this.tbar={};var E=this,A=E.tbar,D=E.elements;A.items=[];if(E.defaultButtons){if(D.first||D.prev||D.next||D.last){H=true}if(D.first){A.items.push({id:"btnfirst",iconCls:"mj-first",alt:mj.lng.glb.first,handler:function(){E.trigger("sourcefirst",E);E.trigger("sourceload",E);E.first()}})}if(D.prev){A.items.push({id:"btnprev",iconCls:"mj-previous",alt:mj.lng.glb.previous,handler:function(){E.trigger("sourceprev",E);E.trigger("sourceload",E);E.prev()}})}if(D.pages){A.items.push("|");A.items.push({id:"pageTotal"+this.id,html:'<div><span style="float:left;padding:5px;" unselectable="on" class="mj-page-before-text mj-unselectable">'+this.beforePageText+'</span><input type="text" size="1" value="1" class="mj-page-info" style="float:left;"></input><span style="float:left;padding:5px;" unselectable="on" class="mj-page-before-text mj-unselectable">/ '+String.format(this.afterPageText,1)+"</span></div>"});A.items.push("|")}if(D.next){A.items.push({id:"btnnext",iconCls:"mj-next",alt:mj.lng.glb.next,handler:function(){E.trigger("sourcenext",E);E.trigger("sourceload",E);E.next()}})}if(D.last){A.items.push({id:"btnlast",iconCls:"mj-last",alt:mj.lng.glb.last,handler:function(){E.trigger("sourcelast",E);E.trigger("sourceload",E);E.last()}})}}if(D.refresh){if(H){A.items.push("|")}A.items.push({id:"btnrefresh",iconCls:"mj-refresh",alt:mj.lng.glb.refresh,handler:function(){E.trigger("sourcerefresh",E);E.trigger("sourceload",E);E.refresh()}})}if(this.pageInfo){A.items.push({id:"pageInfo"+this.id,html:'<div style="float:right;padding-bottom:5px;padding-top:5px;text-align:right;" unselectable="on" class="mj-page-before-text mj-unselectable"></div>'})}A.renderTo=this.renderTo;E.tbar=new mj.menu(A);E.tbar.input=E.tbar._el.find("input");E.tbar.input.bind("change",function(){E.trigger("sourcefind",E);E.trigger("sourceload",E);E.go2page(this.value)});E.tbar.pageTotal=$(E.tbar._el.find("span")[1]);E.tbar.pageInfo=E.tbar._el.find("div:last");E.buttons=E.tbar.buttons;E.store.on("load",E.refreshPageBar,E)},getPageCount:function(){return Math.ceil(this.store.recordCount/this.params.limit)},go2page:function(A){var B=this.getPageCount();A=isNaN(parseInt(A))?1:A;if(A<1){A=1}if(A>B){A=B}this.params.current=A;this.params.start=(A-1)*this.params.limit;mj.apply(this.store.params,this.params);this.store.load()},first:function(){if(this.params.current>1){this.go2page(1)}},prev:function(){if(this.params.current>1){this.go2page(--this.params.current)}},next:function(){var A=this.getPageCount();if(A>this.params.current){this.go2page(++this.params.current)}},last:function(){var A=this.getPageCount();if(A>this.params.current){this.go2page(A)}},refresh:function(){this.store.trigger("sourcerefresh",this.store);this.store.load();this.store.trigger("afterrefresh",this.store)}};mj.extend(mj.pager,mj.component);mj.dataFilter=function(A){mj.dataFilter.superclass.constructor.call(this,A)};mj.dataFilter.prototype={componentClass:"mj.dataFilter",width:450,height:300,button:false,iconCls:"mj-filter",store:false,fields:false,grid:false,filterEvent:"getFilteredRecords",splitter:"$_$",countStart:0,init:function(){var A=this;if(!A.store){A.store=A.grid.store}if(!A.fields){A.fields=A.grid.cm}if(A.button){A.button.els.c.append(A.button.els.ci=$(mj.NE(A.button.els.c,{cls:"mj-tool-btn-center-icon "+A.iconCls})))}A.cachedParams={};mj.apply(A.cachedParams,A.store.params);A.win=new mj.window({renderTo:mj.NE(),title:mj.lng.glb.filterRecords,modal:true,width:A.width,height:A.height,minWidth:A.width,minHeight:A.height,buttons:[{title:mj.lng.glb.exit,handler:function(){A.win.hide()}},{title:mj.lng.glb.clear,handler:function(){A.clearFilter()}},{title:mj.lng.glb.get,handler:function(){A.getFilteredData()}}]});var B=A.getFilterElements(A.fields);A.form=new mj.form({renderTo:A.win.getBody(),items:B});A.store.on("sourcerefresh",function(){A.clearFilter()})},clearFilter:function(){var C=this,D;for(var B=0,A=C.form.items.length;B<A;B++){D=C.form.items[B];D.setValue("")}C.store.params.q=({}).toJSONString()},getFilteredData:function(){var B=this,A;A=B.getFilterItemValues();B.store.params.q=A.toJSONString();B.store.params.event=B.filterEvent;B.grid.pbar.params.current=B.grid.pbar.current;B.grid.pbar.params.start=B.grid.pbar.start;B.store.params.current=B.grid.pbar.current;B.store.params.start=B.grid.pbar.start;B.store.load();B.win.hide()},getFilterElements:function(C){var I=this,H,B,E=[],G,F=I.countStart-(this.tabPanel&&this.tabPanel.hideHeader?1:0);for(var A=0,D=C.length;A<D;A++){if(typeof C[A].filter!="undefined"){G=(C[A].filter=="single");itemName=C[A].filterIndex?C[A].filterIndex:C[A].dataIndex;switch(C[A].type){case"combo":if(!G){H=new mj.form.combo({labelWidth:"150px",title:C[A].header,dataIndex:C[A].dataIndex,store:typeof C[A].store!="undefined"?C[A].store:[{id:0,text:mj.lng.titles.buttons.no},{id:1,text:mj.lng.titles.buttons.yes}],width:117,table:C[A].table,mode:"remote",itemStyle:"float:left;clear:none;",name:itemName+I.splitter+"1"});E.push(H);B=new mj.form.combo({itemStyle:"padding-left:10px;float:left;clear:none;",dataIndex:C[A].dataIndex,store:typeof C[A].store!="undefined"?C[A].store:[{id:0,text:mj.lng.titles.buttons.no},{id:1,text:mj.lng.titles.buttons.yes}],width:117,table:C[A].table,mode:"remote",name:itemName+I.splitter+"2"});E.push(B)}else{H=new mj.form.combo({labelWidth:"150px",title:C[A].header,dataIndex:C[A].dataIndex,store:typeof C[A].store!="undefined"?C[A].store:[{id:0,text:mj.lng.titles.buttons.no},{id:1,text:mj.lng.titles.buttons.yes}],width:C[A].width||117,table:C[A].table,mode:"remote",name:itemName});E.push(H)}break;case"date":if(!G){H=new mj.form.dateField({labelWidth:"150px",title:C[A].header,dataIndex:C[A].dataIndex,initValue:null,table:C[A].table,epoch:C[A].epoch,itemStyle:"float:left;clear:none;",name:itemName+I.splitter+"1"});E.push(H);B=new mj.form.dateField({itemStyle:"padding-left:25px;float:left;clear:none;",dataIndex:C[A].dataIndex,initValue:null,table:C[A].table,epoch:C[A].epoch,name:itemName+I.splitter+"2"});E.push(B)}else{H=new mj.form.dateField({labelWidth:"150px",title:C[A].header,dataIndex:C[A].dataIndex,initValue:null,table:C[A].table,epoch:C[A].epoch,name:itemName});E.push(H)}break;case"int":if(!G){H=new mj.form.numberField({labelWidth:"150px",title:C[A].header,dataIndex:C[A].dataIndex,suffix:"",decimalPrecision:0,table:C[A].table,itemStyle:"float:left;clear:none;",name:itemName+I.splitter+"1"});E.push(H);B=new mj.form.numberField({itemStyle:"padding-left:10px;float:left;clear:none;",dataIndex:C[A].dataIndex,suffix:"",decimalPrecision:0,table:C[A].table,name:itemName+I.splitter+"2"});E.push(B)}else{H=new mj.form.numberField({labelWidth:"150px",title:C[A].header,dataIndex:C[A].dataIndex,suffix:"",decimalPrecision:0,table:C[A].table,name:itemName});E.push(H)}break;default:if(!G){H=new mj.form.textField({labelWidth:"150px",title:C[A].header,dataIndex:C[A].dataIndex,table:C[A].table,itemStyle:"float:left;clear:none;",name:itemName+I.splitter+"1"});E.push(H);B=new mj.form.textField({itemStyle:"padding-left:10px;float:left;clear:none;",dataIndex:C[A].dataIndex,table:C[A].table,name:itemName+I.splitter+"2"});E.push(B)}else{H=new mj.form.textField({labelWidth:"150px",title:C[A].header,dataIndex:C[A].dataIndex,table:C[A].table,name:itemName});E.push(H)}}F++}}return E},getFilterItemValues:function(){var C=this,D,F,E={};for(var B=0,A=C.form.items.length;B<A;B++){D=C.form.items[B];F=D.getValue();if(F!==""){E[(D.table?D.table+".":"")+D.name]=F}}return E},show:function(){this.win.show()}};mj.extend(mj.dataFilter,mj.component);mj.dataFilterTrigger=function(A){mj.dataFilterTrigger.superclass.constructor.call(this,A)};mj.dataFilterTrigger.prototype={componentClass:"mj.dataFilterTrigger",table:"",countStart:1,returns:false,handler:false,filterMode:true,localSort:false,tabs:{},titles:{},init:function(){var A=this;mj.apply(A.titles,{tabs:{filter:"Filtre",records:"KayÄ±tlar"}});A.store=new mj.store({url:A.url,localSort:A.localSort,params:{event:A.filterEvent,table:A.table}});mj.applyIf(A.store.params,A.params);var C=this;A.win=new mj.window({renderTo:mj.NE(),title:mj.lng.glb.filterRecords,modal:true,width:A.width,height:A.height,minWidth:A.width,minHeight:A.height,buttons:[{title:mj.lng.glb.exit,handler:function(){A.win.hide()}},{title:mj.lng.glb.clear,handler:function(){A.clearFilter();A.tabPanel.setActive(0);var E=C.filterMode?C.titles.get:mj.lng.glb.filter;var D=C.btns.getIndex("title",E);if(D>-1){C.btns[D].setTitle(C.titles.get)}C.filterMode=true}},{title:mj.lng.glb.get,handler:function(){if(C.filterMode){A.getFilteredData();this.setTitle(mj.lng.glb.filter);C.filterMode=false}else{C.tabPanel.setActive(0);this.setTitle(C.titles.get);C.filterMode=true}}}]});A.btns=A.win.buttons;A.mask=new mj.mask({el:A.win.getBody()});A.panel=new mj.panel({renderTo:A.win.getBody()});A.tabPanel=new mj.tab({renderTo:A.panel.getBody(),activeTab:0,border:false,hideHeader:true,tabWidth:120,maxTitle:12,items:[{title:A.titles.tabs.filter,iconCls:"tabs",closable:false},{title:A.titles.tabs.records,iconCls:"tabs",closable:false}]});A.tabs["filter"]=A.tabPanel.tabs[0];A.tabs["records"]=A.tabPanel.tabs[1];var B=A.getFilterElements(A.fields);A.form=new mj.form({renderTo:A.tabs.filter.getBody(),items:B});A.grid=new mj.grid({renderTo:A.tabs.records.getBody(),store:A.store,pbar:new mj.pager({pos:"bottom",limit:25}),fitToParent:true,cm:A.fields});if(A.handler&&typeof A.handler=="function"){A.grid.on("rowdblclick",function(E,D){A.handler(A,E.selectedRow.data);A.win.hide()},A)}else{if(A.returns){A.grid.on("rowdblclick",function(E,D){this.setValue(E.selectedRow.data[A.returns.values[0].name],true);this.setValue(E.selectedRow.data[A.returns.values[1].name]);this.trigger("dataselect",this,E.selectedRow.data);A.win.hide()},A.returns.el)}}A.store.on("sourcerefresh",function(){A.clearFilter()})},getFilteredData:function(){var C=this,A;C.mask.show(50);var B=0;while(++B<C.btns.length){C.btns[B].setDisable()}A=C.getFilterItemValues();C.store.params.q=A.toJSONString();C.store.params.event=C.filterEvent;C.grid.pbar.params.current=C.grid.pbar.current;C.grid.pbar.params.start=C.grid.pbar.start;C.store.params.current=C.grid.pbar.current;C.store.params.start=C.grid.pbar.start;C.store.load();C.store.onOnce("load",C._onStoreLoad,C)},_onStoreLoad:function(){this.tabPanel.setActive(1);var A=0;while(++A<this.btns.length){this.btns[A].setEnable()}this.mask.hide()},show:function(){this.win.show();return this.win}};mj.extend(mj.dataFilterTrigger,mj.dataFilter);mj.drag=function(A){mj.drag.superclass.constructor.call(this,A)};mj.drag.prototype={componentClass:"mj.drag",defaultConfigStr:"el",proxy:true,dragType:"vh",clientDrag:true,moving:true,copy:false,cls:"",startAction:"mousedown",dropEls:[],curDrop:false,dropOverCls:"mj-drag-drop-hover",appendParent:false,keepAspectRatio:false,proxyOpacity:0.5,initDrops:function(){for(var C=0,A=this.dropEls.length;C<A;C++){var B=$(this.dropEls[C]);ofs=B.offset();reg={};reg.l=ofs.left;reg.t=ofs.top;reg.r=ofs.left+B.width();reg.b=ofs.top+B.height();this.dropEls[C].reg=reg}},fromDrops:function(B){var E=this;E.fromDrop=false;for(var D=0,A=E.dropEls.length;D<A;D++){var G=E.dropEls[D],C=$(G);var F=G.reg;if(B.left>=F.l&&B.left<=F.r&&B.top>=F.t&&B.top<=F.b){E.fromDrop=G}}},checkDrops:function(G){var D=this;D.curDrop=false;for(var C=0,A=D.dropEls.length;C<A;C++){var F=D.dropEls[C],B=$(F);var E=F.reg;if(G.X>=E.l&&G.X<=E.r&&G.Y>=E.t&&G.Y<=E.b){B.addClass(D.dropOverCls);D.curDrop=F;D.trigger("onDropOver",D,F);B.trigger("onDropOver")}else{if(B.hasClass(D.dropOverCls)){B.removeClass(D.dropOverCls);D.trigger("onDropOut",D,F);B.trigger("onDropOut")}}}},destroy:function(){this._el.remove()},init:function(){var J=this,T=this;if(!J.dragEl){J.dragEl=J.el}var B=J.el=(typeof J.el==="string"?mj.get(J.el):J.el),C=J.dragEl=(typeof J.dragEl==="string"?mj.get(J.dragEl):J.dragEl);if(!B){return }var S;var O=J._el=$(B),K=J._dragEl=$(C);J.pwidth=0;J.pheight=0;if(!J.parent){J.parent=O.parent()}else{J.parent=$(J.parent);if(J.parent.css("position")!="static"||J.parent[0]==mj.bd[0]){J.offsetParent=J.parent[0]}}O.addClass(J.cls);if(O.css("position")!="relative"){O.css("position","absolute")}if(J.side){K.addClass("mj-resizer-"+J.side);J.mode="R"}var P,M,N,H={},R={},U={},F={},A;if(J.keepAspectRatio){J.aspectRatio=O.outerHeight()/O.outerWidth()}if(J.resizer){if(J.resizer.maxWidth){var D=parseInt(J.resizer._el.css("left"));if(D){J.resizer.setMaxWidth(J.resizer.config.maxWidth-D)}if(!J.resizer.config.parentBorders||!J.resizer.config.parentBorders.maxWidth){J.resizer.config.parentBorders.maxWidth=J.resizer.config.maxWidth}}if(J.resizer.maxHeight){var L=parseInt(J.resizer._el.css("top"));if(L){J.resizer.setMaxHeight(J.resizer.config.maxHeight-L)}if(!J.resizer.config.parentBorders||!J.resizer.config.parentBorders.maxHeight){J.resizer.config.parentBorders.maxHeight=J.resizer.config.maxHeight}}}var I,Q,G,E;I=function(Z){var Y,X,W,V;if(J.mode=="R"){Y=J.minWidth,W=J.maxWidth;X=J.minHeight,V=J.maxHeight}else{if(J.clientDrag){Y=J.minWidth||J.clientReg.l,W=J.maxWidth||J.clientReg.r-P;X=J.minHeight||J.clientReg.t,V=J.maxHeight||J.clientReg.b-M}}Z.X=Z.X<Y?Y:(Z.X>W?W:Z.X);Z.Y=Z.Y<X?X:(Z.Y>V?V:Z.Y);if(J.keepAspectRatio){if(Z.X*J.aspectRatio<X||Z.X*J.aspectRatio>V){Z.X=Z.Y/J.aspectRatio}else{Z.Y=Z.X*J.aspectRatio}}return{X:Z.X,Y:Z.Y}},Q=function(V){if((J.startAction=="mousedown"&&V.which==1)&&J.trigger("beforedrag",J,V,H)!==false&&J.pause!==true){V.preventDefault();J.dragging="half";$().mouseup(G).mousemove(E);J.trigger("dragstart",J,V,H)}},G=function(c){if(J.dragging=="half"){$().unbind("mousemove",E).unbind("mouseup",G)}else{if(J.dragging==true){$().unbind("mousemove",E).unbind("mouseup",G);c.preventDefault();if(J.proxy){J.proxy[0].className=""}if(J.trigger("dragstop",J,J.curDrop,J.fromDrop)!==false){if(J.mode=="R"){if(O.hasAbsoluteParent()){var Z=0,Y=0}else{var Z=$.browser.msie?0:c.view.scrollMaxX,Y=$.browser.msie?0:c.view.scrollMaxY}O.css({width:F.X-Z,height:F.Y-Y});J.trigger("resize",J,F.X,F.Y)}else{if(J.moving){H=N.offset();if(J.offsetParent!=mj.bd[0]){U=$(J.offsetParent).offset({border:true});H.left=H.left-U.left;H.top=H.top-U.top}if(J.copy){J.xel=O.clone().css(H).appendTo(J.parent);var W=J.config;W.el=J.xel[0];W.copy=false;var X=new mj.drag(W);X.on("dragafterstop",function(f,d,g){J.trigger("dragafterstop",f,d,g)},J);X.on("dragstop",function(f,d,g){J.trigger("dragstop",f,d,g)},J)}else{O.css(H)}if(J.appendParent){O.appendTo(J.parent)}if(J.parent&&J.resizer){if(J.resizer.maxWidth){var V=J.resizer.config.parentBorders.maxWidth-H.left;J.resizer.setMaxWidth(V>J.resizer.config.maxWidth?J.resizer.config.maxWidth:V)}if(J.resizer.maxHeight){var a=J.resizer.config.parentBorders.maxHeight-H.top;J.resizer.setMaxHeight(a>J.resizer.config.maxHeight?J.resizer.config.maxHeight:a)}}}}J.trigger("dragafterstop",J,J.curDrop,J.fromDrop)}if(J.curDrop){$(J.curDrop).removeClass(J.dropOverCls)}if(J.proxy){J.proxy.remove();J.proxy=true}J.dragging=null;window.mjDragging=null}}},E=function(X){X.preventDefault();if(J.dragging=="half"){P=O.outerWidth();M=O.outerHeight();J.pheight=J.parent[0].clientHeight;J.pwidth=J.parent[0].clientWidth;J.offsetParent=J.offsetParent||J.el.offsetParent||mj.bd[0];if(J.clientDrag){var Z={left:0,top:0};if(J.parent[0]!=J.offsetParent){var Z=J.parent.offset({relativeTo:J.offsetParent,border:true})}J.clientReg={l:Z.left,t:Z.top,r:Z.left+J.pwidth,b:Z.top+J.pheight}}H=O.offset({relativeTo:J.offsetParent});J.dropEls=J.dropEls.length>0?J.dropEls:window.dropEls||[];if(J.dropEls.length>0){J.initDrops();J.fromDrops(H)}if(J.proxy){if(J._el.hasAbsoluteParent()){var V=parseInt(J._el.css("left")),W=parseInt(J._el.css("top"));V=!isNaN(V)?V:0;W=!isNaN(W)?W:0;var Y={left:V,top:W}}else{var Y=J._el.offset({relativeTo:J.offsetParent})}N=J.proxy=$(mj.NE(J.parent,{cls:"mj-proxy"})),op={"z-index":"32001",position:J.position||O.css("position"),width:J.proxyEl?J.proxyEl.width:P,height:J.proxyEl?J.proxyEl.height:M,left:Y.left,top:Y.top,opacity:J.proxyOpacity};N.css(op)}else{N=J._el}if(J.mode=="R"){S={width:O.width(),height:O.height()}}J.dragging=true;window.mjDragging=true;R.left=X.pageX;R.top=X.pageY}if(J.dragging){if(J.mode=="R"){F={X:S.width+X.pageX-R.left,Y:S.height+X.pageY-R.top,E:X};A=I(F);N.css({width:A.X,height:A.Y})}else{F={X:H.left+X.pageX-R.left,Y:H.top+X.pageY-R.top};A=I(F);if(J.dragType=="vh"){N.css({left:A.X,top:A.Y})}else{if(J.dragType=="v"){N.css({top:A.Y})}else{if(J.dragType=="h"){N.css({left:A.X})}}}if(J.trigger("dragmove",J,A.X,A.Y)==false){G(X)}if(J.dropEls.length>0){J.checkDrops(A)}}}};K.bind(this.startAction,Q);mj.drag.superclass.init.call(this)}};mj.extend(mj.drag,mj.component);mj.resizer=function(A){mj.resizer.superclass.constructor.call(this,A);this.init()};mj.resizer.prototype={componentClass:"mj.resizer",defaultConfigStr:"el",proxy:true,keepAspectRatio:false,init:function(){var B=this,C=B.el,D=B._el=$(C);var A=B.resizeEl=$(mj.NE(C,{html:mj.insertSpacer(10,10)}));B.se=new mj.drag({el:C,dragEl:A,side:"se",minWidth:B.minWidth,maxWidth:B.maxWidth,minHeight:B.minHeight,maxHeight:B.maxHeight,keepAspectRatio:B.keepAspectRatio,proxy:B.proxy});B.se.on("resize",function(G,F,E){D.trigger("resize")})},setMaxWidth:function(A){if(this.se){this.se.maxWidth=A}},setMaxHeight:function(A){if(this.se){this.se.maxHeight=A}}};mj.extend(mj.resizer,mj.component);mj.rating=function(A){mj.rating.superclass.constructor.call(this,A)};mj.rating.prototype={componentClass:"mj.rating",disabled:false,iconPos:"left",cls:"mj-rating-star",count:5,value:0,enabled:true,init:function(){var B=this,C=B.id||mj.genId("mj-rating-");B.cnt=mj.NE(B.renderTo,{cls:B.cls,id:C});B._cnt=$(B.cnt);B._cnt.bind("mouseout",function(){B.setRawValue.call(B,B.value)});B.icons=[];for(var A=0;A<B.count;A++){B.icons.push({_el:$(mj.NE(B.cnt,{cls:"mj-rating-icon mj-off",id:C+"-icons-"+(A+1),html:mj.insertSpacer(12,12)}))});B.icons[A]._el.bind("mouseover",function(){if(B.enabled){B.setRawValue.call(B,this.id.toString().replace(C+"-icons-",""))}});B.icons[A]._el.bind("click",function(){if(B.enabled){var D=this.id.toString().replace(C+"-icons-","");B.setValue.call(B,D);B.trigger("click",B,D)}})}B.setValue(B.value)},setIcon:function(A,D){var B=this,C=B.icons[A];if(C.value!=D){if(D){C._el.removeClass("mj-off");C._el.addClass("mj-on")}else{C._el.removeClass("mj-on");C._el.addClass("mj-off")}}},setRawValue:function(D){var C=this;D=parseInt(D);if(D>=0&&D<=C.count){for(var B=0;B<D;B++){C.setIcon(B,true)}for(var A=D;A<C.count;A++){C.setIcon(A,false)}return true}return false},setValue:function(B){var A=this.setRawValue(B);if(A){this.value=B}return A},enable:function(){this.enabled=true},disable:function(){this.enabled=false}};mj.extend(mj.rating,mj.component);mj.button=function(A){mj.button.superclass.constructor.call(this,A)};mj.button.prototype={componentClass:"mj.button",disabled:false,iconPos:"left",cls:"",alt:false,init:function(){var E=this;this._cw=this.width?("width:"+(this.width-12)+"px"):"";var F=this.el=this.renderTo;var B=this._el=$(F);B.addClass("mj-button mj-unselectable "+E.cls);if(E.alt){E.alt=mj.translate(E.alt);B.attr("title",E.alt)}E.title=mj.translate(E.title);var D=function(){return E.icon=$(mj.NE(E.renderTo,{cls:"mj-button-icon "+E.iconCls}))};mj.NE(this.renderTo,{cls:"mj-button-left"});var A=this._center=$(mj.NE(this.renderTo,{cls:"mj-button-center mj-unselectable",style:this._cw,unselectable:"on",html:this.title?('<center><span style="'+this._cw+'" unselectable="on">'+this.title+"</span></center>"):""}));if(this.iconCls){if(this.iconPos=="right"){A.append(D(A))}else{A.prepend(D(A))}}mj.NE(this.renderTo,{cls:"mj-button-right"});if(this.disabled){this.disable()}B.hover(function(){if(!E.disabled){B.addClass("mj-button-hover")}},function(){if(!E.disabled){B.removeClass("mj-button-hover")}});B.mouseout(function(){B.removeClass("mj-button-down")});B.mousedown(function(){if(!E.disabled){B.addClass("mj-button-down")}});B.mouseup(function(){B.removeClass("mj-button-down")});B.click(function(G){if(!E.disabled){if(mj._activeFormElement){mj._activeFormElement.trigger("blur",mj._activeFormElement)}E.trigger("click",E,E.handlerId,G)}});if(E.handler){E.on("click",E.handler,E.scope)}if(E._customRights){var C=E._customRights.split(",");C=C[0];if(mj._renderingModule&&mj._renderingModule._customRights&&mj._renderingModule._customRights.indexOf(C)>-1){E._el.addClass("mj-invisible");E.setHandler(function(){return false},this)}}mj.button.superclass.init.call(this)},setHandler:function(A,B){if(this.handler){this.mon("click",this.handler)}this.handler=A;this.scope=B||this.scope||this;this.on("click",this.handler,this.scope)},setDisable:function(){this.disable()},setEnable:function(){this.enable()},disable:function(){if(!this._el.hasClass("mj-disabled")){this._el.addClass("mj-disabled");if(this.icon){this.icon.addClass(this.iconCls+"-disabled")}}this.disabled=true},enable:function(){this._el.removeClass("mj-disabled");if(this.icon){this.icon.removeClass(this.iconCls+"-disabled")}this.disabled=false},setAlt:function(A){this.alt=mj.translate(A);this._el.attr("title",this.alt)},setTitle:function(A){this.title=mj.translate(A);this._center[0].innerHTML=this.title?('<center><span style="'+this._cw+'" unselectable="on">'+this.title+"</span></center>"):""}};mj.extend(mj.button,mj.component);mj.speedButton=function(A){mj.speedButton.superclass.constructor.call(this,A)};mj.speedButton.prototype={componentClass:"mj.speedButton",init:function(){var C=this;var D=this.el=mj.NE(this.renderTo);var A=this._el=$(D);A.addClass("mj-speed-button mj-unselectable "+C.cls);this.icon=$(mj.NE(A,{cls:"mj-speed-button-icon "+C.iconCls}));if(C.alt){C.alt=mj.translate(C.alt);A.attr("title",C.alt)}if(this.disabled){this.disable()}A.hover(function(){if(!C.disabled){A.addClass("mj-speed-button-hover")}},function(){if(!C.disabled){A.removeClass("mj-speed-button-hover")}});A.mouseout(function(){A.removeClass("mj-speed-button-down")});A.mousedown(function(){if(!C.disabled){A.addClass("mj-speed-button-down")}});A.mouseup(function(){A.removeClass("mj-speed-button-down")});A.click(function(E){if(!C.disabled){if(mj._activeFormElement){mj._activeFormElement.trigger("blur",mj._activeFormElement)}C.trigger("click",C,C.handlerId,E)}});if(C.handler){C.on("click",C.handler,C.scope)}if(C._customRights){var B=C._customRights.split(",");B=B[0];if(mj._renderingModule&&mj._renderingModule._customRights&&mj._renderingModule._customRights.indexOf(B)>-1){C._el.addClass("mj-invisible");C.setHandler(function(){return false},this)}}mj.button.superclass.init.call(this)},setTitle:function(A){return false}};mj.extend(mj.speedButton,mj.button);mj.mask=function(A){mj.mask.superclass.constructor.call(this,A)};mj.mask.prototype={componentClass:"mj.mask",init:function(){var A=this,B=A.el=A.el?A.el:document.body,C=A._el=$(B);A.mask=$(mj.NE(B,{cls:"mj-mask"}));mj.mask.superclass.init.call(this)},show:function(F){var C=this,B=C.mask;B.css("z-index",F?F:C.zIndex);var D=$(C.el);var E=D.offset();var A=D.offsetParent().attr("tagName");B.css("left",(($.browser.msie&&A=="BODY")?E.left:C.el.offsetLeft));B.css("top",(($.browser.msie&&A=="BODY")?E.top:C.el.offsetTop));B.css("height",C.el.offsetHeight);B.css("width",C.el.offsetWidth);B.show()},hide:function(){this.mask.hide()},destroy:function(){this.mask.remove()}};mj.extend(mj.mask,mj.component);mj.randomColors=function(A){this.colors=["red","blue","lights","green","darks"];mj.randomColors.superclass.constructor.call(this,A)};mj.randomColors.prototype={componentClass:"mj.randomColors",_activeIndex:0,_autoPallette:true,r:256,g:256,b:256,border:360,border2:270,state:"",lights:false,darks:false,changeTint:function(A){var B=this;B.v=false;B.lights=false;B.darks=false;B.r=256;B.g=256;B.b=256;if(A=="red"){B.r=256;B.g=40;B.b=40;B.state="red"}else{if(A=="blue"){B.r=40;B.g=40;B.b=256;B.state="blue"}else{if(A=="green"){B.r=40;B.b=40;B.g=256;B.state="green"}else{if(A=="darks"){darks=true}else{if(A=="lights"){lights=true}else{B.r=256;B.g=256;B.b=256}}}}}},color:function(D,C,A){var B=this;B.red=D;B.green=C;B.blue=A},generate:function(){var E=this;if(E._autoPallette){E.changeTint(E.colors[E._activeIndex++])}E.a=256;var C=Math.floor(Math.random()*E.r);var B=Math.floor(Math.random()*E.g);var A=Math.floor(Math.random()*E.b);var F=C+B+A;if(E.lights){while(E.sum<E.border){var G=Math.floor(Math.random()*3);switch(E.choose){case 0:C+=(E.border-E.sum);break;case 1:A+=(E.border-E.sum);break;case 2:B+=(E.border-E.sum);break}F=C+B+A}}else{if(E.darks){C=Math.min(C,170);B=Math.min(B,170);A=Math.min(A,170);while(F>=E.border2){var G=Math.floor(Math.random()*3);switch(G){case 0:C=Math.max(C-10,1);break;case 1:B=Math.max(B-10,1);break;case 2:A=Math.max(A-10,1);break;default:break}F=C+B+A}}}var D="#"+E.toHex(C)+E.toHex(B)+E.toHex(A);return D},toHex:function(B){var C=this,A=Math.floor(B/16);var E=B-(A*16);var D="";D+=C.getHex(A)+C.getHex(E);return D},getHex:function(B){var A="";switch(B){case 10:A+="A";break;case 11:A+="B";break;case 12:A+="C";break;case 13:A+="D";break;case 14:A+="E";break;case 15:A+="F";break;default:A+=B}return A}};mj.extend(mj.randomColors,mj.component);mj.shortcuts={on:function(){$.hotkeys.add.apply($.hotkeys,arguments)},mon:function(){$.hotkeys.remove.apply($.hotkeys,arguments)}};mj.menu=function(A){mj.menu.superclass.constructor.call(this,A)};mj.menu.prototype={componentClass:"mj.menu",width:200,style:"horizontal",visible:true,alignTo:"tl",subMenuAlign:"bl",canHide:false,drag:false,cls:"",buttons:false,init:function(){var A=this.visible?"block":"none";var B=this,F=mj.NE,C=B.el=F(B.renderTo,{cls:"mj-menu-"+B.style+" "+B.cls,style:"display:"+A}),E=B._el=$(C);B.menuConfig=B.menuConfig||B.config;B.buttons=[];if(B.style=="vertical"){var D=0;$(B.items).each(function(){D+=(this=="|"||this[0]=="|")?(B.style=="horizontal"?2:1):22});E.height(B.height=D);E.width(B.width)}$(B.items).each(function(){if(this[0]=="|"||this=="|"){B.addSplitter()}else{if(this.html||(this[0]&&this[0].html)){B._el.append(this.html||this[0].html)}else{var G=B.addButton(this);if(B.style=="vertical"){G.els.c.width(B.width-35-($.browser.msie?2:0))}}}});B.on("itemclick",function(I,G,H){if(B.canHide){B.hide()}if(B.parent){B.parent.trigger("itemclick",B.parent,G,H)}});B.on("itemtoggle",function(I,G,H){if(B.parent){B.parent.trigger("itemtoggle",B.parent,G,H)}});mj.menu.superclass.init.call(this)},addButton:function(A){var C=this;if(!C.buttons){C.buttons=[]}mj.applyIf(A,{renderTo:C.el,menuConfig:C.menuConfig,parent:C,subMenuAlign:C.subMenuAlign,drag:C.drag||C.menuConfig.drag||mj.menu.prototype.drag,icon:C.icon,iconCls:C.iconCls});var B=new mj.toolbutton(A);C.buttons.push(B);if(C.style=="vertical"){C._el.height(mj.oLength(C.buttons)*22)}return B},addSplitter:function(){mj.NE(this.el,{cls:"mj-menu-splitter",html:mj.insertSpacer()})},show:function(F,B){var L=this,J=L._el,H=0,A=0,I=0,G=0,E=F._el,D=E.offset({border:true,padding:true}),K=E.width(),C=E.height();switch(F.subMenuAlign){case"tl":I=D.left;G=D.top;break;case"tr":I=D.left+K;G=D.top;break;case"bl":I=D.left;G=D.top+C;break;case"br":I=D.left+K;G=D.top+C-4;break}L.showAt(I,G)},showAt:function(F,D){var I=this,G=I._el,E=0,C=0,H=parseInt(G[0].style.height),A=parseInt(G[0].style.width);switch(I.alignTo){case"tl":C=F;E=D;break;case"tr":E=D;C=F-I.width;break;case"bl":C=F;E=D-H;break;case"br":E=D-H;C=F-I.width;break}G.css({position:"absolute",top:E,left:C});if(I.parent){if(I.parent.parent.activeSub){I.parent.parent.activeSub.hide()}I.parent.parent.activeSub=I}var B=function(L){var K=L.target.parentNode,J=$(K);I._hideCheck.call(I,L)};$(document).bind("mousedown",B);$(document).bind("dragstart",B);G.show()},_hideCheck:function(B){var A=$(B.target).hasParent(this.el);if(!A&&this.canHide){this.hide()}},hide:function(){var A=this;if(A.canHide){if(A.parent){A.parent.parent.activeSub=null}A._el.hide()}},clear:function(){this.items=[];this.buttons=[];this._el.empty()},getItem:function(D,C){var C=C?C:this.items;for(var B=0,A=C.length;B<A;B++){if(C[B].id==D){return C[B]}else{if(C[B].items&&C[B].items.length>0){return this.getItem(D,C[B].items)}}}return false}};mj.extend(mj.menu,mj.component);mj.toolbutton=function(A){mj.toolbutton.superclass.constructor.call(this,A)};mj.toolbutton.prototype={componentClass:"mj.toolbutton",subMenuAlign:"bl",type:"default",drag:false,disabled:false,iconCls:"",init:function(){var F=this.id?("mj-"+mj.genId()+"-"+this.id):"mj-"+mj.genId();this.id=this.id?this.id:F;var I=this,D=mj.NE,C=I.el=D(I.renderTo,{cls:"mj-tool-btn mj-unselectable ",style:I.drag?"position:relative;":"",id:F,title:mj.translate(I.alt),name:(I.name?I.name:F)}),G=I._el=$(C);I.els={l:$(D(C,{cls:"mj-tool-btn-left"})),c:$(D(C,{cls:"mj-tool-btn-center"})),r:$(D(C,{cls:"mj-tool-btn-right"}))};if(I.disabled){I.setDisable()}var B="";if(I.iconCls){var H=I.iconCls}if(I.icon){B+=";background:transparent url("+I.icon+") no-repeat"}if(B!==""&&I.parent&&I.parent.style=="horizontal"){B+=";width:16px"}if(I.parent.style=="horizontal"&&!I.icon&&!H){B+="width:0"}I.els.ci=$(D(I.els.c,{cls:"mj-tool-btn-center-icon "+H,style:B}));if(I.title){I.els.ct=$(D(I.els.c,{cls:"mj-tool-btn-center-text",html:mj.translate(I.title)}));I.els.ct.attr("unselectable","on")}if(I.items){I.els.csi=$(D(I.els.c,{cls:"mj-tool-btn-center-subicon"}));I.subMenu=new mj.menu({style:"vertical",width:I.subMenuWidth||mj.menu.prototype.width,canHide:true,visible:false,parent:I,items:I.items,menuConfig:I.menuConfig,alignTo:I.alignTo||I.parent.alignTo||mj.menu.prototype.alingTo,subMenuAlign:I.subMenuAlign||I.parent.subMenuAlign||mj.menu.prototype.subMenuAlign,isSub:true})}var E=function(){if(I.subTimer){clearTimeout(I.subTimer);I.subTimer=null}};if(I.drag){I.dragHandle=new mj.drag({el:G,moving:false,position:"absolute",proxyEl:{width:30,height:30},parent:mj.bd});I.dragHandle.on("beforedrag",function(J,K){return !I.disabled});I.dragHandle.on("beforedrag",function(J,L){var K=this;while(K.parent){K=K.parent}return K.trigger("beforedrag",J,L,this)},I);I.dragHandle.on("dragstart",function(J,L){var K=this;while(K.parent){K=K.parent}K.trigger("dragstart",J,L,this)},I);I.dragHandle.on("dragstop",function(J){var K=this;while(K.parent){K=K.parent}K.trigger("dragstop",J,this)},I)}G.hover(function(){if(!I.disabled){G.addClass("mj-tool-btn-hover");if(I.subMenu&&!I.disabled){I.subTimer=setTimeout(function(){I.showSubMenu();E()},mj.glb.menuDelay)}}},function(){if(!I.disabled){G.removeClass("mj-tool-btn-hover");E()}});G.mouseout(function(){G.removeClass("mj-tool-btn-down")});G.mousedown(function(J){if(!I.disabled){G.addClass("mj-tool-btn-down");if(I.type=="toggle"||I.type=="radio"){J.stopPropagation()}}});G.mouseup(function(){G.removeClass("mj-tool-btn-down")});G.click(function(){if(!I.disabled){if(I.items){I.showSubMenu()}else{I.trigger("click",I,I.id);if(I.parent&&I.parent.events&&I.parent.events.itemclick){if(I.parent.canHide&&I.type=="default"){I.parent.hide();I.parent.trigger("itemclick",I.parent,I,I.id)}else{I.parent.trigger("itemtoggle",I.parent,I,I.id)}}}}});I.on("itemclick",function(L,J,K){if(L.parent&&L.parent.events&&L.parent.events.itemclick){L.parent.trigger("itemclick",L.parent,J,K)}});I.on("itemtoggle",function(L,J,K){if(L.parent&&L.parent.events&&L.parent.events.itemclick){L.parent.trigger("itemtoggle",L.parent,J,K)}});if(I.handler){I.on("click",I.handler,I.scope)}if(I.type=="toggle"){I.setToggle(I.state);I.on("click",I.toggle,I)}if(I.type=="radio"){I._el.addClass("mj-radio");if(I.state){I.setRadio(I.state)}I.on("click",I.radio,I)}if(I._customRights){var A=I._customRights.split(",");A=A[0];if(mj._renderingModule&&mj._renderingModule._customRights&&mj._renderingModule._customRights.indexOf(A)>-1){I._el.addClass("mj-invisible");I.setHandler(function(){return false},this)}}mj.toolbutton.superclass.init.call(this)},radio:function(){if(!this.disabled){this.setRadio(!this.state)}},setRadio:function(F){var B=this._el.parent().find('div[@name="'+$(this).attr("name")+'"]');var C=this.parent.items;for(var D=0,A=C.length;D<A;D++){var E=C[D];if(E.type&&E.type=="radio"){E.state=false}if(this.id==E.id){E.state=true}}B.removeClass("mj-radio-checked");this._el.addClass("mj-radio-checked");this.state=true},setHandler:function(A,B){if(this.handler){this.mon("click",this.handler)}this.handler=A;this.scope=B||this.scope||this;this.on("click",this.handler,this.scope)},setDisable:function(){this.disabled=true;this._el.addClass("mj-item-disabled")},setEnable:function(){this.disabled=false;this._el.removeClass("mj-item-disabled")},toggle:function(){this.setToggle(!this.state)},setAlt:function(A){this.alt=A;this._el.attr("title",A)},setTitle:function(A){this.title=mj.translate(A);this.els.ct.text(this.title)},setToggle:function(A){if(A){this._el.removeClass("mj-toggle-unchecked");this._el.addClass("mj-toggle-checked")}else{this._el.removeClass("mj-toggle-checked");this._el.addClass("mj-toggle-unchecked")}this.state=A},showSubMenu:function(){var B=this,A=B.subMenu;if(A){A.show(B,B.subMenuAlign)}}};mj.extend(mj.toolbutton,mj.component);mj.contextmenu=function(A){A.clientArea=$(A.parent?A.parent:mj.bd);A.parent=null;mj.contextmenu.superclass.constructor.call(this,A)};mj.contextmenu.prototype={componentClass:"mj.contextmenu",style:"vertical",subMenuAlign:"tr",canHide:true,visible:false,init:function(){var B=this,A=B.clientArea;A.bind("contextmenu",function(C){B.trigger("show",B,C.pageX,C.pageY);B.showAt(C.pageX,C.pageY);C.preventDefault();C.stopPropagation()});mj.contextmenu.superclass.init.call(this)}};mj.extend(mj.contextmenu,mj.menu);mj.view=function(A){mj.view.superclass.constructor.call(this,A)};mj.view.prototype={componentClass:"mj.view",multiSelect:false,overClass:"view-over",selectedClass:"view-selected",items:[],selections:[],selected:[],loadMask:true,init:function(){this.sel=[];this.cnt=$(this.renderTo);if(this.pbar&&typeof this.pbar.render=="function"){this.pbar.render({scope:this})}if(this.loadMask){this.mask=new mj.mask({el:this.cnt[0]})}this.store.on("beforeload",function(){if(this.loadMask){this.mask.show(50)}},this);this.store.on("load",function(){this.load()},this);mj.bindResize(this.cnt,this.doLayout,this)},doLayout:function(){$(this.renderTo).kkresizeheight(this.cnt.height()-(this.pbar?25:0))},removeAll:function(){this.clearSelections();this.items=[];$(this.renderTo).find("div").remove()},load:function(){this.removeAll();if(this.filter){this.store.filter(this.filter.dI,this.filter.v);B=this.store.data}else{var B=this.store.data}if(!B){this.store.load()}var D;for(b in B){D=B[b];if(typeof D!="function"){var E=this.tpl.apply(D);var A=$(this.renderTo).append(E).find(this.selector+":last").attr("id",mj.genId("view-el-"));D.el=A;if($.browser.msie){A.attr("unselectable","on")}var F={id:A.attr("id"),el:mj.get(A.attr("id")),jEL:A,store:B[b],storeIndex:parseInt(b)};this.items.push(F);var C=this;A.bind("click",{scope:this},function(G){var H=C.view||C;H.onClick(G)}).bind("dblclick",{scope:this},function(G){var H=C.view||C;H.onDblClick(G)}).bind("contextmenu",{scope:this},function(G){var H=C.view||C;H.onContextMenu(G)});if(this.overClass){A.hover(function(G){var H=C.view||C;$(this).addClass(H.overClass);H.trigger("onItemOver",H,this,G)},function(G){var H=C.view||C;$(this).removeClass(H.overClass);H.trigger("onItemOut",H,this,G)})}}}this.trigger("afterload",this);if(this.loadMask){this.mask.hide()}},getViewEl:function(A){return this.items[mj.getIndex(this.items,"id",$(A.target).parents(this.selector).attr("id")||$(A.target).attr("id"))]},clearSelections:function(){$(this.renderTo).find(this.selector).removeClass(this.selectedClass);this.selections=[];this.selected=[];this.sel=[]},onClick:function(B){var A=this.getViewEl(B);this._onSelect(A,B);this.trigger("itemclick",this,A,B)},_onSelect:function(A,C){if(C&&(!this.multiSelect||!C.ctrlKey)){this.clearSelections()}A.jEL.addClass(this.selectedClass);this.selections.push(A);var B=this.scope?{index:A.storeIndex,id:A.store[this.scope.idField],value:A.store[this.scope.displayField]}:{index:A.storeIndex,id:A.id,value:A.store.title};if(this.multiSelect){this.sel.push(B)}else{this.sel=B}this.selected.push(this.sel)},select:function(A){var B=this.items[A];if(B){this._onSelect(this.items[A])}},onDblClick:function(A){this.trigger("dblclick",this)},onContextMenu:function(A){A.preventDefault();this.trigger("contextmenu",this)}};mj.extend(mj.view,mj.component);mj.form=function(A){mj.form.superclass.constructor.call(this,A)};mj.form.prototype={componentClass:"mj.form",method:"POST",buttonPos:"bottom",hasUpload:false,encoded:true,fieldSets:false,buttons:false,init:function(){var C=this,F=C.renderTo,G=C._r=$(F);C.fieldSets=[];var D={tag:"form",method:C.method,cls:"mj-form"};if(C.hasUpload){D.enctype="multipart/form-data"}if(C.buttons){if(C.buttonPos=="bottom"){C.cnt=$(mj.NE(G,{tag:"div",style:"overflow:auto;height:"+(G[0].style.height+";")}));C.buttonContainer=$(mj.NE(G,{tag:"div",cls:"mj-form-buttons-container"}))}else{if(C.buttonPos=="top"){C.buttonContainer=$(mj.NE(G,{tag:"div",cls:"mj-form-buttons-container"}));C.cnt=$(mj.NE(G,{tag:"div",style:"overflow:auto;height:"+(G[0].style.height+";")}))}}C.buttonConfigs=C.buttons;C.buttons=[];$(C.buttonConfigs).each(function(){C.addButton.call(C,this)})}else{C.cnt=$(mj.NE(G,{tag:"div",style:"overflow:auto;height:"+(G[0].style.height+";")}))}C.form=$(mj.NE(C.cnt,D));if(!C.items){C.items=[]}else{for(var B=0,A=C.items.length;B<A;B++){var E=C.items[B];E.form=C;C.on("render",function(H){H.renderItem.call(H,this)},E);if(E.componentClass=="mj.form.fileInput"){C.hasUpload=true}}}C.cachedItems={};if(C.buttons){C.cnt.height(G.height()-C.buttonContainer.height())}mj.form.superclass.init.call(this);C.trigger("render",C,C);mj.bindResize(C.cnt,C.doForm,C);this.modifiedFields=[];if(this.store){this.store.on("load",this.loadForm,this)}},doForm:function(){this.cnt.height(this.renderTo.height()-(this.buttons?this.buttonContainer.height():0))},addButton:function(B){var C=this;if(!C.buttons){C.buttons=[]}var A=B;if(!A.componentClass){mj.applyIf(A,{renderTo:mj.NE(C.buttonContainer)});A=new mj.button(A)}A.window=C;C.buttons.push(A)},renderItem:function(C,D){if(typeof D=="undefined"){C.renderTo=this.form}else{if(typeof D=="string"){D=mj.getIndex(this.fieldSets,"id",D);if(D==-1){return }}C.renderTo=this.fieldSets[D].fieldSetEl}if(C.right){var B=this,A=B.items.indexOf(C);if(A>0&&typeof B.items[A-1]!="undefined"&&B.items[A-1]._el){B.items[A-1]._el.css("float","left")}C.itemStyle+="clear:none;float:left;margin-left:5px;"}C.render.call(C,this)},add:function(B,C){if(B.componentClass=="mj.form.fileInput"){this.hasUpload=true}if(B.right){var A=this.items.length;if(A>0&&typeof this.items[A-1]!="undefined"){this.items[A-1]._el.css("float","left")}B.itemStyle+="clear:none;float:left;margin-left:5px;"}this.renderItem(B,C);B.form=this;if(typeof C=="string"){this.items[this.items.getIndex("id",C)].items.push(B)}if(typeof C=="number"){this.fieldSets[C].items.push(B)}this.items.push(B)},getField:function(C){if(this.cachedItems[C]){return this.cachedItems[C]}if(!isNaN(C)){return this.items[C]}for(var B=0,A=this.items.length;B<A;B++){if(this.items[B].name==C||this.items[B].dataIndex==C){this.cachedItems[C]=this.items[B];return this.items[B]}}},getValue:function(F,B){var E={},D=this;if(!F){F=[];if(!D.items||D.items.length==0){return E}for(var C=0,A=D.items.length;C<A;C++){if(D.items[C].componentClass!="mj.form.fieldSet"&&D.items[C].componentClass!="mj.panel"){F.push(D.items[C].name?D.items[C].name:(D.items[C].dataIndex?D.items[C].dataIndex:C))}}}if(typeof F=="string"){F=[F]}for(var C=0,A=F.length;C<A;C++){if(B){E[F[C]]=D.getField.call(D,F[C]).getElValue()}else{E[F[C]]=D.getField.call(D,F[C]).getValue()}}return E},getElValue:function(A){return this.getValue(A,true)},setValue:function(B,C){for(var A in B){if(typeof B[A]!="function"){var D;if(D=this.getField(A)){if(C){D.setElValue(B[A])}else{D.setValue(B[A])}}}}},setElValue:function(A){this.setValue(A,true)},clear:function(){$(this.items).each(function(){if(typeof this.clear=="function"){this.clear()}})},removeAll:function(){this.clear();this.form.empty();this.items=[];this.cachedItems={};this.modified=false;this.modifiedFields=[]},submit:function(opt){var S=opt.success;var F=opt.failure;if(S){delete opt.success}if(F){delete opt.failure}var defOpt={url:this.url,type:this.method,encoded:this.encoded,success:function(data){var d=eval("("+data+")");if(d){if(d.success&&S){S(d)}}if(!d.success&&F){F(d)}}};if(typeof opt=="string"){defOpt.url=opt;opt=defOpt}mj.applyIf(opt,defOpt);var data=opt.encoded?mj.escape(this.getValue().toJSONString()):this.getValue().toJSONString();opt.data="data="+data;if(opt.params){for(var x in opt.params){if(typeof opt.params[x]!="function"){opt.data+="&"+x+"="+opt.params[x]}}}if(opt.url!=""){if(!this.hasUpload){$.ajax(opt)}else{var $form=$(this.form),options=opt;function fileUpload(){var form=$form[0];var opts=$.extend({},$.ajaxSettings,options);var id="jqFormIO"+mj.genId();var $io=$('<iframe id="'+id+'" name="'+id+'" />');var io=$io[0];var op8=$.browser.opera&&window.opera.version()<9;if($.browser.msie||op8){io.src='javascript:false;document.write("");'}$io.css({position:"absolute",top:"-1000px",left:"-1000px"});var xhr={responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){}};var g=opts.global;if(g&&!$.active++){$.event.trigger("ajaxStart")}if(g){$.event.trigger("ajaxSend",[xhr,opts])}var cbInvoked=0;var timedOut=0;setTimeout(function(){$io.appendTo("body");io.attachEvent?io.attachEvent("onload",cb):io.addEventListener("load",cb,false);var encAttr=form.encoding?"encoding":"enctype";var t=$form.attr("target");$form.attr({target:id,method:"POST",action:opts.url});form[encAttr]="multipart/form-data";if(opts.timeout){setTimeout(function(){timedOut=true;cb()},opts.timeout)}form.submit();$form.attr("target",t)},10);function cb(){if(cbInvoked++){return }io.detachEvent?io.detachEvent("onload",cb):io.removeEventListener("load",cb,false);var ok=true;try{if(timedOut){throw"timeout"}var data,doc;doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;xhr.responseText=doc.body?doc.body.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(opts.dataType=="json"||opts.dataType=="script"){var ta=doc.getElementsByTagName("textarea")[0];data=ta?ta.value:xhr.responseText;if(opts.dataType=="json"){eval("data = "+data)}else{$.globalEval(data)}}else{if(opts.dataType=="xml"){data=xhr.responseXML;if(!data&&xhr.responseText!=null){data=toXml(xhr.responseText)}}else{data=xhr.responseText}}}catch(e){ok=false;$.handleError(opts,xhr,"error",e)}if(ok){opts.success(data,"success");if(g){$.event.trigger("ajaxSuccess",[xhr,opts])}}if(g){$.event.trigger("ajaxComplete",[xhr,opts])}if(g&&!--$.active){$.event.trigger("ajaxStop")}if(opts.complete){opts.complete(xhr,ok?"success":"error")}setTimeout(function(){$io.remove();xhr.responseXML=null},100)}function toXml(s,doc){if(window.ActiveXObject){doc=new ActiveXObject("Microsoft.XMLDOM");doc.async="false";doc.loadXML(s)}else{doc=(new DOMParser()).parseFromString(s,"text/xml")}return(doc&&doc.documentElement&&doc.documentElement.tagName!="parsererror")?doc:null}}fileUpload()}}},loadForm:function(){if(this.store&&this.store.data.length>0){var B=this.items,D=this.store.data[0];for(var C=0,A=B.length;C<A;C++){if(B[C].dataIndex){B[C].setValue(D[B[C].dataIndex]);if(B[C].componentClass=="mj.form.triggerField"){B[C].setValue(D[B[C].dataIndex+"_lookup_"],true)}}}}},load:function(){this.store.load()},startLoad:function(){this.loading=true;this.modified=false;this.modifiedFields=[]},finishLoad:function(){this.loading=false},setModified:function(A){this.modified=true;if(this.modifiedFields.indexOf(A)==-1){this.modifiedFields.push(A)}}};mj.extend(mj.form,mj.component);mj.form.field=function(A){mj.form.field.superclass.constructor.call(this,A)};mj.form.field.prototype={componentClass:"mj.form.field",labelWidth:"75px",labelAlign:"left",itemCls:"mj-form-item",titleCls:"mj-form-caption",inputCls:"mj-form-input",hidden:false,readOnly:false,disabled:false,left:false,top:false,type:"text",tag:"input",labelPos:"left",itemStyle:"",render:function(){var C=this,F=mj.NE,B="";if(C.hidden){C.itemCls+=" mj-invisible"}if(C.left||C.top){C.left=typeof C.left!="undefined"?(isNaN(C.left)?C.left:(C.left+"px")):"";C.top=typeof C.top!="undefined"?(isNaN(C.top)?C.top:(C.top+"px")):"";B="position:absolute;left:"+C.left+";top:"+C.top}var D=C.el=F(C.renderTo,{cls:C.itemCls,style:B+";"+C.itemStyle}),E=C._el=$(D);if(C.title){C.titleEl=F(D,{html:this.title,cls:C.titleCls+(C.labelPos=="top"?" "+C.titleCls+"-top":""),style:"width:"+C.labelWidth+";text-align:"+C.labelAlign})}C.input=$(F(D,{tag:C.tag,id:(C.id||mj.genId("mj-form-item-")),style:""+(C.height?"height:"+C.height+"px;":"")+(C.width?"width:"+C.width+"px;":""),type:C.type,cls:C.inputCls,MAXLENGTH:C.maxLength,readonly:C.readOnly,disabled:C.disabled,name:C.name}));C.input.focus(function(){mj._activeFormElement=C;C.trigger("focus",C)});C.input.blur(function(){C.trigger("blur",C,C)});C.on("blur",function(){C._onBlur.call(C)});C.input.keyup(function(){C.trigger("change",C)});if(C._customRights){var A=C._customRights.split(",");A=A[0];if(mj._renderingModule&&mj._renderingModule._customRights&&mj._renderingModule._customRights.indexOf(A)>-1){C._el.addClass("mj-invisible")}}C.trigger("render",C)},getValue:function(A){if(A){return this.input[0].value}else{return this.value}},getElValue:function(){return this.getValue(true)},formatValue:function(A){return A},setValue:function(A){if(this.validate(A)!==false){this.value=A;this.setElValue(this.formatValue(A));if(this.form&&!this.form.loading){this.form.setModified(this)}}},setElValue:function(A){this.input[0].value=A},clear:function(){this.setValue("")},validate:function(A){},clearValidate:function(){this.orjValidate=this.validate;this.validate=function(){return true}},setOldValidate:function(){this.validate=this.orjValidate;this.orjValidate=null},clearInvalid:function(){if(this.input){this.input.removeClass("mj-text-input-invalid");this.invalid=false}},markInvalid:function(A){if(this.input){this.input.addClass("mj-text-input-invalid");this.invalid=true;this.trigger("invalid",this,A)}},setPos:function(A,B){this._el.css({position:"absolute",left:A,top:B})},setWidth:function(A){this._el.width(A);if(this.title){A-=this.labelWidth}this.input.width(A-($.browser.msie?6:5))},_onBlur:function(){this.setValue(this.getElValue());if(mj._activeFormElement==this){mj._activeFormElement=null}},_onChange:function(){this.setValue(this.getElValue())},setDisable:function(){this.input.attr("readonly","true");this.input.attr("disabled","true");this.disabled=true},setEnable:function(){this.input.attr("readonly","false");this.input.attr("disabled","false");this.disabled=false}};mj.extend(mj.form.field,mj.component);mj.form.textField=function(A){mj.form.textField.superclass.constructor.call(this,A)};mj.form.textField.prototype={componentClass:"mj.form.textField",inputCls:"mj-text-editor",init:function(){var A=this;A.on("render",A._onRender,A);if(A.renderTo){A.render()}mj.form.textField.superclass.init.call(this)},_onRender:function(){var A=this;if(A.width){A.input.width(A.width)}A.input.focus(function(){A.input.addClass("focus")});A.input.blur(function(){A.input.removeClass("focus")})},focus:function(){this.input.focus()}};mj.extend(mj.form.textField,mj.form.field);mj.initEditor=function(E,A){if(A&&A.style=="small"){var D=new WYSIWYG.Settings();D.ImagesDir=mj.glb.openwysiwyg+"images/";D.PopupsDir=mj.glb.openwysiwyg+"popups/";D.Width="355px";D.Height="100px";D.DefaultStyle="font-family: Tahoma, helvetica, arial, sans-serif;font-size:11px;";D.Toolbar[0]=new Array("font","fontsize","bold","italic","underline","unorderedlist","orderedlist","outdent","indent","inserttable","viewSource");D.Toolbar[1]="";D.StatusBarEnabled=false;var C=D}else{var B=new WYSIWYG.Settings();B.ImagesDir=mj.glb.openwysiwyg+"images/";B.PopupsDir=mj.glb.openwysiwyg+"popups/";B.Width="410px";B.Height="200px";B.addToolbarElement("font",3,1);B.addToolbarElement("fontsize",3,2);B.ImagePopupFile=mj.glb.openwysiwyg+"addons/imagelibrary/insert_image.php";B.ImagePopupWidth=600;B.ImagePopupHeight=245;var C=B}if(A&&A.toolbar){if(A.toolbar[0]){C.Toolbar[0]=C.Toolbar[0].concat(A.toolbar[0])}if(A.toolbar[1]){C.Toolbar[1]=C.Toolbar[1].concat(A.toolbar[1])}}mj.apply(C,A);WYSIWYG.setSettings(E,C);WYSIWYG._generate(E,C)};mj.form.textArea=function(A){mj.form.textArea.superclass.constructor.call(this,A)};mj.form.textArea.prototype={componentClass:"mj.form.textArea",inputCls:"mj-text-area",type:"textarea",tag:"textArea",editor:false,init:function(){var A=this;A.on("render",A._onRender,A);if(A.renderTo){A.render()}mj.form.textArea.superclass.init.call(this)},_onRender:function(){if(this.editor){mj.initEditor(this.id,this.config)}},getValue:function(A){if(this.editor){var B=$("div#"+this.input[0].id+"_1 iframe")[0].contentWindow.document.body.innerHTML;this.setValue(B)}if(A){return this.input[0].value}else{return this.value}},setValue:function(A){if(this.validate(A)!==false){this.value=A;this.setElValue(this.formatValue(A));if(this.editor){$("div#"+this.input[0].id+"_1 iframe")[0].contentWindow.document.body.innerHTML=A}}}};mj.extend(mj.form.textArea,mj.form.field);mj.form.timeField=function(A){mj.apply(this,{invalidText:mj.lng.objects.timeField.invalidText});mj.form.timeField.superclass.constructor.call(this,A)};mj.form.timeField.prototype={componentClass:"mj.form.timeField",regEx:/^([01]\d|2[0-3]):([0-5][0-9])$/,init:function(){var A=this;A.on("render",A._onRender,A);if(A.renderTo){A.render()}A.on("invalid",function(C,B,E,D){new mj.message({title:mj.lng.glb.info,msg:B,modal:true})},A);mj.form.textField.superclass.init.call(this)},validate:function(B){this.clearInvalid();var A=true;if(B!=""&&B!=null){A=this.regEx.test(B);if(!A){this.markInvalid(this.invalidText)}}return A}};mj.extend(mj.form.timeField,mj.form.textField);mj.form.mailField=function(A){mj.form.mailField.superclass.constructor.call(this,A)};mj.form.mailField.prototype={componentClass:"mj.form.mailField",regEx:/^(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}$/,init:function(){var A=this;A.on("render",A._onRender,A);if(A.renderTo){A.render()}A.on("invalid",function(C,B,E,D){new mj.message({title:"Bilgi",msg:B,modal:true})},A);mj.form.textField.superclass.init.call(this)},validate:function(B){this.clearInvalid();var A=true;if(B!=""&&B!=null){A=this.regEx.test(B);if(!A){this.markInvalid(mj.lng.objects.mailField.invalidText)}}return A}};mj.extend(mj.form.mailField,mj.form.textField);mj.form.passField=function(A){mj.apply(this,{invalidText:mj.lng.objects.passField.invalidText});mj.form.passField.superclass.constructor.call(this,A)};mj.form.passField.prototype={componentClass:"mj.form.passField",regEx:/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{4,15}$/,init:function(){var A=this;A.type="password";A.on("render",A._onRender,A);if(A.renderTo){A.render()}A.on("invalid",function(C,B,E,D){new mj.message({title:mj.lng.glb.info,msg:B,modal:true})},A);mj.form.textField.superclass.init.call(this)},validate:function(B){this.clearInvalid();var A=true;if(B!=""&&B!=null){A=this.regEx.test(B);if(!A){this.markInvalid(this.invalidText)}}return A}};mj.extend(mj.form.passField,mj.form.textField);mj.form.checkBox=function(A){mj.form.checkBox.superclass.constructor.call(this,A)};mj.form.checkBox.prototype={componentClass:"mj.form.checkBox",inputCls:"mj-text-editor",type:"checkbox",labelPos:"left",checked:false,cls:"mj-checkbox",init:function(){var A=this;A.on("render",A._onRender,A);if(A.renderTo){A.render()}mj.form.checkBox.superclass.init.call(this)},_onRender:function(){var A=this;A.check=$(mj.NE(A._el,{tag:"div",cls:A.cls,disabled:A.disabled}));A.input.addClass("mj-invisible");if(A.disabled){A.check.attr("disabled",true);A.check.addClass("mj-item-disabled")}if(A.readOnly){A.check.attr("readonly",true);A.check.addClass("mj-item-readOnly")}if(!A.readOnly&&!A.disabled){A.check.click(function(){var B=$(this);var C=B.prev()[0].checked==true;B.toggleClass(A.cls+"-checked");B.prev()[0].checked=!C;A.checked=!C;if(typeof A.handler=="function"){A.handler()}})}if(A.checked){A.setValue(A.checked)}},getValue:function(A){if(A){return this.input[0].checked}else{return this.checked}},setValue:function(A){if(this.validate(A)!==false){this.checked=Boolean(A);this.setElValue(this.formatValue(Boolean(A)))}},setElValue:function(A){this.input[0].checked=A;if(A==true){this.check.addClass(this.cls+"-checked")}else{this.check.removeClass(this.cls+"-checked")}}};mj.extend(mj.form.checkBox,mj.form.field);mj.form.radio=function(A){mj.form.radio.superclass.constructor.call(this,A)};mj.form.radio.prototype={componentClass:"mj.form.radio",inputCls:"mj-text-editor",labelPos:"left",width:50,checks:false,checked:false,template:['<div class="mj-radio" name="{name}" style="width:{width}px;">','<input class="mj-invisible" type="text" value="{id}"/>','<span unselectable="on" class="mj-unselectable" title="{desc}" style="padding-left: 16px; cursor: default;">{text}</span>',"</div>"],init:function(){var A=this;A.tpl=new mj.template(this.template);if(A.items&&!A.store){A.store=new mj.store({data:A.items})}if(A.store&&!A.items){A.items=A.store.data}A.on("render",A._onRender,A);if(A.renderTo){A.render()}mj.form.radio.superclass.init.call(this)},_onRender:function(){var C=this;this.input.addClass("mj-invisible");if(this.items){this.checks=[];this.radioContainer=$(mj.NE(this._el,{style:"float:left;",disabled:this.disabled,readonly:this.readOnly}));for(var B=0,A=this.items.length;B<A;B++){var D=this.items[B];this.addItem(D,true)}}},addItem:function(D,A){D.name=this.dataIndex;if(!D.width){D.width=this.width}var C=this.tpl.apply(D);var B=this.radioContainer.append(C).find("div:last");if(D.checked){$(B).addClass("mj-radio-checked")}if(D.disabled){B.attr("disabled",true);B.addClass("mj-item-disabled")}if(D.readOnly){B.attr("readonly",true);B.addClass("mj-item-readOnly")}if(!A){this.items.push(D)}if(!this.readOnly&&!this.disabled&&!D.readOnly&&!D.disabled){B.bind("click",{scope:this},function(F){var G=F.data.scope;G.trigger("itemclick",D);var E=$(this).parent().find('div[@name="'+$(this).attr("name")+'"]');E.removeClass("mj-radio-checked");G.setValue($(this).find("input").val());if(typeof G.handler=="function"){G.handler()}})}this.checks.push(B)},setElValue:function(D){this.input[0].value=D;for(var B=0,A=this.items.length;B<A;B++){var C=this.items[B];if(C.id==D){this.checks[B].addClass("mj-radio-checked")}else{this.checks[B].removeClass("mj-radio-checked")}}}};mj.extend(mj.form.radio,mj.form.field);mj.form.numberField=function(A){mj.apply(this,{minText:mj.lng.objects.numberField.minText,maxText:mj.lng.objects.numberField.maxText,nanText:mj.lng.objects.numberField.nanText});mj.form.numberField.superclass.constructor.call(this,A)};mj.form.numberField.prototype={componentClass:"mj.form.numberField",inputCls:"mj-text-editor",decimalSeparator:",",groupingSeparator:".",decimalPrecision:2,decimalPrecisionReal:2,prefix:"",suffix:" YTL",defaultZero:false,allowDecimals:true,allowNegative:true,allowGroupingEnter:true,money:false,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,_onRender:function(){var A=this;if(!A.money){A.allowDecimals=false;A.allowGroupingEnter=false;A.decimalSeparator="";A.groupingSeparator="";A.decimalPrecision=0;A.decimalPrecisionReal=0;A.suffix=""}mj.form.numberField.superclass._onRender.call(this);var B=function(D){var C=D.keyCode||D.charCode;if(!$.browser.msie&&(mj.keys.isSpecial(D)||C==mj.keys.BACKSPACE||C==mj.keys.DELETE)){return }var F="0123456789";var E=A.input[0].value;F+=A.allowDecimals&&E.indexOf(A.decimalSeparator)===-1?A.decimalSeparator:"";F+=A.allowNegative&&E.indexOf("-")===-1?"-":"";F+=A.allowGroupingEnter?A.groupingSeparator:"";if(F.indexOf(String.fromCharCode(C))===-1){return false}};A.on("focus",A._onFocus);A.input.keypress(B);A.input[0].style.textAlign="right"},_onBlur:function(){this.clearValue();this.setValue(this.getElValue())},_onFocus:function(){this.value=this.value||"";var A=(this.decimalSeparator!=".")?(this.value+"").replace(/\./g,this.decimalSeparator):this.value;this.setElValue(A)},clearValue:function(){var B=this.input[0].value;if(this.allowGroupingEnter){var A=new RegExp(("\\"+this.groupingSeparator),"g");B=B.replace(A,"")}if(this.decimalSeparator!=""&&this.decimalSeparator!="."){var A=new RegExp(("\\"+this.decimalSeparator),"g");B=B.replace(A,".")}this.input[0].value=B},setValue:function(A){A=((this.defaultZero&&A=="")?0:A);if((A!=""||typeof A=="number")&&this.validate(A)!==false){this.value=parseFloat(A);if(this.decimalPrecisionReal&&!isNaN(this.decimalPrecisionReal)){A=parseFloat(A).toFixed(this.decimalPrecisionReal)}this.setElValue(this.formatValue(A));if(this.form&&!this.form.loading){this.form.setModified(this)}}},clearInvalid:function(){this.input.removeClass("mj-text-input-invalid")},markInvalid:function(A){this.input.addClass("mj-text-input-invalid");this.trigger("invalid",this,A)},validate:function(A){this.clearInvalid();if(isNaN(A)){this.markInvalid(String.format(this.nanText,this.minValue));return false}if(A<this.minValue){this.markInvalid(String.format(this.minText,this.minValue));return false}if(A>this.maxValue){this.markInvalid(String.format(this.maxText,this.maxValue));return false}return true},formatValue:function(A){return this.prefix+mj.format.float2Money(A,this.decimalPrecision,this.decimalSeparator,this.groupingSeparator)+this.suffix},clear:function(){this.value=null;this.setElValue("")}};mj.extend(mj.form.numberField,mj.form.textField);mj.form.triggerField=function(A){if(A.width){A.width-=17}mj.form.triggerField.superclass.constructor.call(this,A)};mj.form.triggerField.prototype={componentClass:"mj.form.triggerField",inputCls:"mj-text-editor",triggerClass:"trigger-field",readOnly:true,_onRender:function(){mj.form.triggerField.superclass._onRender.call(this);var A,B=this;A="div";B.triggerField=$(mj.NE(B.input[0].parentNode,{tag:A,cls:"trigger "+B.triggerClass}));B.triggerField.hover(function(){$(this).addClass("trigger-arrow-over")},function(){$(this).removeClass("trigger-arrow-over")});B.triggerField.mousedown(function(){B.triggerField.addClass("trigger-arrow-click")});B.triggerField.mouseup(function(){B.triggerField.removeClass("trigger-arrow-click")});B.triggerField.click(function(C){if(!B.disabled){B.trigger("triggerclick",B);C.stopPropagation()}});B.on("triggerclick",B.onTriggerClick);$(document).bind("click",function(C){B.hideAll()})},hideAll:function(){el=mj.glb.views;for(var B=0,A=el.length;B<A;B++){el[B]._hide()}mj.glb.views=[]},onTriggerClick:function(){this.hideAll();if(typeof this.handler=="function"){this.handler()}},getPosition:function(){var A=$.browser.msie?this.input.prev().offset():this.input.offset();if($.browser.msie&&this.labelAlign=="left"){A.left=A.left+parseInt(this.labelWidth)}return A},setWidth:function(A){this._el.width(A);if(this.title){A-=this.labelWidth}this.input.width(A-($.browser.msie?23:22))},setValue:function(B,A){if(A){this.value=B}else{if(this.validate(B)!==false){this.displayValue=B;this.setElValue(this.formatValue(this.displayValue))}}},clear:function(){this.setValue("");this.setValue("",true)},setDisable:function(){this.triggerField.addClass(this.triggerClass+"-disabled");mj.form.triggerField.superclass.setDisable.call(this)},setEnable:function(){this.triggerField.removeClass(this.triggerClass+"-disabled");mj.form.triggerField.superclass.setEnable.call(this)}};mj.extend(mj.form.triggerField,mj.form.textField);mj.form.combo=function(A){mj.form.combo.superclass.constructor.call(this,A)};mj.form.combo.prototype={componentClass:"mj.form.combo",triggerClass:"",idField:"id",displayField:"text",mode:"local",maxHeight:200,typeAhead:true,viewing:false,first:false,readOnly:false,sel:false,change:false,clearOnTriggerClick:false,init:function(){mj.form.combo.superclass.init.call(this);this.sel=[];t=this;t.cmbTpl='<div class="combo-list-item mj-unselectable">{'+this.displayField+"}</div>";var A=this.multiRow?"":"mj-invisible";this.first=true;t.viewEl=$(mj.NE(mj.bd,{tag:"div",id:mj.genId("mj-combo-view-"),cls:"combo-list "+A}));t.viewInner=$(mj.NE(t.viewEl,{tag:"div",cls:"combo-list-inner"}));t.view=new mj.view({renderTo:t.viewInner,store:this.store,tpl:new mj.template(t.cmbTpl),selector:"div.combo-list-item",overClass:"combo-over",selectedClass:"combo-selected",multiSelect:this.multiSelect,filter:false,scope:t});this.view.on("itemclick",function(){if(this.selected[0]){var C=this.selected[0].id;var B=this.scope;B.setValue(C);if(this.view){this.sel=[]}else{B.sel=[];if(this.sel.length){B.sel=this.sel}else{B.sel.push(this.sel)}}if(!B.multiRow){B._hide()}if(B._el.hasClass("grid-editor-item")){B.trigger("editcomplete",this)}}});if(this.multiRow){this.viewShow();this.view.store.on("load",function(){t._show();t.viewing=false});this.view.load()}if(this.typeAhead){this.on("change",function(){this.change=true;if(this.mode=="local"){this.view.filter={dI:this.displayField,v:this.getValue(true)};this.view.load();this._show()}else{this.store.params["dI"]=this.displayField;this.store.params["v"]=mj.escape(this.getValue(true));this.view.store.on("load",function(){this._show()},this);this.view.store.load()}},this)}},onTriggerClick:function(){this.hideAll();this.viewShow();if(this.clearOnTriggerClick){this.setValue("")}if(!this.viewing){if(!this.first){this.view.store.load()}if(this.mode=="remote"){this.view.store.on("load",function(){this._show()},this)}else{this._show()}}else{this._hide()}},viewShow:function(){t=this;t.cmbTpl='<div class="combo-list-item mj-unselectable">{'+this.displayField+"}</div>";var A=this.multiRow?"":"mj-invisible";if(!t.view){}else{this.first=false}this.view.store.on("load",function(){if(!this.typeAhead){for(s in this.sel){if(typeof this.sel[s]!="function"){this.view._onSelect(this.view.items[this.sel[s].index])}}}},this);if(this.mode=="local"){if(this.view.items.length>0){for(s in this.sel){if(typeof this.sel[s]!="function"){this.view._onSelect(this.view.items[this.sel[s].index])}else{this.view.store.load()}}}}},findIndex:function(B){var A=mj.getIndex(this.store.data,this.idField,B);if(A==-1){A=mj.getIndex(this.store.data,this.displayField,B)}return A},setValue:function(D){if(!this.multiSelect){this.sel=[]}if(this.mode=="local"||this.view.store.loaded){if(this.mode=="remote"){this.store=this.view.store}if(D!==""&&D!=null){var A=this.findIndex(D);if(A!=-1){var C=this.store.data[A];this.sel.push({index:A,id:C.id,value:C[this.displayField]});this.value=C.id;this.displayValue=C[this.displayField];this.setElValue(this.formatValue(this.displayValue))}}else{if(this.store.params&&this.store.params.v){delete this.store.params.v}this.value=D;this.displayValue=D;this.setElValue(D)}}else{var B=this;this.view.store.on("load",function(){if(!B.change){D=B.sel.length==1?B.sel[0].value:D;var E=B.findIndex(D);if(E>-1){var F=B.store.data[E];B.sel.push({index:E,id:F.id,text:F[B.displayField]});B.view._onSelect(B.view.items[B.sel[B.sel.length-1].index]);B.value=F.id;B.lookupValue=F[B.displayField];B.setElValue(B.formatValue(B.lookupValue))}}else{B.change=false}});if(!this.view.store.loaded){this.view.store.load()}}if(this.form&&!this.form.loading){this.form.setModified(this)}},_show:function(){this.viewEl.removeClass("mj-invisible");var C=this.getPosition();var B=($.browser.msie?this.input.outerWidth():this.input.outerWidth())+15;var A=this.maxHeight>(this.view.store.recordCount*20)?this.view.store.recordCount*20:this.maxHeight;this.viewEl.css("top",C.top+(this.multiRow?0:21)).css("left",C.left).css("width",B).css("height",A).css("z-index",this.multiRow?550:552);if(this.multiRow){$(this.el).css("height",A<this.maxHeight?A:this.height)}this.viewInner.css("width",B).css("height",A);this.viewing=true;mj.glb.views.push(this)},_hide:function(){this.viewEl.css("z-index",0).addClass("mj-invisible");this.viewing=false},_onBlur:function(){return false}};mj.extend(mj.form.combo,mj.form.triggerField);mj.form.datePicker=function(A){mj.form.datePicker.superclass.constructor.call(this,A)};mj.form.datePicker.prototype={componentClass:"mj.form.datePicker",inputCls:"mj-datepicker",weekend:[5,6],initValue:false,init:function(){this.render();if(this.initValue===false){this.initValue=new Date()}this.fillMonth(this.initValue);mj.form.datePicker.superclass.init.call(this)},render:function(){var J=this,M=mj.NE,I="";if(J.hidden){J.itemCls+=" mj-invisible mj-absolute"}if(J.left||J.top){J.left=typeof J.left!="undefined"?(isNaN(J.left)?J.left:(J.left+"px")):"";J.top=typeof J.top!="undefined"?(isNaN(J.top)?J.top:(J.top+"px")):"";I="position:absolute;left:"+J.left+";top:"+J.top}var D=J.el=M(J.renderTo,{cls:J.itemCls+" mj-unselectable",style:I}),K=J._el=$(D);if(!J.inline){J.titleEl=M(D,{html:this.title,cls:J.titleCls,style:"width:"+J.labelWidth+";text-align:"+J.labelAlign})}var U=J.input=$(M(D,{cls:J.inputCls,readOnly:J.readOnly}));J.cnts={header:$(M(U,{cls:"mj-date-header"})),days:$(M(U,{cls:"mj-date-days"})),dates:$(M(U,{cls:"mj-date-dates"})),buttons:$(M(U,{cls:"mj-date-buttons"}))};var H=function(Z){Z.hover(function(){Z.addClass("hover")},function(){Z.removeClass("hover")});return Z};var S=J.cnts.header;J.headerEls={prevYear:H($(M(S,{cls:"mj-date-prevyear",html:mj.insertSpacer(18,18)}))),prevMonth:H($(M(S,{cls:"mj-date-prevmonth",html:mj.insertSpacer(18,18)}))),current:H($(M(S,{cls:"mj-date-current"}))),nextMonth:H($(M(S,{cls:"mj-date-nextmonth",html:mj.insertSpacer(18,18)}))),nextYear:H($(M(S,{cls:"mj-date-nextyear",html:mj.insertSpacer(18,18)})))};var V=$(M(J.headerEls.current,{tag:"span",cls:"mj-date-currenttext"}));J.headerEls.dateSelect=H($(M(J.headerEls.current,{tag:"img",cls:"mj-date-select",src:mj.glb.blankImage})));var X=function(Z){Z.stopPropagation();J.showMonthYearSelect(J.current)};J.headerEls.dateSelect.click(X);V.click(X);J.headerEls.current=V;J.headerEls.prevYear.click(function(Z){Z.stopPropagation();J.fillMonth(J.getPrevYear(J.current))});J.headerEls.nextYear.click(function(Z){Z.stopPropagation();J.fillMonth(J.getNextYear(J.current))});J.headerEls.prevMonth.click(function(Z){Z.stopPropagation();J.fillMonth(J.getPrevMonth(J.current))});J.headerEls.nextMonth.click(function(Z){Z.stopPropagation();J.fillMonth(J.getNextMonth(J.current))});var T=J.cnts.days;J.dayTitles=[];for(var R=-1;R<7;R++){J.dayTitles.push($(M(T,{cls:"mj-date-daytitle",html:(R>-1?Date.strings.daysShort[(R+Date.firstDayOfWeek)%7]:"")})))}var T=J.cnts.dates;J.dayButtons=[];var A=function(Z){Z.click(function(){var f=Z[0].name.split("-");var c=new Date(),a=f[5],g=f[4],d=f[3];c.setDate(a);c.setMonth(g-1);c.setFullYear(d);J.setValue(c);J.trigger("selectdate",J,c,a,g,d)});return Z};for(R=0;R<6;R++){var W=[];for(var Q=0;Q<8;Q++){var C;if(Q==0){C=$(M(T,{cls:"mj-date-week"}))}else{C=A(H($(M(T,{cls:"mj-date-day"}))))}W.push(C)}J.dayButtons.push(W)}var T=J.cnts.buttons;var G=function(){var Z=new Date();J.fillMonth(Z);J.setValue(Z);J.trigger("selectdate",J,Z)};J.buttons={today:new mj.button({renderTo:M(T,{cls:"mj-date-button-today"}),title:mj.lng.glb.today,handler:G})};var O=J.mySelect=$(M(U,{cls:"mj-date-myselect mj-invisible"}));var Y=M(O,{cls:"mj-date-monthcontainer"}),B=M(O,{cls:"mj-date-yearcontainer"}),F=M(O,{cls:"mj-date-buttoncontainer"});F=M(F,{cls:"mj-date-buttonalign"});var L=J.monthSelectors=[];var N=function(c,a){var Z=function(d){d.stopPropagation();L.selectedMonthCell.removeClass("mj-date-selected");L.selectedMonth=a;L.selectedMonthCell=c;c.addClass("mj-date-selected")};c.click(Z);return c};for(var R=0;R<12;R++){var Q=parseInt(R/2)+(R%2==1?6:0);L.push(N(H($(M(Y,{cls:"mj-date-monthselect",html:(Date.strings.monthsShort[Q])}))),Q))}var P=J.yearSelectors=[];var E=function(c,a){var Z=function(d){d.stopPropagation();P.selectedYearCell.removeClass("mj-date-selected");P.selectedYear=P.firstYear+a;c.addClass("mj-date-selected");P.selectedYearCell=c};c.click(Z);return c};for(var R=0;R<10;R++){J.yearSelectors.push(E(H($(M(B,{cls:"mj-date-yearselect"}))),(R%2?parseInt(R/2)+5:parseInt(R/2))))}J.buttons.prevYearGroup=new mj.button({renderTo:M(B,{cls:"mj-date-button-prevyear"}),title:"<<"});J.buttons.prevYearGroup.on("click",function(Z,a,c){c.stopPropagation();J.fillYears(J.curYear-10)});J.buttons.nextYearGroup=new mj.button({renderTo:M(B,{cls:"mj-date-button-nextyear"}),title:">>"});J.buttons.nextYearGroup.on("click",function(Z,a,c){c.stopPropagation();J.fillYears(J.curYear+10)});J.buttons.ok=new mj.button({renderTo:M(F,{cls:"mj-date-button-yearok"}),title:mj.lng.titles.buttons.ok});J.buttons.cancel=new mj.button({renderTo:M(F,{cls:"mj-date-button-yearcancel"}),title:mj.lng.titles.buttons.cancel});J.buttons.ok.on("click",function(a,c,d){d.stopPropagation();var Z=new Date(J.current);Z.setMonth(L.selectedMonth);Z.setFullYear(P.selectedYear);J.fillMonth(Z);J.hideMonthYearSelect()});J.buttons.cancel.on("click",function(Z,a,c){c.stopPropagation();J.hideMonthYearSelect()});J.trigger("render",J)},getPrevMonth:function(A){var B=new Date(A);B.setMonth(B.getMonth()-1);return B},getNextMonth:function(A){var B=new Date(A);B.setMonth(B.getMonth()+1);return B},getPrevYear:function(A){var B=new Date(A);B.setYear(B.getFullYear()-1);return B},getNextYear:function(A){var B=new Date(A);B.setYear(B.getFullYear()+1);return B},getFirstDayOfMonth:function(A){var B=new Date(A);B.setDate(1);return B.getDay()},setCell:function(A,D,E){A[0].className="mj-date-day";if(this.value&&this.value.getDate()==E.getDate()&&this.value.getMonth()==E.getMonth()&&this.value.getFullYear()==E.getFullYear()){if(this.selectedCell){this.selectedCell.removeClass("mj-date-selected")}this.selectedCell=A;A[0].className+=" mj-date-selected"}else{A[0].className+=" mj-date-"+D}if(this.weekend.indexOf(E.getDay())>-1){A[0].className+=" mj-date-weekend"}var B=E.getDate();var F=E.getMonth()+1;var C=E.getFullYear();A[0].innerHTML=B;A[0].name="mj-date-day-"+C+"-"+F+"-"+B},fillYears:function(F){this.curYear=F;this.yearSelectors.firstYear=this.curYear-4;for(var E=0;E<10;E++){var D=this.curYear+E-4,G=this.yearSelectors[E<5?(E*2):(E-5)*2+1];G.removeClass("mj-date-selected");G[0].innerHTML=D;if(this.current.getFullYear()==D){G.addClass("mj-date-selected");this.yearSelectors.selectedYear=D;this.yearSelectors.selectedYearCell=G}}var C=this.monthSelectors,A=this.current.getMonth();if(C.selectedMonthCell){C.selectedMonthCell.removeClass("mj-date-selected")}C.selectedMonth=A;var B=A<6?(A*2):(A-6)*2+1;C.selectedMonthCell=C[B];C[B].addClass("mj-date-selected")},showMonthYearSelect:function(A){this.mySelect.removeClass("mj-invisible");this.fillYears(A.getFullYear())},hideMonthYearSelect:function(){this.mySelect.addClass("mj-invisible")},fillMonth:function(B){var H=this,A=H.getFirstDayOfMonth(B),F=H.dayButtons;var D=new Date(B);D.setDate(1);for(var E=A+1;E>1;E--){D.setDate(D.getDate()-1);H.setCell(F[0][E-1],"passive",D)}var D=new Date(B);D.setDate(1);var G=D.getMonth(),I="active";for(var E=0;E<6;E++){for(var C=1;C<8;C++){if(E>0||C>A){H.setCell(F[E][C],I,D);D.setDate(D.getDate()+1);if(D.getMonth()!=G){I="passive"}}}F[E][0][0].innerHTML=D.formatDate("W")}H.current=B;H.headerEls.current[0].innerHTML=B.formatDate("F Y")},setValue:function(C){var A=false;var D=this.value||this.initValue;if(C.getMonth()!=D.getMonth()||C.getFullYear()!=D.getFullYear()){A=true}this.value=C;if(A){this.fillMonth(C)}else{if(this.selectedCell){this.selectedCell.removeClass("mj-date-selected")}var B=$('div[name*="mj-date-day-'+C.getFullYear()+"-"+(C.getMonth()+1)+"-"+C.getDate()+'"]',this.cnts.dates);this.selectedCell=B;B[0].className+=" mj-date-selected"}},_hide:function(){this._el.addClass("mj-invisible")},_show:function(){this._el.removeClass("mj-invisible")}};mj.extend(mj.form.datePicker,mj.form.field);mj.form.dateField=function(A){mj.apply(this,{minText:mj.lng.objects.dateField.minText,maxText:mj.lng.objects.dateField.maxText,invalidText:mj.lng.objects.dateField.invalidText});mj.form.dateField.superclass.constructor.call(this,A)};mj.form.dateField.prototype={componentClass:"mj.form.dateField",inputCls:"mj-date-field",width:"85px",format:"d/m/Y",altFormats:"d/m/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|m",disabledDays:null,disabledDaysText:"",disabledDates:null,disabledDatesText:"",minValue:null,maxValue:null,clearOnTriggerClick:true,epoch:false,initValue:false,_onRender:function(){mj.form.dateField.superclass._onRender.call(this);var B=this;B.picker=new mj.form.datePicker({inline:true,hidden:true,renderTo:mj.bd});B.picker.on("selectdate",function(D,C){B.setValue(B.formatValue(C));D._hide();if(B._el.hasClass("grid-editor-item")){B.trigger("editcomplete",this)}});if(this.initValue===false){var A=new Date();this.initValue=A.formatDate(this.format)}this.setValue(this.initValue);B._el.addClass("mj-date-field-cnt")},onTriggerClick:function(){if(this.disabled){return }if(this.clearOnTriggerClick){this.clear()}this.hideAll();ofs=this.getPosition();var A=this.picker;A._el.css("top",ofs.top+16).css("left",ofs.left+($.browser.msie?0:-1));if(window.windowManager){A._el.css("z-index",window.windowManager.activeIndex+1)}this.viewing=true;mj.glb.views.push(A);var B=this.value?mj.str2date(this.epoch?this.input[0].value:this.value):new Date();A.fillMonth(B);A.setValue(B);A._show()},formatValue:function(A){return(new Date(Date.parse(A))).formatDate(this.format)},validate:function(A){return !isNaN(Date.parse(A))},setWidth:function(A){this._el.width(A);if(this.title){A-=this.labelWidth}this.input.width(A-($.browser.msie?23:22))},setValue:function(D){if(this.validate(D)!==false||D==""||(this.epoch&&typeof D=="number")){if(this.epoch){if(D!=""&&D!=null){if(typeof D=="string"&&D.indexOf("/")>-1){var B=D.split("/");if(B.length==3){var C=[];C.push(B[1]);C.push(B[0]);C.push(B[2]);this.value=new Date(C.join("/")).getTime()/1000}else{this.value=""}}else{if(typeof D=="number"){var C=new Date(D*1000);var A=this.validate(C);if(A!==false){this.value=D;this.setElValue(C.formatDate(this.format));return }else{}}}}else{this.value=0}}else{this.value=D}this.setElValue(D)}},setElValue:function(A){if(this.epoch&&(A==""||A==0)){this.input[0].value="";return }this.input[0].value=A}};mj.extend(mj.form.dateField,mj.form.triggerField);mj.form.fileInput=function(A){mj.form.fileInput.superclass.constructor.call(this,A);this.init()};mj.form.fileInput.prototype={componentClass:"mj.form.fileInput",itemCls:"mj-form-item",titleCls:"mj-form-caption",inputCls:"mj-form-input",maxFile:0,accept:false,hidden:false,left:false,top:false,accept:"",render:function(){var B=this,E=mj.NE,A="";if(B.hidden){B.itemCls+=" mj-invisible"}if(B.left||B.top){B.left=typeof B.left!="undefined"?(isNaN(B.left)?B.left:(B.left+"px")):"";B.top=typeof B.top!="undefined"?(isNaN(B.top)?B.top:(B.top+"px")):"";A="position:absolute;left:"+B.left+";top:"+B.top}var C=B.el=E(B.renderTo,{cls:B.itemCls,style:A}),D=B._el=$(C);B.titleEl=E(C,{html:this.title,cls:B.titleCls,style:"width:"+B.labelWidth+";text-align:"+B.labelAlign});B.input=$(E(C,{tag:"input",type:"file",cls:B.inputCls}));B.input.MultiFile({max:B.maxFile,accept:B.accept,afterFileSelect:function(F,H,G){},STRING:{remove:"KaldÄ±r",selected:"SeÃ§ilen: $file",denied:"GeÃ§ersiz dosya tipi: $ext!"}});B.trigger("render",B)},init:function(){var A=this;if(A.renderTo){A.render()}mj.form.fileInput.superclass.init.call(A)},getValue:function(A){return"_isFile"},setValue:function(A){return },setElValue:function(A){return },clear:function(){return },validate:function(A){}};mj.extend(mj.form.fileInput,mj.form.field);mj.form.imageField=function(A){mj.form.imageField.superclass.constructor.call(this,A)};mj.form.imageField.prototype={componentClass:"mj.form.imageField",inputCls:"mj-image-field",triggerCls:"mj-image-upload",width:100,height:100,init:function(){var A=this;if(A.renderTo){A.render()}mj.form.imageField.superclass.init.call(A)},render:function(){var B=this,E=mj.NE,A="";if(B.left||B.top){B.left=typeof B.left!="undefined"?(isNaN(B.left)?B.left:(B.left+"px")):"";B.top=typeof B.top!="undefined"?(isNaN(B.top)?B.top:(B.top+"px")):"";A="position:absolute;left:"+B.left+";top:"+B.top}var C=B.el=E(B.renderTo,{cls:B.itemCls,style:A+";"+B.itemStyle}),D=B._el=$(C);if(B.title){if(B.labelPos=="left"){B.titleEl=E(C,{html:this.title,cls:B.titleCls,style:"width:"+B.labelWidth+";text-align:"+B.labelAlign})}}B.input=$(E(C,{tag:"img",id:(B.id||mj.genId("mj-form-item-")),style:""+(B.height?"height:"+B.height+"px;":"")+(B.width?"width:"+B.width+"px;":""),type:B.type,cls:B.inputCls,src:mj.glb.blankImage}));B.triggerEl=$(E(C,{cls:B.triggerCls,html:mj.insertSpacer(16,16)}));B.triggerEl.hover(function(){B.triggerEl.addClass("mj-image-upload-hover")},function(){B.triggerEl.removeClass("mj-image-upload-hover")});B.triggerEl.click(function(){if(B.trigger("triggerclick",B,B)!==false){B._triggerClick.call(B,B)}})},getElValue:function(){return this.input.attr("src")},setElValue:function(A){mj.get(this.id).src=A},setValue:function(A){this.value=A;this.setElValue(A?A:mj.glb.blankImage)},_triggerClick:function(A){return true}};mj.extend(mj.form.imageField,mj.form.field);mj.form.fieldSet=function(A){mj.form.superclass.constructor.call(this,A)};mj.form.fieldSet.prototype={componentClass:"mj.form.fieldSet",fieldsetCls:"mj-fieldset",legendCls:"mj-legend",style:"",itemStyle:"",_onRender:function(){var E=this;E.fieldSetEl=$(mj.NE(E.renderTo,{tag:"fieldset",cls:E.fieldsetCls,style:E.style+E.itemStyle+""+(E.height?"height:"+E.height+"px;":"")+(E.width?"width:"+E.width+"px;":"")}));var A=E.scope.form;if(E.title){E.legendEl=$(mj.NE(E.fieldSetEl,{tag:"legend",cls:E.legendCls}));E.titleEl=$(mj.NE(E.legendEl,{tag:"span",html:E.title}))}E.scope.form=E.fieldSetEl;if(!E.items){E.items=[]}else{for(var C=0,B=E.items.length;C<B;C++){var D=E.items[C];E.scope.add(D)}}E.scope.form=A;E.scope.fieldSets.push(E);mj.form.fieldSet.superclass.init.call(this)},render:function(A){this.scope=A;this._onRender()},clear:function(){$(this.items).each(function(){this.clear()})}};mj.extend(mj.form.fieldSet,mj.component);mj.grid=function(A){mj.grid.superclass.constructor.call(this,A)};mj.grid.prototype={componentClass:"mj.grid",width:50,height:40,selectMode:"row",fitToParent:false,selectedRow:{},loadMask:true,noWrap:true,scroll:"auto",sortable:true,getSize:function(){if(this.fitToParent){this.height=this.initialRenderTo.height()||parseInt(this.initialRenderTo[0].style.height);this.width=this.initialRenderTo.width()||parseInt(this.initialRenderTo[0].style.width)}},doGrid:function(){if(this.initialRenderTo[0].offsetHeight>0){this.getSize();if(this.height!=this.lastHeight||this.width!=this.lastWidth){this.cnt1.width(this.width);this.cnt1.height(this.height);$(this.cnt).width(this.width);$(this.headerWrap).width(this.width);var A=this.height-(this.pageBar?$(this.pageBar).height():0);$(this.cnt).height(A);$(this.drag.el).height(A-16);A-=$(this.header).height();$(this.gridScroll).width(this.width);$(this.gridScroll).height(A);$(this.drag.el).css("left","0px");$(this.drag.el).css("top","0px");this.lastWidth=this.width;this.lastHeight=this.height}}},init:function(){var N=this;this.initialRenderTo=this.renderTo;this.getSize();this.cnt=this.cnt1=$(mj.NE(this.renderTo,{style:"width:"+this.width+"px;height:"+this.height+"px;overflow:hidden",cls:"mj-grid mj-unselectable"}));if(this.pbar&&typeof this.pbar.render=="function"){this.pbar.render({scope:this});this.cnt=$(this.renderTo);this.pbar.on("sourceload",function(){N.selectedRow={}})}this.cnt.css("width",this.width+"px");this.cnt.css("overflow","hidden");var C=parseInt(this.cnt.css("height"));this.height=C>0?C:this.height;var T="",S=this.gridId=mj.genId(),O=$.cssEngine,L=this.width,R=this.height;var G=0;this.clientHeight=0;var A=0,B=0,D=this.cm.length,F=this.width,N=this,Q=this.width;$(this.cm).each(function(){this.colIndex=A++;this.isLast=A==D;this.width=(this.isLast&&this.width+G<Q)?Q-G:(this.width?this.width:100);if(!this.hide){B+=this.width;G+=this.width}});this._cw=G;this.noWrapStyle=this.noWrap?"white-space : nowrap;":"";var I=$.browser.msie?"":"position:relative";this.headerWrap=mj.NE(this.cnt,{tag:"div",cls:"mj-grid-header-row",style:"width:"+this.width+"px;"});this.header=mj.NE(mj.NE(this.headerWrap,{tag:"table",cellpadding:"0",cellspacing:"0",width:G,style:I}),{tag:"tr",cls:"mj-grid-header-row"}).parentNode;this.dragEl=$(mj.NE(this.cnt,{tag:"div",cls:"",style:"position:absolute;width:2px;background:transparent;height:"+this.height+"px;"}));this.drag=new mj.drag({el:this.dragEl[0],parent:this.cnt[0],dragType:"h",cls:"mj-drag-col"});this.drag.on("dragstop",function(c){var d=$(c.proxy),f=this;d=c.proxy[0].style;tOfP=f.drag.el.offsetParent==mj.bd[0]?{left:0,top:0}:$(f.drag.el.offsetParent).offset();var X=$('td[name="column-'+f.curColumn+'"]',f.cnt);var W=$('td[name="column-'+f.curColumn+'"] div.mj-cell-inner',f.cnt);var U=f.cm[f.curColumn].width||60;var Y=X.offset();var Z=parseInt(X[0].style.width);var V=(parseInt(d.left)+tOfP.left)-(X.offset().left);var a=(V-Z);$(f.header).width($(f.header).width()+a);$(f.dataContainer).width($(f.dataContainer).width()+a);X.css("width",V+"px");W.css("width",(V-10)+"px");f.cm[f.curColumn].curWidth=V},this);var H=N.header.rows[0];var E=this.gridScroll=mj.NE(this.cnt,{style:"position:relative;overflow:"+this.scroll+";width:"+this.width+"px;height:"+(this.height-parseInt($(this.headerWrap).css("height")))+"px;"});var P=this._renderColumns();var K=new mj.contextmenu({renderTo:mj.NE(),parent:H,menuScope:this,width:130,items:[{id:"_1",title:mj.lng.objects.grid.columns,subMenuWidth:130,items:P},"|",{id:"_2",title:mj.lng.objects.grid.sortAZ,iconCls:"mj-menu-sort-asc",handler:function(){N.sort(N._contextCol,"ASC")}},{id:"_3",title:mj.lng.objects.grid.sortZA,iconCls:"mj-menu-sort-desc",handler:function(){N.sort(N._contextCol,"DESC")}}]});K.on("itemtoggle",function(V,U,X,W){if(N.cm[U.index].hide){N.showColumn(U.index)}else{N.hideColumn(U.index)}},this);this.clientWidth=G;var M=this.dataContainer=mj.NE(E,{tag:"table",cellpadding:"0",cellspacing:"0",width:(G)+"px"});var J=this.header;$(E).scroll(function(U){$(M).css("top",-U.target.scrollTop);if(!$.browser.msie){$(J).css("left",-U.target.scrollLeft)}else{$(J).css("margin-left",-U.target.scrollLeft)}$(M).css("left",-U.target.scrollLeft)});if(this.loadMask){this.mask=new mj.mask({el:this.cnt1[0]})}this.store.on("beforeload",function(){if(this.loadMask){this.mask.show(50)}},this);this.store.on("load",this._onLoad,this);this.on("rowclick",this.selectRow,this);this.on("cellclick",this.selectCell,this);mj.grid.superclass.init.call(this);mj.bindResize(this.cnt1,this.doGrid,this)},clearSortImages:function(){$("img",this.cnt).not($("div img.mj-invisible")).addClass("mj-invisible").removeClass("mj-sorter-asc").removeClass("mj-sorter-desc")},setFieldSort:function(B,A){$("img",this.cm[B].el).removeClass("mj-invisible").addClass("mj-sorter-"+(String(A).toLowerCase()));this.cm[B].sortDir=A},clientSort:function(B,A){this.clearSortImages();this.setFieldSort(B,A);this.store.sort(this.cm[B].dataIndex,A);this._onLoad()},remoteSort:function(D,C){var B=this;B.clearSortImages();var A=this.cm[D];B._sortParams={sort:(A.table?A.table+".":"")+(A.sortField||A.dataIndex),dir:C,colIndex:D};mj.apply(B.store.params,B._sortParams);B.store.on("load",function(){if(typeof this.params.colIndex!="undefined"&&this.params.dir){B.setFieldSort(this.params.colIndex,this.params.dir)}});B.load()},sort:function(B,A){if(this.sortable){if(this.store.localSort||(this.pbar&&this.pbar.getPageCount()==1)){this.clientSort(B,A)}else{this.remoteSort(B,A)}}else{return false}},_renderColumn:function(G,C){var D=this,F=D.header.rows[0];if(G.hide){var B=" mj-invisible"}else{var B=""}var A=G.el=$(mj.NE(F,{tag:"td",unselectable:"on",name:"column-"+(C),cls:"mj-unselectable mj-column-"+(C)+B,html:'<div unselectable="on" class="mj-cell-inner mj-unselectable">'+G.header+mj.insertSpacer(13,10)+"</div>",style:"width:"+(G.width-1)+"px"}));var E=$("img",A);E.attr("name","sorter-"+(C));E.addClass("mj-unselectable mj-invisible mj-sorter");A.mouseover(function(I){var H=A.offset();if(I.clientX-H.left<6){D.curColumn=parseInt(C);D.curColumn--;tOfP=D.drag.el.offsetParent==mj.bd[0]?{left:0,top:0}:$(D.drag.el.offsetParent).offset();D.drag.el.style.left=(H.left-tOfP.left)+"px";D.drag.el.style.top=(H.top-tOfP.top)+"px"}});A.click(function(J){var I=typeof D.cm[C].sortDir=="undefined";var H=(I||(!I&&D.cm[C].sortDir=="DESC"))?"ASC":"DESC";D.sort(C,H)});A.bind("contextmenu",function(){D._contextCol=C});return{index:C,title:G.header,type:"toggle",state:!G.hide}},_renderColumns:function(){var C=this;var A=[],B=0;$(C.cm).each(function(){A.push(C._renderColumn(this,B++))});return A},selectRow:function(A,C,B){if(this.selectMode=="row"){if(this.selectedRow&&this.selectedRow.el){this.selectedRow.el.removeClass("mj-grid-selected")}this.selectedRow=this.rows[C];this.selectedRow.index=C;this.selectedRow.el.addClass("mj-grid-selected")}},clearSelectedRow:function(){if(this.selectMode=="row"){if(this.selectedRow&&this.selectedRow.el){this.selectedRow.el.removeClass("mj-grid-selected");this.selectedRow={}}}},selectCell:function(C,D,B,A){if(this.selectMode=="cell"){if(this.selectedCell){this.selectedCell.removeClass("mj-grid-selected")}this.selectedCell=A;this.selectedCell.addClass("mj-grid-selected")}},getCellValue:function(B,A){return this.rows[B].cols[A].data},setCellValue:function(G,B,D,C){var E=this.rows[G];var A=E.cols[B];var F=this.cm[B].align||false;A.data=D;E.data[A.dataIndex]=D;if(C){D=C(D);if(F){D='<div style="text-align:'+F+';">'+D+"</div>"}A.el.find("div:first").text(D)}else{if(typeof D=="number"&&!F){D='<div style="text-align:right;">'+D+"</div>";A.el.find("div:first").empty().append(D.toString())}else{if(F){D='<div style="text-align:'+F+';">'+D+"</div>"}A.el.find("div:first").text(D)}}},load:function(){this.store.load()},showColumn:function(D){var E=$('td[name="column-'+D+'"]',this.cnt);if(E.hasClass("mj-invisible")){var B=parseInt(E[0].style.width);var A=$(this.header).width();var C=$(this.dataContainer).width();E.removeClass("mj-invisible");$(this.header).width(A+B);$(this.dataContainer).width(C+B)}this.cm[D].hide=false},hideColumn:function(D){var E=$('td[name="column-'+D+'"]',this.cnt);if(!E.hasClass("mj-invisible")){var B=parseInt(E[0].style.width);var A=$(this.header).width();var C=$(this.dataContainer).width();E.addClass("mj-invisible");$(this.header).width(A-B);$(this.dataContainer).width(C-B)}this.cm[D].hide=true},_onLoad:function(){var D=this,C=this.dataContainer,A=this.cm,B=this.gridId;$(C).empty();var F=this.rows=[],E="odd";$(this.store.data).each(function(){E=E=="even"?"odd":"even";var I=mj.NE(C,{tag:"tr",cls:"mj-grid-data-row mj-"+E}).rows,L=this,H=I.length-1;var I=I[H],K=$(I);K.click(function(){D.trigger("rowclick",D,H)});K.dblclick(function(){D.trigger("rowdblclick",D,H)});var G=0;var J={};J.cols=[];I.cols=[];$(A).each(function(){if(D.cm[G].hide){var N=" mj-invisible"}else{var N=""}var P=(D.cm[G].curWidth||this.width)-1;var Q=(!(L[this.dataIndex]==null||L[this.dataIndex]==undefined)?L[this.dataIndex]:"&nbsp;");if(typeof Q=="string"&&(!D.store.renderer||!D.store.renderer[this.dataIndex])){Q=Q.replace(/\</g,"&lt;").replace(/\>/g,"&gt;")}var M=$(mj.NE(I,{tag:"td",name:"column-"+(G),cls:"mj-column-"+(G),style:($.browser.mozilla?"height:23px;":"")+"width:"+P+"px",cls:"mj-cell mj-grid"+B+"-col-"+this.colIndex+N,html:'<div class="mj-cell-inner" unselectable="on" style="'+D.noWrapStyle+"width:"+(P-10)+'px;"></div>'}));var O=$(".mj-cell-inner",M);var S=D.cm[G].align||false;if(this.renderer){Q=this.renderer(Q,L,O)}else{if(typeof Q=="number"&&!S){Q='<div style="text-align:right;">'+Q+"</div>"}}if(S){Q='<div style="text-align:'+S+';">'+Q+"</div>"}O.append(Q.toString());J.cols.push({el:M,data:L[this.dataIndex],dataIndex:this.dataIndex});var R=I.cols.push(M);if(D.selectMode=="cell"){M.click(function(T){T.stopPropagation();D.trigger("cellclick",D,H,R,M)});M.dblclick(function(T){T.stopPropagation();D.trigger("celldblclick",D,H,R,M)})}G++});K.mouseover(function(){$(this).addClass("mj-grid-hover")});K.mouseout(function(){$(this).removeClass("mj-grid-hover")});J.el=$(I);J.data=L;F.push(J)});if(this.loadMask){this.mask.hide()}},getValue:function(C){var B=[],A=this;if(C){B.push(A.store.data[C])}else{B=A.store.data}return B},saveAsXLS:function(A){var D=this,H=mj.NE;var B=$(H(mj.bd,{style:"display:none"}));B.append(this.cnt[0].innerHTML);$("td",B).attr("height","0");var G=$("table",B);A=A||mj.genId("rapor")+"xls";G.attr("border","0");G.css("border-left","1px solid #000");G.css("border-top","1px solid #000");$("td",G).css("border","1px solid #000");$(G[1]).prepend($("tr",G[0]));$(G[0]).remove();var E=(D.fileTitle?D.fileTitle:"")+B[0].innerHTML;E=mj.escape(E);var C=$(H(mj.bd,{style:"display:none"}));var F=H(C,{tag:"form",action:mj.glb.exportPath,method:"POST",html:'<input type="hidden" name="format" value="xls"/><input type="hidden" name="content" value="'+E+'"/><input type="hidden" name="filename" value="'+A+'"/>'});F.submit();C.remove();B.remove()},copyContent:function(A){A.append(this.cnt[0].innerHTML);$("td",A).attr("height","0");var B=$("table",A);B.attr("border","0");B.css("border-left","1px solid #000");B.css("border-top","1px solid #000");$("td",B).css("border-right","1px solid #000");$("td",B).css("border-bottom","1px solid #000");$(B[1]).prepend($("tr",B[0]));$(B[0]).remove()}};mj.extend(mj.grid,mj.component);mj.editableGrid=function(A){mj.editableGrid.superclass.constructor.call(this,A)};mj.editableGrid.prototype={componentClass:"mj.editableGrid",selectMode:"cell",activeEditor:null,init:function(){mj.editableGrid.superclass.init.call(this);this.cnt1.addClass("mj-editable-grid");this.on("cellclick",this.startEdit);$(document).bind("click",{scope:this},function(C){var A=C.data.scope,B=A.activeEditor;if(B){A.endEdit(B)}});this.drag.on("dragstart",function(B){var A=this.activeEditor;if(A){this.endEdit(A)}},this)},_renderColumn:function(D,A){var B=this;var C=D.editor;if(C){C.config.itemCls=(C.config.itemCls?C.config.itemCls:C.cls.prototype.itemCls)+" mj-invisible grid-editor-item";C.config.renderTo=this.gridScroll;D.editor=new C.cls(C.config);D.editor.on("editcomplete",function(){var F=this.cellInfo;var G=F.row,J=F.col,H;var E=B.store,I=E.dm[J];H=this.getElValue();B.rows[G].cols[J].el.find("div")[0].innerHTML=H;E.data[G][I]=H;B.endEdit()})}return mj.editableGrid.superclass._renderColumn.call(this,D,A)},endEdit:function(A){if(A){switch(A.componentClass){case"mj.form.combo":A._hide();break;case"mj.form.dateField":A.picker._el.addClass("mj-invisible");break}}this.activeEditor._el.addClass("mj-invisible");this.activeEditor=null},startEdit:function(D,H,K,L){$(this.rows[H].el).removeClass("mj-grid-hover");var J=this.cm;var B=K-1;var F=J[B];var E=F.editor;var I=this.store,N=J[B].dataIndex,O=I.data[H][N];if(this.activeEditor){this.endEdit(this.activeEditor)}if(E){E.cellInfo={col:B,row:H};E.setValue(O);this.activeEditor=E;var A=0,M=0;for(var C=0;C<B;C++){if(!J[C].hide&&A==0){A+=this.cm[C].el.offset().left}}M+=L[0].offsetTop;A=A!=0?this.cm[B].el.offset().left-A:0;E.setPos(A,M);var G=this.rows[H].cols[B].el.width();E.setWidth(G);E._el.removeClass("mj-invisible")}}};mj.extend(mj.editableGrid,mj.grid);mj.layout=function(A){mj.layout.superclass.constructor.call(this,A)};mj.layout.prototype={componentClass:"mj.layout",initialNorth:50,initialWest:100,initialEast:100,initialSouth:100,centerBorder:"ltrb",createRegion:function(P){var G=false,Q=false,E=0;var O="height",N="width",L="top",I="left",D,H;var J=P.collapsed?"collapsed":"expanded",R=0,C=0,F=0,B=0;var K=mj.NE(this.renderTo,{tag:"div",id:(this.masterId+"-region-"+P.region),cls:"border-panel "+P.region+" "+(P.collapsed?"mj-invisible":"")});P.dType="v";switch(P.region){case"north":D=P.collapsed?0:(P.initial||initialNorth);E=P.collapsed?(P.initial||initialNorth):0;R=(P.max||P.initial)+this.borderSize,C=(P.min||P.initial)+this.borderSize;break;case"south":D=P.collapsed?0:(P.initial||initialSouth);E=P.collapsed?(P.initial||initialSouth):0;break;case"west":O="width",N="height",L="left",I="top",P.dType="h";D=P.collapsed?0:(P.initial||initialWest);E=P.collapsed?(P.initial||initialWest):0;F=(P.max||P.initial)+this.borderSize,B=(P.min||P.initial)+this.borderSize;break;case"east":O="width",N="height",L="left",I="top",P.dType="h";D=P.collapsed?0:(P.initial||initialEast);E=P.collapsed?(P.initial||initialEast):0}H=I+":50%;"+O+":5px;"+N+":40px;";K.style[O]=D+"px";K.style[N]="100%";P.scope=this;if(P.split){G=mj.NE(this.renderTo,{tag:"div",id:K.id+"-splitter",cls:"layout-split splitbar-"+P.dType+(" split-"+P.region)});if(P.collapsible){Q=mj.NE(G,{tag:"div",id:K.id+"-collapser",cls:"collapser "+J,style:"position:absolute;"+H});var A=$(Q);A.hover(function(){if(A.hasClass("expanded")){A.addClass("ex-hover")}else{A.addClass("hover")}},function(){A.removeClass("ex-hover");A.removeClass("hover")})}var M=new mj.drag({el:G,maxHeight:R,maxWidth:F,minHeight:C,minWidth:B,dragType:P.dType});M.on("beforedrag",function(S){return !this.scope.regions[this.region].collapsed},P);M.on("dragstop",function(S){this.scope.refreshLayout(S,this.region)},P);G.style[O]=this.splitSize+"px";G.style[N]="100%";G.style[L]=D+"px"}if(P.collapsible){$(Q).bind("mousedown",{region:P.region,t:this},function(T){T.stopPropagation();try{this.id.indexOf("collapser")}catch(T){return }var S=T.data.region;T.data.t._toggleRegion(S,!T.data.t.regions[S].collapsed)})}this.regions[P.region]={region:P.region,config:P,container:K,splitter:G||P.split,collapser:Q,collapsible:P.collapsible,drag:M,dType:P.dType,collapsed:P.collapsed||false,size:E,initial:D,hiding:false,getBody:function(){return K},collapse:function(){this.scope._toggleRegion(this.region,true)},expand:function(){this.scope._toggleRegion(this.region,false)},hide:function(){this.scope._hideRegion(this.region)},show:function(){this.scope._showRegion(this.region)},scope:this}},addRegion:function(A){if(!this.regions[A.region]){if(!this.items){this.items=[]}this.items.push(A);this.createRegion(A);this.doLayout()}},getStyleName:function(B){var A="width";switch(B){case"north":case"south":A="height"}return A},_hideRegion:function(C){var B=this.getStyleName(C);if(this.regions[C]&&C!="center"){var A=this.regions[C];A.container.style[B]="0px";if(A.splitter){A.splitter.style[B]="0px";$(A.splitter).addClass("mj-invisible")}$(A.container).addClass("mj-invisible");this.regions[C].hiding=true;this.doLayout()}},_showRegion:function(C){var B=this.getStyleName(C);if(this.regions[C]&&C!="center"){var A=this.regions[C];A.container.style[B]=(A.collapsed?0:A.initial)+"px";if(A.splitter){A.splitter.style[B]=this.splitSize+"px";$(A.splitter).removeClass("mj-invisible")}if(!A.collapsed){$(A.container).removeClass("mj-invisible")}this.regions[C].hiding=false;this.doLayout()}},_toggleRegion:function(D,C){if(this.regions[D]&&D!="center"){var B=this.regions[D];if(B.collapsible){if(B.collapsed!=C){var A=B.container;$(A).toggleClass("mj-invisible");$(B.collapser).swapClass("collapsed","expanded");switch(D){case"north":case"south":var E=B.collapsed?0:$(A).height();A.style.height=B.size+"px";break;default:var E=B.collapsed?0:$(A).width();A.style.width=B.size+"px"}B.collapsed=!B.collapsed;B.size=E;this.doLayout()}}}},init:function(){this.splitSize=5;this.borderSize=1;var C;this.regions={};$(this.renderTo).addClass("border-layout-ct mj-resize-handle");var A=this.renderTo[0].style;A.width="100%";A.height="100%";A.position="relative";A.overflow="hidden";this.masterId=this.renderTo.id||mj.genId("layout-");C=mj.NE(this.renderTo,{tag:"div",id:(this.masterId+"-region-center"),cls:"border-panel center",style:"width:"+this.renderTo.width()+"px;height:"+this.renderTo.height()+"px;"});if(this.centerBorder.length<4){if(this.centerBorder.indexOf("l")==-1){$(C).css("border-left","0")}if(this.centerBorder.indexOf("t")==-1){$(C).css("border-top","0")}if(this.centerBorder.indexOf("r")==-1){$(C).css("border-right","0")}if(this.centerBorder.indexOf("b")==-1){$(C).css("border-bottom","0")}}this.regions["center"]={container:C,getBody:function(){return C},splitter:false};if(this.items){for(var B in this.items){if(typeof this.items[B]!="function"){this.createRegion(this.items[B])}}}this.doLayout(true);$(window).bind("resize",{scope:this},function(D){D.data.scope.doLayout()});mj.bindResize(this.renderTo,this.doLayout,this)},getBody:function(A){if(this.regions[A]){return this.regions[A].getBody()}},refreshLayout:function(D,C){var B=$(D.proxy);B=D.proxy[0].style;var A=this.regions[C].container.style;switch(C){case"north":A.height=(parseInt(B.top)-this.borderSize)+"px";break;case"west":A.width=(parseInt(B.left)-this.borderSize)+"px";break;case"south":A.height=(this.renderTo.height()-parseInt(B.top)-this.borderSize-this.splitSize)+"px";break;case"east":A.width=(this.renderTo.width()-parseInt(B.left)-this.borderSize-this.splitSize)+"px";break}this.doLayout()},doLayout:function(L){var C=this.renderTo[0],Y=false,N=false,W=false,I=this.regions,Q,F={regions:{}},P=0;for(var O in I){if(typeof I[O]!="function"){Y=!!I[O].collapsed;N=!!I[O].splitter;W=!!I[O].hiding;Q=I[O].container.style;switch(O){case"center":N=false;W=false;F.regions[O]={height:C.offsetHeight,width:C.offsetWidth,top:0,left:0,collapse:Y,split:N,hiding:W};break;case"north":P=parseInt(Q.height);F.regions[O]={height:P,width:"100%",top:0,left:0,collapse:Y,split:N,hiding:W};break;case"south":P=parseInt(Q.height);F.regions[O]={height:P,width:"100%",top:0,left:0,collapse:Y,split:N,hiding:W};break;case"west":P=parseInt(Q.width);F.regions[O]={height:0,width:P,top:0,left:0,collapse:Y,split:N,hiding:W};break;case"east":P=parseInt(Q.width);F.regions[O]={height:0,width:P,top:0,left:0,collapse:Y,split:N,hiding:W};break}}}var Z=F.regions.center,V=I.center.container.style;var A=F.regions["north"];var G=0,d=0,E=0,H=0;if(A){G=A.hiding?0:((A.split?this.splitSize:0)+this.borderSize);Z.top+=A.height+G;Z.height-=A.height+G}else{A={height:0,width:0,top:0,left:0,collapse:false,split:false,hiding:false}}var S=F.regions["south"];if(S){d=S.hiding?0:((S.split?this.splitSize:0)+this.borderSize);Z.height-=S.height+d;F.regions.south.top=Z.height+A.height+d+G-this.borderSize}else{S={height:0,width:0,top:0,left:0,collapse:false,split:false,hiding:false}}var B=F.regions["west"];if(B){E=B.hiding?0:((B.split?this.splitSize:0)+this.borderSize);Z.left+=B.width+E;Z.width-=B.width+E;F.regions.west.top+=A.height+G;F.regions.west.height+=C.offsetHeight-(A.height+S.height+d+G)}else{B={height:0,width:0,top:0,left:0,collapse:false,split:false,hiding:false}}var a=F.regions["east"];if(a){H=a.hiding?0:((a.split?this.splitSize:0)+this.borderSize);Z.width-=a.width+H;F.regions.east.top+=A.height+G;F.regions.east.height=C.offsetHeight-(A.height+S.height+d+G);F.regions.east.left+=B.width+Z.width+E+H-this.borderSize}else{a={height:0,width:0,top:0,left:0,collapse:false,split:false,hiding:false}}var D,J,M,U;var K=C.offsetWidth,W=C.offsetHeight;this.ly=F;this.trigger("layoutbeforeresize",this);V.left=(Z.left-(B.hiding?0:B.collapse?1:0))+"px";var X=(Z.width-(2*this.borderSize)+(B.hiding?0:B.collapse?1:0)+(a.hiding?0:a.collapse?1:0));V.width=(X>0?X:0)+"px";var R=(Z.height-(2*this.borderSize)+(A.hiding?0:A.collapse?1:0)+(S.hiding?0:S.collapse?1:0));V.height=(R>0?R:0)+"px";V.top=(Z.top-(A.hiding?0:A.collapse?1:0))+"px";for(var T in F.regions){if(typeof F.regions[T]!="function"&&T!="center"){U=I[T];cfg=U.config;D=U.container.style;M=F.regions[T];switch(T){case"north":D.left=M.left+"px";D.width=M.width+"";D.height=M.height+"px";D.top=M.top+"px";if(F.regions[T].split){J=U.splitter.style;J.top=(M.height+(M.collapse?0:this.borderSize))+"px"}break;case"south":D.left=M.left+"px";D.width=M.width+"";D.height=M.height+"px";D.top=M.top+"px";if(F.regions[T].split){J=U.splitter.style;J.top=(Z.height+A.height+G+(M.collapse?this.borderSize:0))+"px";U.drag.maxHeight=(W-((cfg.min||U.initial)+this.borderSize+this.splitSize));U.drag.minHeight=(W-((cfg.max||U.initial)+this.borderSize+this.splitSize))}break;case"west":D.left=M.left+"px";D.width=(M.width)+"px";D.height=V.height;D.top=V.top;if(F.regions[T].split){J=U.splitter.style;J.top=D.top;J.height=(parseInt(D.height)+(2*this.borderSize))+"px";J.left=(M.width+(M.collapse?0:this.borderSize))+"px"}break;case"east":D.left=M.left+"px";D.width=(M.width)+"px";D.height=V.height;D.top=V.top;if(F.regions[T].split){J=U.splitter.style;J.top=D.top;J.height=(parseInt(D.height)+(2*this.borderSize))+"px";J.left=(M.left-this.splitSize+(M.collapse?this.borderSize:0))+"px";U.drag.maxWidth=(K-((cfg.min||U.initial)+this.borderSize+this.splitSize));U.drag.minWidth=(K-((cfg.max||U.initial)+this.borderSize+this.splitSize))}}}}this.renderTo.trigger("kkresize");this.trigger("layoutafterresize",this)}};mj.extend(mj.layout,mj.component);mj.accordion=function(A){mj.accordion.superclass.constructor.call(this,A)};mj.accordion.prototype={componentClass:"mj.accordion",title:false,multiple:false,collapsible:true,active:-1,activeItem:false,bodyHeight:0,init:function(){var D=this;D.container=mj.NE(D.renderTo);$(D.container).addClass("mj-resize-handle");D.panels=[];var G=D.id||mj.genId("kkaccordion-"),F;D.bodyHeight=parseInt(this.renderTo[0].style.height)-(D.items.length*24);for(var C=0,A=D.items.length;C<A;C++){var E,B={type:"accordion",renderTo:mj.NE(D.container,{cls:"mj-accordion"}),collapsible:D.collapsible,title:"",titleCls:"",collapsed:true,height:D.bodyHeight};E=D.items[C];B.disabled=false;if(C==D.active){B.collapsed=false}else{B.collapsed=true}B.fitToParent=false;mj.apply(B,E);F=new mj.panel(B);$(F.header).bind("click",{index:C},function(H){D.changeActive(H.data.index)});if(C==D.active){D.activeItem=F}D.panels.push(F)}mj.bindResize(this.container,this.doPanel,this)},changeActive:function(A){if(!this.panels[A].disabled){if(!this.multiple){if(this.activeItem){if(!this.activeItem.collapsed){this.activeItem.collapse();this.active=A;this.activeItem=this.panels[A]}else{this.active=-1;this.activeItem=false}}else{this.active=A;this.activeItem=this.panels[A]}}}},doPanel:function(){this.bodyHeight=parseInt(this.renderTo[0].style.height)-(this.items.length*24);this.bodyWidth=parseInt(this.renderTo[0].style.width);if(this.bodyHeight!=this.lastBodyHeight||this.bodyWidth!=this.lastBodyWidth){for(var B=0,A=this.panels.length;B<A;B++){this.panels[B].body.style.height=Math.max(this.bodyHeight,0)+"px";this.panels[B].body.style.width=Math.max(this.bodyWidth,0)+"px";this.panels[B].container.style.width=Math.max(this.bodyWidth,0)+"px";this.panels[B].header.style.width=Math.max(this.bodyWidth,0)+"px"}this.lastBodyHeight=this.bodyHeight;this.lastBodyWidth=this.bodyWidth}}};mj.extend(mj.accordion,mj.component);mj.panel=function(A){mj.panel.superclass.constructor.call(this,A)};mj.panel.prototype={componentClass:"mj.panel",title:false,type:"default",loaded:false,collapsible:false,border:false,collapsedCls:"mj-panel-collapsed",disabled:false,fitToParent:true,init:function(){if(this.renderTo){this.render()}},render:function(){var B=this;var C=B.id||mj.genId("kkpanel-");if(B.border&&!B.form){$(B.renderTo).css("border","1px solid #A3AEB7")}if(!B.width){B.width=$(B.renderTo).width()||parseInt($(B.renderTo).css("width"))}if(isNaN(B.width)){B.width=0}$(B.renderTo).css("width",B.width+"px");B.container=mj.NE(B.renderTo,{tag:"div",id:C+"-container",cls:"mj-unselectablex",style:B.itemStyle+"width:"+$(B.renderTo).css("width")+";overflow:hidden;"+(B.height?"":("height:"+($(B.renderTo).height())+"px;"))});$(B.container).attr("unselectable","on");if(B.border&&B.form){$(B.container).css("border","1px solid #A3AEB7")}if(B.title){B.header=mj.NE(B.container,{tag:"div",id:C+"-header",cls:"mj-panel-header "+(B.collapsed?B.collapsedCls:"")});if(B.collapsible){B.collapseEl=mj.NE(B.header,{tag:"div",cls:"mj-tool mj-tool-toggle"})}B.titleEl=mj.NE(B.header,{tag:"span",cls:["mj-title-text ",B.titleCls," mj-unselectable"].join(""),html:B.title});$(B.titleEl).attr("unselectable","on");$(B.header).attr("unselectable","on").addClass("mj-unselectable");if(B.collapsible){$(B.header).click(function(){if(!B.disabled){if(!B.collapsed){B.collapse()}else{B.expand()}if(typeof B.handler=="function"){B.handler()}}})}}B.body=mj.NE(B.container,{tag:"div",id:C+"-body",cls:"mj-resize-handle "+(B.collapsed?"mj-invisible":""),style:"height:"+(B.height?B.height:$(B.container).innerHeight()-(B.title?24:0))+"px;width:100%;background-color:white;overflow:auto;",html:B.html||""});if(B.buttons){var A=B.buttons;B.buttons=[];B.buttonContainer=$(mj.NE(B.container,{tag:"div",cls:"mj-panel-buttons-container"}));$(B.body).height($(B.body).height()-B.buttonContainer.height());$(A).each(function(){B.addButton.call(B,this)});if(B.collapsed){B.buttonContainer.addClass("mj-invisible")}}B.getBody=function(){return B.body};if(B.autoLoad){window.tmp=B.body;B.autoLoad.url+="?h=tmp";mj.load(B.body,B.autoLoad);B.loaded=true}if(B.disabled){this.setDisable()}mj.bindResize(B.container,B.doPanel,B);B.doPanel()},collapse:function(){this.collapsed=true;$(this.header).addClass("mj-panel-collapsed");$(this.body).addClass("mj-invisible");if(this.buttonContainer){this.buttonContainer.addClass("mj-invisible")}this.height=this.renderTo.height();this.renderTo.height($(this.header).height()-1)},expand:function(){this.collapsed=false;$(this.header).removeClass("mj-panel-collapsed");$(this.body).removeClass("mj-invisible");if(this.buttonContainer){this.buttonContainer.removeClass("mj-invisible")}this.renderTo.height(this.height>0?($(this.body).height()+$(this.header).height()+(this.buttonContainer?this.buttonContainer.height():0)):0);if(this.autoLoad){if(this.refresh){mj.load(this.body,this.autoLoad)}else{if(!this.loaded){mj.load(this.body,this.autoLoad);this.loaded=true}}}this.doPanel()},doPanel:function(){var C=parseInt(this.renderTo.css("height"));var B=this.renderTo[0].style.width.indexOf("%")>-1?this.renderTo.width():parseInt(this.renderTo[0].style.width);if(C!=this.lastHeight||B!=this.lastWidth){var D=this.header?$(this.header).height():0,E=this.buttonContainer?parseInt($(this.buttonContainer).css("height")):0;C-=D;C-=E;if(parseInt(C)>0){if(!this.height||this.fitToParent){$(this.container).height(C+D+E)}if(!this.width||this.fitToParent){$(this.container).width(B)}var A=$(this.body);A.height(C);A.width(B);A.trigger("kkresize")}this.lastWidth=B;this.lastHeight=C}},addButton:function(B){var C=this;if(!C.buttons){C.buttons=[]}var A=B;if(!A.componentClass){mj.applyIf(A,{renderTo:mj.NE(C.buttonContainer)});A=new mj.button(A)}A.window=C;C.buttons.push(A)},getTitle:function(){return this.title},setTitle:function(A){if(this.titleEl){this.titleEl.innerHTML=A;this.title=A}},setDisable:function(){this.disabled=true;$(this.header).addClass("mj-item-disabled")},setEnable:function(){this.disabled=false;$(this.header).removeClass("mj-item-disabled")}};mj.extend(mj.panel,mj.component);mj.tab=function(A){mj.tab.superclass.constructor.call(this,A)};mj.tab.prototype={componentClass:"mj.tab",index:0,tabWidth:120,maxTitle:14,width:600,height:250,innerTab:false,defaultActive:true,tabScroll:false,border:true,tabPosition:"top",hideHeader:false,padding:"no-padding",tabs:false,tabBodies:false,tabContents:false,activeTab:-1,activeItem:false,setActive:function(C){var D=this.activeTab,E=C;if(this.activeTab!=-1){if(this.activeItem){this.activeItem.active=false;this.activeItem.bm.addClass("mj-invisible");this.activeItem.title.removeClass("mj-tab-active")}this.activeTab=-1}this.activeItem={};this.tabs[C].title.addClass("mj-tab-active");this.activeTab=C;this.activeItem=this.tabs[C];if(this.activeItem.autoLoad){window.tmp=this.activeItem.bc;var B=this.activeItem.autoLoad.url||this.activeItem.autoLoad;var A=(B.indexOf("?")>-1?"&":"?");B+=(A+"h=tmp");if(typeof this.activeItem.autoLoad=="string"){this.activeItem.autoLoad=B}if(typeof this.activeItem.autoLoad=="object"){this.activeItem.autoLoad.url=B}if(this.activeItem.refresh){mj.load(this.activeItem.bc,this.activeItem.autoLoad)}else{if(!this.activeItem.loaded){mj.load(this.activeItem.bc,this.activeItem.autoLoad);this.activeItem.loaded=true}}}this.activeItem.bm.removeClass("mj-invisible");this.activeItem.bc.trigger("kkresize");this.tabs[C].active=true;this.trigger("tabchange",this,E,D)},setDisable:function(A){A.title.addClass("mj-tab-disabled");A.disabled=true},setEnable:function(A){A.title.removeClass("mj-tab-disabled");A.disabled=false},addTab:function(A,E,B){var G=mj.genId(),C=this;var D={};C.scrollPos=0;D.name=A.name?A.name:"";D.title=$(mj.NE(this.tabsContainer,{cls:"mj-tab-title",style:"width:"+C.tabWidth+"px;"}));mj.NE(D.title,{cls:"mj-tab-title-left"});var H=$(mj.NE(D.title,{cls:"mj-tab-title-center"}));mj.NE(D.title,{cls:"mj-tab-title-right"});H.attr("unselectable","on");H.width(C.tabWidth-13);var F=C.tabs.push(D)-1;if(A.iconCls){D.icon=mj.NE(H,{cls:"mj-tab-icon "+A.iconCls})}D.titleText=A.title||"";D.titleEl=mj.NE(H,{cls:"mj-tab-text",html:D.titleText.ellipse(C.maxTitle)});$(D.titleEl).attr("unselectable","on");D.setDisable=function(){this.title.addClass("mj-tab-disabled");this.disabled=true};D.setEnable=function(){this.title.removeClass("mj-tab-disabled");this.disabled=false};if(A.disabled){D.setDisable()}if(A.closable!==false){D.close=$(mj.NE(H,{cls:"mj-tab-close",html:mj.insertSpacer(11,11)}));D.close.click(function(J){var I=C.tabs.indexOf(D);if(!D.disabled&&C.trigger("closeclick",C,D,I)!==false){C.remove(I)}J.stopPropagation()})}D.title.click(function(){if(!D.active&&!D.disabled){var I=C.tabs.indexOf(D);C.trigger("click",C,I);C.setActive(I);D.title.removeClass("mj-tab-hover")}});D.title.hover(function(){if(!D.active&&!D.disabled){D.title.addClass("mj-tab-hover")}},function(){D.title.removeClass("mj-tab-hover")});D.bm=$(mj.NE(this.body,{tag:"div",cls:"mj-tab-panel-b panel-noborder "+(A.active?"":"mj-invisible"),style:"width:"+(this.width)+"px;"}));D.bw=mj.NE(D.bm,{tag:"div",cls:"tab-panel-bwrap"});D.container=D.bc=$(mj.NE(D.bw,{tag:"div",cls:"mj-resize-handle panel-body panel-body-noheader mj-tab-noborder "+(this.padding||"panel-body-pad"),style:"overflow: auto; width: "+(this.width)+"px; height: "+(this.height-(this.padding?28:48))+"px;",html:A.html}));D.autoLoad=A.autoLoad;D.refresh=A.refresh;D.getBody=function(){return this.bc};D.getTitle=function(){return this.titleText};D.setTitle=function(I){this.titleText=I;this.titleEl.innerHTML=I.ellipse(C.maxTitle)};if(!E){if(!this.items){this.items=[]}this.items.push(D);var F=this.items.length-1}else{this.items[B]=D;var F=B}if(!D.disabled){this.setActive(F)}C.itemx=D;C.doAddTab();this._scrollLeft()},doAddTab:function(){var B=parseInt(this.body[0].style.width)||this.body.width();var D=parseInt(this.body[0].style.height)||this.body.height();this.itemx.bm.kkresizewidth(B,true);this.itemx.bm.kkresizeheight(D,true);$(this.itemx.bw).kkresizeheight(D,true);this.itemx.bc.kkresizewidth(B,true);this.itemx.bc.kkresizeheight(D);var A=this.items.length,C=this.tabsScroller.width(),E=Math.floor(C/this.tabWidth);this.scrollParams={l:A,width:C,itemCount:E,scrollLeft:(-(A-E)*this.tabWidth)}},_scrollLeft:function(){var A=this.scrollParams.l,B=this.scrollParams.width,C=this.scrollParams.itemCount,D=this.scrollParams.scrollLeft;if(A>C&&B>this.tabWidth){this.scrollPos=D}else{this.scrollPos=0}if(!$.browser.msie){this.tabsContainer.css("left",this.scrollPos)}else{this.tabsContainer.css("margin-left",this.scrollPos)}this._updateScroll()},_scrollRight:function(){var A=this.items.length+(this.scrollPos/this.tabWidth);if(A>this.scrollParams.itemCount){this.scrollPos-=this.tabWidth;if(!$.browser.msie){this.tabsContainer.css("left",this.scrollPos)}else{this.tabsContainer.css("margin-left",this.scrollPos)}this._updateScroll()}},remove:function(D){var A=this.tabs.length;if(A>1){var E=this.tabs[D];E.title.remove();E.bm.remove();this.tabs.splice(D,1);this.items.splice(D,1);var A=this.items.length,C=this.tabsScroller.width(),F=Math.floor(C/this.tabWidth);this.scrollParams={l:A,width:C,itemCount:F,scrollLeft:(-(A-F)*this.tabWidth)};this._updateScroll();for(var B=0;B<A;B++){if(!this.tabs[B].disabled){this.setActive(B);break}}}},_updateScroll:function(){var B=this,A=B.scrollLeft,D=B.scrollRight;if(B.scrollPos==0){A.disabled=true;A.addClass("mj-tab-scl-disabled")}else{A.disabled=false;A.removeClass("mj-tab-scl-disabled")}var C=this.items.length+(this.scrollPos/this.tabWidth);if(C==this.scrollParams.itemCount){D.disabled=true;D.addClass("mj-tab-scr-disabled")}else{D.disabled=false;D.removeClass("mj-tab-scr-disabled")}},init:function(){var D={w:0,h:0},A=this.activeTab,C=this;this.tabs=[],this.tabBodies=[],this.tabContents=[];C.cnt=C.renderTo;if(this.innerTab){this.width=this.innerTab.body.width()||parseInt(this.innerTab.activeItem.getBody()[0].style.width);this.height=(this.innerTab.body.height()||parseInt(this.innerTab.activeItem.getBody()[0].style.height))-(this.hideHeader?0:26);if($.browser.msie){D.w=0,D.h=0}else{D.w=2,D.h=4}this.renderTo.empty()}else{this.renderTo=$(mj.NE($(this.renderTo).empty()))}this.renderTo.width((this.width-D.w)+"px").height((this.height-D.h)+"px").addClass("mj-tab-panel "+(this.border?"":" mj-tab-noborder"));if(this.innerTab){this.border=false}if(this.tabPosition=="top"){this.header=$(mj.NE(this.renderTo,{tag:"div",id:mj.genId("t-"),cls:"mj-tab-panel-header mj-unselectable "+(this.tabScroll?"tab-scrolling":""),style:"-moz-user-select: none;width: "+(this.width)+"px;"+(this.hideHeader?"display:none;":"")}));this.bodyContainer=$(mj.NE(this.renderTo,{tag:"div",id:mj.genId("t-"),cls:"tab-panel-bwrap"}))}else{this.bodyContainer=$(mj.NE(this.renderTo,{tag:"div",id:mj.genId("t-"),cls:"tab-panel-bwrap"}));this.header=$(mj.NE(this.renderTo,{tag:"div",id:mj.genId("t-"),cls:"mj-tab-panel-footer mj-unselectable "+(this.tabScroll?"tab-scrolling":""),style:"-moz-user-select: none;width: "+(this.width)+"px;"+(this.hideHeader?"display:none;":"")}))}C.scl=this.scrollLeft=$(mj.NE(this.header,{cls:"mj-tab-scroll-left"}));C.scl.hover(function(){if(!C.scl.disabled){C.scl.addClass("mj-tab-scroll-left-hover")}},function(){C.scl.removeClass("mj-tab-scroll-left-hover")});C.scl.click(function(){if(!C.scl.disabled){C.scrollPos+=C.tabWidth;if(!$.browser.msie){C.tabsContainer.css("left",C.scrollPos)}else{C.tabsContainer.css("margin-left",C.scrollPos)}C._updateScroll()}});this.tabsScroller=$(mj.NE(this.header,{cls:"mj-tab-container"}));C.scr=this.scrollRight=$(mj.NE(this.header,{cls:"mj-tab-scroll-right"}));C.scr.hover(function(){C.scr.addClass("mj-tab-scroll-right-hover")},function(){C.scr.removeClass("mj-tab-scroll-right-hover")});C.scr.click(function(){if(!C.scr.disabled){C._scrollRight()}});this.tabsContainer=$(mj.NE(this.tabsScroller,{cls:"mj-tab-container-scroll"}));if($.browser.msie){this.tabsContainer.css("position","static")}this.body=$(mj.NE(this.bodyContainer,{tag:"div",id:mj.genId("t-"),cls:"mj-resize-handle tab-panel-body"+(this.border?"":" mj-tab-noborder")+" tab-panel-body-"+this.tabPosition,style:"width: "+(this.width-2)+"px; height: "+(this.height-28)+"px;>"}));C.doTab();if(this.items){for(var B in this.items){if(typeof this.items[B]!="function"){this.addTab(this.items[B],true,B)}}if(typeof A=="number"&&A>-1){this.setActive(A)}}mj.bindResize(C.cnt,C.doTab,C)},doTab:function(){var I=this;if(I.innerTab){var H=I.innerTab.body.width()||parseInt(I.innerTab.body[0].style.width);var F=I.innerTab.body.height()||parseInt(I.innerTab.body[0].style.height);I.cnt.width(H);I.cnt.height(F)}I.width=I.cnt.width()||parseInt(I.cnt[0].style.width);I.height=I.cnt.height()||parseInt(I.cnt[0].style.height);if(I.width!=I.lastWidth||I.height!=I.lastHeight){I.renderTo.kkresizewidth(I.width-(I.border?2:0),true);I.renderTo.kkresizeheight(I.height-(I.border?2:0));var H=parseInt(I.renderTo[0].style.width)||I.renderTo.width(),F=parseInt(I.renderTo[0].style.height)||I.renderTo.height();I.header.width((H>0?H:0));var D=F>27?F-(this.hideHeader?0:27):0;I.bodyContainer.width(H);I.bodyContainer.height(D);I.body.kkresizeheight(D,true);I.body.kkresizewidth(H,true);var H=parseInt(this.body[0].style.width)||this.body.width();var F=parseInt(this.body[0].style.height)||this.body.height();if(this.items){for(var E=0,G=this.items.length;E<G;E++){if(this.items[E].bm){this.items[E].bm.kkresizewidth(H,true);this.items[E].bm.kkresizeheight(F,true);$(this.items[E].bw).kkresizeheight(F,true);this.items[E].bc.kkresizewidth(H,true);this.items[E].bc.kkresizeheight(F)}}if(I.scrollable!==true&&I.width>=(I.items.length*I.tabWidth)){I.scl.addClass("mj-invisible");I.scr.addClass("mj-invisible");I.tabsScroller.width(I.width)}else{I.tabsScroller.width((I.width-32-(I.border?2:0))>0?(I.width-32-(I.border?2:0)):0)}var C=I.items.length,B=I.tabsScroller.width(),A=Math.floor(B/I.tabWidth);I.scrollParams={l:C,width:B,itemCount:A,scrollLeft:(-(C-A)*I.tabWidth)}}I.body.trigger("kkresize");I.lastWidth=I.width;I.lastHeight=I.height}}};mj.extend(mj.tab,mj.component);mj.tree=function(A){mj.tree.superclass.constructor.call(this,A)};mj.tree.prototype={componentClass:"mj.tree",loaderDepth:0,refresh:false,loadingNode:false,loaded:false,mode:"local",classes:{nodeClass:"mj-node",open:"mj-open",close:"mj-close",opened:"mj-opened",closed:"mj-closed",expandable:"mj-expandable",expandable_ie:"mj-expandable-ie",collapsable:"mj-collapsable",collapsable_ie:"mj-collapsable-ie",lastCollapsable:"mj-lastCollapsable",lastCollapsable_ie:"mj-lastCollapsable-ie",lastExpandable:"mj-lastExpandable",lastExpandable_ie:"mj-lastExpandable-ie",last:"mj-last-node",last_ie:"mj-last-node-ie",selected:"mj-selected",hitarea:"mj-hitarea"},init:function(){this.cnt=this.renderTo;this.nodes={}},load:function(){if(!this.loaded){this.store.on("load",this._onLoad,this);this.store.load();this.loaded=true}else{this.reload()}},nodeLoad:function(A){this.loadingNode=A;this.store.params.node=A.id;this.store.load()},nc:function(I,G,E){var C=mj.NE($(I),{tag:"ul",cls:""}),K;$(C).attr("unselectable","on");for(var D=0,F=G.length;D<F;D++){K=G[D];if(K){var B=(K.leaf==false||K.leaf==0)||K.data;var J=(E?(E+D):D);this.nodes[J]=K;var H=[this.check?('<input class="node-cb mj-unselectable mj-invisible" unselectable="on" type="checkbox" '+(K.checked?'checked="checked" />':" />")+'<div style="width: 16px;height:16px;float:left;" class="mj-checkbox '+(K.checked?"mj-checkbox-checked":"")+'"></div>'):"",this.icon?'<img style="border:0pt none;width:16px;" src="'+(K.icon?K.icon:mj.glb.blankImage)+'" class="'+(K.iconCls?K.iconCls:this.classes.closed)+' mj-unselectable" unselectable="on"/>':"",'<a id="'+(K.id?K.id:mj.genId("node-"))+'" name="'+J+'" class="mj-node mj-unselectable" unselectable="on" hidefocus="on" style="text-decoration:none;line-height:18px;vertical-align:top;outline:0;" href="',K.href?K.href:"#",'" tabIndex="1" ',K.hrefTarget?' target="'+K.hrefTarget+'"':"",'><span unselectable="on" class="mj-unselectable" style="padding:1px 3px 1px 3px;">',K.text,"</span></a>"];var A=mj.NE(C,{tag:"li",cls:((K.leaf==false||K.leaf==0)&&this.mode=="remote")?this.classes.expandable:"",html:H.join("")});if(B){$(A).append('<div class="mj-tree-line mj-invisible"><img style="border:0pt none;width:14px;" src="'+mj.glb.blankImage+'" class="mj-unselectable" unselectable="on"/></div>');if(this.mode=="local"){this.nc($(A),G[D].data,(J+"/"))}}}}},cc:function(P,O,H,A,N){var E=this;var F="",D="";if(N==true){F="width:"+P.find("div:first").width()+"px";D='<div class="mj-c-tree-root-node"></div>'}var J=mj.NE($(P),{tag:"ul",cls:"",style:F}),Q,C;for(var K=0,L=O.length;K<L;K++){Q=O[K];if(Q){var M=(Q.leaf==false||Q.leaf==0)||Q.data;C=(A?(String(A)+String(K)):String(K));this.nodes[C]=Q;var B=[];var I=-1;while(++I<this.cm.length){B.push('<div name="mj-c-tree-row-'+K+"-col-"+I+"-col-"+C+'" class="mj-c-tree-col mj-c-tree-col-'+I+" "+(I!=0?"mj-c-tree-col-border":"")+'" style="width:'+(I==0?(this.cm[I].width+((this.loaderDepth-H)*16)):this.cm[I].width)+'px;"><div class="">'+(typeof Q[this.cm[I].dataIndex]=="undefined"||Q[this.cm[I].dataIndex]==""?"&nbsp;":Q[this.cm[I].dataIndex])+"</div></div>")}B.push('<div class="mj-c-tree-clear"></div>');var R=['<div mj:tree-node-id="',Q.id,'" class="mj-c-tree-node-el mj-c-tree-node-leaf ',Q.cls,'">',this.icon?'<img style="border:0pt none;width:16px;" src="'+(Q.icon?Q.icon:mj.glb.blankImage)+'" class="'+this.classes.closed+'" unselectable="on"/>':"",B.join(""),"</div>"];var G=$(mj.NE(J,{tag:"li",cls:(Q.leaf==false||Q.leaf==0)?this.classes.expandable:"",html:R.join("")}));$(G).find("div.mj-c-tree-col").each(function(){var S=$(this).attr("name").replace("mj-c-tree-row-","").split("-col-");var T=parseInt(S[0]),V=parseInt(S[1]),U=S[2];$(this).click(function(W){W.stopPropagation();E.trigger("cellclick",E,T,V,U,this)})});if(M&&this.mode=="local"){this.cc(G,O[K].data,H+1,(C+"/"))}}}},depth:function(B,C){for(var A in B){if(typeof B[A]!="function"){if(typeof B[A].data=="object"){if(this.loaderDepth<C++){this.loaderDepth=C}this.depth(B[A].data,C)}}}},treeview:function(E){var F=this;function G(){var K=F;var L=$(this).parent();if($(this).hasClass(K.classes.hitarea)){var J=$(this);var M=F.mode=="remote"}else{if($(this).hasClass(K.classes.nodeClass)){var J=L.find("div:first");var M=true}}if(K.mode=="remote"){if(L.hasClass(K.classes.expandable)||this.className==K.classes.hitarea){var I;if(L.hasClass(K.classes.expandable)){I=escape(this.id)}if($(this).hasClass(K.classes.hitarea)&&!L.hasClass(K.classes.collapsable)){I=escape(L.find("a:first").attr("id"))}if(I){E.store.params.node=I;E.store.load()}}if(L.hasClass(K.classes.collapsable)){L.find("ul").remove()}}L.swapClass(K.classes.collapsable,K.classes.expandable).swapClass(K.classes.lastCollapsable,K.classes.lastExpandable).find(">ul").toggle(E.speed,E.toggle);if($.browser.msie&&parseInt($.browser.version)==6){J.swapClass(K.classes.collapsable_ie,K.classes.expandable_ie).swapClass(K.classes.lastCollapsable_ie,K.classes.lastExpandable_ie)}L.find(".mj-tree-line:first").swapClass("mj-invisible","mj-visible");if(E.icon){if(this.className==K.classes.hitarea){$(this).next().swapClass(K.classes.closed,K.classes.opened)}if(this.tagName=="A"){$(this).prev().swapClass(K.classes.closed,K.classes.opened)}}if(E.unique){$(this).parent().siblings().replaceclass(K.classes.collapsable,K.classes.expandable).replaceclass(K.classes.lastCollapsable,K.classes.lastExpandable).find(">ul").hide(E.speed,E.toggle)}K.lineCreate();if(!M){E.clickHandler.call(K||this,J.parent().find("a:first"))}}this.toggler=G;function C(){var L=F;if(E.mode=="local"){$(this).addClass("checked");$(this).parent().find("input").attr("checked",this.checked).css("opacity","1");var J=$(this).parents("li");if(this.checked){J.filter('has("checked")').find("input:first").attr("checked",this.checked)}var P=J.find("input:checked");for(var K=0,I=P.length;K<I;K++){var N=$(P[K]).parent(),M=N.find("input:checked").length,O=N.find("input:checkbox").length;if(M==1&&M!=O){$(P[K]).attr("checked",false).css("opacity","1")}else{if(M!=0&&M<O){$(P[K]).attr("checked",true).css("opacity","0.2")}else{if(M==O){$(P[K]).attr("checked",true).css("opacity","1")}}}}}}function D(){var Q=F;if(E.mode=="local"){var L=$(this),P=L.prev(),I=!P.attr("checked");P.addClass("checked");P.parent().find("input").attr("checked",I).css("opacity","1");var M=P.parents("li");if(I){M.filter('has("checked")').find("input:first").attr("checked",I);L.addClass("mj-checkbox-checked").css("opacity","1")}else{L.parent().find(".mj-checkbox").removeClass("mj-checkbox-checked").css("opacity","1")}var S=M.find("input:checked");for(var N=0,R=S.length;N<R;N++){var K=$(S[N]).parent(),J=K.find("input:checked").length,O=K.find("input:checkbox").length;if(J==1&&J!=O){$(S[N]).attr("checked",false).css("opacity","1");$(S[N]).next().removeClass("mj-checkbox-checked").css("opacity","1")}else{if(J!=0&&J<O){$(S[N]).attr("checked",true).css("opacity","0.2");$(S[N]).next().addClass("mj-checkbox-checked").css("opacity","0.4")}else{if(J==O){$(S[N]).attr("checked",true).css("opacity","1");$(S[N]).next().addClass("mj-checkbox-checked").css("opacity","1")}}}}}}this.checkfn=C;function H(){var K=F;var I=$("li",E.cnt[0]);var J=I.find("a."+K.classes.selected);J.removeClass(K.classes.selected);if(F.selectedItem&&F.selectedItem.prev().hasClass(K.classes.opened)&&!F.selectedItem.parent().hasClass(K.classes.collapsable)){F.selectedItem.prev().swapClass(K.classes.opened,K.classes.closed)}var L;if($(this).hasClass(K.classes.nodeClass)){L=$(this);if($(this).parent().hasClass(K.classes.last)&&K.icon){$(L).prev().addClass(K.classes.opened)}}if($(this).hasClass(K.classes.hitarea)){L=$(this).parent().find("a:first")}$(L).addClass(K.classes.selected);E.clickHandler.call(K||this,L)}this.down=H;this.cnt.addClass(E.cnt.attr("id")+(E.cm?" mj-c-treeview":" mj-treeview"));$("li",this.cnt).prepend('<div class="'+this.classes.hitarea+'">'+mj.insertSpacer(15,19)+"</div>");$("li:last-child",this.cnt).each(function(){if($.browser.msie&&parseInt($.browser.version)==6){var I=$(this).find("div:first");I.addClass(F.classes.last_ie)}}).addClass(this.classes.last);$((E.collapsed?"li":"li."+this.classes.close)+":not(."+this.classes.open+") > ul",this.cnt).hide();var B=$("li:has(ul)",this.cnt);B.filter(":has(>ul:hidden)").addClass(this.classes.expandable).swapClass(this.classes.last,this.classes.lastExpandable).end().not(":has(>ul:hidden)").addClass(this.classes.collapsable).swapClass(this.classes.last,this.classes.lastCollapsable).end().find("div."+this.classes.hitarea).each(function(J){if($.browser.msie&&parseInt($.browser.version)==6){var I=$(this),K=I.parent("li");if(K.hasClass(F.classes.expandable)){I.addClass(F.classes.expandable_ie)}if(K.hasClass(F.classes.lastExpandable)){I.addClass(F.classes.lastExpandable_ie)}if(K.hasClass(F.classes.collapsable)){I.addClass(F.classes.collapsable_ie)}if(K.hasClass(F.classes.lastCollapsable)){I.addClass(F.classes.lastCollapsable_ie)}if(K.hasClass(F.classes.last)){I.addClass(F.classes.last_ie)}}}).toggle(G,G);var A=$("li",this.cnt);A.find("input").click(C);A.find("input").next().click(D);A.find("a."+this.classes.nodeClass).mousedown(H).toggle(G,G);$(".mj-expandable .mj-tree-line",this.cnt).addClass("mj-invisible");return this},lineCreate:function(){var E=this.cnt.find(".mj-tree-line");for(var B=E.length-1;B>-1;B--){var A=$(E[B]),D=A.next();if(!A.hasClass("mj-invisible")){if(!A.parent().next().length){A.addClass("mj-invisible")}else{if(D.length>0){var C=parseInt(D.height());A.height(C>0?C-1:0)}}}else{A.height(0)}}},_onLoad:function(){var C,L=this;if(!this.store.loaded||this.refresh){if(!this.loaded){this.depth(this.store.data,this.loaderDepth)}this.cnt.empty();C=this.cnt;if(this.cm){var M=0,G=[];for(var J=0,K=this.cm.length;J<K;J++){M+=this.cm[J].width?this.cm[J].width:0;G.push('<div class="mj-c-tree-hd mj-c-tree-hd-'+(J==0?"first":"")+'" style="width:'+(J==0?(this.cm[J].width+(this.loaderDepth*16)):this.cm[J].width)+'px;"><div class="mj-c-tree-hd-text">'+this.cm[J].header+"</div></div>")}M+=this.loaderDepth*16+K*2;G.push('<div class="mj-c-tree-clear"></div>');mj.NE(C,{tag:"div",cls:"mj-c-tree-header",style:"width:"+M+"px",html:G.join("")});this.cc(C,this.store.data,1,0,true)}else{this.nc(C,this.store.data)}var E=$("li:last",C);if(E.hasClass(this.classes.expandable)){E.addClass(this.classes.lastExpandable)}this.clickHandler=function(N){this.selectedItem=N;this.selectedNode=this.nodes[N[0].name];this.trigger("nodeclick",this,N)};this.tree=this.treeview({cnt:C,mode:this.mode,cm:this.cm?true:false,store:this.store,collapsed:!this.expanded,icon:this.icon,unique:this.unique,check:this.check,clickHandler:this.clickHandler});if(this.mode=="remote"){$("li."+this.classes.expandable,C).find("div."+this.classes.hitarea).each(function(O){if($.browser.msie&&parseInt($.browser.version)==6){var N=$(this),P=N.parent("li");if(P.hasClass(L.classes.expandable)){N.addClass(L.classes.expandable_ie)}if(P.hasClass(L.classes.lastExpandable)){N.addClass(L.classes.lastExpandable_ie)}if(P.hasClass(L.classes.collapsable)){N.addClass(L.classes.collapsable_ie)}if(P.hasClass(L.classes.lastCollapsable)){N.addClass(L.classes.lastCollapsable_ie)}if(P.hasClass(L.classes.last)){N.addClass(L.classes.last_ie)}}}).mousedown(this.down).toggle(this.toggler,this.toggler)}else{if(this.check){var I=$("li",C).find("input:checked").parents("li");for(var D=0,H=I.length;D<H;D++){var B=$(I[D]),A=B.find("input:checked").length+1,F=B.find("input:checkbox").length;if(A==1&&A!=F){$(I[D]).find("input").attr("checked",false).css("opacity","1");$(I[D]).find("input").next().removeClass("mj-checkbox-checked").css("opacity","1")}else{if(A!=0&&A<F){$(I[D]).find("input:first").attr("checked",true).css("opacity","0.2");$(I[D]).find("input:first").next().addClass("mj-checkbox-checked").css("opacity","0.4")}else{if(A==F){$(I[D]).find("input").attr("checked",true).css("opacity","1");$(I[D]).find("input").next().addClass("mj-checkbox-checked").css("opacity","1")}}}}}}}else{if(this.mode=="remote"){if(this.loadingNode){C=this.cnt.find("a#"+this.loadingNode.id);C.parent().find("ul").empty();this.loadingNode=false}else{C=this.selectedItem[0].parentNode}this.nc(C,this.store.data,this.selectedItem.attr("name")+"/");$("li",C).find("a."+this.classes.nodeClass).mousedown(this.down).toggle(this.toggler,this.toggler);$("li",C).prepend('<div class="'+this.classes.hitarea+'">').find("div."+this.classes.hitarea).each(function(O){if($.browser.msie&&parseInt($.browser.version)==6){var N=$(this),P=N.parent("li");if(P.hasClass(L.classes.expandable)){N.addClass(L.classes.expandable_ie)}if(P.hasClass(L.classes.lastExpandable)){N.addClass(L.classes.lastExpandable_ie)}if(P.hasClass(L.classes.collapsable)){N.addClass(L.classes.collapsable_ie)}if(P.hasClass(L.classes.lastCollapsable)){N.addClass(L.classes.lastCollapsable_ie)}if(P.hasClass(L.classes.last)){N.addClass(L.classes.last_ie)}}}).mousedown(this.down).toggle(this.toggler,this.toggler);var E=$("li:last",C);if(E.hasClass(this.classes.expandable)){E.addClass(this.classes.lastExpandable);if($.browser.msie&&parseInt($.browser.version)==6){E.find("div:first").addClass(this.classes.lastExpandable_ie)}}else{E.addClass(this.classes.last);if($.browser.msie&&parseInt($.browser.version)==6){E.find("div:first").addClass(this.classes.last_ie)}}this.lineCreate()}}},reload:function(){delete this.selectedItem;delete this.selectedNode;this.store.loaded=false;this.store.params.node="";this.store.load()},getNode:function(B,C){if(typeof C=="undefined"){C="id"}var A=mj.getIndex(this.nodes,C,B);if(A!=-1){this.nodes[A].nodeIndex=parseInt(A);return this.nodes[A]}return null},getItem:function(B,C){if(typeof C=="undefined"){C="text"}var A=mj.getIndex(this.nodes,C,B);if(A!=-1){return $(this.cnt).find("a[name="+A+"]")}return null},selectNode:function(B,H){var J=this.getItem(B,H),E;if(J){var F=$("a."+this.classes.selected,this.cnt),G=J[0].name.split("/"),A="";F.removeClass(this.classes.selected);for(var D=0,C=G.length;D<C;D++){A+=G[D];E=$("a[name="+A+"]",this.cnt);var I=E.parents("li:first");I.swapClass(this.classes.collapsable,this.classes.expandable).swapClass(this.classes.lastCollapsable,this.classes.lastExpandable).find(">ul").toggle(this.speed,this.toggle);A+="/";this.clickHandler(E)}J.addClass(this.classes.selected)}}};mj.extend(mj.tree,mj.component);mj.windowManager=function(A){mj.windowManager.superclass.constructor.call(this,A)};mj.windowManager.prototype={componentClass:"mj.windowManager",modalIndex:mj.glb.modalIndex,activeIndex:false,activeWin:false,init:function(){this.windows=[];this.w=$(this.windows);mj.windowManager.superclass.init.call(this)},add:function(A){A.manager=this;A.managerId=this.windows.push(A);if(A.parentWin){A.parentWin.add(A)}A.on("show",this.onWindowShow,this);A.on("hide",this.onWindowHide,this);A.on("close",this.onWindowClose,this);A.on("init",this.onWindowInit,this)},onWindowShow:function(A){this.bringToFront(A)},onWindowHide:function(A){if(A.mask){A.mask.hide()}this.activeWin=false;this.activeIndex=A.lastIndex;A._el.css("z-index",A._zBackup)},onWindowClose:function(A){if(A.mask){A.mask.destroy()}this.activeWin=false;this.activeIndex=A.lastIndex;this.windows.splice(A.managerId,1)},onWindowInit:function(A){if(A.modal){A.mask=new mj.mask({zIndex:this.modalIndex})}},bringToFront:function(B){if(this.activeWin!=B){B.lastIndex=this.activeIndex;var A=(this.activeIndex?this.activeIndex:this.modalIndex)+2;this.activeIndex=A;this.activeWin=B;if(B.mask){B.mask.show(A-1)}B._zBackup=B._el.css("z-index");B._el.css("z-index",A)}B.trigger("activate",B);this.trigger("activate",B)}};mj.extend(mj.windowManager,mj.component);mj.window=function(A){mj.applyIf(A,{parent:A.parent||mj.bd});if(A.wM){A.wM.add(this)}else{if(!window.windowManager){window.windowManager=new mj.windowManager()}window.windowManager.add(this)}mj.window.superclass.constructor.call(this,A)};mj.window.prototype={componentClass:"mj.window",width:600,height:500,resizable:true,drag:true,destroyOnClose:false,minimizable:false,maximizable:false,closable:true,opacity:1,init:function(){var M=this,B=mj.NE,A=M.el=B(M.renderTo,{cls:"mj-win"+(M.cls?" "+M.cls:""),style:"width:"+M.width+"px;height:"+M.height+"px;"}),K=M._el=$(A);M.updating=true;M.width=K.width();M.height=K.height();M._cnt=K;M.els={tl:$(B(A,{cls:"mj-win-tl"})),tc:$(B(A,{cls:"mj-win-tc mj-unselectable",unselectable:"on"})),tr:$(B(A,{cls:"mj-win-tr"})),lc:$(B(A,{cls:"mj-win-lc"})),rc:$(B(A,{cls:"mj-win-rc"})),bl:$(B(A,{cls:"mj-win-bl"})),bc:$(B(A,{cls:"mj-win-bc"})),br:$(B(A,{cls:"mj-win-br"})),cs:$(B(A,{cls:"mj-win-cs"})),cn:$(B(A,{cls:"mj-win-cn"})),cc:$(B(A,{cls:"mj-win-cc mj-resize-handle",style:"opacity:"+M.opacity+";-moz-opacity:"+M.opacity+";filter:alpha(opacity="+(M.opacity*100)+");"}))};M.els.tcDrag=$(B(M.els.tc,{cls:"mj-win-drag"}));M.els.cc.bind("mousedown",function(){M.manager.bringToFront.call(M.manager,M)});M.els.tcDrag.bind("mousedown",function(){M.manager.bringToFront.call(M.manager,M)});M.title=mj.translate(M.title);M.titleEl=B(M.els.tcDrag,{tag:"span",html:M.title});M.body=M.els.cc;M.body.win=M;M.getBody=function(){return M.body};if(M.minimizable){var L=M.els.minimize=$(B(M.els.tc,{cls:"mj-win-btn mj-win-minimize"}));L.hover(function(){L.addClass("mj-win-minimize-hover")},function(){L.removeClass("mj-win-minimize-hover")});var F=M.minimize;L.click(function(){F.call(M)})}if(M.maximizable){var E=M.els.maximize=$(B(M.els.tc,{cls:"mj-win-btn mj-win-maximize"}));E.hover(function(){if(M.maximized){E.addClass("mj-win-restore-hover")}else{E.addClass("mj-win-maximize-hover")}},function(){E.removeClass("mj-win-restore-hover");E.removeClass("mj-win-maximize-hover")});var J=M.maximize;E.click(function(){J.call(M)});M.els.tc.dblclick(function(){J.call(M)})}if(M.closable){var G=M.els.close=$(B(M.els.tc,{cls:"mj-win-btn mj-win-close"}));G.hover(function(){G.addClass("mj-win-close-hover")},function(){G.removeClass("mj-win-close-hover")});var C=M.close;G.click(function(){C.call(M)})}if(M.drag){M.dragHandle=new mj.drag({el:A,dragEl:M.els.tcDrag,parent:M.parent});M.dragHandle.on("beforedrag",function(){if(this.maximized){return false}},M)}if(M.resizable){M.resizer=new mj.resizer({el:A,minWidth:M.minWidth||M.width,maxWidth:M.maxWidth,minHeight:M.minHeight||M.height,maxHeight:M.maxHeight})}if(M.buttons){M.buttonsConfig=M.buttons;M.buttons=null;if(M.buttonsConfig){$(M.buttonsConfig).each(function(){M.addButton.call(M,this)})}}if(M.tbar){mj.apply(M.tbar,{renderTo:M.els.cn});M.tbar=new mj.menu(M.tbar)}M.updating=null;M._layout();var I=$(document.body),D=typeof M.left!="undefined"?M.left:Math.floor((I.width()-M.width)/2),H=typeof M.top!="undefined"?M.top:Math.floor((I.height()-M.height)/2);M._el.css("left",D>0?D:0);M._el.css("top",H>0?H:0);M._el.resize(function(){var N=M.width=K.width(),O=M.height=K.height();M.trigger("resize",M,N,O)});M._el.bind("resize",function(){M.width=K.width();M.height=K.height();M._layout();M.trigger("afterresize",M,M.width,M.height)});if(M.autoLoad){window.tmp=M.body;M.autoLoad.url+="?h=tmp";mj.load(M.body,M.autoLoad);M.loaded=true}M.on("hide",M._onHide,M);M.on("beforeclose",M._onBeforeClose,M);mj.bindResize(M.el,M.doFit,M);mj.window.superclass.init.call(M)},_onHide:function(){if(this.subWindows){var A=$(this.subWindows);return A.eachR(function(){return this.hide()})}return true},_onBeforeClose:function(){if(this.subWindows){var A=$(this.subWindows);return A.eachR(function(){return this.close()})}return true},_layout:function(){if(!this.updating){var B=this,D=B.els,A=B.width-12,C=B.height-29;B._cnt.width(B.width);B._cnt.height(B.height);D.tc.width(A);D.bc.width(A);D.lc.height(C);D.rc.height(C);D.cc.width(A-2);D.cc.kkresizewidth(A-2,true);D.cs.width(A+2);D.cn.width(A-2);if(B.buttons){D.cs.height(26);C=C-29}if(B.tbar){D.cn.height(25);D.cc.css("top",$.browser.msie?48:49);C=C-26}D.cc.kkresizeheight(C+($.browser.msie?1:0));B.els.tcDrag.width(A-15)}},show:function(){var A=this;A.trigger("show",this);A.trigger("activate",this);A._el.show();A.els.cc.trigger("kkresize");A.minimized=false},hide:function(){if(this.trigger("hide",this)){this._el.hide()}},minimize:function(){if(this.trigger("minimize",this)){this._el.hide();this.minimized=true}},close:function(){if(this.trigger("beforeclose")===false){return false}if(this.destroyOnClose){if(this.trigger("close",this)!==false){this.destroy()}return false}else{return this.hide()}},destroy:function(){this._el.remove();this.trigger("afterdestroy",this)},resize:function(A,B){this.resizing=true;this.onWidth(A);this.onHeight(B)},onWidth:function(A){this._el.width(A);this._layout();if(!this.resizing){this.trigger("resize",this,A,this._el.height())}this.resizing=null},onHeight:function(A){this._el.height(A);this._layout()},doFit:function(){if(this.maximized){var A,B;A=$(this.parent).width();B=$(this.parent).height();this.width=parseInt(A);this.height=parseInt(B);this.onWidth(A);this.onHeight(B)}},maximize:function(){var B,D,C,A;if(!this.maximized){this.oldPosition={top:this._el.css("top"),left:this._el.css("left"),width:this._el.width(),height:this._el.height()};B=$(this.parent).width();D=$(this.parent).height();C=($(this.parent).offset()).top+"px";C="0px";A="0px";this.maximized=true;this.els.maximize.addClass("mj-restore-btn")}else{B=this.oldPosition.width;D=this.oldPosition.height;C=this.oldPosition.top;A=this.oldPosition.left;this.maximized=false;this.oldPosition=null;this.els.maximize.removeClass("mj-restore-btn")}this._el.css("top",C);this._el.css("left",A);this.width=parseInt(B);this.height=parseInt(D);this.onWidth(B);this.onHeight(D)},addButton:function(B){var C=this;if(!C.buttons){C.buttons=[]}var A=B;if(!A.componentClass){mj.apply(A,{renderTo:mj.NE(C.els.cs)});A=new mj.button(A)}A.window=C;C.buttons.push(A);C._layout()},add:function(B){var A=this;if(!A.subWindows){A.subWindows=[]}B.on("close",function(){A.subWindows.splice(B._subIndex,1)});B._subIndex=A.subWindows.push(B)},setTitle:function(A){if(this.titleEl){this.title=mj.translate(A);this.titleEl.innerHTML=this.title}}};mj.extend(mj.window,mj.component);mj.message=function(C){if(typeof C==="string"){C={msg:C}}C.msg=mj.translate(C.msg);var G=window.windowManager?window.windowManager.activeIndex+1:1000,A=mj.message.defaults;var J={"OK":mj.lng.titles.buttons.ok,"CANCEL":mj.lng.titles.buttons.cancel,"YES":mj.lng.titles.buttons.yes,"NO":mj.lng.titles.buttons.no};A.buttonTitles=A.buttonTitles?mj.apply(A.buttonTitles,J):J;var B=C.renderTo=C.renderTo?C.renderTo:mj.NE();mj.applyIf(C,A);var I=function(K,M){var L=C.cb;if(typeof L==="function"){L.call(C.scope,K,K.handlerId)}else{K.window.close()}};if(C.buttons){var F=[],E=C.buttons;for(var G=0,D=E.length;G<D;G++){if(typeof E[G]==="string"){F.push({title:A.buttonTitles[E[G]],handler:I,handlerId:E[G]})}else{F.push(E[G])}}}C.buttons=F;var H=mj.message.activeMessageWin=new mj.window(C);H.on("close",function(){$(B).remove();mj.message.activeMessageWin=false});mj.NE(H.body,{html:C.msg,cls:"mj-message-text"});H.show()};mj.message.defaults={cls:"mj-message-window",modal:false,width:300,height:150,title:"Bilgi",buttons:["OK"],buttonTitles:{},cb:function(B,A){B.window.close()}};mj.plotter=function(A){mj.plotter.superclass.constructor.call(this,A)};mj.plotter.prototype={componentClass:"mj.plotter",version:"1.0",width:false,height:false,mask:true,maskOpacity:0.3,legendWindowOpacity:0.3,legendWindowWidth:200,canvas:false,cnt:false,ctx:false,series:false,opt:false,style:"",fontMap:true,tickOrientation:{x:"h",y:"h"},border:true,collapsible:false,footHeight:80,leftWidth:60,marginSize:10,infoBar:false,infoHeight:30,titleMeasure:20,fontSize:10,titleSize:10,tickSize:10,overlay:true,autoScale:{x:0,y:0.02},tickScale:3,xTickScale:false,yTickScale:false,backgroundColor:"#fff",ticksBackgroundColor:"#fff",titleBackgroundColor:"#fff",showXAxisTicks:true,showXAxisTitles:true,showYAxisTicks:true,showYAxisTitles:true,xTickCount:false,yTickCount:false,zoom:true,legend:false,legendLabel:false,drawed:false,legends:true,maxTitle:15,resizable:false,onlyPositiveZoom:false,d:false,tickFormatDefault:{x:{format:function(A){return A.toString()}},y:{format:function(A){return A.toString()}}},_colors:["rgb(120,90,59)","rgb(53,115,53)","rgb(178,87,56)","rgb(203,143,71)","rgb(55,106,155)","rgb(205,197,51)","rgb(209,130,139)","rgb(159,153,57)","rgb(206,173,136)","rgb(191,132,72)","rgb(151,135,169)","rgb(140,48,51)","rgb(59,144,187)","rgb(197,190,104)","rgb(109,136,79)","rgb(144,100,144)","rgb(181,94,94)","rgb(59,144,144)","rgb(204,136,92)","rgb(139,167,55)","rgb(205,171,66)","rgb(150,184,211)"],_ticks:new Array(29030400000,7257600000,2419200000,604800000,259200000,86400000,21600000,14400000,3600000,1000000,500000,250000,100000,50000,25000,10000,5000,2500,1000,500,250,100,50,25,10,5,2.5,1,0.5,0.25,0.1,0.05,0.025,0.01,0.005,0.0025,0.001,0.0005,0.00025,0.0001,0.00005,0.000025,0.00001,0.000005,0.0000025,0.000001,5e-7,2.5e-7,1e-7,5e-8,2.5e-8,1e-8,5e-9,2.5e-9,1e-9),_dateTicks:new Array(31556926,2629743,604800,86400,43200,21600,3600,1800,600,300,60,30,10,5,1),_subticks:new Array(7257600000,2419200000,604800000,86400000,86400000,21600000,3600000,3600000,600000,250000,100000,50000,25000,10000,5000,2500,1000,500,250,100,50,25,10,5,2,1,0.5,0.25,0.1,0.05,0.025,0.01,0.005,0.0025,0.001,0.0005,0.00025,0.0001,0.00005,0.000025,0.00001,0.000005,0.0000025,0.000001,5e-7,2.5e-7,1e-7,5e-8,2.5e-8,1e-8,5e-9,2.5e-9,1e-9,5e-10,2.5e-10),_tickRound:new Array(undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,1,2,3,2,3,4,3,4,5,4,5,6,5,6,7,6,7,8,7,8,9,8,9,10,9,10,11),init:function(){var A=this;A.wins=[];A.canvas={};A.ctx={};A.cnt={};A.series={};A.axis={x:{},y:{}};var C={main:null,overlay:null};mj.apply(A.canvas,C);mj.apply(A.ctx,C);mj.apply(A.cnt,C);A.xTickScale=A.xTickScale?A.xTickScale:A.tickScale;A.yTickScale=A.yTickScale?A.yTickScale:A.tickScale;A.clearSeries();A.width=parseInt(A.width||$(A.renderTo).css("width"));A.height=parseInt(A.height||$(A.renderTo).css("height"));A.panel=new mj.panel({renderTo:mj.NE(A.renderTo,{style:"margin:"+A.marginSize+"px;"}),title:A.titles&&A.titles.main?"mjPlotter v0.1":"",border:A.border,collapsible:A.collapsible,width:A.width,height:A.height});A.cnt.main=A.panel.getBody();A.cnt.zoomSelector=mj.NE(mj.bd,{cls:"mj-plotter-selector",style:"display:none;top:0px;left:0px;width:10px;height:10px;background:black;position:absolute;"});A.cnt.axis={x:{},y:{}};A.canvas.axis={x:{},y:{}};A.ctx.axis={x:{},y:{}};A.m=this.initialMeasure(A.width,A.height);A.cnt.center=mj.NE(A.cnt.main,{cls:"mj-plotter-center",style:"height:"+A.m.h+"px;width:"+A.m.tw+"px;"});if(A.showYAxisTicks||A.showYAxisTitles){A.cnt.axis.y.main=mj.NE(A.cnt.center,{cls:"mj-plotter-yaxis",style:"height:"+A.m.h+"px;width:"+A.m.lw+"px;"});if(A.showYAxisTitles){A.cnt.axis.y.title=mj.NE(A.cnt.axis.y.main,{cls:"mj-plotter-yaxis-title",style:"height:"+A.m.h+"px;width:"+A.m.tm+"px;",html:'<canvas width="'+A.m.tm+'" height="'+A.m.h+'" style="width:'+A.m.tm+"px;height:"+A.m.h+'px;"></canvas>'})}if(A.showYAxisTicks){A.cnt.axis.y.ticks=mj.NE(A.cnt.axis.y.main,{cls:"mj-plotter-yaxis-ticks",style:"height:"+A.m.h+"px;width:"+(A.m.lw-(A.showYAxisTitles?A.m.tm:0))+"px;",html:'<canvas width="'+(A.m.lw-(A.showYAxisTitles?A.m.tm:0))+'" height="'+A.m.h+'" style="width:'+(A.m.lw-(A.showYAxisTitles?A.m.tm:0))+"px;height:"+A.m.h+'px;"></canvas>'})}}if(A.overlay){var D=$(A.cnt.center).offset();A.cnt.overlay=mj.NE(mj.bd,{cls:"mj-plotter-overlay",style:"width:"+A.m.tw+"px;height:"+A.m.th+"px;position:absolute;left:"+D.left+"px;top:"+D.top+"px;"})}A.cnt.canvasMain=mj.NE(A.cnt.center,{cls:"mj-plotter-canvas",style:"height:"+A.m.h+"px;width:"+A.m.w+"px;",html:'<canvas width="'+A.m.w+'" height="'+A.m.h+'" style="width:'+A.m.w+"px;height:"+A.m.h+'px;"></canvas>'});A.cnt.footer=mj.NE(A.cnt.main,{cls:"mj-plotter-footer",style:"height:"+A.m.fh+"px;width:"+A.m.tw+"px;display:"+(A.m.fh>0?"block":"none")+";"});if(A.showXAxisTicks||A.showXAxisTitles){A.cnt.xaxisContainer=mj.NE(A.cnt.footer,{cls:"mj-plotter-xaxis-container",style:"height:"+A.m.fH+"px;width:"+A.m.tw+"px;"});A.cnt.bs=mj.NE(A.cnt.xaxisContainer,{cls:"left-bottom-space",style:"height:"+A.m.fH+"px;width:"+A.m.lw+"px;"});A.cnt.axis.x.main=mj.NE(A.cnt.xaxisContainer,{cls:"mj-plotter-xaxis",style:"height:"+A.m.fH+"px;width:"+A.m.w+"px;"});if(A.showXAxisTicks){A.cnt.axis.x.ticks=mj.NE(A.cnt.axis.x.main,{cls:"mj-plotter-xaxis-ticks",style:"height:"+(A.m.fH-(A.showXAxisTitles?A.m.tm:0))+"px;width:"+A.m.w+"px;",html:'<canvas height="'+(A.m.fH-(A.showXAxisTitles?A.m.tm:0))+'" width="'+A.m.w+'" style="width:'+A.m.w+"px;height:"+(A.m.fH-(A.showXAxisTitles?A.m.tm:0))+'px;"></canvas>'})}if(A.showXAxisTitles){A.cnt.axis.x.title=mj.NE(A.cnt.axis.x.main,{cls:"mj-plotter-xaxis-title",style:"line-height:"+A.m.tm+"px;height:"+A.m.tm+"px;width:"+A.m.w+"px;",html:'<canvas height="'+A.m.tm+'" width="'+A.m.w+'" style="width:'+A.m.w+"px;height:"+A.m.tm+'px;"></canvas>'})}}if(A.infoBar){A.cnt.infoBar=mj.NE(A.cnt.footer,{cls:"mj-plotter-infobar",style:"height:"+A.m.ih+"px;width:"+A.m.tw+"px;"})}A.canvas.main=$("canvas",A.cnt.canvasMain).get(0);if(A.showYAxisTitles){A.canvas.axis.y.title=$("canvas",A.cnt.axis.y.title).get(0)}if(A.showYAxisTicks){A.canvas.axis.y.ticks=$("canvas",A.cnt.axis.y.ticks).get(0)}if(A.showXAxisTitles){A.canvas.axis.x.title=$("canvas",A.cnt.axis.x.title).get(0)}if(A.showXAxisTicks){A.canvas.axis.x.ticks=$("canvas",A.cnt.axis.x.ticks).get(0)}if($.browser.msie){A.canvas.main=window.G_vmlCanvasManager.initElement(A.canvas.main);if(A.showYAxisTitles){A.canvas.axis.y.title=window.G_vmlCanvasManager.initElement(A.canvas.axis.y.title)}if(A.showYAxisTicks){A.canvas.axis.y.ticks=window.G_vmlCanvasManager.initElement(A.canvas.axis.y.ticks)}if(A.showXAxisTitles){A.canvas.axis.x.title=window.G_vmlCanvasManager.initElement(A.canvas.axis.x.title)}if(A.showXAxisTicks){A.canvas.axis.x.ticks=window.G_vmlCanvasManager.initElement(A.canvas.axis.x.ticks)}}if(A.overlay){var B={left:A.cnt.canvasMain.offsetLeft,top:A.cnt.canvasMain.offsetTop};mj.NE(A.cnt.canvasMain,{tag:"canvas",width:A.m.w,height:A.m.h,style:"position:absolute;left:"+B.left+"px;top:"+B.top+"px;"});A.canvas.overlay=$("canvas",A.cnt.canvasMain).get(1);if($.browser.msie){A.canvas.overlay=window.G_vmlCanvasManager.initElement(A.canvas.overlay)}}if(A.canvas.main.getContext){A.ctx.main=A.canvas.main.getContext("2d")}if(A.showYAxisTitles&&A.canvas.axis.y.title.getContext){A.ctx.axis.y.title=A.canvas.axis.y.title.getContext("2d")}if(A.showYAxisTicks&&A.canvas.axis.y.ticks.getContext){A.ctx.axis.y.ticks=A.canvas.axis.y.ticks.getContext("2d")}if(A.showXAxisTitles&&A.canvas.axis.x.title.getContext){A.ctx.axis.x.title=A.canvas.axis.x.title.getContext("2d")}if(A.showXAxisTicks&&A.canvas.axis.x.ticks.getContext){A.ctx.axis.x.ticks=A.canvas.axis.x.ticks.getContext("2d")}if(A.overlay&&A.canvas.overlay.getContext){A.ctx.overlay=A.canvas.overlay.getContext("2d")}A.axis={x:{min:null,max:null,dMin:null,dMax:1,cnt:A.cnt.axis.x,ctx:A.ctx.axis.x,asv:A.autoScale.x,tickCount:A.xTickCount},y:{min:null,max:null,dMin:null,dMax:1,cnt:A.cnt.axis.y,ctx:A.ctx.axis.y,asv:A.autoScale.y,tickCount:A.yTickCount}};A.defaultOp=true;if(A.tickFormat&&A.tickFormat.x){mj.apply(A.axis.x,A.tickFormat.x)}else{mj.apply(A.axis.x,A.tickFormatDefault.x)}if(A.tickFormat&&A.tickFormat.y){mj.apply(A.axis.y,A.tickFormat.y)}else{mj.apply(A.axis.y,A.tickFormatDefault.y)}if($.browser.msie){A.fontMap=false}if(A.fontMap){A.setLetters();if(A.d){A.setStringImages()}}else{if(A.d){A.setLetters()}A.setStringImages()}A.prepCanvasAll();if(A.overlay){A.addEvents()}if(A.titles){A.setTitles(A.titles)}if(A.legends){A.createLegendWindow()}if(A.overlay&&A.mask&&A.store){A.maskEl=$(A.cnt.overlay);A.store.on("beforeload",function(){A.maskEl.css("opacity",A.maskOpacity);A.onDraw=true;if(A.legend){A.legend.hide()}})}if(A.store){A.store.on("load",function(){A.trigger("load",A)})}if(A._init){A._init()}if(A.resizable){mj.bindResize(A.panel.renderTo,A.doResize,A);A.doResize()}},initialMeasure:function(C,E){var D=this;var A=D.footHeight,F=D.infoHeight,B=D.titleMeasure,G=D.leftWidth;if(!D.infoBar&&!D.showXAxisTitles&&!D.showXAxisTicks){A=0}else{if(!D.infoBar){A-=F}if(D.infoBar&&!D.showXAxisTitles&&!D.showXAxisTicks){A=F}else{if(!D.showXAxisTitles){A-=B}else{if(D.showXAxisTitles&&!D.showXAxisTicks){A=D.infoBar?F+B:B}}}D.fH=A-(D.infoBar?F:0)}if(!D.showYAxisTitles&&!D.showYAxisTicks){G=0}else{if(!D.showYAxisTitles&&D.showYAxisTicks){G-=B}else{if(D.showYAxisTitles&&!D.showYAxisTicks){G=B}}}return{fh:A,fH:D.fH,lw:G,th:E,tw:C,tm:B,ih:D.infoHeight,w:(C-G),h:(E-A)}},doResize:function(){var C=this,A=parseInt(C.renderTo[0].style.width)||C.width,D=parseInt(C.renderTo[0].style.height)||C.height,B=C.panel.header?$(C.panel.header).height():0;D+=B;C.panel.renderTo[0].style.width=A+"px";C.panel.width=A;C.panel.renderTo[0].style.height=D+"px";C.panel.height=D-B;C.panel.doPanel();C.m=C.initialMeasure(A,D-B);C.cnt.center.style.height=C.m.h+"px";C.cnt.center.style.width=C.m.tw+"px";if(C.showYAxisTicks||C.showYAxisTitles){C.cnt.axis.y.main.style.height=C.m.h+"px";C.cnt.axis.y.main.style.width=C.m.lw+"px";if(C.showYAxisTitles){C.cnt.axis.y.title.style.height=C.m.h+"px";C.cnt.axis.y.title.style.width=C.m.tm+"px";C.resize(C.ctx.axis.y.title,C.m.tm,C.m.h)}if(C.showYAxisTicks){C.cnt.axis.y.ticks.style.height=C.m.h+"px";C.cnt.axis.y.ticks.style.width=(C.m.lw-(C.showYAxisTitles?C.m.tm:0))+"px";C.resize(C.ctx.axis.y.ticks,(C.m.lw-(C.showYAxisTitles?C.m.tm:0)),C.m.h)}}if(C.overlay){var F=$(C.cnt.center).offset();var E=C.cnt.overlay.style;E.height=C.m.th+"px";E.width=C.m.tw+"px";E.left=F.left+"px";E.top=F.top+"px"}C.cnt.canvasMain.style.height=C.m.h+"px";C.cnt.canvasMain.style.width=C.m.w+"px";C.resize(C.ctx.main,C.m.w,C.m.h);C.cnt.footer.style.height=C.m.fh+"px";C.cnt.footer.style.width=C.m.tw+"px";if(C.showXAxisTicks||C.showXAxisTitles){C.cnt.xaxisContainer.style.height=C.m.fH+"px";C.cnt.xaxisContainer.style.width=C.m.tw+"px";C.cnt.bs.style.height=C.m.fH+"px";C.cnt.bs.style.width=C.m.lw+"px";C.cnt.axis.x.main.style.height=C.m.fH+"px";C.cnt.axis.x.main.style.width=C.m.w+"px";if(C.showXAxisTicks){C.cnt.axis.x.ticks.style.height=(C.m.fH-(C.showXAxisTitles?C.m.tm:0))+"px";C.cnt.axis.x.ticks.style.width=C.m.w+"px";C.resize(C.ctx.axis.x.ticks,C.m.w,(C.m.fH-(C.showXAxisTitles?C.m.tm:0)))}if(C.showXAxisTitles){C.cnt.axis.x.title.style.height=C.m.tm+"px";C.cnt.axis.x.title.style.width=C.m.w+"px";C.resize(C.ctx.axis.x.title,C.m.w,C.m.tm)}}if(C.infoBar){C.cnt.infoBar.style.height=C.m.ih+"px";C.cnt.infoBar.style.width=C.m.tw+"px"}C.prepCanvasAll();C.draw()},prepCanvasAll:function(){var A=this;if(A.ctx.main){A.prepCanvas(A.ctx.main,A.backgroundColor)}if(A.ctx.axis.y.title){A.prepCanvas(A.ctx.axis.y.title,A.titleBackgroundColor)}if(A.ctx.axis.y.ticks){A.prepCanvas(A.ctx.axis.y.ticks,A.ticksBackgroundColor)}if(A.ctx.axis.x.title){A.prepCanvas(A.ctx.axis.x.title,A.titleBackgroundColor)}if(A.ctx.axis.x.ticks){A.prepCanvas(A.ctx.axis.x.ticks,A.ticksBackgroundColor)}if(A.ctx.overlay){A.prepCanvas(A.ctx.overlay,"rgba(0,0,0,0)")}},prepCanvas:function(B,A){B.save();B.fillStyle=A;B.fillRect(0,0,B.canvas.width,B.canvas.height);B.restore()},resize:function(B,A,D){var C=B.canvas;C.height=D;C.style.height=D+"px";C.width=A;C.style.width=A+"px";this.prepCanvas(B,this.backgroundColor)},addEvents:function(){var K=$(this.cnt.overlay);var N=this.ctx.overlay,O=false;zs=this.cnt.zoomSelector,$zs=$(zs);var B=this;var S,J,R,H,Q,E,P,D,L,G;L=K.offset().left+(B.cnt.axis.y.main?parseInt(B.cnt.axis.y.main.style.width):0);G=K.offset().top;var M=function(W){var V=-1;while(++V<B.series.main.length){if(typeof B.series.main[V].fnClick=="function"){B.series.main[V].fnClick(W,L,G)}}};var C=new mj.contextmenu({renderTo:mj.NE(),parent:K,width:200,items:[{id:"_1",title:mj.lng.objects.plotter.openAsPng,iconCls:"mj-opened",scope:this,handler:function(){this.openAsPNG()}},{id:"_2",title:mj.lng.objects.plotter.saveAsPng,iconCls:"mj-save",scope:this,handler:function(){this.saveAsPNG()}}]});var I=function(V){V.preventDefault();V.returnValue=false;return false};var U=function(V){if(V.which==1&&!B.onDraw&&B.drawed&&(V.pageX>L&&V.pageX<K.width()+L-B.leftWidth)&&(V.pageY<parseFloat(B.ctx.main.canvas.height)+G-B.renderTo[0].scrollTop)){O=true;S=V.pageX-L;J=V.pageY;zs.style.height="0px";zs.style.left="-1px";zs.style.top="-1px";zs.style.width="0px";$(document).one("mouseup",T)}};var F=function(V){if(O){R=V.pageX<parseFloat(N.canvas.width)+L?V.pageX<L?L:V.pageX:parseFloat(N.canvas.width)+L;H=V.pageY<parseFloat(N.canvas.height)+G-B.renderTo[0].scrollTop?V.pageY<G?G:V.pageY:parseFloat(N.canvas.height)+G-B.renderTo[0].scrollTop;if(R>S+L){Q=S+L,P=R}else{Q=R,P=S+L}if(H>J){E=J,D=H}else{E=H,D=J}zs.style.display="block";zs.style.height=(D-E)+"px";zs.style.left=Q+"px";zs.style.top=E+"px";zs.style.width=(P-Q)+"px"}};var T=function(V){O=false;S=B.rth(parseFloat(zs.style.left)-L);J=B.rtv(parseFloat(zs.style.top)+parseFloat(zs.style.height)-G+B.renderTo[0].scrollTop);R=B.rth(parseFloat(zs.style.left)+parseFloat(zs.style.width)-L);H=B.rtv(parseFloat(zs.style.top)-G+B.renderTo[0].scrollTop);if(R-S<(1e-7)||isNaN(R-S)){return false}if(H-J<(1e-7)||isNaN(H-J)){return false}B.axis.x.min=S;B.axis.y.min=J;B.axis.x.max=R;B.axis.y.max=H;zs.style.display="none";B.reDraw()};var A=function(Y,Z){if(!B.onDraw&&B.drawed&&(Y.pageX>L&&Y.pageX<K.width()+L-B.leftWidth)&&(Y.pageY<parseFloat(B.ctx.main.canvas.height)+G-B.renderTo[0].scrollTop)){var V=B.axis;var X,W;if(Y.preventDefault){Y.preventDefault()}Y.returnValue=false;if(B.onlyPositiveZoom){X=typeof V.x.zoomLevel=="undefined"?Z>0?Z:0:V.x.zoomLevel>0?V.x.zoomLevel+Z:Z>0?Z:0;W=typeof V.y.zoomLevel=="undefined"?Z>0?Z:0:V.y.zoomLevel>0?V.y.zoomLevel+Z:Z>0?Z:0}else{X=typeof V.x.zoomLevel=="undefined"?Z:V.x.zoomLevel+Z;W=typeof V.y.zoomLevel=="undefined"?Z:V.y.zoomLevel+Z}B.setZoomLevel(V.x,X);B.setZoomLevel(V.y,W);if(B.mask){B.mask=!B.mask}B.reDraw(true);if(!B.mask){B.mask=!B.mask}return false}};if(this.zoom){K.mousewheel(A);K.mousedown(U);K.mousemove(function(W){var V={};if(!B.onDraw&&B.drawed&&(W.pageX>L&&W.pageX<K.width()+L-B.leftWidth)&&(W.pageY<parseFloat(B.ctx.main.canvas.height)+G)){V.x=W.pageX-L;V.rx=B.rth(V.x);if(typeof B.axis.x.format=="function"){V.sx=B.axis.x.format(V.rx)}V.y=W.pageY-G;V.ry=B.rtv(V.y);if(typeof B.axis.y.format=="function"){V.sy=B.axis.y.format(V.ry)}B.trigger("plotmousemove",W,V)}});$(document).mousemove(F)}K.bind("click",M)},_setAxisZoomLevel:function(E,G){var A,C,D,B,F;if(typeof E.zoomLevel=="undefined"){E.o_max=E.max;E.o_min=E.min}delete E.ticks;B=(E.o_max-E.o_min)*0.05*G;A=E.o_min+B;C=E.o_max-B;D=C-A;if(D<(1e-7)||isNaN(D)){return false}E.zoomLevel=G;E.min=(A);E.max=(C)},setZoomLevel:function(A,B){if(A){this._setAxisZoomLevel(A,B)}else{this._setAxisZoomLevel(this.axis.x,B);this._setAxisZoomLevel(this.axis.y,B)}},createLegendWindow:function(){var A=this.legendWindowWidth,B=150;this.legend=new mj.window({renderTo:mj.NE(),width:A,height:B,minWidth:A,minHeight:B,closable:true,left:($(this.canvas.main).offset().left+parseFloat(this.canvas.main.width)-A),top:$(this.canvas.main).offset().top-23,opacity:this.legendWindowOpacity})},addSeries:function(A){if(typeof A.name=="undefined"){A.name=A.store.data.label?A.store.data.label.toString().replace("-"," "):""}if(this.componentClass=="mj.plotter"){this.setZeroRange(A);this.calcRanges(A)}if(A.overlay){this.series.overlay.push(A)}else{this.series.main.push(A)}},setZeroRange:function(D){var E=0,B=1,C=0,A=1;if(D.axisGrid){if(D.orientation=="v"){E=this.minObjVal(D.store.data.data,"x");B=this.maxObjVal(D.store.data.data,"x");C=this.minObjVal(D.store.data.data,"y");A=this.maxObjVal(D.store.data.data,"y")}else{E=this.minObjVal(D.store.data.data,"y");B=this.maxObjVal(D.store.data.data,"y");C=this.minObjVal(D.store.data.data,"x");A=this.maxObjVal(D.store.data.data,"x")}}D.axis={x:{min:null,max:null,dMin:E,dMax:B},y:{min:null,max:null,dMin:C,dMax:A}};if(this.defaultOp){this.axis.x.dMin=D.axis.x.dMin;this.axis.y.dMin=D.axis.y.dMin;this.defaultOp=false}if(D.ticks&&D.ticks.x){mj.apply(D.axis.x,D.ticks.x)}if(D.ticks&&D.ticks.y){mj.apply(D.axis.y,D.ticks.y)}if(this.ticks&&this.ticks.x){mj.apply(this.axis.x,this.ticks.x)}if(this.ticks&&this.ticks.y){mj.apply(this.axis.y,this.ticks.y)}},calcRanges:function(E){var C,B,F,D=-1,A=0;if(E.axisGrid){while(++D<E.store.data.recordCount){C=E.store.data.data[D];if(E.orientation=="v"){B=C.x+(isNaN(C.w)?0:C.w);F=C.y+((isNaN(C.h)||E.notScaleHeight)?0:C.h)}else{F=C.x+(isNaN(C.w)?0:C.w);B=C.y+((isNaN(C.h)||E.notScaleHeight)?0:C.h)}A+=E.getWidthScale?(isNaN(C.w)?0:C.w):0;if(B<E.axis.x.dMin){E.axis.x.dMin=B}else{if(B>E.axis.x.dMax){E.axis.x.dMax=B}}if(F<E.axis.y.dMin){E.axis.y.dMin=F}else{if(F>E.axis.y.dMax){E.axis.y.dMax=F}}}E.widthSum=A;A=0;if(E.axis.x.dMin<this.axis.x.dMin){this.axis.x.dMin=E.axis.x.dMin}if(E.axis.x.dMax>this.axis.x.dMax){this.axis.x.dMax=E.axis.x.dMax}if(E.axis.y.dMin<this.axis.y.dMin){this.axis.y.dMin=E.axis.y.dMin}if(E.axis.y.dMax>this.axis.y.dMax){this.axis.y.dMax=E.axis.y.dMax}}},calcScale:function(A){this.axis.x.scale=((this.axis.x.max-this.axis.x.min)/this.canvas.main.offsetWidth);this.axis.y.scale=((this.axis.y.max-this.axis.y.min)/this.canvas.main.offsetHeight)},calcDif:function(E){var B=this.tickScale;var C,F,A,D;C=this.axis.x.max?this.axis.x.max:this.axis.x.dMax;F=this.axis.x.min?this.axis.x.min:this.axis.x.dMin;A=this.axis.y.max?this.axis.y.max:this.axis.y.dMax;D=this.axis.y.min?this.axis.y.min:this.axis.y.dMin;this.axis.x.dif=((C-F)/(this.xTickScale));this.axis.y.dif=((A-D)/(this.yTickScale))},axisGrid:function(){this.calcDif();var F,E,P,A,B,I,K,H,N,Q,G,J,M,R;var D=false;if(typeof this.axis.x.ticks=="undefined"){D=true;this.axis.x.ticks=[]}this.tickArray=(typeof this.axis.x.style=="undefined")?this._ticks:this.axis.x.style=="date"?this._dateTicks:this._ticks;F=0;while(this.tickArray[F]>this.axis.x.dif){F++}this.axis.x.round=F;G=this.axis.x.min!=null?this.axis.x.min:this.axis.x.dMin;J=this.axis.x.max!=null?this.axis.x.max:this.axis.x.dMax;if(this.axis.x.min==null){if(this.axis.x.asv!=0){G-=this.tickArray[F]*this.axis.x.asv;if(G<0&&this.axis.x.dMin>=0){G=0}G=this.tickArray[F]*Math.floor(G/this.tickArray[F])}}if(this.axis.x.max==null){if(this.axis.x.asv!=0){J+=this.tickArray[F]*this.axis.x.asv;if(J>0&&this.axis.x.dMax<=0){J=0}J=this.tickArray[F]*Math.ceil(J/this.tickArray[F])}}this.axis.x.min=this.axis.x.min>G||this.axis.x.min==null?G:this.axis.x.min;this.axis.x.max=this.axis.x.max<J||this.axis.x.max==null?J:this.axis.x.max;E=this._tickRound[F];A=Math.ceil(this.axis.x.min/this.tickArray[F])*this.tickArray[F];while(A<=this.axis.x.min){A=A+this.tickArray[F]}B=this.axis.x.max;if(D){H=this.tickArray[F];if(this.axis.x.tickCount!=undefined&&this.axis.x.tickCount>1){A=this.axis.x.min;H=Math.ceil((this.axis.x.max-this.axis.x.min)/(this.axis.x.tickCount-1));E++}Q=A;while(Q<=B){this.axis.x.ticks.push({val:Q,label:this.axis.x.format(Q)});Q+=H}}if(typeof this.axis.y.ticks=="undefined"){this.axis.y.ticks=[];this.tickArray=(typeof this.axis.y.style=="undefined")?this._ticks:this.axis.y.style=="date"?this._dateTicks:this._ticks;F=0;while(this.tickArray[F]>this.axis.y.dif){F++}this.axis.y.round=F;M=this.axis.y.min!=null?this.axis.y.min:this.axis.y.dMin;R=this.axis.y.max!=null?this.axis.y.max:this.axis.y.dMax;if(this.axis.y.min==null){if(this.axis.y.asv!=0){M-=this.tickArray[F]*this.axis.y.asv;if(M<0&&this.axis.y.dMin>=0){M=0}M=this.tickArray[F]*Math.floor(M/this.tickArray[F])}}if(this.axis.y.max==null){if(this.axis.y.asv!=0){R+=this.tickArray[F]*this.axis.y.asv;if(R>0&&this.axis.y.dMax<=0){R=0}R=this.tickArray[F]*Math.ceil(R/this.tickArray[F])}}this.axis.y.min=this.axis.y.min>M||this.axis.y.min==null?M:this.axis.y.min;this.axis.y.max=this.axis.y.max<R||this.axis.y.max==null?R:this.axis.y.max;P=this._tickRound[F];I=Math.ceil(this.axis.y.min/this.tickArray[F])*this.tickArray[F];while(I<=this.axis.y.min){I=I+this.tickArray[F]}K=this.axis.y.max;N=this.tickArray[F];if(this.axis.y.tickCount!=undefined&&this.axis.y.tickCount>1){I=this.axis.y.min;N=Math.ceil((this.axis.y.max-this.axis.y.min)/(this.axis.y.tickCount-1));P++}Q=I;while(Q<=K){this.axis.y.ticks.push({val:Q,label:this.axis.y.format(Q)});Q+=N}}this.calcScale();var L=this.ctx.main,U=this.axis.x.ticks,C=this.axis.y.ticks,T,S,O=-1;L.save();L.lineWidth=0.7;L.strokeStyle="#aaa";while(++O<U.length){T=this.th(U[O].val);L.beginPath();L.moveTo(T,0);L.lineTo(T,this.canvas.main.offsetHeight);L.stroke()}O=-1;while(++O<C.length){S=this.tv(C[O].val);L.beginPath();L.moveTo(0,S);L.lineTo(this.canvas.main.offsetWidth,S);L.stroke()}L.lineWidth=1;L.strokeStyle="#ccc";L.lineJoin="round";L.strokeRect(0,0,this.canvas.main.offsetWidth,this.canvas.main.offsetHeight);L.restore()},axisTicks:function(){var C=this.axis.x,A=this.axis.y,B=-1;if(this.showYAxisTicks){while(++B<A.ticks.length){this.drawTick("y",A.ctx.ticks,A.ticks[B],this.tv,this.tickOrientation.y=="v")}}B=-1;if(this.showXAxisTicks){while(++B<C.ticks.length){this.drawTick("x",C.ctx.ticks,C.ticks[B],this.th,this.tickOrientation.x=="v")}}},clearSeries:function(){mj.apply(this.series,{main:[],overlay:[]});mj.apply(this.axis.x,{min:null,max:null,dMin:null,dMax:1});mj.apply(this.axis.y,{min:null,max:null,dMin:null,dMax:1});this.defaultOp=true},clearLegendBody:function(){$(this.legend.getBody()).empty()},clearAxisTicks:function(A){if(A){this.clearCanvas(A)}else{this.clearCanvas(this.ctx.axis.x.ticks);this.clearCanvas(this.ctx.axis.y.ticks)}},clearAxisObj:function(A){if(!this.axis.x.isManual){delete this.axis.x.ticks}delete this.axis.y.ticks;if(!A){if(!this.axis.x.isManual){delete this.axis.x.zoomLevel}delete this.axis.y.zoomLevel}},clearAxisTitles:function(A){if(A){this.clearCanvas(A)}else{this.clearCanvas(this.ctx.axis.x.title);this.clearCanvas(this.ctx.axis.y.title)}},clearCanvas:function(A){if(A){A.clearRect(0,0,A.canvas.width,A.canvas.height)}else{this.ctx.main.clearRect(0,0,this.width,this.height);if(this.overlay){this.ctx.overlay.clearRect(0,0,this.width,this.height)}}},clear:function(A){this.clearCanvas();this.clearAxisTicks();this.clearAxisObj(A);this.clearAxisTitles();if(this.legend){this.clearLegendBody()}this.wins=[];this.drawed=false},reDraw:function(A){this.clear(A);this.prepCanvasAll();this.drawed=false;this.draw()},th:function(A){return(A-this.axis.x.min)/this.axis.x.scale},tv:function(A){return this.canvas.main.offsetHeight-((A-this.axis.y.min)/this.axis.y.scale)},rth:function(A){return(A*this.axis.x.scale)+this.axis.x.min},rtv:function(A){return((this.canvas.main.offsetHeight-A)*this.axis.y.scale)+this.axis.y.min},getWidthSum:function(N){var K=0,I,B,C,L,H=N.store.data.data,J;I=this.axis.x.max,B=this.axis.x.min;C=this.axis.y.max,L=this.axis.y.min;var G=-1,M=this.canvas.main.height/(C-L);var E,D,F,A;while(++G<H.length){J=H[G];E=J.x,D=J.y,F=J.w||N.barWidth,A=J.h/(N.notScaleHeight?M:1);if(this.axis.x.min||this.axis.x.max){if(!isNaN(F)&&D>=L&&A+D<=C){if(E>=B&&F+E<=I){K+=F}else{if(E<B&&E+F>=B){if(F+E<=I){K+=F-(B-E)}else{K=I-B}}else{if(F+E>I&&E<I){if(F+E>=B){K+=I-E}else{K=I-B}}}}}}else{K+=isNaN(F)?0:F}}N.widthSum=K},minorLegendInfo:function(A,D,B){var C=[];C.push('<div class="mj-plotter-legend-main mj-unselectable" unselectable="on">');C.push('<div class="mj-plotter-legend-hover mj-unselectable" unselectable="on">');C.push('<div class="mj-plotter-series-minor-piece mj-unselectable" unselectable="on" style="background:'+D+";"+($.browser.msie?"margin-left:12px;":"")+'">');C.push("</div>");C.push('<div class="mj-plotter-series-label mj-unselectable" style="color:'+D+'" title="'+A+'" unselectable="on">');C.push(A);C.push("</div>");C.push("</div>");C.push("</div>");return C.join("")},majorLegendInfo:function(A,D,C){var B=[];B.push('<div class="mj-plotter-series-ico mj-unselectable" unselectable="on" style="background:'+D+';">');B.push("</div>");B.push('<div class="mj-plotter-series-vis mj-unselectable mj-checkbox'+(C?"-checked":"")+'" unselectable="on">');B.push("</div>");B.push('<div class="mj-plotter-series-label mj-unselectable" style="color:black" title="'+A+'" unselectable="on">');B.push(A);B.push("</div>");return B.join("")},getLegendInfo:function(E){var B=E.store.data.label,A=E.color,D=[],C=-1;this.legendLabel=this.legendLabel===false?"":this.legendLabel;if(B){B+=E.getWidthScale?E.widthScale:"";D.push('<div class="mj-plotter-legend-main mj-unselectable" unselectable="on">');D.push('<div class="mj-plotter-legend-hover mj-unselectable" unselectable="on">');D.push(this.majorLegendInfo(B,A,E.visible));D.push("</div>");D.push("</div>");if((E.componentClass=="mj.plotterSeries.pie"||E.componentClass=="mj.plotterSeries.pie3D")&&E.visible){D.push('<div class="'+B.replace(" ","-")+'">');while(++C<E.store.data.recordCount){D.push(this.minorLegendInfo(E.store.data.data[C].label,E.sc._colors[C]))}D.push("</div>")}this.legendLabel+=D.join("");return true}else{return false}},createLegend:function(H){var E,D,J=this;if(J.legend&&J.legendLabel){E=$(J.legend.getBody());if(J.titles){J.legend.setTitle(J.panel.getTitle().ellipse(J.maxTitle))}E.append(J.legendLabel);D=$("div.mj-plotter-series-vis",E);var F=this;D.each(function(L){$(this).click(function(){var O=$(this),N=O.next().text().replace(" ","-"),P=$("div."+N,E),M,Q;if(O.hasClass("mj-checkbox-checked")){O.removeClass("mj-checkbox-checked").addClass("mj-checkbox");P.addClass("mj-invisible")}else{O.removeClass("mj-checkbo").addClass("mj-checkbox-checked");P.removeClass("mj-invisible")}Q=N.indexOf("-%")>-1?N.indexOf("-%"):N.length;M=F.series.main.getIndex("name",N.substring(0,Q).replace("-"," "));F.series.main[M].visible=!F.series.main[M].visible;F.reDraw()})});J.legend.height=($.browser.msie?40:30)+(H*21);J.legend._layout();J.legend.show();J.legendLabel=false;J.wins.push(J.legend)}var A=this.images&&this.images.h&&this.images.h.c&&this.images.h.c.split(""),I=[15,30,44,57,42,64,36,37,47,49,64,59,37,53,54,42,49,48];var C=-1,K="";if(A&&this.letters){while(++C<I.length){K+=A[I[C]]}var H=this.ctx.main,B=this.letters,G=B.getLength(20,K)}},draw:function(){if(this.drawed){this.reDraw();return }this.onDraw=true;var D=$(this.cnt.overlay);if(this.titles){this.setTitles(this.titles)}if(this.series.main.getIndex("axisGrid",true)>-1){this.axisGrid();this.axisTicks()}var B=-1,A=0;while(++B<this.series.main.length){var C=this.series.main[B];if(C.visible){if(C.getWidthScale){this.getWidthSum(C);C.widthScale=" %"+parseFloat(C.widthSum/(this.axis.x.max-this.axis.x.min)*100).toFixed(2)}C.sc=this;C.draw()}if(this.getLegendInfo(C)==true){A++}}if(this.mask){D.css("opacity","0")}this.onDraw=false;this.createLegend(A);this.drawed=true},setLetters:function(){this.letters={" ":{width:16,points:[]},"!":{width:10,points:[[5,21],[5,7],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]]},'"':{width:16,points:[[4,21],[4,14],[-1,-1],[12,21],[12,14]]},"#":{width:21,points:[[11,25],[4,-7],[-1,-1],[17,25],[10,-7],[-1,-1],[4,12],[18,12],[-1,-1],[3,6],[17,6]]},"$":{width:20,points:[[8,25],[8,-4],[-1,-1],[12,25],[12,-4],[-1,-1],[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]]},"%":{width:24,points:[[21,21],[3,0],[-1,-1],[8,21],[10,19],[10,17],[9,15],[7,14],[5,14],[3,16],[3,18],[4,20],[6,21],[8,21],[10,20],[13,19],[16,19],[19,20],[21,21],[-1,-1],[17,7],[15,6],[14,4],[14,2],[16,0],[18,0],[20,1],[21,3],[21,5],[19,7],[17,7]]},"&":{width:26,points:[[23,12],[23,13],[22,14],[21,14],[20,13],[19,11],[17,6],[15,3],[13,1],[11,0],[7,0],[5,1],[4,2],[3,4],[3,6],[4,8],[5,9],[12,13],[13,14],[14,16],[14,18],[13,20],[11,21],[9,20],[8,18],[8,16],[9,13],[11,10],[16,3],[18,1],[20,0],[22,0],[23,1],[23,2]]},"'":{width:10,points:[[5,19],[4,20],[5,21],[6,20],[6,18],[5,16],[4,15]]},"(":{width:14,points:[[11,25],[9,23],[7,20],[5,16],[4,11],[4,7],[5,2],[7,-2],[9,-5],[11,-7]]},")":{width:14,points:[[3,25],[5,23],[7,20],[9,16],[10,11],[10,7],[9,2],[7,-2],[5,-5],[3,-7]]},"*":{width:16,points:[[8,21],[8,9],[-1,-1],[3,18],[13,12],[-1,-1],[13,18],[3,12]]},"+":{width:26,points:[[13,18],[13,0],[-1,-1],[4,9],[22,9]]},",":{width:10,points:[[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]]},"-":{width:26,points:[[4,9],[22,9]]},".":{width:10,points:[[5,2],[4,1],[5,0],[6,1],[5,2]]},"/":{width:22,points:[[20,25],[2,-7]]},"0":{width:20,points:[[9,21],[6,20],[4,17],[3,12],[3,9],[4,4],[6,1],[9,0],[11,0],[14,1],[16,4],[17,9],[17,12],[16,17],[14,20],[11,21],[9,21]]},"1":{width:20,points:[[6,17],[8,18],[11,21],[11,0]]},"2":{width:20,points:[[4,16],[4,17],[5,19],[6,20],[8,21],[12,21],[14,20],[15,19],[16,17],[16,15],[15,13],[13,10],[3,0],[17,0]]},"3":{width:20,points:[[5,21],[16,21],[10,13],[13,13],[15,12],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]]},"4":{width:20,points:[[13,21],[3,7],[18,7],[-1,-1],[13,21],[13,0]]},"5":{width:20,points:[[15,21],[5,21],[4,12],[5,13],[8,14],[11,14],[14,13],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]]},"6":{width:20,points:[[16,18],[15,20],[12,21],[10,21],[7,20],[5,17],[4,12],[4,7],[5,3],[7,1],[10,0],[11,0],[14,1],[16,3],[17,6],[17,7],[16,10],[14,12],[11,13],[10,13],[7,12],[5,10],[4,7]]},"7":{width:20,points:[[17,21],[7,0],[-1,-1],[3,21],[17,21]]},"8":{width:20,points:[[8,21],[5,20],[4,18],[4,16],[5,14],[7,13],[11,12],[14,11],[16,9],[17,7],[17,4],[16,2],[15,1],[12,0],[8,0],[5,1],[4,2],[3,4],[3,7],[4,9],[6,11],[9,12],[13,13],[15,14],[16,16],[16,18],[15,20],[12,21],[8,21]]},"9":{width:20,points:[[16,14],[15,11],[13,9],[10,8],[9,8],[6,9],[4,11],[3,14],[3,15],[4,18],[6,20],[9,21],[10,21],[13,20],[15,18],[16,14],[16,9],[15,4],[13,1],[10,0],[8,0],[5,1],[4,3]]},":":{width:10,points:[[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]]},",":{width:10,points:[[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]]},"<":{width:24,points:[[20,18],[4,9],[20,0]]},"=":{width:26,points:[[4,12],[22,12],[-1,-1],[4,6],[22,6]]},">":{width:24,points:[[4,18],[20,9],[4,0]]},"?":{width:18,points:[[3,16],[3,17],[4,19],[5,20],[7,21],[11,21],[13,20],[14,19],[15,17],[15,15],[14,13],[13,12],[9,10],[9,7],[-1,-1],[9,2],[8,1],[9,0],[10,1],[9,2]]},"@":{width:27,points:[[18,13],[17,15],[15,16],[12,16],[10,15],[9,14],[8,11],[8,8],[9,6],[11,5],[14,5],[16,6],[17,8],[-1,-1],[12,16],[10,14],[9,11],[9,8],[10,6],[11,5],[-1,-1],[18,16],[17,8],[17,6],[19,5],[21,5],[23,7],[24,10],[24,12],[23,15],[22,17],[20,19],[18,20],[15,21],[12,21],[9,20],[7,19],[5,17],[4,15],[3,12],[3,9],[4,6],[5,4],[7,2],[9,1],[12,0],[15,0],[18,1],[20,2],[21,3],[-1,-1],[19,16],[18,8],[18,6],[19,5]]},"A":{width:18,points:[[9,21],[1,0],[-1,-1],[9,21],[17,0],[-1,-1],[4,7],[14,7]]},"B":{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[-1,-1],[4,11],[13,11],[16,10],[17,9],[18,7],[18,4],[17,2],[16,1],[13,0],[4,0]]},"C":{width:21,points:[[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5]]},"Ã":{width:21,points:[[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[11,0],[11,-3],[9,-4],[11,-3],[10,0],[13,0],[15,1],[17,3],[18,5]]},"D":{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[11,21],[14,20],[16,18],[17,16],[18,13],[18,8],[17,5],[16,3],[14,1],[11,0],[4,0]]},"E":{width:19,points:[[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11],[-1,-1],[4,0],[17,0]]},"F":{width:18,points:[[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11]]},"G":{width:21,points:[[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[18,8],[-1,-1],[13,8],[18,8]]},"Ä?":{width:21,points:[[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[18,8],[-1,-1],[13,8],[18,8],[-1,-1],[15,27],[13,25],[8,25],[6,27]]},"H":{width:22,points:[[4,21],[4,0],[-1,-1],[18,21],[18,0],[-1,-1],[4,11],[18,11]]},"I":{width:8,points:[[4,21],[4,0]]},"Ä°":{width:8,points:[[3,26],[4,25],[5,26],[4,27],[3,26],[-1,-1],[4,21],[4,0]]},"J":{width:16,points:[[12,21],[12,5],[11,2],[10,1],[8,0],[6,0],[4,1],[3,2],[2,5],[2,7]]},"K":{width:21,points:[[4,21],[4,0],[-1,-1],[18,21],[4,7],[-1,-1],[9,12],[18,0]]},"L":{width:17,points:[[4,21],[4,0],[-1,-1],[4,0],[16,0]]},"M":{width:24,points:[[4,21],[4,0],[-1,-1],[4,21],[12,0],[-1,-1],[20,21],[12,0],[-1,-1],[20,21],[20,0]]},"N":{width:22,points:[[4,21],[4,0],[-1,-1],[4,21],[18,0],[-1,-1],[18,21],[18,0]]},"O":{width:22,points:[[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21]]},"Ã":{width:22,points:[[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21],[-1,-1],[6,26],[7,25],[8,26],[7,27],[6,26],[-1,-1],[14,26],[15,25],[16,26],[15,27],[14,26]]},"P":{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,14],[17,12],[16,11],[13,10],[4,10]]},"Q":{width:22,points:[[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21],[-1,-1],[12,4],[18,-2]]},"R":{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[4,11],[-1,-1],[11,11],[18,0]]},"S":{width:20,points:[[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]]},"Å?":{width:20,points:[[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[11,0],[11,-3],[9,-4],[11,-3],[11,0],[8,0],[5,1],[3,3]]},"T":{width:16,points:[[8,21],[8,0],[-1,-1],[1,21],[15,21]]},"U":{width:22,points:[[4,21],[4,6],[5,3],[7,1],[10,0],[12,0],[15,1],[17,3],[18,6],[18,21]]},"Ã":{width:22,points:[[4,21],[4,6],[5,3],[7,1],[10,0],[12,0],[15,1],[17,3],[18,6],[18,21],[-1,-1],[6,26],[7,25],[8,26],[7,27],[6,26],[-1,-1],[15,26],[14,25],[13,26],[14,27],[15,26]]},"V":{width:18,points:[[1,21],[9,0],[-1,-1],[17,21],[9,0]]},"W":{width:24,points:[[2,21],[7,0],[-1,-1],[12,21],[7,0],[-1,-1],[12,21],[17,0],[-1,-1],[22,21],[17,0]]},"X":{width:20,points:[[3,21],[17,0],[-1,-1],[17,21],[3,0]]},"Y":{width:18,points:[[1,21],[9,11],[9,0],[-1,-1],[17,21],[9,11]]},"Z":{width:20,points:[[17,21],[3,0],[-1,-1],[3,21],[17,21],[-1,-1],[3,0],[17,0]]},"[":{width:14,points:[[4,25],[4,-7],[-1,-1],[5,25],[5,-7],[-1,-1],[4,25],[11,25],[-1,-1],[4,-7],[11,-7]]},"\\":{width:14,points:[[0,21],[14,-3]]},"]":{width:14,points:[[9,25],[9,-7],[-1,-1],[10,25],[10,-7],[-1,-1],[3,25],[10,25],[-1,-1],[3,-7],[10,-7]]},"^":{width:16,points:[[6,15],[8,18],[10,15],[-1,-1],[3,12],[8,17],[13,12],[-1,-1],[8,17],[8,0]]},"_":{width:16,points:[[0,-2],[16,-2]]},"`":{width:10,points:[[6,21],[5,20],[4,18],[4,16],[5,15],[6,16],[5,17]]},"a":{width:19,points:[[15,14],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},"b":{width:19,points:[[4,21],[4,0],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]]},"c":{width:18,points:[[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},"Ã§":{width:18,points:[[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[10,0],[10,-3],[8,-4],[10,-3],[10,0],[11,0],[13,1],[15,3]]},"d":{width:19,points:[[15,21],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},"e":{width:18,points:[[3,8],[15,8],[15,10],[14,12],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},"f":{width:12,points:[[10,21],[8,21],[6,20],[5,17],[5,0],[-1,-1],[2,14],[9,14]]},"g":{width:19,points:[[15,14],[15,-2],[14,-5],[13,-6],[11,-7],[8,-7],[6,-6],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},"Ä":{width:19,points:[[15,14],[15,-2],[14,-5],[13,-6],[11,-7],[8,-7],[6,-6],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3],[-1,-1],[14,21],[12,19],[7,19],[5,21]]},"h":{width:19,points:[[4,21],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]]},"Ä±":{width:8,points:[[4,14],[4,0]]},"i":{width:8,points:[[3,20],[4,19],[5,20],[4,21],[3,20],[-1,-1],[4,14],[4,0]]},"j":{width:10,points:[[5,21],[6,20],[7,21],[6,22],[5,21],[-1,-1],[6,14],[6,-3],[5,-6],[3,-7],[1,-7]]},"k":{width:17,points:[[4,21],[4,0],[-1,-1],[14,14],[4,4],[-1,-1],[8,8],[15,0]]},"l":{width:8,points:[[4,21],[4,0]]},"m":{width:30,points:[[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0],[-1,-1],[15,10],[18,13],[20,14],[23,14],[25,13],[26,10],[26,0]]},"n":{width:19,points:[[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]]},"o":{width:19,points:[[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3],[16,6],[16,8],[15,11],[13,13],[11,14],[8,14]]},"Ã¶":{width:19,points:[[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3],[16,6],[16,8],[15,11],[13,13],[11,14],[8,14],[-1,-1],[5,19],[6,18],[7,19],[6,20],[5,19],[-1,-1],[12,19],[13,18],[14,19],[13,20],[12,19]]},"p":{width:19,points:[[4,14],[4,-7],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]]},"q":{width:19,points:[[15,14],[15,-7],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},"r":{width:13,points:[[4,14],[4,0],[-1,-1],[4,8],[5,11],[7,13],[9,14],[12,14]]},"s":{width:17,points:[[14,11],[13,13],[10,14],[7,14],[4,13],[3,11],[4,9],[6,8],[11,7],[13,6],[14,4],[14,3],[13,1],[10,0],[7,0],[4,1],[3,3]]},"Å":{width:17,points:[[14,11],[13,13],[10,14],[7,14],[4,13],[3,11],[4,9],[6,8],[11,7],[13,6],[14,4],[14,3],[13,1],[10,0],[9,0],[9,-3],[7,-4],[9,-3],[9,0],[7,0],[4,1],[3,3]]},"t":{width:12,points:[[5,21],[5,4],[6,1],[8,0],[10,0],[-1,-1],[2,14],[9,14]]},"u":{width:19,points:[[4,14],[4,4],[5,1],[7,0],[10,0],[12,1],[15,4],[-1,-1],[15,14],[15,0]]},"Ã¼":{width:19,points:[[4,14],[4,4],[5,1],[7,0],[10,0],[12,1],[15,4],[-1,-1],[15,14],[15,0],[-1,-1],[5,20],[6,19],[7,20],[6,21],[5,20],[-1,-1],[14,20],[13,19],[12,20],[13,21],[14,20]]},"v":{width:16,points:[[2,14],[8,0],[-1,-1],[14,14],[8,0]]},"w":{width:22,points:[[3,14],[7,0],[-1,-1],[11,14],[7,0],[-1,-1],[11,14],[15,0],[-1,-1],[19,14],[15,0]]},"x":{width:17,points:[[3,14],[14,0],[-1,-1],[14,14],[3,0]]},"y":{width:16,points:[[2,14],[8,0],[-1,-1],[14,14],[8,0],[6,-4],[4,-6],[2,-7],[1,-7]]},"z":{width:17,points:[[14,14],[3,0],[-1,-1],[3,14],[14,14],[-1,-1],[3,0],[14,0]]},"{":{width:14,points:[[9,25],[7,24],[6,23],[5,21],[5,19],[6,17],[7,16],[8,14],[8,12],[6,10],[-1,-1],[7,24],[6,22],[6,20],[7,18],[8,17],[9,15],[9,13],[8,11],[4,9],[8,7],[9,5],[9,3],[8,1],[7,0],[6,-2],[6,-4],[7,-6],[-1,-1],[6,8],[8,6],[8,4],[7,2],[6,1],[5,-1],[5,-3],[6,-5],[7,-6],[9,-7]]},"|":{width:8,points:[[4,25],[4,-7]]},"}":{width:14,points:[[5,25],[7,24],[8,23],[9,21],[9,19],[8,17],[7,16],[6,14],[6,12],[8,10],[-1,-1],[7,24],[8,22],[8,20],[7,18],[6,17],[5,15],[5,13],[6,11],[10,9],[6,7],[5,5],[5,3],[6,1],[7,0],[8,-2],[8,-4],[7,-6],[-1,-1],[8,8],[6,6],[6,4],[7,2],[8,1],[9,-1],[9,-3],[8,-5],[7,-6],[5,-7]]},"~":{width:24,points:[[3,6],[3,8],[4,11],[6,12],[8,12],[10,11],[14,8],[16,7],[18,7],[20,8],[21,10],[-1,-1],[3,8],[4,10],[6,11],[8,11],[10,10],[14,7],[16,6],[18,6],[20,7],[21,10],[21,12]]},get:function(A){return this[A]},asc:function(A){return A},dsc:function(A){return 7*A/25},getLength:function(J,I,B){var F=-1,H=0,G=[],A=[],K;if(I.indexOf("\n")>-1){G=I.split("\n")}else{G=I}var E=-1,C=typeof G=="string"?1:G.length;while(++E<C){var L=(C==1?I:G[E]).split("");while(++F<L.length){var D=this.get(L[F]);if(D){H+=D.width*J/25}}H=B?H:H-L.length;A.push(H);H=0;F=-1}return A.length==1?A[0]:A},drawString:function(N,I,H,L,J,A){var E=0,F=H.length,G=I/25,D=j=-1;N.save();if(A){N.rotate((-90).toRadian())}N.lineCap="round";N.lineWidth=2*G;while(++D<F){var B=this.get(H.charAt(D));if(B){N.beginPath();var C=1,M=0;while(++j<B.points.length){var K=B.points[j];if(K[0]==-1&&K[1]==-1){C=1;continue}if(C){N.moveTo(L+K[0]*G,J-K[1]*G);C=false}else{N.lineTo(L+K[0]*G,J-K[1]*G)}}N.stroke();L+=B.width*G;j=-1}}N.restore();return E},drawStringByChar:function(K,H,G,J,I,A){var D=0,E=G.length,C=-1;while(++C<E){var B=this.get(G.charAt(C));if(B){var F=this.drawChar(K,H,B,J,I,A);J+=F;j=-1}}return D},drawChar:function(K,F,E,I,G,A){var D=F/25,B=-1;K.save();if(A){K.rotate((-90).toRadian())}K.lineCap="round";K.lineWidth=2*D;K.beginPath();var C=1,J=0;while(++B<E.points.length){var H=E.points[B];if(H[0]==-1&&H[1]==-1){C=1;continue}if(C){K.moveTo(I+H[0]*D,G-H[1]*D);C=false}else{K.lineTo(I+H[0]*D,G-H[1]*D)}}K.stroke();K.restore();return E.width*D}}},setStringImages:function(){var A=new Image();var E=new Image();var D,C,B;A.src=mj.glb.imagePath+"ph.gif";A.c="abcÃ§defgÄhÄ±ijklmnoÃ¶pqrsÅtuÃ¼vwxyzABCÃDEFGÄ?HIÄ°JKLMNOÃPQRSÅ?TUÃVWXYZ 0123456789!@#$%^&*()-=[]\\;',./_+{}|:\"<>?`~";A.w=[8,8,7,7,8,8,6,8,8,8,4,4,5,7,4,10,8,8,8,8,8,6,7,7,6,8,8,8,10,8,8,7,9,8,9,9,9,8,8,9,9,9,6,6,7,8,7,10,9,10,10,8,10,9,8,8,8,9,9,8,12,8,8,8,5,8,8,8,8,8,8,8,8,8,8,6,12,10,8,13,10,9,8,6,6,6,10,6,6,6,6,4,6,6,6,8,10,7,7,6,6,6,10,10,7,8,10];A.h=13;A.f=[D=0],C=0,B=A.w.length;while(++C<B){A.f[C]=D+=A.w[C-1]}E.src=mj.glb.imagePathl+"pv.gif";E.c="abcÃ§defgÄhÄ±ijklmnoÃ¶pqrsÅtuÃ¼vwxyzABCÃDEFGÄ?HIÄ°JKLMNOÃPQRSÅ?TUÃVWXYZ 0123456789!@#$%^&*()-=[]\\;',./_+{}|:\"<>?`~";E.h=[8,8,7,7,8,8,6,8,8,8,4,4,5,7,4,10,8,8,8,8,8,6,7,7,6,8,8,8,10,8,8,7,9,8,9,9,9,8,8,9,9,9,6,6,7,8,7,10,9,10,10,8,10,9,8,8,8,9,9,8,12,8,8,8,5,8,8,8,8,8,8,8,8,8,8,6,12,10,8,13,10,9,8,6,6,6,10,6,6,6,6,4,6,6,6,8,10,7,7,6,6,6,10,10,7,8,10];E.w=13;E.f=[D=E.height],C=0,B=E.h.length;while(++C<B){E.f[C]=D-=E.h[C-1]}this.images={h:A,v:E}},getStringLength:function(J,I,C,B){var F=-1,H=0,G=[],A=[],K;if(J.indexOf("\n")>-1){G=J.split("\n")}else{G=J}var E=-1,D=typeof G=="string"?1:G.length;while(++E<D){var L=(D==1?J:G[E]).split("");while(++F<L.length){if((K=I.indexOf(L[F]))>=0){H+=C[K]}}H=B?H:H-L.length;A.push(H);H=0;F=-1}return A.length==1?A[0]:A},drawTitle:function(I,E,A){var G=y=z=len=0,H,D,F=this.titleSize;var J=E.split(""),C=-1,B=J.length;if(this.fontMap){len=this.letters.getLength(F,E,A);if(A){G=-(I.canvas.height-(I.canvas.height-len)/2);y=$.browser.msie?0:I.canvas.width-((I.canvas.width-F)/2)}else{G=$.browser.msie?-(I.canvas.width-len)/2:(I.canvas.width-len)/2;y=I.canvas.height-((I.canvas.height-F)/2)}this.letters.drawString(I,F,E,G,y,A)}else{D=A?this.images.v:this.images.h;len=A?this.getStringLength(E,D.c,D.h,A):this.getStringLength(E,D.c,D.w);if(A){y=I.canvas.height-(I.canvas.height-len)/2;G=$.browser.msie?$.browser.version.indexOf("6")>-1?-4:0:G}else{G=$.browser.msie?0:(I.canvas.width-len)/2}while(++C<B){if(A){if((H=D.c.indexOf(J[C]))>=0){y-=D.h[H];this.drawCharFromImage(I,D,H,G,y,A)}}else{if((H=D.c.indexOf(J[C]))>=0){this.drawCharFromImage(I,D,H,G,y,A);G+=D.w[H]-1}}}}},maxVal:function(A){var C=-999999999999,B=-1;while(++B<A.length){C=A[B]>C?A[B]:C}return C},maxObjVal:function(C,B){var D=-999999999999,A=-1;while(++A<C.length){D=C[A][B]>D?C[A][B]:D}return D},minObjVal:function(C,B){var D=999999999999,A=-1;while(++A<C.length){D=C[A][B]<D?C[A][B]:D}return D},drawTick:function(D,K,P,T,I){var L,C=0,B=0,A=0,E,Q,G,O=-1,N,M,S,H,J=false,F=this.tickSize,R=F/25;L=T.call(this,P.val);if(this.fontMap){S=this.letters.getLength(F,P.label,I);J=S instanceof Array;H=J?this.maxVal(S):S;M=J?S[0]:S;G=P.label.split(""),N=G.length;if(D=="x"){if(L>this.canvas.main.width||L<0){return }C=L-((I?(30*R*(J?S.length:1)/2):(M/2))+6*R);C=C<0?0:C+(I?30*R:M)>K.canvas.width?K.canvas.width-(I?30*R*(J?S.length:1):M+(J?8:2)):C;B=(I?(K.canvas.height-((K.canvas.height-M)/2)-1):30*R)+1}else{if(D=="y"){L=L==K.canvas.height?L-(I?(M/2):30*R/2):L==0?L+(I?(M/2):30*R/2):L;B=L-(I?-(M/2):30*R/-4);C=K.canvas.width-((I?J?40*R:S+1:1));if(!I){G=G.reverse();B+=J?30*R/2:0}}}while(++O<N){if(I){if(E=this.letters.get(G[O])){this.letters.drawChar(K,F,E,-(D=="x"&&!J?B-E.width*R+3:B),(D=="x"?C+(30*R):C),I);B-=E.width*R}else{if(G[O]=="\n"){B+=(S[0]+S[1]-1)/2;B=D=="x"?K.canvas.height-((K.canvas.height-S[1])/2):B;C+=30*R}}}else{if(E=this.letters.get(G[O])){if(D=="y"){C-=E.width*R}this.letters.drawChar(K,F,E,C,B,I);if(D=="x"&&G[O+1]!="\n"){C+=E.width*R}}else{if(G[O]=="\n"){C-=H-(((H-S[1])-(H-S[0]))/2)+6*R;C=D=="y"?K.canvas.width-((H-S[0])/2)-1:C;B+=(D=="x"?35:-30)*R}}}}}else{Q=I?this.images.v:this.images.h;S=this.getStringLength(P.label,Q.c,I?Q.h:Q.w,I);J=S instanceof Array;H=J?this.maxVal(S):S;M=J?S[0]:S;G=P.label.split(""),N=G.length;if(D=="x"){if(L>this.canvas.main.width||L<0){return }C=L-(I?(Q.w*(J?S.length:1)/2):(M/2));C=C<0?0:C+(I?Q.w:M)>K.canvas.width?K.canvas.width-(I?Q.w*(J?S.length:1):M+(J?8:2)):C;B=(I?(K.canvas.height-((K.canvas.height-M)/2)-1):B)+1}else{if(D=="y"){L=L==K.canvas.height?L-(I?(M/2):Q.h/2):L==0?L+(I?(M/2):Q.h/2):L;B=L-(I?-(M/2):Q.h/2);C=K.canvas.width-((I?J?2*Q.w:Q.w+1:1));if(!I){G=G.reverse();B+=J?Q.h/2:0}}}while(++O<N){if(I){if((E=Q.c.indexOf(G[O]))>=0){B-=Q.h[E];this.drawCharFromImage(K,Q,E,C,B,I)}else{if(G[O]=="\n"){B+=(S[0]+S[1]-1)/2;B=D=="x"?K.canvas.height-((K.canvas.height-S[1])/2):B;C+=Q.w}}}else{if((E=Q.c.indexOf(G[O]))>=0){if(D=="y"){C-=Q.w[E]}this.drawCharFromImage(K,Q,E,C,B,I);if(D=="x"&&G[O+1]!="\n"){C+=Q.w[E]}}else{if(G[O]=="\n"){C-=H-(((H-S[1])-(H-S[0]))/2);C=D=="y"?K.canvas.width-((H-S[0])/2)-1:C;B+=(D=="x"?1:-1)*Q.h}}}}}},drawCharFromImage:function(C,D,B,A,G,F){A=Math.floor(A);G=Math.floor(G);try{if(F){C.drawImage(D,0,D.f[B]-D.h[B],D.w,D.h[B],A,G,D.w,D.h[B])}else{C.drawImage(D,D.f[B],0,D.w[B],D.h,A,G,D.w[B],D.h)}if(this.intFun){clearInterval(this.intFun);delete this.intFun}}catch(E){return null}},drawText:function(K,H,G,J,I,A){var C=J,B=I;if(this.fontMap){I+=12;this.letters.drawString(K,H,G,J,I,A)}else{var D=-1,E,F,L=G.split("");E=A?this.images.v:this.images.h;K.save();while(++D<L.length){if((F=E.c.indexOf(L[D]))>=0){I-=A?E.h[F]:0;this.drawCharFromImage(K,E,F,J,I,A);if(!A&&L[D+1]!="\n"){J+=E.w[F]}}else{if(L[D]=="\n"){I=A?B:I+E.h;J=A?J+E.w:C}}}K.restore()}},setTitles:function(A){if(A.main){this.setTitle(A.main)}if(this.showXAxisTitles&&A.x){this.drawTitle(this.ctx.axis.x.title,A.x)}if(this.showYAxisTitles&&A.y){this.drawTitle(this.ctx.axis.y.title,A.y,true)}},load:function(){var A=this;A.store.load()},getTitle:function(){return this.panel.getTitle()},setTitle:function(A){this.titles.main=A;this.panel.setTitle(A)},parseColor:function(D){function C(K,J,F,H){var I=["r","g","b","a"];var E=4;while(-1<--E){this[I[E]]=arguments[E]||((E==3)?1:0)}this.toString=function(){if(this.a>=1){return"rgb("+[this.r,this.g,this.b].join(",")+")"}else{return"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"}};this.scale=function(N,M,O,L){E=4;while(-1<--E){if(arguments[E]!=null){this[I[E]]*=arguments[E]}}return this.normalize()};this.adjust=function(N,M,O,L){E=4;while(-1<--E){if(arguments[E]!=null){this[I[E]]+=arguments[E]}}return this.normalize()};this.clone=function(){return new C(this.r,this.b,this.g,this.a)};var G=function(M,L,N){return Math.max(Math.min(M,N),L)};this.normalize=function(){this.r=G(parseInt(this.r),0,255);this.g=G(parseInt(this.g),0,255);this.b=G(parseInt(this.b),0,255);this.a=G(this.a,0,1);return this};this.normalize()}var A;if(A=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(D)){return new C(parseInt(A[1]),parseInt(A[2]),parseInt(A[3]))}if(A=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(D)){return new C(parseInt(A[1]),parseInt(A[2]),parseInt(A[3]),parseFloat(A[4]))}if(A=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\,[0-9]+)?)\s*\)/.exec(D)){return new C(parseInt(A[1]),parseInt(A[2]),parseInt(A[3]),parseFloat(A[4].replace(",",".")))}if(A=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(D)){return new C(parseFloat(A[1])*2.55,parseFloat(A[2])*2.55,parseFloat(A[3])*2.55)}if(A=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(D)){return new C(parseFloat(A[1])*2.55,parseFloat(A[2])*2.55,parseFloat(A[3])*2.55,parseFloat(A[4]))}if(A=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(D)){return new C(parseInt(A[1],16),parseInt(A[2],16),parseInt(A[3],16))}if(A=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(D)){return new C(parseInt(A[1]+A[1],16),parseInt(A[2]+A[2],16),parseInt(A[3]+A[3],16))}var B=$.trim(D).toLowerCase();if(B=="transparent"){return new C(255,255,255,0)}else{A=lookupColors[B];return new C(A[0],A[1],A[2])}},getRandomColor:function(C){C=C?C:155;var A=[];for(var B=0;B<3;B++){A[B]=Math.round(100*Math.random()+C)}return"rgb("+A.join(",")+")"},convertImage:function(){if($.browser.msie){alert("ie desteklenmemektedir.");return false}var D=this;var C=$(D.cnt.main);var K=C.width();var F=C.height();var E=this.canvas.main.width,A=this.canvas.main.height;C.css("display","none");if(D.canvas.axis&&D.canvas.axis.y){if(D.canvas.axis.y.title){E+=D.canvas.axis.y.title.width;if(D.canvas.axis.y.ticks){E+=D.canvas.axis.y.ticks.width}}else{if(D.canvas.axis.y.ticks){E+=D.canvas.axis.y.ticks.width}}}if(D.canvas.axis.x){if(D.canvas.axis.x.ticks){A+=D.canvas.axis.x.ticks.height;if(D.canvas.axis.x.title){A+=D.canvas.axis.x.title.height}}else{if(D.canvas.axis.x.title){A+=D.canvas.axis.x.title.height}}}E+=1;A+=1;var J=mj.NE(C.parent(),{style:"height:"+F+"px;width:"+K+"px;",html:'<canvas width="'+E+'" height="'+A+'" style="width:'+E+"px;height:"+A+'px;"></canvas>'});J=$("canvas",J).get(0);if($.browser.msie){J=window.G_vmlCanvasManager.initElement(J)}var G=J.getContext("2d");G.strokeStyle=this.parseColor("#000").scale(null,null,null,0.5).toString();G.strokeRect(0,0,E,A);var B=0;var I=D.canvas.main.height;if(D.canvas.axis&&D.canvas.axis.y){if(D.canvas.axis.y.title){G.drawImage(D.canvas.axis.y.title,1,1,D.canvas.axis.y.title.width,D.canvas.axis.y.title.height,1,1,D.canvas.axis.y.title.width,D.canvas.axis.y.title.height);B+=D.canvas.axis.y.title.width;if(D.canvas.axis.y.ticks){B+=D.canvas.axis.y.ticks.width;G.drawImage(D.canvas.axis.y.ticks,1,1,D.canvas.axis.y.ticks.width,D.canvas.axis.y.ticks.height,D.canvas.axis.y.title.width,1,D.canvas.axis.y.ticks.width,D.canvas.axis.y.ticks.height)}G.drawImage(D.canvas.main,0,0,D.canvas.main.width,D.canvas.main.height,B,1,D.canvas.main.width,D.canvas.main.height)}else{if(D.canvas.axis.y.ticks){B+=D.canvas.axis.y.ticks.width;G.drawImage(D.canvas.axis.y.ticks,1,1,D.canvas.axis.y.ticks.width,D.canvas.axis.y.ticks.height,1,1,D.canvas.axis.y.ticks.width,D.canvas.axis.y.ticks.height);G.drawImage(D.canvas.main,0,0,D.canvas.main.width,D.canvas.main.height,D.canvas.axis.y.ticks.width,1,D.canvas.main.width,D.canvas.main.height)}else{G.drawImage(D.canvas.main,1,1,D.canvas.main.width,D.canvas.main.height,1,1,D.canvas.main.width,D.canvas.main.height)}}}if(D.canvas.axis.x){if(D.canvas.axis.x.ticks){I+=D.canvas.axis.x.ticks.height;G.drawImage(D.canvas.axis.x.ticks,1,0,D.canvas.axis.x.ticks.width,D.canvas.axis.x.ticks.height,B+1,D.canvas.main.height,D.canvas.axis.x.ticks.width,D.canvas.axis.x.ticks.height);if(D.canvas.axis.x.title){G.drawImage(D.canvas.axis.x.title,1,0,D.canvas.axis.x.title.width,D.canvas.axis.x.title.height,B+1,I,D.canvas.axis.x.title.width,D.canvas.axis.x.title.height)}}else{if(D.canvas.axis.x.title){G.drawImage(D.canvas.axis.x.title,0,0,D.canvas.axis.x.title.width,D.canvas.axis.x.title.height,B,I,D.canvas.axis.x.title.width,D.canvas.axis.x.title.height)}}}var H=J.toDataURL();$(J).parent().remove();C.css("display","block");return H},openAsPNG:function(){var A=this.convertImage();if(A){window.open(A)}},saveAsPNG:function(){var B=this.convertImage();var A="application/octet-stream";if(B){window.location.href=B.replace("image/png",A)}}};mj.extend(mj.plotter,mj.component);mj.plotterTree=function(A){mj.plotterTree.superclass.constructor.call(this,A)};mj.plotterTree.prototype={componentClass:"mj.plotterTree",showXAxisTicks:false,showXAxisTitles:false,showYAxisTicks:false,showYAxisTitles:false,overlay:false,zoom:true,mask:true,onlyNegativeZoom:true,marginSize:0,minZoomLevel:-5,maxZoomLevel:0,treeEvents:function(){var J=$(this.canvas.main);var O=this.ctx.main,I=this;var E,L,C,K,H,D,G,B,A,M;A=J.offset().left;M=J.offset().top;var F=new mj.contextmenu({renderTo:mj.NE(),parent:J,width:130,items:[{id:"_1",title:mj.lng.objects.plotter.openAsPng,iconCls:"mj-opened",scope:this,handler:function(){this.openAsPNG()}},{id:"_2",title:mj.lng.objects.plotter.saveAsPng,iconCls:"mj-save",scope:this,handler:function(){this.saveAsPNG()}}]});var N=function(Q){var P=-1;while(++P<I.series.main.length){if(typeof I.series.main[P].fnClick=="function"){I.series.main[P].fnClick(Q,A,M,J)}}};J.bind("click",N);J.bind("mousedown",function(P){if(P.which==1){I._dragStarted={x:P.layerX,y:P.layerY};I.cnt.main.style.cursor="url("+mj.glb.imagePath+"pt/closedhand.cur),default;"}});J.bind("mouseup",function(P){I._dragStarted=false;I.cnt.main.style.cursor="url("+mj.glb.imagePath+"pt/openhand.cur),default;"});J.bind("mouseout",function(P){I._dragStarted=false;I.cnt.main.style.cursor="url("+mj.glb.imagePath+"pt/openhand.cur),default;"});J.bind("mousemove",function(P){if(I._dragStarted){I.cnt.main.scrollLeft+=I._dragStarted.x-P.layerX;I.cnt.main.scrollTop+=I._dragStarted.y-P.layerY}});J.mousewheel(function(Q,R){if(Q.preventDefault){Q.preventDefault()}Q.returnValue=false;var P=I.zoomLevel;if(I.onlyNegativeZoom){I.zoomLevel+=I.zoomLevel==0&&R>0?0:R;I.zoomLevel=I.zoomLevel<I.minZoomLevel?I.minZoomLevel:I.zoomLevel>I.maxZoomLevel?I.maxZoomLevel:I.zoomLevel}if(I.zoomLevel!=P){I.draw()}return false})},_init:function(){var A=this;A.cnt.main.style.cursor="url("+mj.glb.imagePath+"pt/openhand.cur),default;";A.zoomLevel=0;A.treeEvents();if(A.mask&&A.store){A.maskEl=$(A.cnt.canvasMain);A.store.on("beforeload",function(){A.maskEl.css("opacity",A.maskOpacity);A.onDraw=true})}}};mj.extend(mj.plotterTree,mj.plotter);mj.plotterSeries=function(A){mj.plotterSeries.superclass.constructor.call(this,A)};mj.plotterSeries.prototype={componentClass:"mj.plotterSeries",axisGrid:true,fill:true,color:null,fillOpacity:0.2,lineOpacity:0.8,colorOffset:0,orientation:"v",zoom:true,shadow:false,legend:true,visible:true,init:function(){},dist:function(B,D,A,C){return Math.sqrt(Math.pow(A-B,2)+Math.pow(C-D,2))},getVars:function(){var A=this;return{sc:A.sc,data:A.store.data.data,ctx:A.sc.ctx.main,canvas:A.sc.canvas.main,xmin:A.sc.axis.x.min,xmax:A.sc.axis.x.max,ymin:A.sc.axis.y.min,ymax:A.sc.axis.y.max,xs:A.sc.axis.x.scale,ys:A.sc.axis.y.scale}},dp:function(I,G,A,D){var L=this.vars.ctx,F=this.vars.sc,K=this.vars.ymin,B=this.vars.xmin,C=this.vars.ymax,E=this.vars.xmax;var J,H;A=A?A:2;L.dashStyle="solid";L.lineCap="round";L.fillStyle="#fff";L.beginPath();J=I;H=G+(D?D:0);L.moveTo(J+A,H);L.arc(J,H,A,0,D?Math.PI:2*Math.PI,false);L.stroke()},draw:function(){var B=this;B.vars=B.getVars();B.vars.ctx.save();B.vars.ctx.lineJoin="round";if(B.shadow&&typeof B.fnShadow=="function"){B.fnShadow()}B.color=B.color?B.color:B.sc.getRandomColor(B.colorOffset);B.vars.ctx.strokeStyle=B.vars.sc.parseColor(B.color).scale(null,null,null,B.lineOpacity).toString();B.vars.ctx.lineWidth=B.lineWidth;if(B.fill){B.vars.ctx.fillStyle=B.color?B.vars.sc.parseColor(B.color).scale(null,null,null,B.fillOpacity).toString():B.vars.sc.parseColor(B.color).scale(null,null,null,B.fillOpacity).toString();if(typeof B.fnFill=="function"){B.fnFill(B.vars.data)}}if(typeof B.fnDraw=="function"){B.fnDraw(B.vars.data,0)}if(B.componentClass=="mj.plotterSeries.line"&&B.lineScatter){var A={type:B.lineScatter,shadow:B.shadow,lineOpacity:B.scatterOpacity,scatterWidth:B.scatterWidth,lineWidth:B.lineWidth,color:B.color,sc:B.sc,store:B.store};var C=new mj.plotterSeries.scatter(A);C.draw()}if(B.componentClass=="mj.plotterSeries.scatter"){switch(B.type){case"box":if(typeof B.fnDrawBox=="function"){B.fnDrawBox(B.vars.data)}break;case"point":if(typeof B.fnDrawPoint=="function"){B.fnDrawPoint(B.vars.data)}break;case"triangle":if(typeof B.fnDrawTriangle=="function"){B.fnDrawTriangle(B.vars.data)}break}}B.vars.ctx.restore()}};mj.extend(mj.plotterSeries,mj.component);mj.plotterTreeSeries=function(A){mj.plotterTreeSeries.superclass.constructor.call(this,A)};mj.plotterTreeSeries.prototype={componentClass:"mj.plotterTreeSeries",axisGrid:false,lineColor:"#343e40",fill:true,icon:true,leafTypeStyle:{"1":{color:"#006699",img:mj.glb.imagePath+"pt/mamul.png"},"2":{color:"#562380",img:mj.glb.imagePath+"pt/yarimamul.png"},"3":{color:"#a0121e",img:mj.glb.imagePath+"pt/hammadde.png"},"4":{color:"#a7c843",img:mj.glb.imagePath+"pt/operasyon.png"},"5":{color:"#373d11",img:mj.glb.imagePath+"pt/fason.png"},"6":{color:"#000",img:mj.glb.imagePath+"pt/sarf.png"},"7":{color:"#111",img:mj.glb.imagePath+"pt/imalat.png"},"8":{color:"#222",img:mj.glb.imagePath+"pt/isletme.png"}},lineWidth:2,scatterWidth:150,scatterHeight:44,margins:{b:10,t:10,l:10,r:10},tieLength:20,textLength:20,cornerRadius:10,type:"box",anim:false,init:function(){},draw:function(){var B=this,A=-1;B.vars=B.getVars();B.corners=[];B.subs=[];B.infos=[];B.nodeDepth=0;var E=B.vars.sc,C=B.prepData(B.store.data,1);if(!B._scatterWidth){B._scatterWidth=B.scatterWidth}else{B.scatterWidth=B._scatterWidth}B.scatterWidth+=E.zoomLevel*3;if(!B._scatterHeight){B._scatterHeight=B.scatterHeight}else{B.scatterHeight=B._scatterHeight}B.scatterHeight+=E.zoomLevel*2;if(!B._tieLength){B._tieLength=B.tieLength}else{B.tieLength=B._tieLength}B.tieLength+=E.zoomLevel*2;if(!B._textLength){B._textLength=B.textLength}else{B.textLength=B._textLength}B.textLength+=E.zoomLevel*0.5;if(!E._fontSize){E._fontSize=E.fontSize}else{E.fontSize=E._fontSize}E.fontSize+=E.zoomLevel*0.5;C.depth=B.nodeDepth;var D={w:C.depth*(B.scatterWidth+(2*B.tieLength))+B.tieLength,h:C.absChildCount*(B.scatterHeight+B.margins.t+B.margins.b)};D.h=D.h>E.panel.height?D.h:E.panel.height;D.w=D.w>E.panel.width?D.w:E.panel.width;E.resize(E.ctx.main,D.w,D.h);B.vars.ctx.save();B.depths=[];B.currentNode=C.depth;A=-1;while(++A<C.depth){B.depths.push(0)}if(C.depth>1||C.collapsed){B._draw(C,1)}if(E.mask){E.maskEl.css("opacity","1")}B.vars.ctx.restore()},drawBox:function(E,B){var O=this.vars.ctx,J=this.vars.sc;var L,K,N,F;var C=E.node==1?E.data[0].leafTypeId:E.leafTypeId;O.save();O.dashStyle="solid";O.lineCap="square";O.fillStyle=J.parseColor(E.color||this.leafTypeStyle[C].color||"#fff").scale(null,null,null,E.opacity||this.fillOpacity).toString();O.strokeStyle=J.parseColor(E.color||E.lineColor||this.lineColor).scale(null,null,null,E.opacity||1).toString();O.beginPath();var A=this.cornerRadius;L=E.x-(E.aIndex?E.aIndex*this.margins.t:0);K=E.y+(E.aIndex?E.aIndex*this.margins.t:0);N=E.w?E.w:this.scatterWidth;F=E.h?E.h:this.scatterHeight;E.r={x:parseInt(L+N),y:parseInt(K+F/2),w:this.tieLength};O.moveTo(L+A,K);O.quadraticCurveTo(L,K,L,K+A);O.lineTo(L,K+F-A);O.quadraticCurveTo(L,K+F,L+A,K+F);O.lineTo(L+N-A,K+F);O.quadraticCurveTo(L+N,K+F,L+N,K+F-A);O.lineTo(L+N,K+A);O.quadraticCurveTo(L+N,K,L+N-A,K);O.closePath();O.stroke();O.strokeStyle=J.parseColor(E.color||this.lineColor).scale(null,null,null,E.opacity||1).toString();if(this.fill){O.fill()}if(this.icon&&(!E.aIndex||E.selected)){var D=new Image();var G={x:parseInt(L+(A/2)),y:parseInt(K+(A/2)),w:16+J.zoomLevel*1,h:16+J.zoomLevel*1,data:E};this.infos.push(G);E.info=G;D.onload=function(){O.drawImage(D,E.info.x,E.info.y,16+J.zoomLevel*1,16+J.zoomLevel*1)};D.src=mj.glb.imagePath+this.leafTypeStyle[C].img}var I=E.code?E.code:E.data[0].code;var H=J.fontSize;J.drawText(O,H,I.ellipse(this.textLength),L+4+(2*A),K+6+J.zoomLevel*1.6);I=E.name?E.name:E.data[0].name;J.drawText(O,H,I.ellipse(this.textLength),L+4+(2*A),K+26+J.zoomLevel*1.6);O.restore();if(E.node>1&&(!E.aIndex||E.selected)){this.drawTies(E,B)}if(E.collapsed&&this.anim){var M={r:{x:parseInt(E.r.x-this.scatterWidth-this.tieLength),y:parseInt(E.r.y),w:parseInt(this.tieLength)}};this.drawTies(M,B);var G={x:parseInt(M.r.x-(8+J.zoomLevel*0.5)),y:parseInt(M.r.y-(8+J.zoomLevel*0.5)),w:16+J.zoomLevel*1,h:16+J.zoomLevel*1,data:E};this.corners.push(G);E.corner=G;E.img.src=mj.glb.imagePath+"pt/plus.png"}},fnClick:function(D,B,H,C){var G=$($.browser.msie?C:D.target).offset();var A=D.pageX-G.left-1,F=D.pageY-G.top-1;var E=this.isCorner(A,F);if(E){if(E.data.collapsed){E.data.collapsed=false}else{E.data.collapsed=true}if(typeof this.afterClick=="function"){this.afterClick(E.data)}this.sc.draw()}if(typeof this._fnClick=="function"){this._fnClick(D,A,F)}},isCorner:function(A,B){return this.isIt(this.corners,A,B)},isSub:function(A,B){return this.isIt(this.subs,A,B)},isInfo:function(A,B){return this.isIt(this.infos,A,B)},isIt:function(B,A,F){var D=-1,E=false,C=false;while(++D<B.length&&E==false){if((B[D].x<=A)&&(B[D].x+B[D].w-3>=A)&&(B[D].y<=F)&&(B[D].y+B[D].h-3>=F)){C=B[D];E=true}}return C}};mj.extend(mj.plotterTreeSeries,mj.plotterSeries);mj.plotterSeries.line=function(A){mj.plotterSeries.line.superclass.constructor.call(this,A)};mj.plotterSeries.line.prototype={componentClass:"mj.plotterSeries.line",scatterWidth:3,fill:false,colorOffset:20,lineWidth:2,scatterOpacity:1,shadow:true,lineScatter:false,trackPoint:false,fnDraw:function(F,H){var B,J,G,O,M,K;var N=this.vars.ctx,I=this.vars.sc,L=this.vars.ymin,A=this.vars.xmin,C=this.vars.ymax,E=this.vars.xmax;M=I.th(F[0].x);K=I.tv(F[0].y)+H;var D=0;N.beginPath();N.moveTo(M,K);while(++D<F.length){B=F[D].x;J=F[D].y;M=I.th(B);K=I.tv(J)+H;G=N.fillStyle;O=N.strokeStyle;N.lineTo(M,K)}N.stroke()},fnFill:function(G){if(G.length>1){var C,I,K,J;var M=this.vars.ctx,H=this.vars.sc,L=this.vars.ymin,B=this.vars.xmin,D=this.vars.ymax,F=this.vars.xmax;var A=Math.min(Math.max(0,L),D);K=H.th(G[0].x);J=H.tv(A);var E=-1;M.beginPath();M.moveTo(K,J);while(++E<G.length){C=G[E].x;I=G[E].y;K=H.th(C);J=H.tv(I);M.lineTo(K,J)}J=H.tv(A);M.lineTo(K,J);M.closePath();M.fill()}},fnShadow:function(){var A=this.vars.ctx,B=this.vars.data;A.lineWidth=this.lineWidth+1;A.strokeStyle="rgba(0,0,0,0.1)";this.fnDraw(B,2.5);A.lineWidth=this.lineWidth+1;A.strokeStyle="rgba(0,0,0,0.2)";this.fnDraw(B,1.5)}};mj.extend(mj.plotterSeries.line,mj.plotterSeries);mj.plotterSeries.scatter=function(A){mj.plotterSeries.scatter.superclass.constructor.call(this,A)};mj.plotterSeries.scatter.prototype={componentClass:"mj.plotterSeries.scatter",fill:false,lineWidth:2,scatterWidth:3,type:null,fnDrawBox:function(C){var B=this,A=B.vars.ctx;A.lineWidth=B.lineWidth;if(B.shadow){A.strokeStyle="rgba(0,0,0,0.1)";B.drawBox(C,A.lineWidth/2,2.5);A.strokeStyle="rgba(0,0,0,0.2)";B.drawBox(C,A.lineWidth/2,1.5)}A.strokeStyle=B.color?B.color:sc.parseColor(B.color).scale(null,null,null,B.scatterOpacity).toString();B.drawBox(C,(B.scatterWidth+2)/2)},drawBox:function(G,A,C){var L=this.vars.ctx,H=this.vars.sc,K=this.vars.ymin,B=this.vars.xmin,D=this.vars.ymax,F=this.vars.xmax;var J,I;L.dashStyle="solid";L.lineCap="square";L.fillStyle="#fff";L.beginPath();var E=-1;while(++E<G.length){if(G[E].x<F){J=H.th(G[E].x);I=H.tv(G[E].y)+(C?C:0);L.moveTo(J+A,I+A);L.lineTo(J-A,I+A);L.lineTo(J-A,I-A);L.lineTo(J+A,I-A);L.lineTo(J+A,I+A)}else{break}}L.stroke()},fnDrawPoint:function(C){var B=this,A=B.vars.ctx;if(B.shadow){A.lineWidth=B.lineWidth;A.strokeStyle="rgba(0,0,0,0.1)";B.drawPoint(C,A.lineWidth/2,2.5);A.lineWidth=B.scatterWidth;A.strokeStyle="rgba(0,0,0,0.2)";B.drawPoint(C,A.lineWidth/2,1.5)}A.lineWidth=B.scatterWidth;A.strokeStyle=B.color?B.color:sc.parseColor(B.color).scale(null,null,null,B.scatterOpacity).toString();B.drawPoint(C,B.scatterWidth/2)},drawPoint:function(G,A,C){var L=this.vars.ctx,H=this.vars.sc,K=this.vars.ymin,B=this.vars.xmin,D=this.vars.ymax,F=this.vars.xmax;var J,I;L.dashStyle="solid";L.lineCap="round";L.fillStyle="#fff";L.beginPath();var E=-1;while(++E<G.length){if(G[E].x<F){J=H.th(G[E].x);I=H.tv(G[E].y)+(C?C:0);L.moveTo(J+A,I);L.arc(J,I,A,0,C?Math.PI:2*Math.PI,C=="undefined")}else{break}}L.stroke()},fnDrawTriangle:function(C){var B=this,A=B.vars.ctx;A.lineWidth=B.lineWidth;if(B.shadow){A.strokeStyle="rgba(0,0,0,0.1)";B.drawTriangle(C,A.lineWidth/2,2.5);A.strokeStyle="rgba(0,0,0,0.2)";B.drawTriangle(C,A.lineWidth/2,1.5)}A.strokeStyle=B.color?B.color:sc.parseColor(B.color).scale(null,null,null,B.scatterOpacity).toString();B.drawTriangle(C,(B.scatterWidth+3)/2)},drawTriangle:function(G,A,C){var L=this.vars.ctx,H=this.vars.sc,K=this.vars.ymin,B=this.vars.xmin,D=this.vars.ymax,F=this.vars.xmax;var J,I;L.dashStyle="solid";L.lineCap="square";L.fillStyle="#fff";L.beginPath();var E=-1;while(++E<G.length){if(G[E].x<F){J=H.th(G[E].x);I=H.tv(G[E].y)+(C?C:0);L.moveTo(J-A,I+A);L.lineTo(J+A,I+A);L.lineTo(J,I-A);L.lineTo(J-A,I+A)}else{break}}L.stroke()}};mj.extend(mj.plotterSeries.scatter,mj.plotterSeries);mj.plotterSeries.bar=function(A){mj.plotterSeries.bar.superclass.constructor.call(this,A)};mj.plotterSeries.bar.prototype={componentClass:"mj.plotterSeries.bar",lineWidth:1,barWidth:100,notScaleHeight:false,getWidthScale:false,drawBar:function(G,M){var H=this,O=H.vars.ctx,A=H.vars.sc,Q=H.vars.ymin,K=H.vars.xmin,U=H.vars.ymax,N=H.vars.xmax;var S=-1,P=H.vars.canvas.height/(U-Q);var E=M.x,D=M.y,F=M.w,T=M.h;var R=true,J=true,L=true,W=true;var B=E,V=E+F,C=D,I=D+T;if(V<K||B>N||I<Q||C>U){return }if(B<K){B=K;R=false}if(V>N){V=N;L=false}if(C<Q){C=Q;W=false}if(I>U){I=U;J=false}if(G.color){O.fillStyle=H.vars.sc.parseColor(G.color).scale(null,null,null,H.fillOpacity).toString();O.strokeStyle=H.vars.sc.parseColor(G.color).scale(null,null,null,H.lineOpacity).toString()}else{O.fillStyle=H.vars.sc.parseColor(H.color).scale(null,null,null,H.fillOpacity).toString();O.strokeStyle=H.vars.sc.parseColor(H.color).scale(null,null,null,H.lineOpacity).toString()}if(H.fill){O.beginPath();O.moveTo(H.vars.sc.th(B),H.vars.sc.tv(C));O.lineTo(H.vars.sc.th(B),H.vars.sc.tv(I));O.lineTo(H.vars.sc.th(V),H.vars.sc.tv(I));O.lineTo(H.vars.sc.th(V),H.vars.sc.tv(C));O.lineTo(H.vars.sc.th(B),H.vars.sc.tv(C));O.fill()}if(H.lineWidth){if(R||L||J||W){O.beginPath();O.moveTo(H.vars.sc.th(B),H.vars.sc.tv(C));if(R){O.lineTo(H.vars.sc.th(B),H.vars.sc.tv(I))}else{O.moveTo(H.vars.sc.th(B),H.vars.sc.tv(I))}if(J){O.lineTo(H.vars.sc.th(V),H.vars.sc.tv(I))}else{O.moveTo(H.vars.sc.th(V),H.vars.sc.tv(I))}if(L){O.lineTo(H.vars.sc.th(V),H.vars.sc.tv(C))}else{O.moveTo(H.vars.sc.th(V),H.vars.sc.tv(C))}if(W){O.lineTo(H.vars.sc.th(B),H.vars.sc.tv(C))}else{O.moveTo(H.vars.sc.th(B),H.vars.sc.tv(C))}O.stroke()}}},fnDraw:function(E){if(E.length<1){return }var N=this,O=N.vars.ctx,H=N.vars.sc,L=N.vars.ymin,A=N.vars.xmin,C=N.vars.ymax,F=N.vars.xmax;var D=-1,M=N.vars.canvas.height/(C-L);if(N.getWidthScale){N.notScaleHeight=true}var J,I,K,G,B;while(++D<E.length){if(N.orientation=="v"){J=E[D].x,I=E[D].y,K=E[D].w||N.barWidth,G=E[D].h/(N.notScaleHeight?M:1)}else{J=E[D].y,I=E[D].x,K=E[D].h||N.barWidth,G=E[D].w/(N.notScaleHeight?M:1)}B={x:J,y:I,w:K,h:G};N.drawBar(E[D],B)}}};mj.extend(mj.plotterSeries.bar,mj.plotterSeries);mj.plotterSeries.bar3D=function(A){mj.plotterSeries.bar3D.superclass.constructor.call(this,A)};mj.plotterSeries.bar3D.prototype={componentClass:"mj.plotterSeries.bar3D",deepLength:8,lineOpacity:0.5,backLineOpacity:0.3,fnDraw:function(V){if(V.length<1){return }var G=this,L=G.vars.ctx,A=G.vars.sc,N=G.vars.ymin,J=G.vars.xmin,S=G.vars.ymax,K=G.vars.xmax;var P=-1,M=G.vars.canvas.height/(S-N),I,H,U,T,Q,O,E,D,C,B,F,R;I=G.deepLength*Math.cos((45).toRadian());H=G.deepLength*Math.sin((45).toRadian());while(++P<V.length){if(G.orientation=="v"){F=V[P].w||G.barWidth,R=V[P].h;U=V[P].x,T=V[P].x+F,Q=V[P].x+F,O=V[P].x;E=V[P].y,D=V[P].y,C=V[P].y+R,B=V[P].y+R}else{F=V[P].h||G.barWidth,R=V[P].w;U=V[P].y,T=V[P].y+F,Q=V[P].y+F,O=V[P].y;E=V[P].x,D=V[P].x,C=V[P].x+R,B=V[P].x+R}L.strokeStyle=G.vars.sc.parseColor(G.color).scale(null,null,null,G.lineOpacity).toString();L.beginPath();L.moveTo(G.vars.sc.th(U),G.vars.sc.tv(E));L.lineTo(G.vars.sc.th(T),G.vars.sc.tv(D));L.lineTo(G.vars.sc.th(Q),G.vars.sc.tv(C));L.lineTo(G.vars.sc.th(O),G.vars.sc.tv(B));L.closePath();L.moveTo(G.vars.sc.th(Q),G.vars.sc.tv(C));L.lineTo(G.vars.sc.th(Q+I),G.vars.sc.tv(C+H));L.lineTo(G.vars.sc.th(Q+I),G.vars.sc.tv(C+H-R));L.lineTo(G.vars.sc.th(Q),G.vars.sc.tv(C-R));L.moveTo(G.vars.sc.th(Q+I),G.vars.sc.tv(C+H));L.lineTo(G.vars.sc.th(Q-F+I),G.vars.sc.tv(C+H));L.lineTo(G.vars.sc.th(O),G.vars.sc.tv(B));L.lineTo(G.vars.sc.th(Q),G.vars.sc.tv(C));L.fill();L.stroke();L.strokeStyle=G.vars.sc.parseColor(G.color).scale(null,null,null,G.backLineOpacity).toString();L.moveTo(G.vars.sc.th(U+I),G.vars.sc.tv(E+H));L.lineTo(G.vars.sc.th(U+I),G.vars.sc.tv(E+H+R));L.moveTo(G.vars.sc.th(U+I),G.vars.sc.tv(E+H));L.lineTo(G.vars.sc.th(U+I+F),G.vars.sc.tv(E+H));L.moveTo(G.vars.sc.th(U+I),G.vars.sc.tv(E+H));L.lineTo(G.vars.sc.th(U),G.vars.sc.tv(E));L.stroke()}}};mj.extend(mj.plotterSeries.bar3D,mj.plotterSeries.bar);mj.plotterSeries.range=function(A){mj.plotterSeries.range.superclass.constructor.call(this,A)};mj.plotterSeries.range.prototype={componentClass:"mj.plotterSeries.range",lineWidth:0,fnDraw:function(D){var M=this,N=M.vars.ctx,G=M.vars.sc,K=M.vars.ymin,A=M.vars.xmin,B=M.vars.ymax,E=M.vars.xmax;var C=-1,L=M.vars.canvas.height/(B-K);var I,H,J,F;while(++C<D.length){if(M.orientation=="v"){I=D[C].x,H=K,J=D[C].w||M.barWidth,F=B-K}else{H=D[C].x,I=A,F=D[C].w||M.barWidth,J=E-A}p={x:I,y:H,w:J,h:F};M.drawBar(D[C],p)}}};mj.extend(mj.plotterSeries.range,mj.plotterSeries.bar);mj.plotterSeries.pie=function(A){mj.plotterSeries.pie.superclass.constructor.call(this,A)};mj.plotterSeries.pie.prototype={componentClass:"mj.plotterSeries.pie",axisGrid:false,scale:0.9,fillOpacity:0.7,position:"c",zoom:false,pieces:false,sh:1,sw:1,fnClick:function(Q,K,C){var B=this.sc,I=$(Q.target),S,F,P,N,G,D,M=-1,O=false,J=false;if(this.store.data.recordCount==1){return }if(!B.onDraw&&B.drawed&&(Q.pageX>K&&Q.pageX<I.width()+K-B.leftWidth)&&(Q.pageY<parseFloat(B.ctx.main.canvas.height)+C-B.renderTo[0].scrollTop)){S=this.getCenter();N=Q.pageX-K;D=Q.pageY-C;var T=Math.atan((D-S.y)/(N-S.x))+(Math.PI/2);if(N<S.x){T+=Math.PI}var H=T/(2*Math.PI);var L=-1;var E=0;while(++M<this.pieces.length&&O==false){F=this.pieces[M];E+=F.v;P=F.cx;G=F.cy;var R=this.dist(P,G,N,D);if(R<=this.r&&(E/this.sum)>H&&!J){O=true}}if(O){var A=this.pieces.getIndex("o",1);if(A!=-1){this.store.data.data[A].offset=0;this.pieces[A].o=0}this.store.data.data[M-1].offset=1;this.pieces[M-1].o=1;B.reDraw()}else{return }}},getCenter:function(){var C=this.vars.canvas,B=C.width,E=C.height,A=B*this.sw,D=E*this.sh,F={x:B/2,y:E/2};switch(this.position){case"tl":F={x:A*0.5,y:D*0.5};break;case"tc":F={x:B/2,y:D*0.5};break;case"tr":F={x:B-A*0.5,y:D*0.5};break;case"cl":F={x:A*0.5,y:E/2};break;case"cr":F={x:B-A*0.5,y:E/2};break;case"bl":F={x:A*0.5,y:E-D*0.5};break;case"bc":F={x:B/2,y:E-D*0.5};break;case"br":F={x:B-A*0.5,y:E-D*0.5};break;default:F={x:B/2,y:E/2}}return F},getRadius:function(){return Math.floor(Math.min(this.vars.canvas.width*this.sw,this.vars.canvas.height*this.sh)*this.scale)/2},drawPiece:function(M,I,G,A,F,K,C,B,E){var D=(2*Math.PI*F)-Math.PI/2;var H=(2*Math.PI*(F+K))-Math.PI/2;var J=H-((H-D)/2);if(typeof E.offset!="undefined"&&parseFloat(E.offset)>0){G+=Math.sin(J)*(parseFloat(E.offset)*A*0.1);I+=Math.cos(J)*(parseFloat(E.offset)*A*0.1)}var L={sa:D,ea:H,a:J,cx:I,cy:G,dr:A,v:E.x,o:typeof E.offset!="undefined"?E.offset:0};this.pieces.push(L);M.beginPath();M.moveTo(I,G);M.arc(I,G,A,D,H,false);M.lineTo(I,G);M.closePath();M.fillStyle=this.vars.sc.parseColor(E.color||this.vars.sc._colors[B]).scale(null,null,null,C).toString();M.fill()},draw:function(){var C=this;C.pieces=[];C.vars=C.getVars();C.r=C.getRadius();if(!C.pos){C.pos=C.getCenter()}C.current=0;C.sum=0;var B=-1,D=0,A=C.vars.ctx;while(++B<C.vars.data.length){C.sum+=C.vars.data[B].x}B=-1;while(++B<C.vars.data.length){D=C.vars.data[B].x/C.sum;C.drawPiece(A,C.pos.x,C.pos.y,C.r,C.current,D,C.fillOpacity,B,C.vars.data[B]);C.current+=D}}};mj.extend(mj.plotterSeries.pie,mj.plotterSeries);mj.plotterSeries.pie3D=function(A){mj.plotterSeries.pie3D.superclass.constructor.call(this,A)};mj.plotterSeries.pie3D.prototype={componentClass:"mj.plotterSeries.pie3D",deepLength:20,bottomOpacity:0.6,sideOpacity:0.8,fnClick:function(S,L,D){var C=this.sc,J=$(S.target),U,G,R,P,H,E,O=-1,Q=false,K=false,A=this.pos,N={};if(this.store.data.recordCount==1){return }if(!C.onDraw&&C.drawed&&(S.pageX>L&&S.pageX<J.width()+L-C.leftWidth)&&(S.pageY<parseFloat(C.ctx.main.canvas.height)+D-C.renderTo[0].scrollTop)){U=this.getCenter();P=S.pageX-L;E=S.pageY-D;N.eg=(E-U.y)/(P-U.x);N.a0orj=Math.atan(N.eg);N.a0=N.a0orj+(Math.PI/2);N.rx=(U.x0-U.x1)/2;N.ry=(U.y0-U.y1)/2;N.a1orj=Math.atan((N.ry*Math.sin(N.a0))/(N.rx*Math.cos(N.a0)));N.a1=N.a1orj+(Math.PI/2);if(E>U.y){N.a1+=Math.PI}N.x=(N.rx*Math.cos(N.a1));N.y=(N.ry*Math.sin(N.a1));if(P>U.x&&E<U.y){N.oa=N.a1orj}if(E>U.y){N.oa=N.a1-(Math.PI/2)}if(P<U.x&&E<U.y){N.oa=N.a1+3*(Math.PI/2)}var I=N.oa/(2*Math.PI);var M=-1;var F=0;while(++O<this.pieces.length&&Q==false){G=this.pieces[O];F+=G.v;R=G.cx;H=G.cy;var T=this.dist(R,H,P,E),V=this.dist(N.x+U.x,N.y+U.y,R,H);if(T<=V&&(F/this.sum)>I&&!K){Q=true}}if(Q){var B=this.pieces.getIndex("o",1);if(B!=-1){this.store.data.data[B].offset=0;this.pieces[B].o=0}this.store.data.data[O-1].offset=1;this.pieces[O-1].o=1;C.reDraw()}else{return }}},getCenter:function(){var C=this.vars.canvas,B=C.width,E=C.height,A=B*this.sw,D=E*this.sh,F={x:B/2,y:E/2};switch(this.position){case"tl":F={x:A*0.5,y:D*0.5};break;case"tc":F={x:B/2,y:D*0.5};break;case"tr":F={x:B-A*0.5,y:D*0.5};break;case"cl":F={x:A*0.5,y:E/2};break;case"cr":F={x:B-A*0.5,y:E/2};break;case"bl":F={x:A*0.5,y:E-D*0.5};break;case"bc":F={x:B/2,y:E-D*0.5};break;case"br":F={x:B-A*0.5,y:E-D*0.5};break;default:F={x:B/2,y:E/2,x0:B-(A*this.scale),y0:E-(D*this.scale-3*this.deepLength),x1:A*this.scale,y1:D*this.scale-3*this.deepLength,x2:B-(A*this.scale),y2:E-(D*this.scale-5*this.deepLength),x3:A*this.scale,y3:D*this.scale-this.deepLength}}return F},drawPiece:function(Q,L,K,O,F,D,I,J,C){var G=(2*Math.PI*K)-Math.PI/2;var M=(2*Math.PI*(K+O))-Math.PI/2;var N=M-((M-G)/2);if(typeof I.offset!="undefined"&&parseFloat(I.offset)>0){L.cy-=Math.sin(N)*(parseFloat(I.offset)*L.ry*0.2);L.cx-=Math.cos(N)*(parseFloat(I.offset)*L.rx*0.2)}if(C){var P={sa:G,ea:M,a:N,cx:L.cx,cy:L.cy,v:I.x,o:typeof I.offset!="undefined"?I.offset:0};this.pieces.push(P)}var B=3;if(J!="s"){var H=(K*360)+1;var E=((K+O)*360)+1;var A={};Q.beginPath();while(H<E){A.ang0=(H).toRadian()+Math.PI/2;A.x0=L.rx*Math.cos(A.ang0);A.y0=L.ry*Math.sin(A.ang0);A.a0=Math.pow(L.ry,2)/A.y0;A.b0=(A.x0*Math.pow(L.ry,2))/(A.y0*Math.pow(L.rx,2));A.ang1=(H+B).toRadian()+Math.PI/2;A.x1=L.rx*Math.cos(A.ang1);A.y1=L.ry*Math.sin(A.ang1);A.a1=Math.pow(L.ry,2)/A.y1;A.b1=(A.x1*Math.pow(L.ry,2))/(A.y1*Math.pow(L.rx,2));A.x=(A.a0-A.a1)/(A.b0-A.b1);A.y=A.a0-(A.b0*A.x);Q.moveTo(L.cx,L.cy);Q.lineTo(A.x0+L.cx,A.y0+L.cy);if(typeof A.px0=="undefined"||typeof A.py0=="undefined"){A.px0=A.x0+L.cx;A.py0=A.y0+L.cy}Q.quadraticCurveTo(A.x+L.cx,A.y+L.cy,A.x1+L.cx,A.y1+L.cy);Q.lineTo(L.cx,L.cy);H+=B}Q.closePath();Q.fillStyle=this.vars.sc.parseColor(I.color||this.vars.sc._colors[D]).scale(null,null,null,F).toString();Q.fill()}if(J=="b"){Q.strokeStyle=this.vars.sc.parseColor(I.color||this.vars.sc._colors[D]).scale(null,null,null,1).toString();Q.fillStyle=this.vars.sc.parseColor(I.color||this.vars.sc._colors[D]).scale(null,null,null,F).toString();Q.beginPath();Q.moveTo(L.cx,L.cy);Q.lineTo(A.px0,A.py0);Q.lineTo(A.px0,A.py0-2*this.deepLength);Q.lineTo(L.cx,L.cy-2*this.deepLength);Q.closePath();Q.fill();Q.stroke();Q.beginPath();Q.moveTo(L.cx,L.cy);Q.lineTo(A.x1+L.cx,A.y1+L.cy);Q.lineTo(A.x1+L.cx,A.y1+L.cy-2*this.deepLength);Q.lineTo(L.cx,L.cy-2*this.deepLength);Q.closePath();Q.fill();Q.stroke()}if(J=="s"){var H=(K*360)+1;var E=((K+O)*360)+1;var A={};Q.beginPath();while(H<E){A.ang0=(H).toRadian()+Math.PI/2;A.x0=L.rx*Math.cos(A.ang0);A.y0=L.ry*Math.sin(A.ang0);A.a0=Math.pow(L.ry,2)/A.y0;A.b0=(A.x0*Math.pow(L.ry,2))/(A.y0*Math.pow(L.rx,2));A.ang1=(H+B).toRadian()+Math.PI/2;A.x1=L.rx*Math.cos(A.ang1);A.y1=L.ry*Math.sin(A.ang1);A.a1=Math.pow(L.ry,2)/A.y1;A.b1=(A.x1*Math.pow(L.ry,2))/(A.y1*Math.pow(L.rx,2));A.x=(A.a0-A.a1)/(A.b0-A.b1);A.y=A.a0-(A.b0*A.x);Q.moveTo(A.x0+L.cx,A.y0+L.cy);Q.quadraticCurveTo(A.x+L.cx,A.y+L.cy,A.x1+L.cx,A.y1+L.cy);Q.lineTo(A.x1+L.cx,A.y1+L.cy-2*this.deepLength);Q.quadraticCurveTo(A.x+L.cx,A.y+L.cy-2*this.deepLength,A.x0+L.cx,A.y0+L.cy-2*this.deepLength);Q.lineTo(A.x0+L.cx,A.y0+L.cy);H+=B}Q.closePath();Q.fillStyle=this.vars.sc.parseColor(I.color||this.vars.sc._colors[D]).scale(null,null,null,F).toString();Q.fill()}},draw:function(){var C=this;C.pieces=[];C.vars=C.getVars();if(!C.pos){C.pos=C.getCenter()}C.pos.k=4*((Math.sqrt(2)-1)/3);C.current=0;C.sum=0;var B=-1,D=0,A=C.vars.ctx;while(++B<C.vars.data.length){C.sum+=C.vars.data[B].x}B=-1;while(++B<C.vars.data.length){D=C.vars.data[B].x/C.sum;C.pos.rx=(C.pos.x2-C.pos.x3)/2;C.pos.ry=(C.pos.y2-C.pos.y3)/2;C.pos.cx=C.pos.x3+C.pos.rx;C.pos.cy=C.pos.y3+C.pos.ry;C.drawPiece(A,C.pos,C.current,D,C.bottomOpacity,B,C.vars.data[B],"b",false);C.current+=D}C.current=0;B=-1;while(++B<C.vars.data.length){D=C.vars.data[B].x/C.sum;C.pos.rx=(C.pos.x2-C.pos.x3)/2;C.pos.ry=(C.pos.y2-C.pos.y3)/2;C.pos.cx=C.pos.x3+C.pos.rx;C.pos.cy=C.pos.y3+C.pos.ry;C.drawPiece(A,C.pos,C.current,D,C.sideOpacity,B,C.vars.data[B],"s",false);C.current+=D}C.current=0;B=-1;while(++B<C.vars.data.length){D=C.vars.data[B].x/C.sum;C.pos.rx=(C.pos.x0-C.pos.x1)/2;C.pos.ry=(C.pos.y0-C.pos.y1)/2;C.pos.cx=C.pos.x1+C.pos.rx;C.pos.cy=C.pos.y1+C.pos.ry;C.drawPiece(A,C.pos,C.current,D,C.fillOpacity,B,C.vars.data[B],"t",true);C.current+=D}}};mj.extend(mj.plotterSeries.pie3D,mj.plotterSeries.pie);mj.plotterSeries.gauge=function(A){mj.plotterSeries.gauge.superclass.constructor.call(this,A)};mj.plotterSeries.gauge.prototype={componentClass:"mj.plotterSeries.gauge",start:180,range:180,min:0,max:100,scale:0.8,centerOpacity:0.3,fillOpacity:0.3,needleOpacity:0.5,rangeOpacity:0.4,fillColor:"#fff",rangeColor:"#ccc",centerColor:"#fff",needleColor:"#f00",needleRadius:110,rangeWidth:30,needleRangeDiff:20,needleWidth:3,centerWidth:100,tickCount:11,majorTickStepDivisor:1,minorTickStepDivisor:5,tickCorrectorMin:1,tickCorrectorMax:10,getScaledValue:function(A){return this.start+((A-this.min)/(this.max-this.min)*this.range)},drawTick:function(M,K,I,A,F,L,D,E,H){var C,B,J,G;C=K+(A-E)*Math.cos((F).toRadian());J=I+(A-E)*Math.sin((F).toRadian());B=K+(A-L+H)*Math.cos((F).toRadian());G=I+(A-L+H)*Math.sin((F).toRadian());M.lineWidth=D;M.moveTo(C,J);M.lineTo(B,G)},fillBackGround:function(J,I,G,A,K,B,E,F){var D,H,C;J.beginPath();C=this.getScaledValue(K);D=I+(A)*Math.cos((C).toRadian());H=G+(A)*Math.sin((C).toRadian());J.moveTo(I,G);J.arc(I,G,A,(K).toRadian(),(K+B).toRadian(),false);J.lineTo(I,G);J.closePath();J.fillStyle=this.vars.sc.parseColor(E).scale(null,null,null,F).toString();J.fill()},drawRangeArea:function(K,I,G,A,L,B,J,E,F){var D,H,C;K.beginPath();C=this.getScaledValue(L);D=I+(A)*Math.cos((C).toRadian());H=G+(A)*Math.sin((C).toRadian());K.moveTo(I,G);K.arc(I,G,A,(L).toRadian(),(L+B).toRadian(),false);K.arc(I,G,(A-J),(L+B).toRadian(),(L).toRadian(),true);K.closePath();K.fillStyle=this.vars.sc.parseColor(E).scale(null,null,null,F).toString();K.fill()},drawRanges:function(D){var C=this,A=C.vars.ctx,B,E;A.beginPath();C.curPos=C.getScaledValue(C.ranges[D].min);B=C.pos.x+(C.r)*Math.cos((C.curPos).toRadian());E=C.pos.y+(C.r)*Math.sin((C.curPos).toRadian());A.moveTo(B,E);A.arc(C.pos.x,C.pos.y,C.r,(C.getScaledValue(C.ranges[D].min)).toRadian(),(C.getScaledValue(C.ranges[D].max)).toRadian(),false);A.arc(C.pos.x,C.pos.y,(C.r-C.rangeWidth),(C.getScaledValue(C.ranges[D].max)).toRadian(),(C.getScaledValue(C.ranges[D].min)).toRadian(),true);A.closePath();A.fillStyle=C.vars.sc.parseColor(C.ranges[D].color).scale(null,null,null,C.rangeOpacity).toString();A.fill()},drawNeedle:function(R,D,H,L){var F=this,I=F.vars.ctx,O,N,M,C,B,A;F.needleRadius=F.needleRadius<=F.centerWidth+F.needleRangeDiff?F.needleRadius:F.centerWidth+F.needleRangeDiff;F.current=F.getScaledValue(R.x);O=F.pos.x+(F.r)*Math.cos((F.current).toRadian());C=F.pos.y+(F.r)*Math.sin((F.current).toRadian());I.beginPath();I.arc(F.pos.x,F.pos.y,F.needleRadius,(F.current-F.needleWidth).toRadian(),(F.current+F.needleWidth).toRadian(),false);I.lineTo(O,C);I.closePath();I.fillStyle=F.vars.sc.parseColor(R.color||F.needleColor).scale(null,null,null,F.needleOpacity).toString();I.fill();var E,P,K,J,G,Q;I.save();if(R.label){P=F.sc.images.h;Q=F.sc.getStringLength(R.label,P.c,P.w,false);K=-1;G=R.label.toString().split(""),J=G.length;O=(typeof R.px!="undefined"?R.px:F.pos.x)-L/2;C=(typeof R.py!="undefined"?R.py+H*(P.h+1):F.pos.y-(D-H)*(P.h+1));I.beginPath();I.moveTo(O-12,C+2);I.lineTo(O-3,C+2);I.lineTo(O-3,C+P.h+1);I.lineTo(O-12,C+P.h+1);I.closePath();I.fill();while(++K<J){if((E=P.c.indexOf(G[K]))>=0){O=Math.floor(O);C=Math.floor(C);I.drawImage(P,P.f[E],0,P.w[E],P.h,O,C,P.w[E],P.h);O+=P.w[E]}}}I.restore()},draw:function(){var G=this,M,L;var P,O,N,C,B,A,Q,R,F,H;G.vars=G.getVars();var I=G.vars.ctx;G.current=0;G.r=G.getRadius();G.centerWidth=G.centerWidth>G.r-(G.rangeWidth+G.needleRangeDiff)?G.r-(G.rangeWidth+G.needleRangeDiff):G.centerWidth;if(!G.pos){G.pos=G.getCenter()}for(M=G.start;M<=(G.start+G.range);M++){L=M;if(L>=360){L=L-360}if(L==0){G.vars.ymax=G.r}if(L==90){G.vars.xmax=G.r}if(L==180){G.vars.ymin=0-G.r}if(L==270){G.vars.xmin=0-G.r}}G.tickStep=(G.max-G.min)/(G.tickCount-1);G.curTick=0;G.curMinTick=0;G.curPos=0;G.curMinPos=0;M=-1;while(++M<G.tickCount){G.curPos=G.getScaledValue(G.curTick);G.drawTick(I,G.pos.x,G.pos.y,G.r,G.curPos,G.rangeWidth,2,G.tickCorrectorMin,G.tickCorrectorMin);G.curTick+=G.tickStep}I.strokeStyle="rgba(0,0,0,1)";I.stroke();M=-1;G.curTick=0;G.curPos=0;P=0;C=0;while(++M<G.tickCount){G.direction=true;G.rev=false;G.curPos=G.getScaledValue(G.curTick);G.curPos=G.curPos%360;Q=G.sc.images.h;R=G.sc.getStringLength(G.curTick.toString(),Q.c,Q.w,false);L=-1;H=G.curTick.toString().split(""),k=H.length;P=G.pos.x+(G.r)*Math.cos((G.curPos).toRadian());C=G.pos.y+(G.r)*Math.sin((G.curPos).toRadian());if(G.curPos>=90&&G.curPos<180){G.direction=false;P+=G.curPos==90?R/2:1;C-=((Q.h/2)-5);if(!G.rev){H=H.reverse();G.rev=true}}else{if(G.curPos>=180&&G.curPos<270){G.direction=false;C-=(Q.h-3);if(!G.rev){H=H.reverse();G.rev=true}}else{if(G.curPos>=270&&G.curPos<360){P-=G.curPos==270?R/2:0;C-=(Q.h-(G.curPos==270?0:3))}else{if(G.curPos>=0&&G.curPos<90){C-=G.curPos==0?Q.h/2:1}}}}if(P!=0&&C!=0){while(++L<k){if((F=Q.c.indexOf(H[L]))>=0){P=Math.floor(P);C=Math.floor(C);if(!G.direction){P-=Q.w[F]}I.drawImage(Q,Q.f[F],0,Q.w[F],Q.h,P,C,Q.w[F],Q.h);if(G.direction){P+=Q.w[F]}}}}if(G.rev){H=H.reverse()}G.curTick+=G.tickStep}M=-1;while(++M<G.tickCount-1){G.curMinTick+=(G.tickStep/G.minorTickStepDivisor);L=-1;while(++L<4){G.curMinPos=G.getScaledValue(G.curMinTick);G.drawTick(I,G.pos.x,G.pos.y,G.r,G.curMinPos,G.rangeWidth,1,G.tickCorrectorMin,G.tickCorrectorMax);G.curMinTick+=(G.tickStep/G.minorTickStepDivisor)}}I.stroke();I.strokeStyle="rgba(0,0,0,0)";if(G.fill){G.fillBackGround(I,G.pos.x,G.pos.y,G.r,G.start,G.range,G.fillColor,G.fillOpacity)}G.drawRangeArea(I,G.pos.x,G.pos.y,G.r,G.start,G.range,G.rangeWidth,G.rangeColor,G.rangeOpacity);M=-1;while(++M<G.ranges.length){G.drawRanges(M)}var T=G.vars.data,U,E,J,S,Q,D=[],K;M=-1;Q=G.sc.images.h;while(++M<T.length){D.push({x:T[M].x,len:G.sc.getStringLength(T[M].label,Q.c,Q.w,false)})}K=G.vars.sc.maxObjVal(D,"len");M=-1;while(++M<T.length){G.drawNeedle(T[M],T.length,M,K)}I.beginPath();I.arc(G.pos.x,G.pos.y,G.centerWidth,0,2*Math.PI,false);I.closePath();I.fillStyle=G.vars.sc.parseColor(G.centerColor).scale(null,null,null,G.centerOpacity).toString();I.fill()}};mj.extend(mj.plotterSeries.gauge,mj.plotterSeries.pie);mj.plotterTreeSeries.treeElements=function(A){mj.plotterTreeSeries.treeElements.superclass.constructor.call(this,A)};mj.plotterTreeSeries.treeElements.prototype={componentClass:"mj.plotterTreeSeries.treeElements",corners:false,subs:false,infos:false,nodeDepth:0,currentNode:0,depths:false,init:function(){},prepData:function(C,D){var B=-1;if(C.detail&&C.detail[0]){var A=mj.oLength(C.detail[0].data);C.node=D++;C.childCount=A;C.absChildCount=0;if(!C.collapsed||!this.anim){while(++B<A){this.prepData(C.detail[0].data[B],D);C.absChildCount+=C.detail[0].data[B].absChildCount;C.detail[0].data[B].nodeIndex=B;if(C.childCount>1){C.detail[0].data[B].isFirst=B==0;C.detail[0].data[B].isLast=B==A-1}else{C.detail[0].data[B].isFirst=C.detail[0].data[B].isLast=false}}}else{C.absChildCount=1}}else{C.node=D;C.childCount=0;C.absChildCount=1}this.nodeDepth=C.node>this.nodeDepth?C.node:this.nodeDepth;return C},_draw:function(F,G){var J=this.vars.ctx,H=this.vars.sc;var C=-1;var I=false;if(F.detail&&F.detail[0]){var B=F.node-1;var A=mj.oLength(F.detail[0].data);if(!F.collapsed){while(++C<A){this._draw(F.detail[0].data[C],G)}this.currentNode--}else{this.currentNode=F.node}}for(var B=0;B<this.nodeDepth;B++){this.depths[B]+=this.anim?((F.childCount==0||F.collapsed)?1:0):(F.childCount==0?1:(F.collapsed?F.absChildCount:0))}if(F.node==this.currentNode){if(F.childCount>0&&(!F.collapsed||!this.anim)){var D=this.drawTieBinds(F.detail[0].data,F);F.top=(F.detail[0].data[0].top+mj.oLength(F.detail[0].data)-1)/2;F.y=parseInt(D)}else{F.top=this.depths[this.currentNode-1]-1;F.y=parseInt(F.top*(this.scatterHeight+this.margins.b+this.margins.t)+this.margins.t)}I=true}else{if(F.childCount==0){this.currentNode=F.node;F.top=this.depths[this.currentNode-1]-1;F.y=parseInt(F.top*(this.scatterHeight+this.margins.b+this.margins.t)+this.margins.t);I=true}}if(I){F.x=parseInt((this.nodeDepth-F.node)*(2*this.tieLength+(this.scatterWidth))+this.margins.l+this.tieLength);if(F.detail&&F.detail[1]){var E={x:parseInt(F.x-8+this.scatterWidth),y:parseInt(F.y-8+this.scatterHeight/2),w:16,h:16,data:F};this.subs.push(E);F.sub=E;if(!F.imgSub){F.imgSub=new Image();F.imgSub.onload=function(){J.drawImage(F.imgSub,F.sub.x,F.sub.y,16,16)}}F.imgSub.src=mj.glb.imagePath+"pt/application_cascade.png"}this.drawBox(F)}return F},drawTies:function(D){var C=this.vars.ctx,E=this.vars.sc;var A,F,B;A=D.r.x;F=D.r.y;B=D.r.w;C.save();C.strokeStyle=E.parseColor(D.color||"#343e40").scale(null,null,null,0.5).toString();C.beginPath();C.moveTo(A,F);if(D.isFirst){C.lineTo(A+B-this.cornerRadius,F);C.lineWidth=this.lineWidth;C.quadraticCurveTo(A+B,F,A+B,F+this.cornerRadius)}else{if(D.isLast){C.lineTo(A+B-this.cornerRadius,F);C.lineWidth=this.lineWidth;C.quadraticCurveTo(A+B,F,A+B,F-this.cornerRadius)}else{C.lineTo(A+B,F);C.closePath()}}C.stroke();C.restore()},drawTieBinds:function(D,G){var L=this.vars.ctx,H=this.vars.sc;var J,I,K;var C=-1,E=false,A=false,B=mj.oLength(D);L.strokeStyle=H.parseColor(D.color||"#343e40").scale(null,null,null,0.5).toString();L.beginPath();while(++C<B){J=D[C].r.x;I=D[C].r.y;K=D[C].r.w;if(!E){L.moveTo(J+K,I+this.cornerRadius);E=I}else{L.lineTo(J+K,I-this.cornerRadius)}}A=I;L.closePath();if(!G.collapsed||this.anim){L.stroke()}G.img=new Image();G.img.onload=function(){L.drawImage(G.img,G.corner.x,G.corner.y,16+H.zoomLevel*1,16+H.zoomLevel*1)};var F={x:parseInt(J+K-(8+H.zoomLevel*0.5)),y:parseInt(E+((A-E)/2)-(8+H.zoomLevel*0.5)),w:16+H.zoomLevel*1,h:16+H.zoomLevel*1,data:G};this.corners.push(F);G.corner=F;if(!G.collapsed){G.img.src=mj.glb.imagePath+"pt/minus.png"}else{G.img.src=mj.glb.imagePath+"pt/plus.png"}this.drawTies({r:{x:parseInt(J+K),y:parseInt(E+((A-E)/2)),w:K}});return E+((A-E)/2)-this.scatterHeight/2}};mj.extend(mj.plotterTreeSeries.treeElements,mj.plotterTreeSeries);mj.plotterTreeSeries.productTree=function(A){mj.plotterTreeSeries.productTree.superclass.constructor.call(this,A)};mj.plotterTreeSeries.productTree.prototype={componentClass:"mj.plotterTreeSeries.productTree",init:function(){var B=this;B.wins={alternate:new mj.window({renderTo:mj.NE(),title:"",width:700,height:300,resizable:false,modal:true}),info:new mj.window({renderTo:mj.NE(),title:"",width:700,height:400,maximizable:true,resizable:true,modal:true,buttons:[{title:mj.lng.glb.exit,sc:B,handler:function(){this.sc.wins.info.hide()}},{title:mj.lng.objects.plotter.getTree,disabled:true,sc:B,handler:function(){var C=this.sc.sc;C.store.params.id=this.sc.grids.info.kullanim.selectedRow.data.id;C.load();this.sc.wins.info.hide()}}]})};B.stores={alternate:new mj.store({data:""}),info:{kullanim:new mj.store({url:B.sc.store.url,params:{event:"getDataKullanilanYer"}})}};B.panels={alternate:new mj.panel({renderTo:B.wins.alternate.getBody()}),info:new mj.panel({renderTo:B.wins.info.getBody()})};B.tabPanels={alternate:new mj.tab({renderTo:B.panels.alternate.getBody(),activeTab:0,border:false,hideHeader:true,tabWidth:120,maxTitle:12,items:[{title:"1",iconCls:"tabs",closable:false},{title:"2",iconCls:"tabs",closable:false}]}),info:new mj.tab({renderTo:B.panels.info.getBody(),activeTab:0,border:false,tabWidth:140,maxTitle:15,items:[{title:mj.lng.objects.plotter.itemInfo,iconCls:"tabs",closable:false},{title:mj.lng.objects.plotter.usage,iconCls:"tabs",closable:false}]})};B.tabs={alternate:{op:B.tabPanels.alternate.tabs[0],hm:B.tabPanels.alternate.tabs[1]},info:{bilgi:B.tabPanels.info.tabs[0],kullanimMain:B.tabPanels.info.tabs[1]}};B.tabPanels.kullanim=new mj.tab({renderTo:B.tabs.info.kullanimMain.getBody(),innerTab:B.tabPanels.info,activeTab:0,tabPosition:"bottom",border:false,items:[{title:mj.lng.glb.records,closable:false},{title:mj.lng.objects.plotter.showTree,disabled:true,closable:false}]});B.tabs.info.kullanim=B.tabPanels.kullanim.tabs[0];B.tabs.info.agac=B.tabPanels.kullanim.tabs[1];var A=mj.lng.objects.plotter;B.grids={alternate:{aOp:new mj.grid({renderTo:B.tabs.alternate.op.getBody(),store:B.stores.alternate,pbar:new mj.pager({pos:"bottom",limit:25}),fitToParent:true,cm:[{header:A.isDefault,dataIndex:"isDefault",width:80,renderer:function(C){return'<center><div class="mj-checkbox '+(C==1?"mj-checkbox-checked":"")+'" style="height:16px;float:none;"></div></center>'}},{header:A.code,dataIndex:"code",width:60},{header:A.maxDelay,dataIndex:"maxDelay",width:100},{header:A.operatorCount,dataIndex:"operatorCount",width:100},{header:A.setupTime,dataIndex:"setupTime",width:100},{header:A.station,dataIndex:"station",width:100},{header:A.timePerUnit,dataIndex:"timePerUnit",width:110}]}),aHm:new mj.grid({renderTo:B.tabs.alternate.hm.getBody(),store:new mj.store({data:[]}),pbar:new mj.pager({pos:"bottom",limit:25}),fitToParent:true,cm:[{header:A.id,dataIndex:"id",width:60},{header:A._id,dataIndex:"_id",width:60},{header:A.isDefault,dataIndex:"isDefault",width:80,renderer:function(C){return'<center><div class="mj-checkbox '+(C==1?"mj-checkbox-checked":"")+'" style="height:16px;float:none;"></div></center>'}},{header:A.code,dataIndex:"code",width:200}]})},info:{kullanim:new mj.grid({adi:"myGrid",renderTo:B.tabs.info.kullanim.getBody(),store:B.stores.info.kullanim,pbar:new mj.pager({pos:"bottom",limit:25}),fitToParent:true,cm:[{header:A.id,dataIndex:"id",width:60},{header:A._id,dataIndex:"_id",width:60},{header:A.code,dataIndex:"code",width:200},{header:A.name,dataIndex:"name",width:250},{header:A.type,dataIndex:"tipi",width:100},{header:A.boxContent,dataIndex:"boxContent",width:70},{header:A.profit,dataIndex:"profitContent",width:70},{header:A.stock,dataIndex:"miktar",width:70}]})}};B.plotterTrees={tree:new mj.plotterTree({renderTo:B.tabs.info.agac.getBody(),store:new mj.store({url:B.sc.store.url,params:{event:"getproductTree"}}),backgroundColor:"#eee",resizable:true,fontMap:true,border:false,fontSize:8,marginSize:0})};B.plotterTrees.tree.on("load",function(){this.series.main=[];this.addSeries(new mj.plotterTreeSeries.productTree({store:this.store.data,anim:true,sc:this,fnClick:false}));this.draw()});B.grids.alternate.aHm.on("rowdblclick",function(F,D){var E=this.getNodeFromPath(this.nodePath);var C={};mj.apply(C,E.detail[1]);mj.apply(E,F.selectedRow.data);E.detail[1]=C;this.draw();this.wins.alternate.hide()},B);B.grids.info.kullanim.on("rowdblclick",function(D,C){this.tabs.info.agac.setEnable();this.wins.info.buttons[1].setEnable();this.tabPanels.kullanim.setActive(1);this.plotterTrees.tree.store.params.id=D.selectedRow.data.id;this.plotterTrees.tree.load()},B);B.tabPanels.kullanim.on("tabchange",function(C,E,D){if(D==1&&E==0){this.tabs.info.agac.setDisable();this.wins.info.buttons[1].setDisable()}},B)},prepData:function(E,F,A,H){var D=-1;E.path=A?A.path+(A.path!=""?"|":"")+H:"";if(E.detail&&E.detail[0]){var C=mj.oLength(E.detail[0].data);E.node=F;if(F==1){mj.apply(E,E.data[0])}F+=mj.getIndex(E.detail[0].data,"leafTypeId",4)>-1?2:1;E.childCount=C;E.absChildCount=0;if(!E.collapsed||!this.anim){var G=false,J=false,B=false;var I=E.detail[0].data[0]._sira;while(++D<C){this.prepData(E.detail[0].data[D],F,E,D);E.detail[0].data[D].nodeIndex=D;if(E.childCount>1){if(I!=E.detail[0].data[D]._sira){I=E.detail[0].data[D]._sira;B=true}if((D==0&&E.detail[0].data[D+1]&&E.detail[0].data[D+1].leafTypeId!=4)||(B&&E.detail[0].data[D+1]&&E.detail[0].data[D+1].leafTypeId!=4)){E.detail[0].data[D].isFirst=E.detail[0].data[D].leafTypeId!=4}if(E.detail[0].data[D].leafTypeId!=4&&E.detail[0].data[D].isFirst){E.detail[0].data[D].closed=false}if(E.detail[0].data[D-1]&&E.detail[0].data[D-1].leafTypeId!=4&&E.detail[0].data[D+1]&&E.detail[0].data[D+1].leafTypeId==4&&!B){E.detail[0].data[D].isLast=E.detail[0].data[D].leafTypeId!=4}if(!G&&typeof E.detail[0].data[D].isFirst=="undefined"&&E.detail[0].data[D].leafTypeId==4&&E.detail[0].data[D-1]&&E.detail[0].data[D-1].leafTypeId!=4){E.detail[0].data[D].isFirst=true;E.detail[0].data[D].absChildCount=0;G=true}if(typeof E.detail[0].data[D].isLast=="undefined"){E.detail[0].data[D].isLast=D==C-1}if(B){B=false;G=false}}else{E.detail[0].data[D].isFirst=E.detail[0].data[D].isLast=false}E.absChildCount+=E.detail[0].data[D].absChildCount}}else{E.absChildCount=1;if(E.leafTypeId!=4&&E.isFirst){E.closed=false}}}else{E.node=F;E.childCount=0;E.absChildCount=E.leafTypeId==4&&E.isFirst?0:1}this.nodeDepth=E.node>this.nodeDepth?E.node:this.nodeDepth;return E},_draw:function(H,I,B,M){var L=this.vars.ctx,J=this.vars.sc;var E=-1;var K=false;if(H.detail&&H.detail[0]){var D=H.node-1;var C=mj.oLength(H.detail[0].data);if(!H.collapsed){while(++E<C){this._draw(H.detail[0].data[E],I,H.detail[0].data,H.detail[1]&&H.isDefault==0)}this.currentNode-=mj.getIndex(H.detail[0].data,"leafTypeId",4)>-1?2:1}else{this.currentNode=H.node}}for(var D=0;D<this.nodeDepth;D++){this.depths[D]+=this.anim?((H.childCount==0||H.collapsed)?((H.leafTypeId==4&&H.isFirst)?0:1):0):(H.childCount==0?((H.leafTypeId==4&&H.isFirst)?0:1):(H.collapsed?H.absChildCount:0))}if(H.node==this.currentNode){if(H.childCount>0&&(!H.collapsed||!this.anim)){var F=this.drawTieBinds(H.detail[0].data,H,B);H.top=(H.detail[0].data[0].top+mj.oLength(H.detail[0].data)-1)/2;H.y=parseInt(F)}else{H.top=this.depths[this.currentNode-1]-1;H.y=parseInt(H.top*(this.scatterHeight+this.margins.b+this.margins.t)+this.margins.t)}K=true}else{if(H.childCount==0){this.currentNode=H.node;H.top=this.depths[this.currentNode-1]-1;H.y=parseInt(H.top*(this.scatterHeight+this.margins.b+this.margins.t)+this.margins.t);K=true}}if(K){H.x=parseInt((this.nodeDepth-H.node)*(2*this.tieLength+(this.scatterWidth))+this.margins.l+this.tieLength+(H.leafTypeId==4?(2*this.tieLength+(this.scatterWidth)):0));var A=this.cornerRadius;if(H.detail&&H.detail[1]){var G={x:parseInt(H.x+(A/2)),y:parseInt(H.y+16+A+J.zoomLevel*1),w:16+J.zoomLevel*1,h:16+J.zoomLevel*1,data:H};this.subs.push(G);H.sub=G;if(!H.imgSub){H.imgSub=new Image();H.imgSub.onload=function(){L.drawImage(H.imgSub,H.sub.x,H.sub.y,16+J.zoomLevel*1,16+J.zoomLevel*1)}}H.imgSub.src=mj.glb.imagePath+"pt/information.png"}if(H.detail&&H.detail[1]&&H.isDefault==0||M){H.lineColor="#f00"}else{delete H.lineColor}this.drawBox(H,B)}return H},drawTies:function(D,A){var N=this.vars.ctx,G=this.vars.sc;var J,H,L;J=D.r.x;H=D.r.y;L=D.r.w;var K=J-(this.scatterWidth/2),I=H-(this.scatterHeight/2);N.save();N.strokeStyle=G.parseColor(D.color||"#343e40").scale(null,null,null,0.5).toString();N.beginPath();N.moveTo(J,H);if(D.leafTypeId==4){if(D.isFirst){N.moveTo(J-this.scatterWidth-L,H);N.lineTo(J-this.scatterWidth,H);N.lineTo(J-this.scatterWidth-L,H)}if(D.isLast){N.moveTo(J,H);N.lineTo(J+this.tieLength,H);N.lineTo(J,H)}var C=parseInt(D.nodeIndex),E=false,M;while(--C>-1&&!E){if(A[C].leafTypeId==4){M=C;E=true}}if(E){N.moveTo(K,I);N.lineTo(K,A[M].y+this.scatterHeight);N.lineTo(K,I)}}else{if(D.isFirst){N.lineTo(J+L,H);N.lineTo(J,H)}else{if(D.isLast){N.moveTo(J+L,H);N.lineTo(J,H);N.lineTo(J+L,H);var F=mj.getIndex(A,"closed",false);if(F>-1){var B=A[F];delete B.closed;N.lineTo(B.r.x+B.r.w,B.r.y);N.lineTo(J+L,H)}}else{N.lineTo(J+L,H);N.closePath()}}}N.stroke();N.restore()},drawTieBinds:function(E,H,A){var M=this.vars.ctx,I=this.vars.sc;var K,J,L;var D=-1,F=false,B=false,C=mj.oLength(E);M.strokeStyle=I.parseColor(E.color||"#343e40").scale(null,null,null,0.5).toString();M.beginPath();K=E[C-1].r.x;J=B=F=E[C-1].r.y;L=E[C-1].r.w;H.img=new Image();H.img.onload=function(){M.drawImage(H.img,H.corner.x,H.corner.y,16+I.zoomLevel*1,16+I.zoomLevel*1)};var G={x:parseInt(K+L-8),y:parseInt(F+((B-F)/2)-(8+I.zoomLevel*0.5)),w:16+I.zoomLevel*1,h:16+I.zoomLevel*1,data:H};this.corners.push(G);H.corner=G;if(!H.collapsed){H.img.src=mj.glb.imagePath+"pt/minus.png"}else{H.img.src=mj.glb.imagePath+"pt/plus.png"}this.drawTies({r:{x:parseInt(K+L),y:parseInt(F+((B-F)/2)),w:L}},A);return F+((B-F)/2)-this.scatterHeight/2},afterClick:function(A){if(A.leafTypeId!=4&&A.isFirst){A.closed=false}},_fnClick:function(F,A,G){var E=this.isSub(A,G),C=mj.lng.objects.plotter;if(E){var B=this.wins.alternate;if(E.data.leafTypeId==4){if(E.data.detail[1].data.length>1){B.setTitle(C.altOperation)}else{B.setTitle(C.infoOperation)}this.stores.alternate.data=E.data.detail[1].data;this.grids.alternate.aOp.load();B.show();this.tabPanels.alternate.setActive(0)}else{this.nodePath=E.data.path;B.setTitle(C.altMaterial);this.grids.alternate.aHm.store.data=E.data.detail[1].data;this.grids.alternate.aHm.load();B.show();this.tabPanels.alternate.setActive(1)}}var D=this.isInfo(A,G);if(D&&D.data.leafTypeId!=4){var B=this.wins.info;B.setTitle(C.infoItem+D.data.code);this.grids.info.kullanim.store.params.id=D.data.leafId||-1;B.show();this.tabPanels.info.setActive(1);this.tabPanels.kullanim.setActive(0);this.grids.info.kullanim.load()}},getNodeFromPath:function(path){var pre="this.store.data",tmp=".detail[0].data[x]";var ta=path.split("|"),i=-1,str="";while(++i<ta.length){str+=tmp.replace("x",ta[i])}return eval(pre+str)}};mj.extend(mj.plotterTreeSeries.productTree,mj.plotterTreeSeries.treeElements);mj.desktop=function(A){mj.desktop.superclass.constructor.call(this,A)};mj.desktop.prototype={componentClass:"mj.desktop",position:"bottom",initTabWidth:150,background:"#fff",contextMenu:true,fishEye:false,multipleWindow:false,helpPath:false,deskIconTpl:new mj.template(['<div class="desktop-icon" id="deskItem-{id}" style="position:absolute;{positionStyle}">','<table><tr><td align="center"><div class=""><img id="img-{id}" src="{deskIcon}" style="z-index:0;" title="{title}"></div></td></tr>','<tr><td align="center"><span id="span-{id}"  class="x-editable">{title}</span></td></tr></table></div>']),QLIconTpl:new mj.template('<div class="quick-launch-item" id="QLItem-{id}"><img id="ql-img-{id}" src="{QLIcon}" title="{title}"></div>'),render:function(){var E=this;if(E.position=="top"){E.tBarCnt=mj.NE(E.renderTo,{tag:"div",cls:"mj-desktop-taskbar-top"});E.body=mj.NE(E.renderTo,{tag:"div",cls:"mj-desktop-body mj-resize-handle",style:"background:"+E.background+";overflow:auto;width:"+(E.renderTo.width())+"px;height:"+(E.renderTo.height()-28)+"px;"})}else{if(E.position=="bottom"){E.body=mj.NE(E.renderTo,{tag:"div",cls:"mj-desktop-body mj-resize-handle",style:"background:"+E.background+";overflow:auto;width:"+(E.renderTo.width())+"px;height:"+(E.renderTo.height()-28)+"px;"});E.tBarCnt=mj.NE(E.renderTo,{tag:"div",cls:"mj-desktop-taskbar-bottom"})}}E.tBarMenu=mj.NE(E.tBarCnt,{tag:"div",cls:"mj-desktop-taskbar-menu"});E.tBarQL=mj.NE(E.tBarCnt,{tag:"div",cls:"mj-desktop-taskbar-ql"});E.tBarTab=mj.NE(E.tBarCnt,{tag:"div",cls:"mj-desktop-taskbar-tab"});E.tBarRA=mj.NE(E.tBarCnt,{tag:"div",cls:"mj-desktop-taskbar-ra"});mj.loading=$(mj.NE(E.tBarRA,{cls:"mj-desktop-taskbar-loader"}));E.tabContainerWidth=E.renderTo.width()-310;var G=$(E.tBarQL).offset();width=$(E.tBarQL).width();height=$(E.tBarQL).height();G.right=G.left+width;G.bottom=G.top+height;$().mousemove(function(I){if(window.mjDragging){A=I.clientX;y=I.clientY;if(A>=G.left&&A<=G.right&&y>=G.top&&y<=G.bottom){$(E.tBarQL).addClass("mj-ql-hover");E.onQL=true}else{$(E.tBarQL).removeClass("mj-ql-hover");E.onQL=false}}});E.tBarSD=mj.NE(E.tBarQL,{tag:"div",cls:"mj-desktop-taskbar-show-desktop"});$(E.tBarSD).bind("click",{scope:E},function(L){var K=L.data.scope;if(K.beforeSD.length>0){for(var J=0,I=K.beforeSD.length;J<I;J++){K.windows[K.beforeSD[J]].window.show()}K.beforeSD=[]}else{while(K.winHistory.length>0){K.beforeSD.push(K.winHistory[0]);K.windows[K.winHistory[0]].window.minimize()}}});if(E.menuItems){mj.apply(E.menuItems,{renderTo:E.tBarMenu,drag:true});E.menu=new mj.menu(E.menuItems);E.menu.on("itemclick",E._menuItemClick,E);E.menu.on("beforedrag",function(K,J,I){return !I.subMenu},this);E.menu.on("dragstop",function(O,J){if(mj.getIndex(this.desktopItems,"id",J.id)==-1){var N=$(this.menu.activeSub?this.menu.activeSub._el:J.renderTo);var M=N.offset();M.right=M.left+N.width();M.bottom=M.top+N.height();var L=parseInt(O.proxy[0].style.top),K=parseInt(O.proxy[0].style.left);if(K<M.left||K>M.right||L<M.rop||L>M.bottom){var P="top:"+L+"px;left:"+K+"px;";var I=this.getMenuItemById(this.menuItems.items,J.id);I.positionStyle=P;if(I){this.desktopItems.push(I)}this.addDesktopIcon(this.desktopItems.length-1,I);setCookie("deskItem-"+J.id,P,365,"/")}}},this)}if(E.desktopItems){var F=getCookieArray("deskItem-");for(var D=0,B=F.length;D<B;D++){var A=F[D].replace("deskItem-","").trim();E.desktopItems.remove(A);E.desktopItems.push(A)}for(var D=0,B=E.desktopItems.length;D<B;D++){var A=E.getMenuItemById(E.menuItems.items,E.desktopItems[D]);if(A){E.desktopItems[D]=A}}E.showDesktopIcon()}if(E.QLItems){var H=getCookieArray("QLItem-");for(var D=0,B=H.length;D<B;D++){var A=H[D].replace("QLItem-","").trim();E.QLItems.remove(A);E.QLItems.push(A)}for(var D=0,B=E.QLItems.length;D<B;D++){var A=E.getMenuItemById(E.menuItems.items,E.QLItems[D]);if(A){E.QLItems[D]=A}}E.showQLIcon()}if(E.fishEye){E.addFishEyeMenu()}var C=getCookie("backgroundImage");if(C){this.changeBackground(C)}$(this.body).bind("contextmenu",{scope:this},function(J){if($(J.target).hasClass("mj-desktop-body")){var I=new mj.menu({renderTo:mj.NE(),canHide:true,style:"vertical",width:170,items:[{id:"_1",title:"MasaÃ¼stÃ¼ DeÄiÅtir",iconCls:""}]});if(J.data.scope.contextMenu){I.trigger("show",I,J.pageY,J.pageX);I.showAt(J.pageX,J.pageY)}J.preventDefault();J.stopPropagation();I.on("itemclick",function(L,K,N,M){this.scope.runApp(this.scope.getMenuItemById(this.scope.menuItems.items,"changeBackground"))},J.data)}});$(window).bind("resize",{scope:E},function(I){I.data.scope.doDesktop()});mj.bindResize(E.body,E.doDesktop,E)},changeBackground:function(A){var B="url('"+A+"')";$(this.body).css("background",B);setCookie("backgroundImage",A,365,"/")},addFishEyeMenu:function(){var B=['<td class="fisheye" style="vertical-align:bottom;"><div><img src="{FEIcon}" title="{title}" style="width:48px;height:48px;margin-top:0px;"></div></td>'];this.shiftFish=mj.NE(this.body,{tag:"div",style:"width:1px;height:"+($(this.body).height()-150)+"px"});var A=mj.NE(this.body,{tag:"table",style:"width :100%;height:150px;",html:'<tbody><tr><td style="width:50%;"><td style="vertical-align:bottom;"><table><tr class="fisheye"></tr></table></td><td style="width:50%;"></tr></tbody>'});var C=$(".fisheye",A)[0];$(A).bind("contextmenu",{scope:this},function(D){D.preventDefault();D.stopPropagation()});this.fisheyeMenu=new mj.fisheye({size:48,magnitude:1.5,renderTo:C,mouseCnt:A,store:new mj.store({data:this.QLItems}),tpl:new mj.template(B),overClass:false,selectedClass:false,selector:"td.fisheye"});this.fisheyeMenu.on("itemclick",function(D){this.runApp(D.selections[0].store)},this);this.fisheyeMenu.load()},addQLIcon:function(C,A){var B=this;$(this.tBarQL).append(this.QLIconTpl.apply(A));this.QLItems[C].qel=mj.get("QLItem-"+this.QLItems[C].id);$(this.QLItems[C].qel).bind("contextmenu",{item:this.QLItems[C],scope:this},function(E){var D=new mj.menu({renderTo:mj.NE(),canHide:true,style:"vertical",width:130,items:[{id:"_1",title:"Sil",iconCls:"mj-menu-delete-icon"}]});D.trigger("show",D,E.pageY,E.pageX);D.showAt(E.pageX,E.pageY);E.preventDefault();E.stopPropagation();D.on("itemclick",function(G,F,I,H){this.scope.removeQLIcon(this.item)},E.data)});$(this.QLItems[C].qel).bind("click",{item:this.QLItems[C],scope:this},function(D){D.data.scope.runApp(D.data.item)});if(B.fishEye&&B.fisheyeMenu){$(B.fisheyeMenu.renderTo).empty();B.fisheyeMenu.load()}},showQLIcon:function(){for(var C=0,B=this.QLItems.length;C<B;C++){var A=this.QLItems[C];if(typeof A=="object"){this.addQLIcon(C,A)}}},removeQLIcon:function(A){this.QLItems.remove(A);$(A.qel).remove();deleteCookie("QLItem-"+A.id,"/");if(this.fishEye&&this.fisheyeMenu){$(this.fisheyeMenu.renderTo).empty();this.fisheyeMenu.load()}},showDesktopIcon:function(){var E={w:$(this.body).width(),h:$(this.body).height()};for(var D=0,C=this.desktopItems.length;D<C;D++){var B=this.desktopItems[D];if(typeof B=="object"){var A=getCookie("deskItem-"+B.id);if(!A){if(B.position){if(B.position.start&&B.position.start!="tl"){switch(B.position.start){case"tr":B.position.x=E.w-parseInt(B.position.x);break;case"bl":B.position.y=E.h-parseInt(B.position.y);break;case"br":B.position.x=E.w-parseInt(B.position.x);B.position.y=E.h-parseInt(B.position.y);break}}B.positionStyle="top:"+B.position.y+"px;left:"+B.position.x+"px;"}else{B.positionStyle="top:"+this.iconTop+"px;left:"+this.iconLeft+"px;";if(this.iconTop+140<E.h){this.iconTop=20;this.iconLeft+=70}else{this.iconTop+=70}}}else{B.positionStyle=A}this.addDesktopIcon(D,B)}}},removeDesktopIcon:function(A){this.desktopItems.remove(A);$(A.el).remove();deleteCookie("deskItem-"+A.id,"/")},deselectAll:function(){var C=this;for(var B=0,A=C.desktopItems.length;B<A;B++){var D=C.desktopItems[B];if(D.el){$(D.el).removeClass("mj-desktop-icon-selected");C.setTitle(D,D._shortTitle)}}},setTitle:function(A,B){A.titleEl[0].innerHTML=B},addDesktopIcon:function(F,A){var E=this;var G=A.title;G=G.split(" ");var D=0;for(var C=0,B=G.length;C<B;C++){D+=G[C].length;if(D>10){G[C]=G[C]+"<br/>";D=0}}G=G.join(" ");this.desktopItems[F]._title=G;this.desktopItems[F]._shortTitle=(A.title.length>12)?(A.title.slice(0,10)+"..."):A.title;A.title=this.desktopItems[F]._shortTitle;$(this.body).append(this.deskIconTpl.apply(A));this.desktopItems[F].el=mj.get("deskItem-"+this.desktopItems[F].id);this.desktopItems[F].titleEl=$("span",this.desktopItems[F].el);$(this.desktopItems[F].el).bind("contextmenu",{item:this.desktopItems[F],scope:this},function(I){var H=new mj.menu({renderTo:mj.NE(),canHide:true,style:"vertical",width:130,items:[{id:"_1",title:mj.lng.glb.del,iconCls:"mj-menu-delete-icon"}]});H.trigger("show",H,I.pageY,I.pageX);H.showAt(I.pageX,I.pageY);I.preventDefault();I.stopPropagation();H.on("itemclick",function(K,J,M,L){this.scope.removeDesktopIcon(this.item)},I.data)});$(this.body).bind("mousedown",{scope:this},function(H){H.data.scope.deselectAll()});$(this.desktopItems[F].el).bind("click",{item:this.desktopItems[F],scope:this},function(H){$(H.data.item.el).addClass("mj-desktop-icon-selected");E.setTitle(H.data.item,H.data.item._title)});$(this.desktopItems[F].el).bind("dblclick",{item:this.desktopItems[F],scope:this},function(H){H.data.scope.runApp(H.data.item)});if(!this.desktopItems[F].fixed){this.desktopItems[F].dragHandle=new mj.drag({el:this.desktopItems[F].el,parent:this.body,proxy:false});this.desktopItems[F].dragHandle.on("dragstart",function(J,H){var I=$(this.el);this.beforeDragXY={top:I.css("top"),left:I.css("left")}},this.desktopItems[F]);this.desktopItems[F].dragHandle.on("dragstop",function(J,H){if(E.onQL){if(mj.getIndex(E.QLItems,"id",this.id)==-1){if(E.QLItems.length<5){E.QLItems.push(this);E.addQLIcon(E.QLItems.length-1,this);setCookie("QLItem-"+this.id,"OK",365,"/")}}var I=$(this.el);I.css("top",this.beforeDragXY.top);I.css("left",this.beforeDragXY.left);$(E.tBarQL).removeClass("mj-ql-hover")}else{var K="top:"+parseInt(J._el[0].style.top)+"px;left:"+parseInt(J._el[0].style.left)+"px;";setCookie("deskItem-"+this.id,K,365,"/")}},this.desktopItems[F])}},getMenuItemById:function(B,E){for(var C=0,A=B.length;C<A;C++){if(B[C].items){var D=this.getMenuItemById(B[C].items,E);if(D){return D}}else{if(B[C].id==E){return B[C]}}}return false},doDesktop:function(){$(this.body).width(this.renderTo.width());var A=this.renderTo.height()-28;$(this.body).height(this.renderTo.height()-28);if(this.shiftFish){$(this.shiftFish).height(A-150)}if(this.fishEye&&this.fisheyeMenu){this.fisheyeMenu.getCenterPoint()}$(this.body).trigger("kkresize")},_menuItemClick:function(B,A,C){if(A.url){this.runApp(A)}},runApp:function(D){var C=this;if(D.multipleWindow||!C.windows[D.id]){var B=D.multipleWindow?mj.genId("win"):D.id;var F=new mj.window({destroyOnClose:true,minimizable:typeof D.minimizable!="undefined"?D.minimizable:true,maximizable:typeof D.maximizable!="undefined"?D.maximizable:true,closable:typeof D.closable!="undefined"?D.closable:true,wM:C.wM,id:D.id,parent:C.body,renderTo:C.body,modal:D.modal||false,title:D.title,width:D.width||600,height:D.height||350,minWidth:D.minWidth||D.width||600,minHeight:D.minHeight||D.height||350,buttons:D.buttons,autoLoad:{url:D.url,params:{id:D.id,winDesktopId:B,title:D.title,jspath:D.jspath,jsurl:D.jsurl,optparams:D.optparams,multipleWindow:D.multipleWindow}}});F.on("close",function(G,I){var H=this;F.tab.remove();F=null;this.winHistory.remove(G.winDesktopId);this.windows[D.multipleWindow?G.winDesktopId:G.id]=null;if(this.tabWidth<this.initTabWidth&&(this.winHistory.length)*(this.tabWidth+12)<(this.tabContainerWidth-12)){this.tabWidth=parseInt((this.tabContainerWidth-12)/(this.winHistory.length))-12;if(this.tabWidth>this.initTabWidth){this.tabWidth=this.initTabWidth}$(".mj-desktop-taskbar-tab-item").width(this.tabWidth);$(".mj-desktop-taskbar-tab-item span").each(function(J){this.innerHTML=this.getAttribute("name").ellipse(parseInt((H.tabWidth)/6))})}if(this.winHistory.length>0&&!this.windows[this.winHistory[this.winHistory.length-1]].window.minimized){this.windows[this.winHistory[this.winHistory.length-1]].window.show()}},C);F.on("activate",function(G){C.activeWindow=G});F.on("minimize",function(G,H){this.windows[G.winDesktopId].tab.removeClass("active-tab");this.winHistory.remove(G.winDesktopId);if(this.winHistory.length>0&&!this.windows[this.winHistory[this.winHistory.length-1]].window.minimized){this.windows[this.winHistory[this.winHistory.length-1]].window.show()}},C);var E={window:F};if(D.multipleWindow){F.winDesktopId=C.windows.push(E,B)}else{C.windows[D.id]=E;F.winDesktopId=D.id}E.id=F.winDesktopId;if((C.winHistory.length+1)*(C.tabWidth+12)>(C.tabContainerWidth-12)){C.tabWidth=parseInt((C.tabContainerWidth-12)/(C.winHistory.length+1))-12;$(".mj-desktop-taskbar-tab-item").width(C.tabWidth);$(".mj-desktop-taskbar-tab-item span").each(function(G){this.innerHTML=this.getAttribute("name").ellipse(parseInt((C.tabWidth)/6))})}var A=E.tab=F.tab=$(mj.NE(C.tBarTab,{tag:"div",cls:"mj-desktop-taskbar-tab-item",style:"width:"+(C.tabWidth)+"px;",html:'<span name="'+D.title+'">'+D.title.ellipse(parseInt((C.tabWidth)/6))+"</span>"}));A.bind("contextmenu",{obj:E,scope:C},function(H){var G=new mj.menu({renderTo:mj.NE(),canHide:true,style:"vertical",width:130,items:[{id:"_1",title:"Kapat",iconCls:"mj-menu-close-icon"}]});G.trigger("show",G,H.pageY,H.pageX);G.showAt(H.pageX,H.pageY);H.preventDefault();H.stopPropagation();G.on("itemclick",function(J,I,L,K){this.obj.window.close()},H.data)});A.bind("click",{obj:E,scope:C},function(I){var G=I.data.scope,H=I.data.obj;if($(this).hasClass("active-tab")){H.window.minimize()}else{H.window.show()}})}(E||C.windows[D.id]).window.show()},showHelp:function(B){if(this.helpPath){var A=B?(this.helpPath+"index.html#help_"+B+"&"+B+".html"):this.helpPath+"index.html";this.helpWin=mj.newWindow({url:A})}},init:function(){var B=this;B.wM=new mj.windowManager();B.tabStrLen=B.initTabStrLen;B.tabWidth=B.initTabWidth;B.iconLeft=20;B.iconTop=20;var A=B.windows={};B.windows.push=function(D,E){D.winDesktopId=E;A[D.winDesktopId]=D;return D.winDesktopId};B.winHistory=[];B.beforeSD=[];B.render();B.wM.on("activate",function(D){$(".mj-desktop-taskbar-tab-item").removeClass("active-tab");this.windows[D.winDesktopId].tab.addClass("active-tab");this.winHistory.remove(D.winDesktopId);this.winHistory.push(D.winDesktopId)},B);mj.loaderShow=function(){mj.loading.addClass("show-loader")};mj.loaderHide=function(){mj.loading.removeClass("show-loader")};$().ajaxStart(function(){mj.loaderShow()}).ajaxStop(function(){mj.loaderHide()});var C=this;mj.shortcuts.on("F1",function(){C.showHelp(C.activeWindow&&C.activeWindow.helpId?C.activeWindow.helpId:false)});B.fakeInput=mj.NE(mj.NE(mj.bd,{style:"display:none;position:absolute;left:-9999px;top:-9999px;"}),{tag:"input"});B.fakeInput.focus()}};mj.extend(mj.desktop,mj.component);mj.cpager=function(A){mj.cpager.superclass.constructor.call(this,A)};mj.cpager.prototype={componentClass:"mj.cpager",actionEvent:"click",render:function(B){var C=this;mj.apply(B.scope.store.params,B.scope.pbar.params);B.scope.pbar.store=B.scope.store;var D=B.scope.cnt.height();var A=B.scope.cnt.width();if(B.scope.pbar.pos&&B.scope.pbar.pos=="lr"){B.scope.pageBarPrev=mj.NE(B.scope.cnt,{tag:"div",style:"height:"+D+"px;",cls:"mj-carousel-left",html:'<div class="mj-split-left">'+mj.insertSpacer(9,10)+"</div>"});B.scope.renderTo=mj.NE(B.scope.cnt,{tag:"div",style:"float:left;overflow:hidden;width:"+(A-20)+"px;height:"+D+"px;"});B.scope.pageBarNext=mj.NE(B.scope.cnt,{tag:"div",style:"height:"+D+"px;",cls:"mj-carousel-right",html:'<div class="mj-split-right">'+mj.insertSpacer(9,10)+"</div>"})}else{B.scope.renderTo=mj.NE(B.scope.cnt,{tag:"div",style:"overflow:auto;height:"+((B.scope.cnt.height()||parseInt(B.scope.cnt[0].style.height))-25)+"px;"});B.scope.pageBar=mj.NE(B.scope.cnt,{tag:"div",cls:"mj-paging"})}B.scope.pbar.renderTo=B.scope.pageBar;$(B.scope.pageBarPrev).bind(C.actionEvent,function(){C.prev()});$(B.scope.pageBarNext).bind(C.actionEvent,function(){C.next()})}};mj.extend(mj.cpager,mj.pager);mj.carousel=function(A){mj.carousel.superclass.constructor.call(this,A)};mj.carousel.prototype={magnitude:2,align:"center",bigClass:"mj-carousel-big",_onItemOver:function(G,F,E){E.stopPropagation();$("#carousel-dummy").remove();var J=this;var A=$(F);var B=A.offset();var H=A.width(),D=A.height();var I={};I.width=H*J.magnitude;I.height=D*J.magnitude;if(J.align=="center"){I.left=(B.left-((H/2)*(J.magnitude-1)));I.top=(B.top-((D/2)*(J.magnitude-1)))}else{if(J.align=="topleft"){I.left=B.left;I.top=B.top}else{if(J.align=="topcenter"){I.left=(B.left-((H/2)*(J.magnitude-1)));I.top=B.top-I.height}else{if(J.align=="mouselb"){I.left=E.clientX;I.top=E.clientY}else{if(J.align=="mouserb"){I.left=E.clientX-I.width;I.top=E.clientY}}}}}var C=$(mj.NE(mj.bd,{tag:"div",id:"carousel-dummy",cls:this.bigClass,style:"border:1px solid #ddd;position:absolute;left:"+I.left+"px;top:"+I.top+"px;width:"+I.width+"px;height:"+I.height+"px;"}));C.append(A.find("img").clone());C.click(function(){A.trigger("click");$("#carousel-dummy").remove()});C.mouseout(function(){$("#carousel-dummy").remove()})},init:function(){var A=this;mj.carousel.superclass.init.call(A);A.on("onItemOver",function(C,B,D){A._onItemOver(C,B,D)})}};mj.extend(mj.carousel,mj.view);mj.fisheye=function(A){mj.fisheye.superclass.constructor.call(this,A)};mj.fisheye.prototype={componentClass:"mj.fisheye",magnitude:2,size:64,getCenterPoint:function(){var D=this;for(var C=0,A=D.items.length;C<A;C++){var E=$(D.items[C].el);D.items[C].img=E.find("img");D.items[C].img[0].style.width=D.size+"px";D.items[C].img[0].style.height=D.size+"px";E.width(D.size);E.height(D.size);var B=E.offset();var F={};F.left=B.left+(D.size/2);F.top=B.top+(D.size/2);D.items[C].centerPoint=F;D.items[C].initCP={top:F.top,left:F.left}}},init:function(){var A=this;A.mouseCnt=$(A.mouseCnt)||A.cnt;mj.fisheye.superclass.init.call(A);A.on("afterload",function(){this.getCenterPoint()},A);A.mouseCnt.bind("mousemove",function(G){for(var D=0,B=A.items.length;D<B;D++){var F=A.items[D].centerPoint;var E=1;if(Math.abs(F.top-G.clientY)<(A.size*(1.5))&&Math.abs(F.left-G.clientX)<(A.size*2)){E=E+((A.magnitude-1)*(((A.size*2)-Math.abs(F.left-G.clientX))/(A.size*2)))}var C=parseInt(A.size*E);A.items[D].img[0].style.width=C+"px";A.items[D].img[0].style.height=C+"px";if(C>A.size){A.items[D].centerPoint.left=A.items[D].initCP.left+((C-A.size)/2);A.items[D].centerPoint.top=A.items[D].initCP.top+((C-A.size)/2)}}});A.mouseCnt.bind("mouseover",function(B){A.reg=A.mouseCnt.offset();A.reg.right=A.reg.left+A.mouseCnt.width();A.reg.bottom=A.reg.top+A.mouseCnt.height()});$().bind("mousemove",{scope:this},function(F){var E=F.data.scope;if(E.reg&&(F.clientX<E.reg.left||F.clientX>E.reg.right||F.clientY<E.reg.top||F.clientY>E.reg.bottom)){for(var C=0,B=E.items.length;C<B;C++){var D=E.items[C].img[0].style;D.width=E.size+"px";D.height=E.size+"px"}}})}};mj.extend(mj.fisheye,mj.view);mj.gantt=function(A){mj.gantt.superclass.constructor.call(this,A)};mj.gantt.prototype={componentClass:"mj.gantt",width:1000,stores:false,firstColumnWidth:120,chartWidth:false,resHeight:160,durationUnit:"second",firstDate:false,lastDate:false,timeInterval:"6hour",timeIntervalWidth:50,cellHeight:22,barHeight:15,barTop:2,doneBarHeight:5,doneBarTop:7,offTime:false,station:false,canvasColor:"#fff",oddEven:false,buttons:false,windows:false,forms:false,grids:false,layouts:false,series:false,lastUpdate:0,updateTaskInterval:3000,canvasItemsDraw:false,liveUpdate:true,displayLabels:false,details:{ref:false,customer:false,checkDependTasks:false},timeRangeMap:[{ms:60000,f:"H:i",name:"minute",up:"5minute",top:"quarterHour",title:"1 dakika"},{ms:300000,f:"H:i",name:"5minute",up:"quarterHour",top:"halfHour",title:"5 dakika"},{ms:600000,f:"H:i",name:"10minute",up:"halfHour",top:"hour",title:"10 dakika"},{ms:900000,f:"H:i",name:"quarterHour",up:"hour",top:"3hour",title:"15 dakika",min:true},{ms:1800000,f:"H:i",name:"halfHour",up:"2hour",top:"4hour",title:"30 dakika"},{ms:3600000,f:"H:i",name:"hour",up:"3hour",top:"6hour",title:"1 saat"},{ms:7200000,f:"H:i",name:"2hour",up:"4hour",top:"8hour",title:"2 saat"},{ms:10800000,f:"H:i",name:"3hour",up:"6hour",top:"12hour",title:"3 saat"},{ms:14400000,f:"H:i",name:"4hour",up:"8hour",top:"12hour",title:"4 saat"},{ms:21600000,f:"H:i",name:"6hour",up:"12hour",top:"day",title:"6 saat"},{ms:28800000,f:"H:i",name:"8hour",up:"day",top:"2day",title:"8 saat"},{ms:43200000,f:"H:i",name:"12hour",up:"day",top:"2day",title:"12 saat"},{ms:86400000,f:"d/m",name:"day",up:"2day",top:"week",title:"1 gÃ¼n"},{ms:172800000,f:"d/m",name:"2day",up:"week",top:"4week",title:"2 gÃ¼n",max:true},{ms:604800000,f:"d/m",name:"week",title:"1 hafta"},{ms:2419200000,f:"d/m",name:"4week",title:"4 hafta"}],timeRange:["minute","5minute","10minute","quarterHour","halfHour","hour","2hour","3hour","4hour","6hour","8hour","12hour","day","2day","week","4week"],_firstDateSetted:false,_lastDateSetted:false,id:false,prefix:false,resCollapsed:true,render:function(){var C=this,E=C.domEls,G=C.id,F=mj.NE,A=C.firstColumnWidth,B=C.renderTo.width(),D=C.renderTo.height();C._labelsOn=C.displayLabels;C.waitMask=$(F(C.renderTo,{cls:"mj-page-wait-mask mj-opacity-8",style:"display:none;width:"+B+"px;height:"+D+"px;",html:'<table width="100%" height="100%"><tr><td align="center" valign="middle"><img src="'+mj.glb.imagePath+'ajax-loader.gif"/><br/><br/><span class="mj-page-wait-title">LÃ¼tfen Bekleyin...</span></td></tr></table>'}));E.quickMsgEls={"cnt":$(F(C.renderTo,{cls:"mj-gantt-quick-msg",style:"width:"+B+"px;top:-20px",html:'<table width="100%" height="20px" cellpadding="0" cellspacing="0" style="position:absolute;top:0;"><tr><td align="center" valign="top"><table cellpadding="0" cellspacing="0"><tr><td style="width:20px;background:transparent url('+mj.glb.imagePath+'gantt-info.png) no-repeat 0 0">'+mj.insertSpacer(20,20)+'</td><td style="background:transparent url('+mj.glb.imagePath+'gantt-info.png) repeat-x 0 -40px"><span>...</span></td><td style="width:20px;background:transparent url('+mj.glb.imagePath+'gantt-info.png) no-repeat 0 -20px">'+mj.insertSpacer(20,20)+"</td></tr></table></td></tr></table>"}))};E.quickMsgEls.content=$("span",E.quickMsgEls.cnt);C.waitMaskShow();setTimeout(function(){C.windows={};C.forms={};C.grids={};C.layouts={};C.canvasItemsDraw={vardiya:{p:{d:true,l:true},g:{d:true,l:true}},personel:{p:{d:true,l:false},g:{d:true,l:false}},kasa:{a:true,ts:false,items:C.stores.kasaStore.data}};C.series={};var Y=16;C._chartClientWidth=C.width;var J=[];J.push({region:"west",initial:260,min:260,max:400,split:true,collapsible:true});C.layouts.main=new mj.layout({renderTo:F(C.renderTo,{tag:"div",id:"layout-cnt"}),layout:"border",items:J});C.tasks=C.stores.grid.data;if(C.details.ref){C.referans=C.stores.referans.data}if(C.details.customer){C.customer=C.stores.customer.data}C.layouts.west=new mj.layout({renderTo:F(C.layouts.main.getBody("west")),layout:"border",items:[{region:"south",initial:83,min:83,max:100,split:true,collapsible:true,collapsed:true}]});C.gridPanel=new mj.panel({renderTo:C.layouts.west.getBody("center"),fitToParent:true,border:false});var c=[{header:"id",dataIndex:"id",width:30},{header:"SÃ¼re",dataIndex:"duration",width:120,renderer:function(h,g,f){return C.renderTaskGridEls(h,g,f,C)}},{header:"Operasyon",dataIndex:"name",width:70}];if(C.details.ref){c.push({header:"Referans",dataIndex:"referans",width:70,renderer:function(g){var f=C.getReferans(g);return f.name}})}if(C.details.customer){c.push({header:"MÃ¼Återi",dataIndex:"customerId",width:70,renderer:function(g){var f=C.getCustomer(g);return f.code}})}c.push({header:"Op#",dataIndex:"operator",width:60});c.push({header:"Ä°st.",dataIndex:"station",renderer:function(g){var f=C.getStationData(g);return f.name},width:60});c.push({header:"BaÅlangÄ±Ã§",dataIndex:"startDate",width:100,renderer:function(f){return(f instanceof Date)?f.formatDate("d/m/Y H:i"):""}});c.push({header:"BitiÅ",dataIndex:"finishDate",width:100,renderer:function(f){return(f instanceof Date)?f.formatDate("d/m/Y H:i"):""}});if(C.details.checkDependTasks){c.push({header:"BaÄlÄ± GÃ¶rev",dataIndex:"predecessor",width:100})}C.curTime=new Date(C.curTimeMs);C.stores.grid.on("load",function(){if(typeof C.refreshed=="undefined"){var g=-1;for(var m=0,f=C.stores.grid.data.length;m<f;m++){var h=C.stores.grid.data[m];h.modifyTime=C.curTimeMs;if(h.station){h._station=C.getStationObject(h.station)}if(!h.pending){h.pending=[]}if(h.predecessor){var n=C.getTask(h.predecessor);if(!n.pending){n.pending=[]}n.pending.push(h)}h.loading=true;C.calculateTask(h);h.loading=false;if(h.times.duration>g){g=h.times.duration}}C._maxDuration=g;for(var m=0,f=C.stores.grid.data.length;m<f;m++){C.calculateTaskSizes(C.stores.grid.data[m])}}});C.grids.gorev=new mj.grid({renderTo:C.gridPanel.getBody(),store:C.stores.grid,pbar:new mj.pager({pos:"bottom",limit:25,elements:{first:false,prev:false,next:false,last:false,refresh:true,pages:false},sc:C,refresh:function(){this.sc.refreshed=true;this.store.clearFilter();this.store.load();C.filterInputs.op1.value="";if(C.details.ref){C.filterInputs.ref1.value=""}if(C.details.customer){C.filterInputs.cust1.value=""}C.filterInputs.ist1.value="";C.filterInputs.tar1.value=""}}),fitToParent:true,cm:c});C.grids.gorev.on("rowclick",function(){C.setActiveRegion("grid")});C.grids.gorev.store.on("load",function(){if(typeof C.refreshed!="undefined"){delete C.refreshed}C.drawCanvas();for(var h=0,f=C.tasks.length;h<f;h++){var g=C.tasks[h];if($.browser.msie){g.gridSetupEl[0].style.background="#ffc";if(g.color){g.gridProductionEl[0].style.background=g.color}}else{g.gridSetupEl.css("background","#ffc");if(g.color){g.gridProductionEl.css("background",g.color)}}}});C.grids.gorev.pbar.tbar.addSplitter();C.buttons.filterBtn=C.grids.gorev.pbar.tbar.addButton({id:"btnFilter",iconCls:"mj-filter",alt:"Filtrele",sc:C,handler:C.filterTasks});C.grids.gorev.pbar.tbar.addSplitter();C.buttons.addBtn=C.grids.gorev.pbar.tbar.addButton({id:"btnAdd",iconCls:"mj-add",alt:"Ekle",scope:C,handler:C.newTask});C.buttons.deleteBtn=C.grids.gorev.pbar.tbar.addButton({id:"btnDelete",iconCls:"mj-delete",alt:"Sil",scope:C,handler:C.deleteTask});E.gridFilter=F(C.layouts.west.getBody("south"));$(C.layouts.west.getBody("south")).css("background","#EDF3FB");C._bindInputKeys=function(f){$(f).bind("keydown",{t:C},function(g){if(g.keyCode==13){C.sc=C;C.filterTasks.call(C)}});$(f).bind("focus",{t:C},function(g){C.filterInputs.isActive=true;C.filterInputs.activeInput=f;C.setActiveRegion("filter");C.isInInput=true});$(f).bind("blur",{t:C},function(g){C.filterInputs.isActive=false;C.isInInput=false})};C.filterInputs={};var X=F(E.gridFilter,{cls:"row",style:"position:absolute;left:0px;top:0px;"});F(X,{style:"font-size:8pt;float:left;",html:"Operasyon:",cls:"mj-unselectable"});C.filterInputs.op1=F(X,{tag:"input",style:"margin-left:42px;",id:"op-1"});C._bindInputKeys(C.filterInputs.op1);var Q=0;if(C.details.ref){var W=F(E.gridFilter,{cls:"row",style:"position:absolute;left:0px;top:"+(Q+=20)+"px;"});F(W,{style:"font-size:8pt;float:left;",html:"Referans:",cls:"mj-unselectable"});C.filterInputs.ref1=F(W,{tag:"input",style:"margin-left:53px;",id:"ref-1"});C._bindInputKeys(C.filterInputs.ref1)}var V=F(E.gridFilter,{cls:"row",style:"position:absolute;left:0px;top:"+(Q+=20)+"px;"});F(V,{style:"font-size:8pt;float:left;",html:"Ä°stasyon:",cls:"mj-unselectable"});C.filterInputs.ist1=F(V,{tag:"input",style:"margin-left:55px;",id:"ist-1"});C._bindInputKeys(C.filterInputs.ist1);var U=F(E.gridFilter,{cls:"row",style:"position:absolute;left:0px;top:"+(Q+=20)+"px;"});F(U,{style:"font-size:8pt;float:left;",html:"Tarih:",cls:"mj-unselectable"});C.filterInputs.tar1=F(U,{tag:"input",style:"margin-left:75px;",id:"tar-1"});C._bindInputKeys(C.filterInputs.tar1);if(C.details.customer){var R=F(E.gridFilter,{cls:"row",style:"position:absolute;left:0px;top:"+(Q+=20)+"px;"});F(R,{style:"font-size:8pt;float:left;",html:"MÃ¼Återi:",cls:"mj-unselectable"});C.filterInputs.cust1=F(R,{tag:"input",style:"margin-left:63px;",id:"ref-1"});C._bindInputKeys(C.filterInputs.cust1)}$("div.row",E.gridFilter).css({"line-height":"18px","margin":"2px 0px 0px 2px"});$("input",E.gridFilter).css({"font-size":"8pt","float":"left","width":"80px","height":"14px","border":"1px solid #A0ADB4"});var Z=$(C.layouts.main.getBody("center"));C.chartWidth=Z.width();C.height=Z.height();C.chartHeight=C.resCollapsed?C.height-7:(C.height-C.resHeight);var M=C.resHeight-8;C.layouts.chart=new mj.layout({renderTo:F(Z),layout:"border",items:[{region:"south",initial:M,min:M,max:M,split:true,collapsible:true,collapsed:C.resCollapsed}]});Z=C.layouts.chart.getBody("center");E.chartCnt=$(F(Z,{id:G+"-chart-container mj-resize-handle",cls:"mj-gantt-chart-container",style:"width:"+(C.chartWidth)+"px;height:"+(C.chartHeight)+"px;"}));mj.bindResize(Z,C.doResize,C);var P=E.chartEls={};var a=23;P.corner=$(F(E.chartCnt,{style:"width:"+A+"px;height:"+(3*a)+"px;float:left;background:#edf3fb;border-right:1px solid #ccc;"}));var d=F(P.corner,{style:"margin-left:23px;margin-top:14px;"});C.buttons.saveBtn=new mj.speedButton({renderTo:d,id:"btnSave",iconCls:"mj-save",alt:"Kaydet",scope:C,handler:C.save,disabled:true});C.buttons.snapshotBtn=new mj.speedButton({renderTo:d,id:"btnSnapshot",iconCls:"mj-snapshot",alt:"GeÃ§erli Plan GÃ¶rÃ¼nÃ¼mÃ¼nÃ¼ Kaydet",scope:C,handler:C.saveSnapshot});C.buttons.playPauseBtn=new mj.speedButton({renderTo:d,id:"btnPlayPause",iconCls:C.liveUpdate?"mj-pause":"mj-play",alt:"CanlÄ± Ä°zleme Modu",scope:C,handler:C.switchLiveUpdate});F(d,{cls:"clear",html:mj.insertSpacer(1,1)});C.buttons.zoomInBtn=new mj.speedButton({renderTo:d,iconCls:"mj-zoom-in",alt:"YakÄ±nlaÅ",scope:C,handler:C.zoomIn});C.buttons.zoomOutBtn=new mj.speedButton({renderTo:d,iconCls:"mj-zoom-out",alt:"UzaklaÅ",scope:C,handler:C.zoomOut});C.buttons.zoomResetBtn=new mj.speedButton({renderTo:d,iconCls:"mj-zoom",alt:"SÄ±fÄ±rla",scope:C,handler:C.zoomReset});P.header=$(F(E.chartCnt,{id:G+"-headers",cls:"mj-gantt-headers",style:"width:"+(C.chartWidth-A-Y-1)+"px;height:"+(3*a)+"px;float:left;overflow:hidden;"}));F(E.chartCnt,{style:"width:"+Y+"px;float:left;height:"+(3*a)+"px;background:#edf3fb;",html:mj.insertSpacer(Y,3*a)});P.headers={line1:$(F(P.header,{style:"width:"+C._chartClientWidth+"px;height:"+a+"px;",cls:"mj-gantt-header1"})),line2:$(F(P.header,{style:"width:"+C._chartClientWidth+"px;height:"+a+"px;",cls:"mj-gantt-header2"})),line3:$(F(P.header,{style:"width:"+C._chartClientWidth+"px;height:"+a+"px;",cls:"mj-gantt-header3"}))};C._chartBodyWidth=C.chartWidth-A-1;C._chartBodyHeight=C.chartHeight-(3*a)-1;P.stations=$(F(E.chartCnt,{style:"width:"+A+"px;height:"+C._chartBodyHeight+"px;float:left;background:#edf3fb;border:1px solid #ccc;border-left:0;border-bottom:0;overflow:hidden"}));P.stationsCnt=$(F(P.stations,{id:G+"-stations",style:"width:"+A+"px;height:"+(C.chartHeight-(3*a)-Y-1)+"px;overflow:hidden"}));P.chartBody=$(F(E.chartCnt,{id:G+"-chart-body",cls:"mj-gantt-grab",style:"width:"+(C._chartBodyWidth)+"px;height:"+C._chartBodyHeight+"px;float:left;background:#fff;overflow:scroll;border-top:1px solid #ccc;position:relative;"}));P.chartBodyScroll=$(F(P.chartBody,{id:G+"-chart-body-scroll",style:"float:left;position:relative;width:"+C._chartClientWidth+"px;"}));P.chartRowsBody=$(F(P.chartBodyScroll));P.infoPane=$(mj.NE(C.layouts.main.getBody("center"),{cls:"mj-gantt-task-info",style:"opacity:0.9;width:"+(C.chartWidth-A-Y-3)+"px;height:"+(3*a)+"px;background:#f4f9a6;position:absolute;top:0;left:"+(A+1)+"px;font-size:11px;padding-left:2px;display:none"}));E.resCnt=$(F(C.layouts.chart.getBody("south"),{id:G+"-res-container",cls:"mj-gantt-res-container",style:"overflow:hidden;width:"+(C.chartWidth)+"px;height:"+(M)+"px;"}));var T=E.resEls={header:$(F(E.resCnt,{id:G+"-res-header",style:"width:"+A+"px;height:"+M+"px;float:left;background:#ddd;border-right:1px solid #ccc;"})),cnt:$(F(E.resCnt,{id:G+"-res-cnt",style:"width:"+(C.chartWidth-A-1)+"px;height:"+M+"px;float:left;background:#ddd;"}))};T.cntScroller=$(F(T.cnt,{style:"width:"+(C.chartWidth-A-Y-1)+"px;height:"+M+"px;float:left;overflow:hidden"}));F(T.cnt,{style:"width:"+Y+"px;background:#ddd;float:left;height:"+M+"px;",html:mj.insertSpacer(Y,M)});T.scroller=E.canvasCnt=$(F(T.cntScroller,{id:G+"-res-cnt-scroller",style:"width:"+(C._chartClientWidth)+"px;height:"+M+"px;float:left;",html:'<canvas width="'+C._chartClientWidth+'" height="'+M+'" style="width:'+C._chartClientWidth+"px;height:"+M+'px;"></canvas>'}));E.canvasInfo=$(F(T.cntScroller,{tag:"div",id:"canvas-info-panel",cls:"mj-invisible mj-gantt-tip",style:"left:"+A+"px;"}));T.cntScroller.bind("mouseout",function(){E.canvasInfo.addClass("mj-invisible")});if(!$.browser.msie){T.scroller.bind("mousedown",function(f){if(f.which==1){T._dragStarted={x:f.layerX,y:f.layerY};T.scroller[0].style.cursor="url("+mj.glb.imagePath+"pt/closedhand.cur),default;"}});T.scroller.bind("mouseup",function(f){T._dragStarted=false;T.scroller[0].style.cursor="url("+mj.glb.imagePath+"pt/openhand.cur),default;"});T.scroller.bind("mouseout",function(f){T._dragStarted=false;T.scroller[0].style.cursor="url("+mj.glb.imagePath+"pt/openhand.cur),default;"});T.scroller[0].style.cursor="url("+mj.glb.imagePath+"pt/openhand.cur),default;";T.scroller.bind("mousemove",function(h){if(T._dragStarted){var g=T._dragStarted.x-h.layerX,f=T._dragStarted.y-h.layerY;T.cntScroller[0].scrollLeft+=g;P.chartBody[0].scrollLeft+=g;P.header[0].scrollLeft+=g}});P.chartBody.bind("mousedown",function(f){if(f.which==1&&$(f.target).hasClass("mj-gantt-grab")){P._dragStarted={x:f.layerX,y:f.layerY};P.chartBody[0].style.cursor="url("+mj.glb.imagePath+"pt/closedhand.cur),default;"}});P.chartBody.bind("mouseup",function(f){if(f.which==1&&$(f.target).hasClass("mj-gantt-grab")){P._dragStarted=false;P.chartBody[0].style.cursor="url("+mj.glb.imagePath+"pt/openhand.cur),default;"}});P.chartBody.bind("mouseout",function(f){if(f.which==1&&$(f.target).hasClass("mj-gantt-grab")){P._dragStarted=false;P.chartBody[0].style.cursor="url("+mj.glb.imagePath+"pt/openhand.cur),default;"}});P.chartBody[0].style.cursor="url("+mj.glb.imagePath+"pt/openhand.cur),default;";P.chartBody.bind("mousemove",function(h){if(P._dragStarted){var g=P._dragStarted.x-h.layerX,f=P._dragStarted.y-h.layerY;P.chartBody[0].scrollLeft+=g;P.chartBody[0].scrollTop+=f}})}E.canvasCnt.bind("mousemove",C,function(n){var w=n.data,g={x:n.layerX,y:n.layerY},q=w.domEls.canvasInfo;var v=function(x,l){return l/x};var f=w.ctx.canvas.offsetHeight;var r=function(l){var x=l.max>0?(f+20-(l.h/v(f,l.max))):l.y;return l.x<g.x&&l.x+l.w>g.x&&x<g.y&&x+(l.h/v(f,l.max))>g.y};var o=w.canvasItemsDraw.points.filter(r,false,0),h=o.length;if(h>0){var u=[];for(var m=0;m<h;m++){u.push('<span style="color:'+("rgb("+o[m].fs.substr(5,o[m].fs.lastIndexOf(",")-5)+")")+'">'+o[m].type+"&nbsp;"+o[m].h+"</span>")}q.removeClass("mj-invisible").html(u.join("<br>"))}else{q.addClass("mj-invisible")}});E.canvas=$("canvas",E.canvasCnt).get(0);if($.browser.msie){E.canvas=window.G_vmlCanvasManager.initElement(E.canvas)}C.ctx=E.canvas.getContext("2d");P.taskPreviewPane=$(mj.NE(T.cnt,{cls:"mj-gantt-task-preview",style:"width:"+(C.chartWidth-A-Y-6)+"px;height:"+(M-5)+"px;left:"+(A+1)+"px;"}));$(C.grids.gorev.cnt[0].lastChild.firstChild).hover(function(){if(!C.layouts.chart.regions.south.collapsed){P.taskPreviewPane.show()}},function(){if(!C.layouts.chart.regions.south.collapsed){P.taskPreviewPane.hide()}});C.tasks=C.stores.grid.data;C.lastColorIndex=0;C.windows.detay=$(F(Z,{cls:"mj-gantt-task-detail",style:"display:none;width:"+C.chartWidth+"px;height:"+C.height+"px;z-index:100"}));C.windows.detay.isActive=false;C.setActiveRegion("body");C.windows.detay._els={center:$(F(C.windows.detay,{cls:"mj-gantt-task-detail-center",style:"width:"+C.chartWidth+"px;height:"+(C.height-30)+"px;"})),south:$(F(C.windows.detay,{cls:"mj-gantt-task-detail-south",style:"width:"+C.chartWidth+"px;"}))};var L=F(C.windows.detay._els.south,{style:"float:right;padding:1px;"});C.windows.detay._buttons={"vazgec":new mj.button({renderTo:F(L),title:"VazgeÃ§",iconCls:"mj-menu-close-icon",handler:function(){if(C.activeRegion!="message"){if(C.forms.tForm.modified){C.setActiveRegion("message");mj.shortcuts.on("e",function(){mj.message.activeMessageWin.close();C.hideDetayWindow();C.focusFakeInput()});mj.shortcuts.on("h",function(){C.setActiveRegion("detaywindow");mj.message.activeMessageWin.close()});mj.shortcuts.on("k",function(){mj.message.activeMessageWin.close();C.windows.detay._buttons.kaydet.handler.call(C)});mj.message.defaults.buttonTitles.SAVEANDEXIT="Kaydet ve ÃÄ±k";mj.message({title:"UyarÄ±",modal:true,msg:"YaptÄ±ÄÄ±nÄ±z deÄiÅiklikler kaydedilmeden Ã§Ä±kÄ±lsÄ±n mÄ±?",buttons:["NO","YES","SAVEANDEXIT"],cb:function(g,f){if(f=="YES"){C.hideDetayWindow();C.focusFakeInput()}else{if(f=="SAVEANDEXIT"){mj.message.activeMessageWin.close();C.windows.detay._buttons.kaydet.handler.call(C)}else{C.setActiveRegion("detaywindow")}}g.window.close()}});mj.message.activeMessageWin.on("beforeclose",function(){mj.shortcuts.mon("e");mj.shortcuts.mon("h");mj.shortcuts.mon("k")})}else{C.hideDetayWindow();C.focusFakeInput()}}}}),"kaydet":new mj.button({renderTo:F(L),title:"Kaydet",iconCls:"mj-accept",handler:function(){if(C.forms.tForm.modified){if(C.forms.tForm.recMode=="edit"){C.updateTask()}else{C.createTask()}}C.hideDetayWindow();C.focusFakeInput()}})};C.forms.tForm=new mj.form({renderTo:C.windows.detay._els.center,items:[new mj.form.fieldSet({id:"fsGorev",title:"GÃ¶rev DetaylarÄ±",items:[new mj.form.textField({title:"GÃ¶rev",dataIndex:"name",labelWidth:"110px",width:150}),new mj.form.combo({title:"Ä°stasyon",dataIndex:"station",mode:"local",store:C.stores.station,width:150,displayField:"name",labelWidth:"110px"}),new mj.form.numberField({title:"Ayar SÃ¼resi",dataIndex:"setup",labelWidth:"110px",width:150,defaultZero:false}),new mj.form.numberField({title:"Br. Ãrt. SÃ¼resi",dataIndex:"tpp",labelWidth:"110px",width:150,defaultZero:false}),new mj.form.numberField({title:"Ãretim SayÄ±sÄ±",dataIndex:"production",labelWidth:"110px",width:150,defaultZero:false}),new mj.form.numberField({title:"OperatÃ¶r SayÄ±sÄ±",dataIndex:"operator",labelWidth:"110px",width:150,defaultZero:false}),new mj.form.numberField({title:"Kasa Ä°Ã§i Miktar",dataIndex:"inbox",labelWidth:"110px",width:150,defaultZero:false})]}),new mj.form.fieldSet({id:"fsGorevGerceklesen",title:"GerÃ§ekleÅen DeÄerler",items:[new mj.form.numberField({title:"OperatÃ¶r SayÄ±sÄ±",dataIndex:"actualOperator",labelWidth:"110px",width:80,defaultZero:false}),new mj.form.dateField({title:"Ayar BaÅlangÄ±Ã§",epoch:true,labelWidth:"110px",dataIndex:"doneStartDate1",itemStyle:"",width:80}),new mj.form.timeField({title:"-",labelWidth:"10px",right:true,itemStyle:"width:70px;",dataIndex:"doneStartDate2",width:50}),new mj.form.dateField({title:"Ayar BitiÅ",epoch:true,labelWidth:"110px",dataIndex:"doneSetupFinishDate1",width:80}),new mj.form.timeField({title:"-",labelWidth:"10px",right:true,itemStyle:"width:70px;",dataIndex:"doneSetupFinishDate2",width:50}),new mj.form.dateField({title:"Ãretim BitiÅ",epoch:true,labelWidth:"110px",dataIndex:"doneFinishDate1",width:80}),new mj.form.timeField({title:"-",labelWidth:"10px",right:true,itemStyle:"width:70px;",dataIndex:"doneFinishDate2",width:50}),new mj.form.checkBox({title:"Ãretim SonlandÄ±",labelWidth:"110px",dataIndex:"finished"})]}),new mj.form.fieldSet({id:"fsMiktar",title:"Ãretim MiktarlarÄ±"})]});var H=C.forms.tForm,I=H.getField(3),O=H.getField(4),S=H.getField(5);F(H.fieldSets[2].fieldSetEl,{html:'<div style="float:left;width:120px;height:15px;">'+mj.insertSpacer(120,15)+'</div><div style="float:left;width:50px;height:15px;">Ãretim</div><div style="float:left;width:18px;height:15px;">'+mj.insertSpacer(18,15)+'</div><div style="float:left;width:120px;height:15px;">Iskarta</div><div style="clear">&nbsp;</div>'});C._productionCountCnt=$(F(H.fieldSets[2].fieldSetEl,{style:"clear:both"}));var K=function(g,f){mj.message({title:"Bilgi",msg:f,modal:true})};I.on("invalid",K);O.on("invalid",K);S.on("invalid",K);C.cM=new mj.contextmenu({renderTo:F(),parent:C.domEls.chartEls.chartBody,canHide:true,style:"vertical",width:150,items:[{title:"Geri Al",iconCls:"mj-menu-delete-icon",scope:C,handler:function(){if(typeof this.undoStation=="function"){this.undoStation()}}},"|",{title:"YakÄ±nlaÅtÄ±r",iconCls:"mj-zoom-in",scope:C,handler:C.zoomIn},{title:"UzaklaÅtÄ±r",iconCls:"mj-zoom-out",scope:C,handler:C.zoomOut}]});C.getStation();C.fillStation();C.fillChartTimeline();C.fillOpMeter();C.initGanttData();C.getOffTime();C.drawOffTime();C.drawCurrentTimeLine();C.hiddenElements=F(P.header,{style:"position:absolute;top:-10000px;left:-100000px; display:none"});C.fakeInput=F(C.hiddenElements,{tag:"input"});C.ajaxForm=new mj.form({renderTo:F(C.hiddenElements),url:C.url});C.focusFakeInput();C._ganttTrigger=function(){if(this!=arguments.callee._oScope){return arguments.callee.apply(arguments.callee._oScope,arguments)}var h=function(){if(this!=arguments.callee._oScope){return arguments.callee.apply(arguments.callee._oScope,arguments)}C._ganttTrigger()};h._oScope=C;var g=parseInt(C.time.ms/C.timeIntervalWidth);C.updateTaskInterval=g;C._timer=setTimeout(h,g);var l=C.curTimeMs+=g;C.curTime=new Date(l);var l=C.curTimeMs=C.curTime.getTime();C.drawCurrentTimeLine.call(C);for(var f in C.station){if(typeof C.station[f]!="function"&&C.station[f].lastTime.getTime()<l){C.station[f].lastTime.setTime(l)}}if(C.liveUpdate){for(var f in C.tasks){if(typeof C.tasks[f]!="function"&&C.tasks[f].done){C.drawTaskDone(C.tasks[f])}}}};C._ganttTrigger._oScope=C;C._ganttTrigger();C.updateTaskValues._oScope=C;C.updateTaskValuesCb._oScope=C;if(C.liveUpdate){C.startLiveUpdate()}C.gotoNow();C.grids.gorev.load();P.chartBody.scroll(function(f){P.header[0].scrollLeft=f.target.scrollLeft;P.stationsCnt[0].scrollTop=f.target.scrollTop;T.cntScroller[0].scrollLeft=f.target.scrollLeft});C.bindShortcuts();var N=window.d.windows.plan.window;N.on("beforeclose",function(){if(C.modified&&C.modified.length>0){mj.message({title:"UyarÄ±",modal:true,msg:"YaptÄ±ÄÄ±nÄ±z deÄiÅiklikler kaydedilmeden Ã§Ä±kÄ±lsÄ±n mÄ±?",buttons:["NO","YES"],cb:function(g,f){if(f=="YES"){C.modified=false;window.dropEls=false;C.stopLiveUpdate();N.close()}g.window.close()}});return false}window.dropEls=false;C.stopLiveUpdate()});C.gotoNow();C.waitMaskHide()},10)},addOffTimeTick:function(G,E){var D=this;var F=E;var C=G+E;for(var B=0,A=D.offTimeTick.length;B<A;B++){var H=D.offTimeTick[B];if((G<=H.start&&C>=H.finish)||(C>=H.start&&C<=H.finish)){F+=H.finish-H.start;C+=H.finish-H.start}else{if(C<H.start){break}}}return F},addOffTimeTickReverse:function(A,H){var I=this;var D=H;var G=A-H;for(var E=0,F=I.offTimeTick.length;E<F;E++){var B=I.offTimeTick[E];if(A<B.start){break}}if(E<F){for(var C=E;C>=0;C--){var B=I.offTimeTick[C];if((G<=B.start&&A>=B.finish)||(A>=B.start&&A<=B.finish)){D+=B.finish-B.start;G-=B.finish-B.start}else{if(G>B.finish){break}}}}return D},ajaxSuccess:function(A){this.waitMaskHide();if(A.msg!=""){this.showQuickMsg(A.msg)}mj.removeModified(this)},ajaxFailure:function(){this.waitMaskHide();if(data.msg!=""){mj.message(data.msg)}},arrangeTask:function(G,A,I,J){var B=G.proxy[0].offsetLeft;var C=J.checkStationTask(A,I,J.getTimeFromPx(B));if(C){G.proxy.css("left",J.getPxFromTime(C));A.startDate.setTime(C);J.calculateTask(A);J.calculateTaskSizes(A);J.setTaskLeftWidth(A,A.times.actualDuration);if(A.times.finishDate>I.lastTime.getTime()){I.lastTime.setTime(A.times.finishDate)}J.setTaskValue(A)}else{G.proxy.css("left",J.getPxFromTime(A.startDate.getTime()))}var H=J.getDependTasks(A);for(var D=0,F=H.length;D<F;D++){var E=H[D];if(E.planned){var C=J.checkStationTask(E,J.station[E.station],E.startDate.getTime());if(C){$(E.el).css("left",J.getPxFromTime(C))}}}},assignTaskToStation:function(A,C,B){if(!A.planned||A.station!=C.id){A.startDate=new Date(B.getTaskStartDate(A,C))}B.calculateTask(A);B.calculateTaskSizes(A);B.drawTaskToStation(A,C);B.setTaskLeftWidth(A,A.times.actualDuration);if(C.lastTime.getTime()<A.times.finishDate){C.lastTime.setTime(A.times.finishDate)}A.station=C.id;A._station=C;if(typeof B.refreshed=="undefined"){C.task.push(A)}A.order=C.task.length-1;A.planned=true;B.saveStation(C);B.drawTaskDone(A,C);B.drawResources()},backupStation:function(D){return false;var C=this,E=[];tasks=D.task;for(var B=0,A=tasks.length;B<A;B++){E.push(tasks[B].times.startDate)}D._backup=E},bindInfoPane:function(A){var B=this,C=B.domEls.chartEls.infoPane;A.el.bind("mouseout",function(){if(window.activeTimer){clearTimeout(window.activeTimer)}C.fadeOut(250)});A.el.bind("mouseover",{task:A},function(E){var D=E.data.task;B.showTaskQuickInfo(D)})},bindShortcuts:function(){var A=this,B=mj.shortcuts.on;B("esc",function(){if(A.activeRegion=="message"){mj.message.activeMessageWin.close();A.focusFakeInput()}else{if(A.windows.detay.isActive){A.windows.detay._buttons.vazgec.handler.call(A)}else{if(A.filterInputs.isActive){A.focusFakeInput();A.grids.gorev.selectRow(A.grids.gorev,0);A.setActiveRegion("grid")}}}});B("f5",function(){A.grids.gorev.pbar.refresh()});B("ctrl+f",function(){var C=A.layouts.west,D=C.regions["south"];if(D.collapsed){C._toggleRegion("south",false)}A.filterInputs.op1.focus()});B("ctrl+q",function(){if(!A.time.min){A.zoom(-1)}});B("ctrl+w",function(){if(!A.time.max){A.zoom(1)}});B("f2",function(){if(A.activeRegion=="detaywindow"&&!mj.message.activeMessageWin){A.windows.detay._buttons.kaydet.handler.call(A)}});B("ctrl+l",function(){A.labelsShowHide()})},calculateBoxes:function(){var P=this,O=P.canvasItemsDraw.kasa.items,D=-1,N="rgba(0, 0, 255, 0.3)";while(++D<O.length){O[D].points=[];O[D].l=false;O[D].fs=N}P.ticks=[];P.ticks.push({tick:P.firstDate.getTime(),box:0});for(var F in P.station){var Q=P.station[F];if(typeof Q=="object"){for(var D=0,G=Q.task.length;D<G;D++){var B=Q.task[D];if(B.planned){P.ticks.push({tick:B.startDate.getTime(),box:0});var K=B.startDate.getTime()+(B.times.actualSetup);P.ticks.push({tick:K,box:1});var J=B.inBox*B.tpp*P.durationMsMultiplier;var H=B.inBox;while(H<=B.production){K+=P.addOffTimeTick(K,J);H+=B.inBox;P.ticks.push({tick:K,box:1})}if(K<B.times.finishDate){P.ticks.push({tick:B.times.finishDate,box:0})}}}}}P.ticks.sort(function(S,R){return S.tick-R.tick});var I=P.firstDate.getTime();var E,A=0,M=0,C=0,L=0;for(var D=0,G=P.ticks.length;D<G;D++){E=P.ticks[D];M=L*P.heightPerBox;A=(((E.tick-I)*this.timeIntervalWidth)/this.time.ms);O[0].points.push({x:C,y:P.ctx.canvas.height-M,w:A,h:M,fs:N,l:O[0].l,type:"Kasa"});I=E.tick;L+=E.box;C+=A}},calculateOperators:function(){var M=this,L=M.canvasItemsDraw.personel.p;L.points=[];M.ticks=[];M.ticks.push({tick:M.firstDate.getTime(),operator:0});for(var G in M.station){var N=M.station[G];if(typeof N=="object"){for(var E=0,H=N.task.length;E<H;E++){var B=N.task[E];if(B.planned){M.ticks.push({tick:B.times.startDate,operator:B.operator});M.ticks.push({tick:B.times.finishDate,operator:(B.operator*(-1))})}}}}M.ticks.sort(function(P,O){return P.tick-O.tick});var J=M.firstDate.getTime();var F,A=0,K=0,C=0,I=0,D="rgba(255, 0, 0, 0.5)";M.fillVardiya();if(L.d){L.fs=D;for(var E=0,H=M.ticks.length;E<H;E++){F=M.ticks[E];K=I;A=(((F.tick-J)*this.timeIntervalWidth)/this.time.ms);L.points.push({x:C,y:M.ctx.canvas.height-K,w:A,h:K,fs:D,l:L.l,type:"Planlanan OperatÃ¶r SayÄ±sÄ±"});J=F.tick;I+=F.operator;C+=A}}},calculateTask:function(A){if(!A.times||!A.loading){var B=this,C=A.times={startDate:B.shiftStartForOffTime(A.startDate.getTime()),lag:A.lag*B.durationMsMultiplier,setup:A.setup*B.durationMsMultiplier,tpp:A.tpp*B.durationMsMultiplier};A.startDate.setTime(C.startDate);C.productionDuration=A.production*C.tpp;C.duration=C.lag+C.setup+C.productionDuration;C.actualLag=B.addOffTimeTick(C.startDate,C.lag);C.setupStartDate=B.shiftStartForOffTime(C.startDate+C.actualLag);C.actualSetup=B.addOffTimeTick(C.setupStartDate,C.setup);C.productionStartDate=B.shiftStartForOffTime(C.setupStartDate+C.actualSetup);C.actualProductionDuration=B.addOffTimeTick(C.productionStartDate,C.productionDuration);C.productionFinishDate=B.shiftStartForOffTime(C.productionStartDate+C.actualProductionDuration);C.actualDuration=C.actualLag+C.actualSetup+C.actualProductionDuration;C.finishDate=C.startDate+C.actualDuration}},calculateTaskSizes:function(A){var C=this,D=A.times,F=A.sizes={},E=C.grids.gorev.cm[1].width-13,B=E/C._maxDuration;F.gridElWidth=parseInt(B*D.duration);F.gridSetupElWidth=parseInt(B*D.setup);F.gridProductionElWidth=F.gridElWidth-F.gridSetupElWidth;var G=C.timeIntervalWidth/C.time.ms;F.elWidth=parseInt(G*D.actualDuration)-1;F.setupElWidth=parseInt(G*D.actualSetup)-1;F.lagWidth=parseInt(G*D.actualLag);F.productionElWidth=F.elWidth-(F.setupElWidth-F.lagWidth)},clearChartComponents:function(){var C=this,F=C.domEls,E=F.chartEls,D=E.headers;D.line1.empty();D.line2.empty();D.line3.empty();for(var B=0,A=C.offTimeTick.length;B<A;B++){if(C.offTimeTick[B].el){$(C.offTimeTick[B].el).remove();C.offTimeTick[B].el=false}}},checkDependTasks:function(A){return },checkStationLastTime:function(A){A.lastTime.setTime(A.task[A.task.length-1].times.finishDate)},checkStationTask:function(B,D,E){var C=this,F=false,A=-1;switch(B.dragType){case"move":break;case"station":break;case"shift":break;default:break}return E},checkTaskStatus:function(A){var B=this;if(A.planned){if(!A.color){B.getColor(A)}if($.browser.msie){A.gridSetupEl[0].style.background="#ffc";if(A.color){A.gridProductionEl[0].style.background=A.color}}else{A.gridSetupEl.css("background","#ffc");if(A.color){A.gridProductionEl.css("background",A.color)}}A.drag.pause=true;B.checkDependTasks(A)}else{if(A.drag){A.drag.pause=false}if($.browser.msie){A.gridSetupEl[0].style.background="#8c8";A.gridProductionEl[0].style.background="#0a0"}else{A.gridSetupEl.css("background","#8c8");A.gridProductionEl.css("background","#0a0")}if(A.predecessor){var C=B.getTask(A.predecessor);if(C&&C.planned!=true){if($.browser.msie){A.gridSetupEl[0].style.background="#c60";A.gridProductionEl[0].style.background="#600"}else{A.gridSetupEl.css("background","#c60");A.gridProductionEl.css("background","#600")}if(A.drag){A.drag.pause=true}}}B.checkDependTasks(A)}},checkTaskOver:function(A,B){return(A.times.startDate>B.times.startDate&&A.times.startDate<B.times.finishDate)||(A.times.finishDate>B.times.startDate&&A.times.finishDate<B.times.finishDate)},clearCanvas:function(){this.ctx.save();this.ctx.fillStyle=this.canvasColor;this.ctx.fillRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height);this.ctx.restore()},createTask:function(){var A=this,B=A.forms.tForm.getValue();B.startDate=A.curTimeMs;fvJSON=B.toJSONString();A.submit({event:"createTask",task:fvJSON,success:function(C){newTask=mj.apply({id:C.taskId},B);newTask.startDate=new Date(newTask.startDate);newTask.modifyTime=A.curTimeMs;if(newTask.station){newTask._station=A.getStationObject(newTask.station)}newTask.pending=[];A.calculateTask(newTask);A.stores.grid.data.push(newTask);A.stores.grid.load();A.waitMaskHide()}},true)},deleteTask:function(){var A=this,B=A.grids.gorev.selectedRow;if(B&&B.data){mj.message({title:"Onay",modal:true,msg:"SeÃ§ili gÃ¶revi silmek istediÄinizden emin misiniz?",buttons:["NO","YES"],cb:function(D,C){D.window.close();if(C=="YES"){if(B.data.el){A.removeTask(B.data)}A.submit({event:"deleteTask",task:B.data.id,success:function(E){A.stores.grid.data.remove(B.data);A.grids.gorev.load();A.waitMaskHide()}},true)}}})}},doResize:function(){var C=this,F=$(C.layouts.main.getBody("center")),G=C.layouts.main.renderTo,B=F.width(),E=F.height(),A=G.width(),D=G.height();C.setChartWidth(B,A);C.setChartHeight(E,D)},dragOpacityDec:function(D){var C=this,E=C.station[D].task;for(var B=0,A=E.length;B<A;B++){E[B].el.css("opacity",0.35)}},dragOpacityInc:function(D){var C=this,E=C.station[D].task;for(var B=0,A=E.length;B<A;B++){E[B].el.css("opacity",0.7)}},drawCanvas:function(){var E=this,C=E.canvasItemsDraw;E.clearCanvas();var A=function(S,L,P){var Q=function(U,T){return T/U};var J=-1,R=L.points,I=S.canvas.offsetHeight;while(++J<R.length){S.fillStyle=R[J].fs;var N=R[J].x,M=P>0?(I+20-(R[J].h/Q(I,P))):R[J].y,O=R[J].w,K=R[J].h;if(R[J].l){if(J==0){S.moveTo(N,M)}else{S.lineTo(N,M)}S.lineTo(N+O,M);S.stroke()}S.fillRect(N,M,O,I)}};var G=function(K,J){var L=-999999999999,I=-1;while(++I<K.length){L=K[I][J]>L?K[I][J]:L}return L};var D=-1,B=0;C.points=[];for(var F in C){if(typeof C[F]!="function"&&F!="max"&&F!="points"){if(F!="kasa"){if(C[F].p.d&&C[F].p.points&&C[F].p.points.length>0){B=G(C[F].p.points,"h");var H=-1;while(++H<C[F].p.points.length){C[F].p.points[H].max=B;C.points.push(C[F].p.points[H])}C[F].p.max=B;A(E.ctx,C[F].p,B)}if(C[F].g.d&&C[F].g.points&&C[F].g.points.length>0){B=G(C[F].g.points,"h");var H=-1;while(++H<C[F].g.points.length){C[F].g.points[H].max=B;C.points.push(C[F].g.points[H])}C[F].g.max=B;A(E.ctx,C[F].g,B)}}else{while(++D<C[F].items.length){if(C[F].items[D].d&&C[F].items[D].points&&C[F].items[D].points.length>0){B=G(C[F].items[D].points,"h");var H=-1;while(++H<C[F].items[D].points.length){C[F].items[D].points[H].max=B;C.points.push(C[F].items[D].points[H])}C[F].items[D].max=B;A(E.ctx,C[F].items[D],B)}}}}}},drawCurrentTimeLine:function(){var A=this;if(A.liveUpdate){var B=A.getPxFromTime(A.curTime);if(!A.currentTimeLine){A.currentTimeLine=$(mj.NE(A.domEls.chartEls.chartBodyScroll,{style:"position:absolute;top:0px;left:"+B+"px;opacity:0.7;background:#6f6;z-index:99;border:1px solid #aaa;width:2px;height:"+(A.chartBodyHeight-2)+"px;"}))}else{A.currentTimeLine.css("left",B+"px")}}},drawResources:function(){var A=this;A.calculateOperators();A.calculateBoxes();A.drawCanvas()},drawTaskDone:function(A){var J=this,B=mj.NE,E=false;if(A.planned){if(A.el&&A.done&&A.done.setupStartDate){if(A.doneEls){J.redrawTaskDone(A)}else{var G=A._station,F=A.doneEls={doneEl:A.el.clone().appendTo(G.chartEl)};F.doneEl.css({"position":"absolute","opacity":"1","z-index":"10","top":J.doneBarTop+"px","height":J.doneBarHeight+"px"});F.doneSetupEl=F.doneEl.children("div:first");F.doneProductionEl=F.doneSetupEl.next();F.doneEl.removeClass("mj-opacity-7");F.doneSetupEl.removeClass("mj-opacity-7");F.doneProductionEl.removeClass("mj-opacity-7");F.doneSetupEl.css({"height":J.doneBarHeight,"background-color":"#ffff6b"});F.doneProductionEl.css({"height":J.doneBarHeight,"background-color":"#fff"});F.doneActualSetupEl=$(B(F.doneEl,{style:"height:"+J.doneBarHeight+"px;background-color:#c2c229;position:absolute"}));F.doneActualProductionEl=$(B(F.doneProductionEl,{style:"height:"+J.doneBarHeight+"px;background-color:#aed68f;"}));F.doneEl.bind("dblclick",{scope:J,task:A},J.getTaskForm);F.doneEl.bind("mouseout",function(){if(window.activeTimer){clearTimeout(window.activeTimer)}J.domEls.chartEls.infoPane.hide()});F.doneEl.bind("mouseover",{task:A},function(L){var K=L.data.task;J.showTaskQuickInfo(K)});F.stopCnt=$(B(F.doneEl));J.redrawTaskDone(A)}E=true}if(E){A.titleCnt=A.doneEls.doneEl;A._titleAbsolute=false}else{var C=A.left?A.left:J.getPxFromTime(A.times.startDate);A.titleCnt=$(B(A._station.chartEl,{style:"position:absolute;left:"+C+"px;top:8px;z-index:10;"}));A._titleAbsolute=true}if(A.titleEl){A.titleEl.remove()}if(J.displayLabels){var D=5,I=-5,H=A.name;A.titleEl=$(B(A.titleCnt,{cls:"mj-unselectable",style:"white-space:nowrap;font-size:11px;font-weight:bold;color:#1d1d1d;display:"+(J._labelsOn?"block":"none"),html:'<div style="height: 17px; top: -4px; left: 6px; position: absolute;">'+H+'</div><div style="height: 17px; top: -4px; left: 4px; position: absolute;">'+H+'</div><div style="height: 17px; top: -6px; left: 6px; position: absolute;">'+H+'</div><div style="height: 17px; top: -6px; left: 4px; position: absolute;">'+H+'</div><div style="height: 17px; top: -5px; left: 5px; position: absolute;color:white;">'+H+"</div>"}))}}},drawTaskToStation:function(B,E){var D=this;B.el=$(B.gridEl).clone().appendTo(E.chartEl);D.bindInfoPane(B);B.setupEl=B.el.children("div:first");B.productionEl=B.setupEl.next();if(!B.color){D.getColor(B)}B.gridSetupEl.css("background","#ffc");B.gridProductionEl.css("background",B.color);if(B.pinned){B.el.css("border","1px solid #f00;")}B.el.css({"position":"absolute","top":D.barTop+"px"});B.el.addClass("mj-gantt-task-el");B.el.attr("name","task-"+B.id);B.el.children("div").attr("name","task-"+B.id);B.setupEl.css({background:"#ffc"});B.productionEl.css({background:B.color});B.chartDrag=new mj.drag({el:B.el[0],parent:E.chartEl,appendParent:true,dragType:"h",proxyOpacity:0.7});B.el.bind("mouseup",function(){B.el.css("opacity",1)});var A=function(I,H){var F=D.getPreviousTask(I);if(!H){var K=F?F.times.finishDate+(D.time.ms/50):D.curTime.getTime();D.getTaskStartDate(I,I._station);if(I._minTime){K=I._minTime>K?I._minTime:K}}else{K=I._minTime}var P=false,N=false;for(var L=0,J=I.pending.length;L<J;L++){var G=I.pending[L],M=0,O=0;if(G.planned){if(G.preType=="s"){M=G.times.startDate-(G.preTime*D.durationMsMultiplier)}else{if(G.preType=="f"){O=G.times.startDate-(G.preTime*D.durationMsMultiplier)}}P=(P&&P<M)?P:M;N=(N&&N<O)?N:O}}return{_maxStart:P,_maxFinish:N,minTime:D.shiftStartForOffTime(K)}};B.chartDrag.on("beforedrag",function(F){return !B.pinned&&!B.done});B.chartDrag.on("dragstart",function(F,G){D._draggingTask=B;B.chartDrag.minWidth=false;B.chartDrag.maxWidth=false;if(G.ctrlKey&&!G.shiftKey){B.dragType="move";var H=B._minmax=A(B,true);B.chartDrag._maxStart=H._maxStart;B.chartDrag._maxFinish=H._maxFinish}else{if(G.shiftKey&&!G.ctrlKey){B.dragType="shift";var H=B._minmax=A(B);B.chartDrag._maxStart=H._maxStart;B.chartDrag._maxFinish=H._maxFinish}else{B.dragType="default";var H=A(B);B.chartDrag._maxStart=H._maxStart;B.chartDrag._maxFinish=H._maxFinish;B.chartDrag.minWidth=D.getPxFromTime(H.minTime)}}D.dragOpacityDec(B.station);B._dragFirstDate=D.firstDate.getTime();B._dragMsFactor=D.time.ms/D.timeIntervalWidth;B._dragPx=function(K){var I=K*B._dragMsFactor,J=I%D.durationMsMultiplier;return B._dragFirstDate+(I-J)}});var C=function(G,L,I,M,F){var K=G.chartDrag;G.startDate.setTime(M);D.calculateTask(G);I=G.dragType=="move"?3:D.getPx(G.times.actualDuration);K.proxy.width(I);var H=D.getNextTask(G),N=0;if(H&&!F){N=H.times.startDate-G.times.actualDuration-1000}N=D.shiftStartForOffTimeBack(N+G.times.actualDuration)-G.times.actualDuration;if(G.chartDrag._maxStart){var J=G.chartDrag._maxStart;N=(N&&N<J)?N:J}if(G.chartDrag._maxFinish){var J=G.chartDrag._maxFinish-G.times.actualDuration;N=(N&&N<J)?N:J}return N};B.chartDrag.on("dragmove",function(I,G,M){var F=0,K=D.domEls.chartEls;switch(B.dragType){case"move":var J=B._dragPx(G),H=C(B,G,F,J,true),L=B._minmax;if(L.minTime){B.chartDrag.minWidth=D.getPxFromTime(L.minTime)}if(H){B.chartDrag.maxWidth=D.getPxFromTime(H)}break;case"shift":var J=B._dragPx(G),H=C(B,G,F,J);var L=B._minmax;if(H&&J>H){B._minmax=L=A(B);B.chartDrag._maxStart=L._maxStart;B.chartDrag._maxFinish=L._maxFinish;return D.shiftTasksForward(B,J-H+parseInt(D.time.ms/50))}else{if(L.minTime&&J<L.minTime){B._minmax=L=A(B);B.chartDrag._maxStart=L._maxStart;B.chartDrag._maxFinish=L._maxFinish;return D.shiftTasksBack(B,L.minTime-J)}}break;default:var J=B._dragPx(G),H=C(B,G,F,J);if(H){B.chartDrag.maxWidth=D.getPxFromTime(H)}break}});B.chartDrag.on("dragstop",function(J){D._draggingTask=false;D.dragOpacityInc(B.station);var H=B._station;D.arrangeTask(J,this,H,D);if(B.dragType=="move"){var I=B.times.startDate,H=B._station,K=H.task;for(var G=0,F=K.length;G<F;G++){if(B!=K[G]&&D.checkTaskOver(B,K[G])){D.insertTask(B,K[G],H);break}}}else{if(B.dragType=="station"){}}D.checkStationLastTime(H);D.setModified(B);return false},B);B.el.bind("dblclick",{scope:D,task:B},D.getTaskForm);B.el.bind("mouseup",function(){D.dragOpacityInc.call(D,B.station)});B.cM=new mj.contextmenu({renderTo:mj.NE(),parent:B.el,canHide:true,style:"vertical",width:130,items:[{title:"Geri Al",iconCls:"mj-menu-close-icon",task:B,handler:function(){if(typeof D.undoStation=="function"){D.undoStation()}}},"|",{title:"Sil",iconCls:"mj-menu-delete-icon",task:B,handler:function(){if(typeof D.removeTask=="function"){D.removeTask(this.task)}}},"|",{title:"Sabitle",task:B,handler:function(){if(B.pinned){D.unpinTask(this.task)}else{D.pinTask(this.task)}}}]});B.cM.on("show",function(){var F=B.cM.buttons[2];if(B.pinned){F.setTitle("AÃ§");F.els.ci.removeClass("mj-lock");F.els.ci.addClass("mj-unlock")}else{F.setTitle("Sabitle");F.els.ci.removeClass("mj-unlock");F.els.ci.addClass("mj-lock")}})},drawOffTime:function(){var I=this;var H=I.stores.station.data.length*I.cellHeight;for(var E=0,G=I.offTimeTick.length;E<G;E++){var F=I.offTimeTick[E];var B=I.getPxFromTime(F.start);var A=I.getPx(F.finish-F.start);var C=new Date(F.start);var D=new Date(F.finish);if((C<I.firstDate&&D>I.firstDate&&D<I.lastDate)||(C>I.firstDate&&D<I.lastDate)||(C>I.firstDate&&C<I.lastDate&&D>I.lastDate)){if(!F.el){F.el=mj.NE(I.domEls.chartEls.chartBody,{cls:"mj-gantt-grab mj-gantt-off-time",style:"left:"+(B)+"px;width:"+(A)+"px;height:"+(H)+"px;",title:F.name+C.formatDate(" [H:i-")+D.formatDate("H:i]")})}else{$(F.el).css("left",B+"px").css("width",A+"px")}}}},fillChartTimeline:function(){var A=336;var N=this,V=N.domEls.chartEls.headers,J=N.oddEven;var O=N.stores.station.data.length*N.cellHeight;N.chartBodyHeight=O;N.firstDate.setHours(0,0,0,0);N.time=N.timeRangeMap[N.timeRange.indexOf(N.timeInterval)];N.timeTop=N.timeRangeMap[N.timeRange.indexOf(N.time.top)];N.timeUp=N.timeRangeMap[N.timeRange.indexOf(N.time.up)];var F=N.time.ms;if(!N._lastDateSetted){N.lastDate=new Date(N.firstDate.getTime()+(F*A));if(((N.lastDate.getTime()-N.firstDate.getTime())/F)>=A){N.lastDate.setTime(N.firstDate.getTime()+(F*A))}N.lastDate.setTime(N.lastDate.getTime()+86400000);N.lastDate.setHours(0,0,0,0)}N.setTimeLineWidth(N.timeIntervalWidth*((N.lastDate-N.firstDate)/F));V.line3.attr("title",N.time.title);N.upperTimeInterval=N.timeUp.ms;V.line2.attr("title",N.timeUp.title);N.topTimeInterval=N.timeTop.ms;V.line1.attr("title",N.timeTop.title);N.timeLine=[];N.domEls.chartEls.chartBodyScroll.css("background","transparent url("+mj.glb.ganttPath+"?w="+N.timeIntervalWidth+")");var R=N.firstDate.getTime(),U=new Date(R),P=new Date(R),K=new Date(R);var E="#fff";var T=N.time.ms/F,H=N.timeUp.ms/F,G=N.timeTop.ms/F,I=(N.lastDate.getTime()-N.firstDate.getTime())/F,Q=0;var B="",D="",L="";N.time.k=T;N.timeUp.k=H;N.timeTop.k=G;var M=function(X,W,Y){return{width:N.timeIntervalWidth*X.k-4,title:'<span title="'+W.formatDate("d/m/Y H:i")+'">'+W.formatDate(X.f)+"</span>"}};while(U<N.lastDate){if(Q%G==0){var S=J?(parseInt(Q/G)%2?"-o":""):"";var C=M(N.timeTop,U);L+='<div class="mj-gantt-header1'+S+' mj-unselectable" style="float:left;border-right:1px solid #aaa;width:'+C.width+'px;padding-top:7px;padding-left:3px;height:16px;">'+C.title+"</div>"}if(Q%H==0){var S=J?(parseInt(Q/H)%2?"-o":""):"";var C=M(N.timeUp,U);D+='<div class="mj-gantt-header2'+S+' mj-unselectable" style="float:left;border-right:1px solid #aaa;width:'+C.width+'px;padding-top:7px;padding-left:3px;height:16px;">'+C.title+"</div>"}if(Q%T==0){var S=J?(parseInt(Q/T)%2?"-o":""):"";var C=M(N.time,U);B+='<div class="mj-gantt-header3'+S+' mj-unselectable" style="float:left;border-right:1px solid #aaa;width:'+C.width+'px;padding-top:7px;padding-left:3px;height:16px;">'+C.title+"</div>"}U.setTime(U.getTime()+F);++Q}V.line1[0].innerHTML=L;V.line2[0].innerHTML=D;V.line3[0].innerHTML=B},fillOpMeter:function(){var F=this;F.accordion=new mj.accordion({renderTo:F.domEls.resEls.header,active:0,items:[{title:"Vardiya",titleCls:""},{title:"Personel",titleCls:"",handler:function(){}},{title:"Kasa",titleCls:"",handler:function(){}}]});var C=F.accordion.activeItem.width-22;var B=F.accordion.panels[0].getBody();new mj.form.checkBox({renderTo:B,title:"Planlanan",checked:F.canvasItemsDraw.vardiya.p.d,dataIndex:"p",labelWidth:C+"px",handler:function(){F.canvasItemsDraw.vardiya.p.d=!F.canvasItemsDraw.vardiya.p.d;F.drawResources()}});new mj.form.checkBox({renderTo:B,title:"GerÃ§ekleÅen",checked:F.canvasItemsDraw.vardiya.g,disabled:true,dataIndex:"g",labelWidth:C+"px",handler:function(){F.canvasItemsDraw.vardiya.g=!F.canvasItemsDraw.vardiya.g;F.drawResources()}});var A=F.accordion.panels[1].getBody();new mj.form.checkBox({renderTo:A,title:"Planlanan",checked:F.canvasItemsDraw.personel.p.d,dataIndex:"p",labelWidth:C+"px",handler:function(){F.canvasItemsDraw.personel.p.d=!F.canvasItemsDraw.personel.p.d;F.drawResources()}});new mj.form.checkBox({renderTo:A,title:"GerÃ§ekleÅen",checked:F.canvasItemsDraw.personel.g,disabled:true,dataIndex:"g",labelWidth:C+"px",handler:function(){F.canvasItemsDraw.personel.g=!F.canvasItemsDraw.personel.g;F.drawResources()}});var G=F.accordion.panels[2].getBody();var D=F.canvasItemsDraw.kasa.items;new mj.form.checkBox({renderTo:G,title:"TÃ¼mÃ¼",checked:F.canvasItemsDraw.kasa.a,dataIndex:"a",labelWidth:(C-15)+"px",handler:function(){F.canvasItemsDraw.kasa.a=!F.canvasItemsDraw.kasa.a;F.canvasItemsDraw.kasa.ts=true;var I=-1;while(++I<D.length){D[I].d=F.canvasItemsDraw.kasa.a}var H=$("div.mj-checkbox",G).not($("div.mj-checkbox:first",G));if(F.canvasItemsDraw.kasa.a){H.addClass("mj-checkbox-checked")}else{H.removeClass("mj-checkbox-checked")}F.tsCheck(G);F.drawResources()}});var E=-1;while(++E<D.length){new mj.form.checkBox({renderTo:G,title:D[E].name,checked:D[E].d,dataIndex:"kasa"+E,labelWidth:(C-8)+"px",handler:function(){var H=F.canvasItemsDraw.kasa.items.getIndex("name",this.title);if(H!=-1){F.canvasItemsDraw.kasa.items[H].d=!F.canvasItemsDraw.kasa.items[H].d;F.drawResources()}F.tsCheck(G)}})}F.tsCheck(G);$("div.mj-form-caption",F.domEls.resEls.header).css({"padding-top":"0px","padding-left":"2px","font-size":"8pt","line-height":"18px"});$("div.mj-form-item",G).not($("div.mj-form-item:first",G)).css({"padding-top":"0px"}).children(".mj-form-caption").css({"padding-left":"10px"})},filterTasks:function(){var J=this.sc,F=J.grids.gorev.store,G=false,A=J.filterInputs.op1,H=J.filterInputs.ref1,C=J.filterInputs.ist1,B=J.filterInputs.tar1,D=J.filterInputs.cust1;J.refreshed=true;if(A.value!=""){F.filter("name",A.value,G,true);G=true}if(J.details.ref&&H.value!=""){var I=J.referans.filter(function(K){return K.name.toString().toLowerCase().substring(0,H.value.length)===H.value.toLowerCase()},true);F.filter("referans",(I instanceof Array&&I[0])?I[0].id:"",G);G=true}if(C.value!=""){F.filter("station",C.value,G);G=true}if(B.value!=""){var E=B.value.split("/");if(E.length==3){F.filter("startDate",B.value,G)}}if(J.details.customer&&D.value!=""){var I=J.customer.filter(function(K){return K.code.toString().toLowerCase().substring(0,D.value.length)===D.value.toLowerCase()},true);F.filter("customerId",(I instanceof Array&&I[0])?I[0].id:"",G);G=true}if(F.data.length==1&&F.data[0].el){J.gotoTaskEl.call(J,F.data[0])}},fillStation:function(){var E=this,H=E.domEls.chartEls;var G=E.stores.station.data;var B=G.length*E.cellHeight;E.domEls.chartEls.chartBodyScroll.height(B);H.stationsCnt.empty();H.chartStationBody=mj.NE(H.stationsCnt,{cls:"mj-unselectable",style:"float:left;background:#ddd;border-right:1px solid #aaa;width:"+(E.firstColumnWidth)+"px;height:"+(B)+"px;"});if(H.chartRowsBody){H.chartRowsBody.remove()}H.chartRowsBody=$(mj.NE(H.chartBodyScroll,{style:"position:relative;"}));window.dropEls=[];for(var D=0,A=G.length;D<A;D++){var C=G[D],F=E.station[C.id];F.el=mj.NE(H.chartStationBody,{html:C.name+'<div class="mj-gantt-fill-station">'+mj.insertSpacer(10,21)+"</div>",cls:"mj-gantt-station-title",style:"cursor:pointer;text-align:left;padding-left:2px;float:left;border-bottom:1px solid #D3D3D3;width:"+(E.firstColumnWidth)+"px;height:"+(E.cellHeight-4)+"px;padding-top:3px;",title:"GÃ¶revleri otomatik olarak dÃ¼zenlemek iÃ§in Ã§ift tÄ±klayÄ±n"});F.chartEl=$(mj.NE(H.chartRowsBody,{name:"station-"+C.id,cls:"mj-gantt-grab",style:"position:absolute;top:"+((D*E.cellHeight))+"px;background:transparent;border-bottom:1px solid #D3D3D3;width:"+E._chartClientWidth+"px;height:"+(E.cellHeight-1)+"px;"}));dropEls.push(F.chartEl);$(F.el).bind("dblclick",{station:C.id,scope:E},E.getStationTask)}},fillVardiya:function(){return },focusFakeInput:function(){this.fakeInput.focus();this.setActiveRegion("body")},getCustomer:function(A){var B=mj.getIndex(this.stores.customer.data,"id",A);if(B>-1){return this.stores.customer.data[B]}else{return{id:0,code:"-"}}},getColor:function(A){return A.color=this.colorGenerator.generate()},getDependTasks:function(A){return[]},getNextTask:function(A){var B=mj.getIndex(A._station.task,"order",A.order+1);return B>-1?A._station.task[B]:false},getOffTime:function(){var J=this;var V=[];var L=J.firstDate.getTime(),M=J.lastDate.getTime();for(var R=0,S=J.offTime.length;R<S;R++){var H=J.offTime[R];switch(H.scope){case"day":for(var Q=0;Q<H.items.length;Q++){var I=H.items[Q],C=I.s*1000,G=I.e*1000;if((C>=L&&C<M)||(G>L&&G<=M)){var D=(C>L?C:L),N=(G>M?M:G);V.push({name:I.name,start:D,finish:N})}}break;case"weekday":var X=new Date(L);var T=[];for(var Q=0;Q<H.items.length;Q++){var I=H.items[Q];if(!I.s){var D=0}else{var O=/(\d*):(\d*)/.exec(I.s);var D=(O[1]*(60*60*1000))+(O[2]*(60*1000))}if(!I.e){var N=86400000}else{var O=/(\d*):(\d*)/.exec(I.e);var N=(O[1]*(60*60*1000))+(O[2]*(60*1000))}T.push({name:I.name,d:I.d,s:D,f:N})}E=24*60*60*1000;X.setHours(0,0,0,0);while(X.getTime()<M){var B=X.getTime();for(var Q=0;Q<T.length;Q++){var I=T[Q];if(I.d==((X.getDay()+1)%7)){var C=B+I.s,G=B+I.f;if((C>=L&&C<M)||(G>L&&G<=M)){var D=(C>L?C:L),N=(G>M?M:G);V.push({name:I.name,start:D,finish:N})}}}X.setTime(X.getTime()+E)}break;case"hour":var X=new Date(L);var E=60*60*1000;while(X.getTime()<M){if(H.items.indexOf(X.getHours())>-1){var C=X.getTime(),W=C%E,C=C-W,G=C+E;var D=(C>L?C:L),N=(G>M?M:G);V.push({name:H.name,start:D,finish:N})}X.setTime(X.getTime()+E)}break;case"time":var X=new Date(L);var T=[];for(var Q=0;Q<H.items.length;Q++){var I=H.items[Q];if(I.f=="G:i"){var O=/(\d*):(\d*)/.exec(I.s);var D=(O[1]*(60*60*1000))+(O[2]*(60*1000));var O=/(\d*):(\d*)/.exec(I.e);var N=(O[1]*(60*60*1000))+(O[2]*(60*1000));T.push({name:I.name,s:D,f:N})}else{break}}E=24*60*60*1000;X.setHours(0,0,0,0);while(X.getTime()<M){var B=X.getTime();for(var Q=0;Q<T.length;Q++){var I=T[Q];var C=B+I.s,G=B+I.f;if((C>=L&&C<M)||(G>L&&G<=M)){var D=(C>L?C:L),N=(G>M?M:G);V.push({name:I.name,start:D,finish:N})}}X.setTime(X.getTime()+E)}break}}J.offTimeTick=[];if(V.length>0){V.sort(function(Z,Y){return Z.start-Y.start});var R=0;while(R<V.length){var U=V[R];if(R+1<V.length&&U.finish>=V[R+1].start){if(U.finish<V[R+1].finish){U.finish=V[R+1].finish}V.splice(R+1,1)}else{R++}}J.overTime.load();for(var Q=0,P=J.overTime.recordCount;Q<P;Q++){J.overTime.data[Q].startdate=J.overTime.data[Q].startdate*1000;J.overTime.data[Q].finishdate=J.overTime.data[Q].finishdate*1000}var R=0;while(R<V.length){var A=V[R];var K=false;for(var Q=0,P=J.overTime.recordCount;Q<P;Q++){var F=J.overTime.data[Q];if(A.start<=F.startdate&&A.finish>=F.startdate&&A.finish<=F.finishdate){A.finish=F.startdate-1}else{if(A.start>=F.startdate&&A.finish<=F.finishdate){V.splice(R,1);K=true;break}else{if(A.start>=F.startdate&&A.start<=F.finishdate&&A.finish>=F.finishdate){A.start=F.finishdate+1}}}}if(!K){R++}}J.offTimeTick=V}},getPreTaskShift:function(A,C){var B=this;if(A.preType=="s"){return C.times.startDate+(A.preTime*B.durationMsMultiplier)}else{if(A.preType=="f"){return C.times.finishDate+(A.preTime*B.durationMsMultiplier)}}},getPreviousTask:function(A){var B=mj.getIndex(A._station.task,"order",A.order-1);return B>-1?A._station.task[B]:false},getPx:function(A){return parseInt((A*this.timeIntervalWidth)/this.time.ms)},getPxFromTime:function(A,C){if(!(C instanceof Date)){C=this.firstDate}if(A instanceof Date){var B=(A.getTime()-C.getTime())}else{var B=(A-C.getTime())}return parseInt((B*this.timeIntervalWidth)/this.time.ms)},getReferans:function(A){var B=mj.getIndex(this.stores.referans.data,"id",A);if(B>-1){return this.stores.referans.data[B]}else{return{id:0,name:"-"}}},getStation:function(){var C=this,D=C.stores.station.data;for(var B=0,A=D.length;B<A;B++){C.station[D[B].id]={id:D[B].id,order:B,task:[],lastTime:new Date(C.firstDate.getTime())};C.saveStation(C.station[D[B].id])}},getStationData:function(B){var A=mj.getIndex(this.stores.station.data,"id",B);if(A>-1){return this.stores.station.data[A]}else{return{id:0,name:"-"}}},getStationObject:function(B){var A=mj.getIndex(this.station,"id",B);if(A>-1){return this.station[A]}},getStationTask:function(G){var D=G.data.scope,F=G.data.station,E=D.getStationObject(F);D.rearrangeStation(E);for(var C=0,A=D.tasks.length;C<A;C++){var B=D.tasks[C];if(!B.planned&&B.station==F){D.assignTaskToStation(B,E,D)}}},getTask:function(A){return this.tasks[mj.getIndex(this.tasks,"id",A)]},getTaskForm:function(e){var t=e.data.scope,task=e.data.task,form=t.forms.tForm,win=t.windows.detay;form.recMode="edit";if(!win.isActive||(win.isActive&&form.editingTask!=task)){form.startLoad();form.clear();if(task.done&&task.done.startDate&&!task.done.finished){form.fieldSets[1].fieldSetEl.hide();form.fieldSets[2].fieldSetEl.hide()}else{form.fieldSets[1].fieldSetEl.show();form.fieldSets[2].fieldSetEl.show();var cnt=t._productionCountCnt,l=task.productionDetails.length;form.fieldSets[2].fieldSetEl.height(40+(l*23));cnt.empty();var formItems=[];for(var i=0;i<l;i++){var pd=task.productionDetails[i];formItems.push(new mj.form.numberField({title:pd.leafCode,dataIndex:"leafProduction_"+pd.leafId,width:50,labelWidth:"110px",defaultZero:false}));formItems.push(new mj.form.numberField({title:" - ",dataIndex:"leafScrap_"+pd.leafId,right:true,width:50,labelWidth:"10px",defaultZero:false}))}task._pdForm=new mj.form({renderTo:cnt,items:formItems});for(var i=0;i<l;i++){var pd=task.productionDetails[i];var val=eval("task._pdForm.setValue({'leafProduction_"+pd.leafId+"': pd.production, 'leafScrap_"+pd.leafId+"': pd.scrap})")}if(task.done&&task.done.setupStartDate){with(task.done){form.setValue({actualOperator:actualOperatorCount,doneStartDate1:setupStartDate?(new Date(setupStartDate.formatDate("m/d/Y"))).getTime()/1000:0,doneStartDate2:setupStartDate?setupStartDate.formatDate("H:i"):"",doneSetupFinishDate1:setupFinishDate?(new Date(setupFinishDate.formatDate("m/d/Y"))).getTime()/1000:0,doneSetupFinishDate2:setupFinishDate?setupFinishDate.formatDate("H:i"):"",doneFinishDate1:finishDate?(new Date(finishDate.formatDate("m/d/Y"))).getTime()/1000:0,doneFinishDate2:finishDate?finishDate.formatDate("H:i"):"",finished:finished})}}}if(task.planned){var _maxStart=false,_maxFinish=false;for(var i=0,l=task.pending.length;i<l;i++){var pendingTask=task.pending[i],_startLimit=0,_finishLimit=0;if(pendingTask.planned){if(pendingTask.preType=="f"){_finishLimit=pendingTask.times.startDate-(pendingTask.preTime*t.durationMsMultiplier)}_maxFinish=(_maxFinish&&_maxFinish<_finishLimit)?_maxFinish:_finishLimit}}var _next=t.getNextTask(task);if(_next){_maxFinish=(_maxFinish&&_maxFinish<_next.times.startDate)?_maxFinish:_next.times.startDate}task._maxFinish=_maxFinish;if(_maxFinish){var _maxDuration=_maxFinish-task.times.startDate,edtSetup=form.getField(3),edtTpp=form.getField(4),edtProduction=form.getField(5),totalTime=_maxFinish-(task.done&&task.done.startDate?task.done.startDate:task.times.startDate);var sd=task.times.startDate,fd=_maxFinish,addMs=0;for(var i=0,len=t.offTimeTick.length;i<len;i++){var off=t.offTimeTick[i];if(sd<=off.start&&fd>=off.finish){_maxDuration-=off.finish-off.start}else{if(fd<off.start){break}}}edtSetup.validate=edtTpp.validate=edtProduction.validate=function(val){switch(this.dataIndex){case"setup":var fTpp=form.getValue("tpp"),fProduction=form.getValue("production");fTpp=fTpp.tpp;fProduction=fProduction.production;var _maxSetup=parseInt((_maxDuration-(fTpp*fProduction*1000))/1000);if(parseInt(val)>_maxSetup){this.markInvalid("Bu gÃ¶rev iÃ§in ayar sÃ¼resini en fazla "+_maxSetup+" sn tanÄ±mlayabilirsiniz!");this.focus();this.setValue(_maxSetup);return false}else{this.clearInvalid()}break;case"tpp":var fSetup=form.getValue("setup"),fProduction=form.getValue("production");fSetup=fSetup.setup;fProduction=fProduction.production;var _maxTpp=parseInt((_maxDuration-(fSetup*1000))/(fProduction*1000));if(parseInt(val)>_maxTpp){this.markInvalid("Bu gÃ¶rev iÃ§in birim Ã¼retim sÃ¼resini en fazla "+_maxTpp+" sn tanÄ±mlayabilirsiniz!");this.focus();this.setValue(_maxTpp);return false}else{this.clearInvalid()}break;case"production":var fSetup=form.getValue("setup"),fTpp=form.getValue("tpp");fSetup=fSetup.setup;fTpp=fTpp.tpp;var _maxProduction=parseInt((_maxDuration-(fSetup*1000))/(fTpp*1000));if(parseInt(val)>_maxProduction){this.markInvalid("Bu gÃ¶rev iÃ§in Ã¼retim miktarÄ±nÄ± en fazla "+_maxProduction+" tanÄ±mlayabilirsiniz!");this.focus();this.setValue(_maxProduction);return false}else{this.clearInvalid()}break}return true}}}with(task){form.setValue({name:name,station:station,setup:setup,tpp:tpp,production:production,setup:setup,operator:operator,inbox:inBox})}form.finishLoad();form.editingTask=task;win.show();form.cnt.height(win._els.center.height());win.isActive=true;t.setActiveRegion("detaywindow")}},getTaskStartDate:function(A,G,J){var H=this;var C=A.predecessor?H.getTask(A.predecessor):null;if(C){var F=H.getPreTaskShift(A,C);A._minTime=F;if(F>G.lastTime.getTime()){G.lastTime.setTime(F)}}if(A.pinned&&A.times.finishDate>G.lastTime.getTime()){G.lastTime.setTime(A.times.finishDate)}var I=G.lastTime.getTime();for(var D=0,E=H.offTimeTick.length;D<E;D++){var B=H.offTimeTick[D];if(I>B.start&&I<B.finish){I=B.finish}}G.lastTime.setTime(I);return I},getTimeFromPx:function(C,D){if(!(D instanceof Date)){D=this.firstDate}var A=(C*this.time.ms)/(this.timeIntervalWidth),B=A%this.durationMsMultiplier;return D.getTime()+(A-B)},gotoNow:function(){this.gotoTime(this.curTime)},gotoTaskEl:function(B){if(B.el){var C=this,D=C.station[C.stores.station.data[0].id].chartEl.offset(),A=B.el.offset();C.domEls.chartEls.chartBody.animate({scrollTop:A.top-D.top,scrollLeft:B.el[0].offsetLeft},1000,function(){window.mj._ganttGridElBorderBlinkCount=5;window.mj._ganttGridElBorderBlinkColors=["red","yellow"];window.mj._ganttGridElBorderBlinkTrigger=function(){if(window.mj._ganttGridElBorderBlinkCount-->0){C._ganttGridElBorderBlinkTimer=setTimeout(function(){mj._ganttGridElBorderBlinkTrigger.call(C)},100);B.el.css("borderColor",mj._ganttGridElBorderBlinkColors[mj._ganttGridElBorderBlinkCount%2])}else{B.el.css("borderColor","#000")}};window.mj._ganttGridElBorderBlinkTrigger();C.showTaskQuickInfo(B,true)})}},gotoTime:function(B){var A=this;A.domEls.chartEls.chartBody.animate({scrollLeft:A.getPxFromTime(B)-parseInt(A._chartBodyWidth/2)},1000)},gridElClick:function(C){var B=C.data.t,A=C.data.task;if(C.ctrlKey){B.gotoTaskEl(A)}},hideDetayWindow:function(){this.windows.detay.isActive=false;this.windows.detay.hide()},initGanttData:function(){var A=this;A.timeIntervalIndex=A.timeRange.indexOf(A.timeInterval);A.durationMsMultiplier=A.durationUnit=="minute"?60*1000:1000;A.time=A.timeRangeMap[A.timeRange.indexOf(A.timeInterval)];A.timeTop=A.timeRangeMap[A.timeRange.indexOf(A.time.top)];A.timeUp=A.timeRangeMap[A.timeRange.indexOf(A.time.up)];A.heightPerOp=3;A.heightPerBox=1;A.curTime=A.curTime||new Date();A.pastStation=[]},insertTask:function(C,D,I){var J=this,F=I.task,B=-1,A=D.order;C.order=-1;F._sort("order");for(var G=0,E=F.length;G<E;G++){if(F[G]==D){B++}F[G].order=B++}C.order=A;F._sort("order");var H=D.times.startDate-C.times.startDate+C.times.actualDuration;D.startDate.setTime(C.times.finishDate);J.calculateTask(D);J.calculateTaskSizes(D);J.setTaskLeftWidth(D,D.times.actualDuration);if(D.times.finishDate>I.lastTime.getTime()){I.lastTime.setTime(D.times.finishDate)}J.shiftTasksForward(D,H)},labelsShowHide:function(F){var D=this,E=F?F.task:D.tasks,B;if(D.displayLabels){D._labelsOn=!D._labelsOn;for(var C=0,A=E.length;C<A;C++){B=E[C];if(B.titleEl){B.titleEl.css("display",D._labelsOn?"block":"none")}}}},locateTask:function(A){var B=this;B.calculateTask(A);B.calculateTaskSizes(A);var D=A.sizes,C=A.times;var E=A.left=B.getPxFromTime(C.startDate);B.setTaskLabelLeft(A,E);A.gridEl.width(D.gridElWidth);A.gridSetupEl.width(D.gridSetupElWidth);A.gridProductionEl.css({width:D.gridProductionElWidth,left:D.gridSetupElWidth});if(A.el){A.el.css({"left":E+"px","width":(D.elWidth)+"px"});A.setupEl.width(D.setupElWidth);A.productionEl.css({width:D.productionElWidth,left:D.setupElWidth+D.lagWidth})}},maskStation:function(B){B.masked=true;if(B.maskEl){return B.maskEl.show()}var A=this,C=A.domEls.chartEls.chartRowsBody;B.maskEl=B.chartEl.clone(false).appendTo(C).addClass("mj-gantt-station-mask").css({"border":"0","background":"#B2B2FF"})},maskStations:function(G){var E=this;for(var D in E.station){if(typeof E.station[D]!="function"){var F=E.station[D],C=true;for(var B=0,A=G.length;B<A;B++){if(G[B]==F.id){C=false}}if(C){E.maskStation(F)}}}},moveTaskToStation:function(B,A){var C=this;C.removeTaskFromStation(B);C.assignTaskToStation(B,C.getStationObject(A),C)},newTask:function(){var A=this,B=A.forms.tForm,C=A.windows.detay;B.clear();B.recMode="add";C.show();B.cnt.height(C._els.center.height());C.isActive=true;A.setActiveRegion("detaywindow")},pinTask:function(A){A.pinned=true;A.el.css("border","1px solid #f00;");this.setModified(A)},rearrangeStation:function(E,F){var D=this;F=typeof F=="number"?F:-1;E.lastTime.setTime((F==-1)?D.curTime.getTime():E.task[F].times.finishDate);if(F>-1){E.task[F].order=F}for(var C=F+1,A=E.task.length;C<A;C++){var B=E.task[C];if(B.done){E.lastTime.setTime(B._finishTimePrediction);continue}B.oldStartDate=new Date(B.startDate.getTime());B.oldOrder=B.order;B.startDate=new Date(D.getTaskStartDate(B,E));D.calculateTask(B);D.setTaskLeftWidth(B,B.times.actualDuration);E.lastTime.setTime(E.lastTime.getTime()+B.times.actualDuration);B.finishDate=new Date(E.lastTime.getTime());B.order=C;D.setTaskValue(B)}D.saveStation(E)},redrawTaskDone:function(Z){if(Z.done){var M=this,f=Z.doneEls,V=M.getPxFromTime(Z.done.setupStartDate),I=(Z.done.setupFinishDate?Z.done.setupFinishDate.getTime():Z.done.setupStartDate.getTime()+Z.times.actualSetup),O=M.getPx(I-Z.done.setupStartDate.getTime()),c=M.getPx((Z.done.setupFinishDate?Z.done.setupFinishDate.getTime():M.curTimeMs)-Z.done.setupStartDate.getTime());O=Math.max(O,c);f.doneSetupEl.width(O);f.doneActualSetupEl.width(c);var N=0;var B=f.stopCnt,S=mj.NE,F=0,C=f.titleEl;B.empty();var R=Z.done.qualityCall,E=Z.done.setupStartDate.getTime();if(R){var D=Z.done.qualityCame?Z.done.qualityCame:M.curTimeMs;var H=Z.done.qualityDone;var W=D-R,K=M.getPx(W),U=M.getPx(R-E);S(B,{style:"cursor:default;width:"+K+"px;height:5px;top:-1px;left:"+U+"px;background:#fbc11f;border:1px solid #4d3b07;position:absolute;",html:mj.insertSpacer(K,5),title:"Kalite Personeli Bekleme"});F+=W;if(H){var W=H-D,K=M.getPx(W),U=M.getPx(D-E);F+=W;S(B,{style:"cursor:default;width:"+K+"px;height:5px;top:-1px;left:"+U+"px;background:#df641e;border:1px solid #451e07;position:absolute;",html:mj.insertSpacer(K,5),title:"Kalite OnayÄ±"})}}if(Z.stops){for(var L=0,U=Z.stops.length;L<U;L++){var T=Z.stops[L];if(T&&typeof T!="function"){if(!Z.done.finished){var A=T.time,Q=A+T.fark;F+=T.fark;for(var X=0,Y=M.offTimeTick.length;X<Y;X++){var g=M.offTimeTick[X];if(A<=g.start&&Q>=g.finish){F-=g.finish-g.start}else{if(A<=g.start&&Q>=g.start&&Q<=g.finish){F-=Q-g.start}else{if(A>=g.start&&Q<=g.finish){F-=Q-A}else{if(A<=g.start){break}}}}}}var G=T.time*1000,J=T.fark*1000;if(J>=parseInt(M.time.ms/50)){var K=M.getPx(J)-2,U=M.getPx(G-E),a=new Date(G);if(T.duruskod){var Q=new Date(G+J)}a=T.duruskod?(a.formatDate("d.m H:i")+" - "+Q.formatDate("d.m H:i")+" arasÄ±nda '"+T.description+"' sebebiyle "+mj.timeShow(J,true)+" duruldu."):(a.formatDate("d.m H:i")+"'den itibaren duruÅ devam ediyor.( "+mj.timeShow(J,true)+")");T.el=S(B,{style:"cursor:default;width:"+K+"px;height:7px;top:-2px;left:"+U+"px;background:"+T.colorRGB+";border:1px solid black;position:absolute;",html:mj.insertSpacer(K,7),title:a})}}}}if(Z.done.finishDate){N=Z.done.finishDate.getTime()-I}else{if(Z.done.production){var P=M.curTimeMs-I;P-=F;N=(P*Z.production/Z.done.production)+F;N=M.addOffTimeTick(M.curTimeMs,N)}else{N=Z.times.productionDuration}}if(!Z.done.finished){N=M.addOffTimeTick(Z.done.setupFinishDate?Z.done.setupFinishDate.getTime():M.curTimeMs,N)}productionWidth=M.getPx(N);if(Z.done.setupFinishDate){f.doneActualProductionEl.css({"width":M.getPx((Z.done.finishDate?Z.done.finishDate.getTime():M.curTimeMs)-I),"display":"block"})}else{f.doneActualProductionEl.css("display","none")}f.doneProductionEl.css({"width":productionWidth,"left":O});f.doneEl.css({"left":V,"width":(O+productionWidth)});Z.drawTime=M.curTimeMs;Z.drawZoomLevel=M.timeIntervalIndex;Z._finishTimePrediction=(Z.done.setupFinishDate?Z.done.setupFinishDate.getTime():M.curTimeMs)+N}},removeTask:function(B){var F=this,G=F.station[B.station];var H=B.order-1;var E=F.getDependTasks(B);var C="";for(var D=0,A=E.length;D<A;D++){if(E[D].planned){C=C==""?E[D].id:C+","+E[D].id}}if(C!=""){new mj.message({title:"UyarÄ±",modal:true,msg:"Silmeden Ã¶nce bu iÅe baÄlÄ± <b>"+C+"</b> nolu iÅler silinmelidir!",buttons:["OK"],cb:function(J,I){J.window.close()}})}else{F.removeTaskFromStation(B);F.setTaskValue(B);F.saveStation(G);new mj.message({title:"UyarÄ±",modal:true,msg:"Ä°stasyon GÃ¶revleri tekrar dÃ¼zenlensin mi?",buttons:["NO","YES"],cb:function(J,I){if(I=="YES"){F.rearrangeStation(G,H)}J.window.close()}})}F.setModified(B)},removeTaskFromStation:function(C){C.chartDrag=null;C.el.remove();if(C.doneEl){C.doneEl.remove()}else{if(C.titleCnt){C.titleCnt.remove()}}C.planned=false;C.finishDate=null;C.drag.pause=false;var E=C._station,F=E.task,B=0;E.task.remove(C);for(var D=0,A=F.length;D<A;D++){F[D].order=B++}F._sort("order");E.lastTime.setTime(F.length>0?F[F.length-1].times.finishDate:t.curTimeMs)},renderTaskGridEls:function(F,B,A,D){var C=B.planned?"#00f":"#f00";A.height(17);B.gridEl=$(mj.NE(A,{cls:"mj-gantt-task-grid-el mj-opacity-7",style:"z-index:1;position:relative;background:#fff;height:"+D.barHeight+"px;width:"+B.sizes.gridElWidth+"px;border:1px solid #000;"}));B.gridEl.bind("dblclick",{scope:D,task:B},D.getTaskForm);var E=D.domEls.chartEls.taskPreviewPane;$(B.gridEl[0].parentNode.parentNode.parentNode).hover(function(){var G=B.gridEl.clone().appendTo(E).css("margin-top",parseInt((D.resHeight-D.barHeight)/2));E.append("<span>"+B.production+" adet "+B.name+" :  Toplam "+B.operator+" kiÅi, "+mj.timeShow(B.times.duration,true)+"<br>Kasa iÃ§i miktar "+B.inBox+"</span>");G.width(B.sizes.elWidth+B.sizes.setupElWidth+1);$(G[0].childNodes[0]).width(B.sizes.setupElWidth);$(G[0].childNodes[1]).css("left",B.sizes.setupElWidth+1).width(B.sizes.elWidth)},function(){E.empty()});B.gridSetupEl=$(mj.NE(B.gridEl,{cls:"mj-gantt-task-grid-setup-el mj-opacity-7",style:"position:absolute;background:#8c8;height:"+D.barHeight+"px;width:"+B.sizes.gridSetupElWidth+"px;border-right:1px solid #000;"}));B.gridProductionEl=$(mj.NE(B.gridEl,{cls:"mj-gantt-task-grid-production-el mj-opacity-7",style:"position:absolute;background:#0a0;height:"+D.barHeight+"px;width:"+B.sizes.gridProductionElWidth+"px;left:"+B.sizes.gridSetupElWidth+"px;"}));B.gridEl.bind("click",{t:D,task:B},D.gridElClick);B.gridEl.bind("mouseup",function(){D.unMaskStations.call(D)});D.setTaskDrag(B);B.loading=true;if(typeof D.refreshed=="undefined"){if(B.planned){D.assignTaskToStation(B,D.station[B.station],D)}}B.loading=false;return F},restoreStation:function(D){var C=this;var E=D._backup;tasks=D.task;for(var B=0,A=tasks.length;B<A;B++){tasks[B].startDate.setDate(E[B]);C.calculateTask(tasks[B])}},save:function(autoSave){var t=this;if(t.modified){var _save=function(){var modifiedTasks=[];for(var i=0,l=t.modified.length;i<l;i++){var task=t.modified[i],updObj;with(task){updObj={id:id,name:name,operator:operator,station:station,setup:setup,tpp:tpp,production:production,inbox:inBox,planned:planned,pinned:pinned?1:0,startDate:parseInt(times.startDate/1000),finishDate:parseInt(times.finishDate/1000),productionDuration:parseInt(times.productionDuration/1000),duration:parseInt(times.duration/1000),actualLag:parseInt(times.actualLag/1000),setupStartDate:parseInt(times.setupStartDate/1000),actualSetup:parseInt(times.actualSetup/1000),productionStartDate:parseInt(times.productionStartDate/1000),actualProductionDuration:parseInt(times.actualProductionDuration/1000),productionFinishDate:parseInt(times.productionFinishDate/1000),actualDuration:parseInt(times.actualDuration/1000)};if(task.done){if(done.startDate){updObj.doneStartDate=done.startDate.getTime()/1000}if(done.setupStartDate){updObj.doneSetupStartDate=done.setupStartDate.getTime()/1000}if(done.setupFinishDate){updObj.doneSetupFinishDate=done.setupFinishDate.getTime()/1000}if(done.finishDate){updObj.doneFinishDate=done.finishDate.getTime()/1000}if(done.finished){updObj.finished=done.finished}if(done.actualOperatorCount){updObj.actualOperatorCount=done.actualOperatorCount}if(done.production){updObj.doneProduction=done.production}}var pd=[];for(var i2=0,l2=task.productionDetails.length;i2<l2;i2++){var pdi=task.productionDetails[i2];pd.push({id:pdi.id,production:pdi.production,scrap:pdi.scrap})}updObj.productionDetails=pd}modifiedTasks.push(updObj)}modifiedTasks=modifiedTasks.toJSONString();t.submit({event:"saveGantt",tasks:modifiedTasks,success:function(data){if(data.msg){t.showQuickMsg(data.msg)}if(data.success){t.modified=false}t.waitMaskHide()}},true)};if(autoSave==true){_save()}else{mj.message({title:"Onay",modal:true,msg:"DeÄiÅiklikleri kaydetmek istediÄinizden emin misiniz?",buttons:["NO","YES"],cb:function(el,btn){el.window.close();if(btn=="YES"){_save()}}})}}},saveSnapshot:function(){var t=this;mj.message({title:"Onay",modal:true,msg:"GeÃ§erli plan gÃ¶rÃ¼ntÃ¼sÃ¼nÃ¼ kaydetmek istediÄinizden emin misiniz?",scope:t,buttons:["NO","YES"],cb:function(el,btn){var t=this;el.window.close();if(btn=="YES"){var snapshotDetails=[];for(var i in t.station){if(typeof t.station[i]!="function"){for(var j=0,ls=t.station[i].task.length;j<ls;j++){var task=t.station[i].task[j];with(task){snapshotDetails.push({id:id,station:station,startDate:parseInt(times.startDate/1000),setupFinishDate:parseInt(times.productionStartDate/1000),finishDate:parseInt(times.finishDate/1000),operatorCount:operator,production:production})}}}}snapshotDetails=snapshotDetails.toJSONString();t.submit({event:"saveSnapshot",startDate:parseInt(t.firstDate.getTime()/1000),finishDate:parseInt(t.lastDate.getTime()/1000),timeInterval:t.timeInterval,snapshotDetails:snapshotDetails},true)}}})},saveStation:function(A){return false},setActiveRegion:function(A){this.activeRegion=A},setChartHeight:function(E,A){var I=this,G=I.domEls,B=G.chartEls;var C=16,H=23;I.waitMask.height(A);var D=I.layouts.chart.regions.south.collapsed,F=D?0:I.resHeight;var A=E-(D?7:(F));G.chartCnt.height(A);B.stations.height(A-(3*H)-1);B.stationsCnt.height(A-(3*H)-C-1);I._chartBodyHeight=A-(3*H)-1;B.chartBody.height(I._chartBodyHeight);I.windows.detay.height(E);I.windows.detay._els.center.height(E-30);if(I.waitMaskActive){I.waitMask.height(I.renderTo.height())}},setChartWidth:function(C,B){var D=this,H=D.domEls,F=H.chartEls,A=D.firstColumnWidth;var G=16,E=23;D.waitMask.width(B);H.quickMsgEls.cnt.width(B);F.infoPane.width(C-A-G-3);F.taskPreviewPane.width(C-A-G-3);H.chartCnt.width(C);F.header.width(C-A-G-1);D._chartBodyWidth=C-A-1;F.chartBody.width(D._chartBodyWidth);H.resCnt.width(C);H.resEls.cnt.width(C-A-1);H.resEls.cntScroller.width(C-A-G-1);D.windows.detay.width(C);D.windows.detay._els.center.width(C);D.windows.detay._els.south.width(C);if(D.waitMaskActive){D.waitMask.width(D.renderTo.width())}},setFirstDate:function(C){var A=this,B=new Date(C);B.setHours(0);B.setMinutes(0);B.setSeconds(0);B.setMilliseconds(0);A._firstDateSetted=true;A.firstDate=B},setLastDate:function(C){var A=this,B=new Date(C);B.setHours(0);B.setMinutes(0);B.setSeconds(0);B.setMilliseconds(0);B.setDate(B.getDate()+1);A._lastDateSetted=true;A.lastDate=B},setModified:function(A){var B=this;if(!B.modified){B.modified=[]}if(B.modified.indexOf(A)==-1){B.modified.push(A)}mj.addModified(B);if(!B._dontShowLiveUpdateMessage&&B.liveUpdate){B.stopLiveUpdate();B.showQuickMsg("GÃ¶revlerde deÄiÅiklik yapÄ±ldÄ±ÄÄ± iÃ§in canlÄ± izleme modu durduruldu.")}B.buttons.saveBtn.setEnable()},setStartFinishDate:function(A,C){var B=this;A.startDate.setTime(C);B.calculateTask(A);A.finishDate.setTime(A.times.startDate+A.times.actualDuration)},setTimeLineWidth:function(C){var B=this,F=B.domEls,D=F.chartEls,E=D.headers;E.line1.width(C);E.line2.width(C);E.line3.width(C);D.chartBodyScroll.width(C);F.resEls.scroller.width(C);F.canvas.width=C;F.canvas.style.width=C+"px";B.clearCanvas();for(var A in B.station){if(typeof B.station[A]!="function"){B.station[A].chartEl.width(C)}}},setTaskDrag:function(A){var B=this,A;A.drag=new mj.drag({el:A.gridEl,parent:mj.bd,position:"absolute",appendParent:true,moving:false});A.drag.on("beforedrag",function(G){if(A.planned||B.activeRegion=="message"||B.activeRegion=="detaywindow"){return false}if(A.predecessor){var E=B.getTask(A.predecessor);if(E&&!E.planned){B.showQuickMsg("Ãncelikle "+A.predecessor+" numaralÄ± iÅi planlamalÄ±sÄ±nÄ±z!");return false}}if(A.station){window.dropEls=[];for(var F=0,D=A.stations.length;F<D;F++){dropEls.push(B.getStationObject(A.stations[F]).chartEl)}if(D==1){var C=B.domEls.chartEls.chartBody,H=A._station.chartEl.offset({relativeTo:C});C.animate({scrollTop:H.top},250)}B.maskStations(A.stations)}return true});A.drag.on("dragstop",function(E,D){if(D){var C=$(D).attr("name").replace("station-","");C=B.station[C];B.assignTaskToStation(this,C,B);B.setModified(A)}B.unMaskStations.call(B)},A);if(A.planned){A.drag.pause=true}},setTaskLabelLeft:function(A,C){var B=this;if(A._titleAbsolute&&A.titleEl){A.titleCnt.css("left",C)}},setTaskLeftWidth:function(A,E){var B=this,C=A.times,D=A.sizes;var F=B.getPxFromTime(C.startDate);if(A.el){A.el.css({"left":F+"px","width":(D.elWidth)+"px"})}B.setTaskLabelLeft(A,F);if(A.setupEl){$(A.setupEl).css("left",D.lagWidth+"px").css("width",D.setupElWidth+"px")}if(D.lagWidth>0){$(A.setupEl).css("border-left","1px solid #000")}A.productionEl.css("left",(D.lagWidth+D.setupElWidth)+"px").css("width",D.productionElWidth+"px")},setTaskValue:function(B){var D=this,E=D.grids.gorev;if(E.rows.length>0){var G=mj.getIndex(E.rows,"data",B);for(var C=0,A=E.cm.length;C<A;C++){var F=E.cm[C];if(F.dataIndex!="duration"&&G!=-1){E.setCellValue(G,mj.getIndex(E.rows[G].cols,"dataIndex",F.dataIndex),B[F.dataIndex],F.renderer)}}D.locateTask(B);D.drawTaskDone(B)}D.checkTaskStatus(B);D.drawResources()},shiftStartForOffTime:function(D){var C=this;for(var B=0,A=C.offTimeTick.length;B<A;B++){var E=C.offTimeTick[B];if(D>=E.start&&D<=E.finish){D=E.finish+1000}else{if(D<E.finish){break}}}return D},shiftStartForOffTimeBack:function(C){var B=this;for(var A=B.offTimeTick.length-1;A>-1;A--){var D=B.offTimeTick[A];if(C>=D.start&&C<=D.finish){C=D.start-1000}else{if(C>D.finish){break}}}return C},shiftTasksBack:function(B,G){var I=this,H=B._station,F=H.task,D=I.getPreviousTask(B);if(D){if(!D.pinned&&!(D.done&&D.done.startDate)){var C=I.getPreviousTask(D),J;if(C&&(C.pinned||(C.done&&C.done.startDate))){var A=(C.done&&C._finishTimePrediction)?C._finishTimePrediction:C.times.finishDate;if(D.times.startDate-G<A){G=A-D.times.startDate+1}if(G<=0){return false}}D.startDate.setTime(D.times.startDate-G);I.calculateTask(D);I.calculateTaskSizes(D);I.setModified(D);I.setTaskLeftWidth(D,D.times.actualDuration);if(D.times.finishDate>H.lastTime.getTime()){H.lastTime.setTime(D.times.finishDate)}I.setTaskValue(D);I.shiftTasksBack(D,G)}else{return false}}var E=I.getTask(B.predecessor);if(E&&E.el){if(!E.pinned&&!(E.done&&E.done.startDate)){var C=I.getPreviousTask(E),J;if(C&&(C.pinned||(C.done&&C.done.startDate))){var A=(C.done&&C._finishTimePrediction)?C._finishTimePrediction:C.times.finishDate;if(E.times.startDate-G<A){G=A-E.times.startDate+1}if(G<=0){return false}}E.startDate.setTime(E.times.startDate-G);I.calculateTask(E);I.calculateTaskSizes(E);I.setModified(E);I.setTaskLeftWidth(E,E.times.actualDuration);if(E.times.finishDate>E._station.lastTime.getTime()){E._station.lastTime.setTime(E.times.finishDate)}I.setTaskValue(E);I.shiftTasksBack(E,G)}else{return false}}},shiftTasksForward:function(B,I){var M=this,K=B._station,E=K.task,G=M.getNextTask(B);if(G){if(!G.pinned&&!(G.done&&G.done.startDate)){var J=M.getNextTask(G),N;if(J&&(J.pinned||(J.done&&J.done.startDate))){var C=(J.done&&J.done.startDate)?J.done.startDate:J.times.startDate;var L=C-M.addOffTimeTickReverse(C,G.times.duration);if(G.times.startDate+I>L){I=L-G.times.startDate-1}if(I<=0){return false}}G.startDate.setTime(G.times.startDate+I);M.calculateTask(G);M.calculateTaskSizes(G);M.setModified(G);M.setTaskLeftWidth(G,G.times.actualDuration);if(G.times.finishDate>K.lastTime.getTime()){K.lastTime.setTime(G.times.finishDate)}M.setTaskValue(G);M.shiftTasksForward(G,I)}else{return false}}for(var F=0,D=B.pending.length;F<D;F++){var A=B.pending[F],H=A.times.startDate-B.times.finishDate+I;if(A.planned){if(!A.pinned&&!(A.done&&A.done.startDate)){var J=M.getNextTask(A),N;if(J&&(J.pinned||(J.done&&J.done.startDate))){var C=(J.done&&J.done.startDate)?J.done.startDate:J.times.startDate;var L=C-M.addOffTimeTickReverse(C,A.times.duration);if(G.times.startDate+I>L){I=L-A.times.startDate-1}if(I<=0){return false}}A.startDate.setTime(A.times.startDate+I);M.calculateTask(A);M.calculateTaskSizes(A);M.setModified(A);M.setTaskLeftWidth(A,A.times.actualDuration);if(A.times.finishDate>A._station.lastTime.getTime()){A._station.lastTime.setTime(A.times.finishDate)}M.setTaskValue(A);M.shiftTasksForward(A,I)}else{return false}}}},showQuickMsg:function(C){var B=this,A=B.domEls.quickMsgEls;A.content[0].innerHTML=C;A.cnt.animate({top:"0"},"slow","swing",function(){setTimeout(function(){A.cnt.animate({top:"-20"},"slow")},1500)})},showTaskQuickInfo:function(B,A){var C=this,D=C.domEls.chartEls.infoPane;if(window.activeTimer){clearTimeout(window.activeTimer)}window.activeTimer=setTimeout(function(){if(window.activeTimer){if(B.done&&!B.done.finishDate&&B.done.startDate){var H=new Date(B._finishTimePrediction)}else{var H=false}var J=new Date(B.times.finishDate);var G=B.productionDetails,K=G.length,L="&nbsp;";if(K==0){L='<span class="mj-gantt-task-production" style="margin-left:5px;">0</span><span class="mj-gantt-task-production-planned">/'+B.production+"</span>"}else{if(K==1){L='<span class="mj-gantt-task-production" style="margin-left:5px;">'+(G[0].production?G[0].production:"0")+"</span>"+(G[0].scrap?('<span class="mj-gantt-task-scrap">-'+G[0].scrap+"</span>"):"")+'<span class="mj-gantt-task-production-planned">/'+B.production+"</span>"}else{L='<table cellspacing="1" cellpadding="0" valign="top" style="margin-left:5px;">';for(var I=0,E=G.length;I<E;I++){L+='<tr><td class="mj-gantt-task-code-title">'+G[I].leafCode+'</td><td class="mj-gantt-task-production" align="right">&nbsp;'+(G[I].production?G[I].production:"0")+"</td>";L+='<td class="mj-gantt-task-scrap" align="right">&nbsp;'+(G[I].scrap?("-"+G[I].scrap):"")+"</td>";if(I==0){L+='<td rowspan="'+K+'" class="mj-gantt-task-production-planned">&nbsp;/&nbsp;'+B.production+"</td>"}L+="</tr>"}L+="</table>"}}var F=['<table cellpadding="0" cellspacing="0">','<tr><td colspan="6"><span class="mj-gantt-task-no">'+B.id+':&nbsp;</span><span class="mj-gantt-task-name">'+B.name+"</span></td></tr>",'<tr class="mj-gantt-task-time">','<td class="mj-gantt-task-time-title">BaÅlangÄ±Ã§</td>','<td width="5px" align="center" class="mj-gantt-task-time-title">&nbsp;:&nbsp;</td>','<td align="center">'+B.startDate.formatDate("d/m/Y H:i")+"</td>",'<td width="5px" align="center" class="mj-gantt-task-time-title">&nbsp;'+((B.done&&B.done.startDate)?"-":"")+"&nbsp;</td>",'<td class="mj-gantt-task-time-absolute" align="center">'+(B.done&&B.done.startDate?B.done.startDate.formatDate("d/m/Y H:i"):"&nbsp;")+"</td>",'<td rowspan="3" valign="middle" align="center" class="mj-gantt-task-table">'+L+"</td>","</tr>",'<tr class="mj-gantt-task-time">','<td class="mj-gantt-task-time-title">BitiÅ</td>','<td width="5px" align="center" class="mj-gantt-task-time-title">&nbsp;:&nbsp;</td>','<td align="center">'+J.formatDate("d/m/Y H:i")+"</td>",'<td width="5px" align="center" class="mj-gantt-task-time-title">&nbsp;'+((B.done&&B.done.finishDate)||H?"-":"")+"&nbsp;</td>",'<td class="mj-gantt-task-time-'+(B.done&&B.done.finishDate?"absolute":"estimated")+'" align="center">'+(B.done&&B.done.finishDate?B.done.finishDate.formatDate("d/m/Y H:i"):(H?H.formatDate("d/m/Y H:i"):"&nbsp;"))+"</td>","</tr>",'<tr class="mj-gantt-task-time">','<td colspan="2">&nbsp;</td>','<td class="mj-gantt-task-time-total" align="center">'+mj.timeShow(B.times.finishDate-B.startDate.getTime(),true)+"</td>",'<td width="5px" align="center" class="mj-gantt-task-time-title">&nbsp;'+(((B.done&&B.done.finishDate)||H)?"-":"")+"&nbsp;</td>",'<td align="center" class="mj-gantt-task-time-total-'+(B.done&&B.done.finishDate?"absolute":"estimated")+'">&nbsp;'+(((B.done&&B.done.finishDate)||H)?mj.timeShow((B.done&&B.done.finishDate?B.done.finishDate.getTime():B._finishTimePrediction)-B.done.startDate.getTime(),true):"&nbsp;")+"</td>","</tr>","</table>"];D.empty();mj.NE(D,{html:F.join("")});D.fadeIn(250);clearTimeout(window.activeTimer)}},350);if(A){setTimeout(function(){if(window.activeTimer){clearTimeout(window.activeTimer)}D.fadeOut(400)},3000)}},startLiveUpdate:function(){var A=this;if(!A.liveUpdate){A.liveUpdate=true;if(!A.currentTimeLine){A.drawCurrentTimeLine()}A.currentTimeLine.css("display","block");A.buttons.playPauseBtn.els.ci.addClass("mj-pause");A.buttons.playPauseBtn.els.ci.removeClass("mj-play");A._liveUpdateTimer=setTimeout(function(){A.updateTaskValues()},A.updateTaskInterval);A.gotoNow()}},stopLiveUpdate:function(){var A=this;if(A.liveUpdate){A.liveUpdate=false;if(A.currentTimeLine){A.currentTimeLine.css("display","none")}A.buttons.playPauseBtn.els.ci.addClass("mj-play");A.buttons.playPauseBtn.els.ci.removeClass("mj-pause");clearTimeout(A._liveUpdateTimer)}},submit:function(D,C){var B=this;if(C){B.waitMaskShow()}mj.applyIf(D,{event:"saveGantt",success:function(E){B.ajaxSuccess.call((D&&D.scope)||B,E)},failure:function(E){B.ajaxFailure.call((D&&D.scope)||B,E)}});var A={url:B.ajaxForm.url};if(D.url){A.url=D.url;D.url=false}if(D.success){A.success=D.success;D.success=false}if(D.failure){A.failure=D.failure;D.failure=false}A.params=D;B.ajaxForm.submit(A)},switchLiveUpdate:function(){var A=this;if(A.liveUpdate){A.stopLiveUpdate()}else{A.startLiveUpdate()}},tsCheck:function(G){var F=this,A=F.canvasItemsDraw.kasa,D=A.items,C=D.length,E=D.filter(function(H){return H.d==false}),B=D.filter(function(H){return H.d==true});$("div.mj-checkbox:first",G).removeClass("mj-checkbox-checked");if(E instanceof Array&&B instanceof Array){if(E.length>0&&B.length>0){A.ts=false;$("div.mj-checkbox:first",G).addClass("mj-checkbox-checked").addClass("mj-item-disabled")}else{if(E.length>0&&B.length==0){if(E.length==C){A.ts=true;A.a=false;$("div.mj-checkbox:first",G).removeClass("mj-item-disabled")}}else{if(E.length==0&&B.length>0){if(B.length==C){A.ts=true;A.a=true;$("div.mj-checkbox:first",G).addClass("mj-checkbox-checked").removeClass("mj-item-disabled")}}}}}},unMaskStations:function(){var B=this;for(var A in B.station){if(typeof B.station[A]!="function"){var C=B.station[A];if(C.masked){C.masked=false;C.maskEl.hide()}}}},unpinTask:function(A){A.pinned=false;A.el.css("border","1px solid #000;");this.setModified(A)},updateTask:function(){var t=this,form=t.forms.tForm,task=form.editingTask,fv=form.getValue(),oldStation=task.station,newStation=fv.station;if(oldStation!=newStation){t.moveTaskToStation(task,newStation)}with(task){name=fv.name;station=fv.station;setup=fv.setup;tpp=fv.tpp;production=fv.production;setup=fv.setup;operator=fv.operator;inBox=fv.inbox}if(!task.done){task.done={}}if((task.done.actualOperatorCount&&parseInt(task.done.actualOperatorCount)!=parseInt(fv.actualOperator))||(!task.done.actualOperatorCount&&parseInt(fv.actualOperator)>0)){task.done.actualOperatorCount=fv.actualOperator}if(fv.doneStartDate1&&fv.doneStartDate2){task.done.setupStartDate=new Date((new Date(fv.doneStartDate1*1000)).formatDate("m/d/Y")+" "+fv.doneStartDate2);task.done.startDate=task.done.setupStartDate}if(fv.doneSetupFinishDate1&&fv.doneSetupFinishDate2){task.done.setupFinishDate=new Date((new Date(fv.doneSetupFinishDate1*1000)).formatDate("m/d/Y")+" "+fv.doneSetupFinishDate2)}if(fv.doneFinishDate1&&fv.doneFinishDate2){task.done.finishDate=new Date((new Date(fv.doneFinishDate1*1000)).formatDate("m/d/Y")+" "+fv.doneFinishDate2)}if(!!task.done.finished!=!!fv.finished){task.done.finished=fv.finished}var fv=task._pdForm.getValue();for(var x in fv){var i=fv[x];if(x.substr(0,x.indexOf("_"))=="leafProduction"){var leafId=x.substr(x.indexOf("_")+1);var pdId=task.productionDetails.getIndex("leafId",leafId);task.productionDetails[pdId].production=fv["leafProduction_"+leafId];task.productionDetails[pdId].scrap=fv["leafScrap_"+leafId];var pVal=parseInt(task.productionDetails[pdId].production+task.productionDetails[pdId].scrap);if((task.done.production&&parseInt(task.done.production)!=pVal)||(!task.done.production&&pVal>0)){task.done.production=pVal}}}var doneExists=false;for(var x in task.done){if(typeof task.done[x]!="function"){doneExists=true;break}}if(!doneExists){task.done=false}t.calculateTask(task);t.calculateTaskSizes(task);t.setTaskValue(task);t.setModified(task);var _max=-1;for(var i=0,l=t.tasks.length;i<l;i++){task=t.tasks[i];if(task.times.duration>_max){_max=task.times.duration}}t._maxDuration=_max;for(var i=0,l=t.tasks.length;i<l;i++){task=t.tasks[i];t.calculateTaskSizes(task);var ts=task.sizes;task.gridEl.width(ts.gridElWidth);task.gridSetupEl.width(ts.gridSetupElWidth);task.gridProductionEl.css({width:ts.gridProductionElWidth,left:ts.gridSetupElWidth})}},updateTaskValues:function(){if(this!=arguments.callee._oScope){return arguments.callee.apply(arguments.callee._oScope,arguments)}var A=this;mj.dontShowLoader=true;A.submit({event:"updateTaskValues",scope:A,curTime:parseInt(A.curTimeMs/1000),lastUpdate:parseInt(A.lastUpdate/1000),success:A.updateTaskValuesCb,failure:A.updateTaskValuesCb})},updateTaskValuesCb:function(F){if(this!=arguments.callee._oScope){return arguments.callee.apply(arguments.callee._oScope,arguments)}var D=this;if(F.msg){D.showQuickMsg(F.msg)}if(F.success){D.lastUpdate=parseInt(F.lastUpdate);for(var C=0,A=F.tasks.length;C<A;C++){var G=F.tasks[C],B=D.getTask(G.id);if(!B.done){B.done={}}B.modifyTime=D.lastUpdate;B.productionDetails=G.productionDetails;mj.apply(B.done,G.done);mj.apply(B.stops,G.stops);D.drawTaskDone(B)}var E=function(){if(this!=arguments.callee._oScope){return arguments.callee.apply(arguments.callee._oScope,arguments)}D.updateTaskValues()};E._oScope=D;if(D.liveUpdate){D._liveUpdateTimer=setTimeout(E,D.updateTaskInterval)}}else{D.stopLiveUpdate()}mj.dontShowLoader=false},waitMaskShow:function(){this.waitMaskActive=true;this.waitMask[0].style.display="block"},waitMaskHide:function(){this.waitMaskActive=false;this.waitMask[0].style.display="none"},zoom:function(A){var B=this;B.waitMaskShow();setTimeout(function(){var D=B.domEls.chartEls.chartBody;var G=B.getTimeFromPx(D[0].scrollLeft+(B._chartBodyWidth/2));B.timeIntervalIndex=A?(B.timeIntervalIndex+A):5;B.time=B.timeRangeMap[B.timeIntervalIndex];B.timeInterval=B.timeRange[B.timeIntervalIndex];B.updateTaskInterval=parseInt(B.time.ms/50);B.clearChartComponents();B.drawOffTime();B.fillChartTimeline();B.initGanttData();B.fillVardiya();for(var F=0,C=B.tasks.length;F<C;F++){var E=B.tasks[F];B.locateTask(E);B.drawTaskDone(E)}B.drawCurrentTimeLine();B.drawResources();B.gotoTime(G);B.waitMaskHide()},10)},zoomIn:function(){if(!this.time.min){this.zoom(-1)}},zoomOut:function(){if(!this.time.max){this.zoom(1)}},zoomReset:function(){this.zoom()},init:function(){var A=this;A.colorGenerator=new mj.randomColors();A.id=A.id||mj.genId(A.prefix||"mj-gantt-");A.offTime=A.offTime||[];A.station=A.station||{};A.firstDate=A.firstDate||new Date();A.buttons={};A.domEls={};A.history=[];A.render()}};mj.extend(mj.gantt,mj.component);var WYSIWYG={Settings:function(){this.ImagesDir="images/";this.PopupsDir="popups/";this.Width="500px";this.Height="200px";this.DefaultStyle="font-family: Arial; font-size: 12px; background-color: #FFFFFF";this.DisabledStyle="font-family: Arial; font-size: 12px; background-color: #EEEEEE";this.PreviewWidth=500;this.PreviewHeight=400;this.RemoveFormatConfMessage="Clean HTML inserted by MS Word ?";this.NoValidBrowserMessage="openWYSIWYG does not support your browser.";this.AnchorPathToStrip="auto";this.ImagePathToStrip="auto";this.ContextMenu=true;this.StatusBarEnabled=true;this.InvertIELineBreaks=false;this.ReplaceLineBreaks=false;this.ImagePopupFile="";this.ImagePopupWidth=0;this.ImagePopupHeight=0;this.Toolbar=new Array();this.Toolbar[0]=new Array("font","fontsize","bold","italic","underline","strikethrough","seperator","forecolor","backcolor","seperator","justifyleft","justifycenter","justifyright","seperator","unorderedlist","orderedlist","outdent","indent");this.Toolbar[1]=new Array("subscript","superscript","seperator","cut","copy","paste","removeformat","seperator","undo","redo","seperator","inserttable","insertimage","createlink","seperator","preview","print","seperator","viewSource","seperator");this.Fonts=new Array("Arial","Sans Serif","Tahoma","Verdana","Courier New","Georgia","Times New Roman","Impact","Comic Sans MS");this.Fontsizes=new Array("1","2","3","4","5","6","7");this.addToolbarElement=function(B,C,A){if(B!="seperator"){this.removeToolbarElement(B)}if(this.Toolbar[C-1]==null){this.Toolbar[C-1]=new Array()}this.Toolbar[C-1].splice(A+1,1,B)};this.removeToolbarElement=function(C){if(C=="seperator"){return }for(var B=0;B<this.Toolbar.length;B++){if(this.Toolbar[B]){var D=this.Toolbar[B];for(var A=0;A<D.length;A++){if(D[A]!=null&&D[A]==C){this.Toolbar[B].splice(A,1)}}}}};this.clearToolbar=function(A){if(typeof A=="undefined"){this.Toolbar=new Array()}else{this.Toolbar[A+1]=new Array()}}},ToolbarList:{"bold":["Bold","Bold","bold.gif","bold_on.gif","0 0","-20px 0"],"italic":["Italic","Italic","italics.gif","italics_on.gif","-40px 0","-60px 0"],"underline":["Underline","Underline","underline.gif","underline_on.gif","-80px 0","-100px 0"],"strikethrough":["Strikethrough","Strikethrough","strikethrough.gif","strikethrough_on.gif","-120px 0","-140px 0"],"seperator":["","","seperator.gif","seperator.gif","-160px 0","-180px 0"],"subscript":["Subscript","Subscript","subscript.gif","subscript_on.gif","-200px 0","-220px 0"],"superscript":["Superscript","Superscript","superscript.gif","superscript_on.gif","-240px 0","-260px 0"],"justifyleft":["Justifyleft","Justifyleft","justify_left.gif","justify_left_on.gif","-280px 0","-300px 0"],"justifycenter":["Justifycenter","Justifycenter","justify_center.gif","justify_center_on.gif","-320px 0","-340px 0"],"justifyright":["Justifyright","Justifyright","justify_right.gif","justify_right_on.gif","-360px 0","-380px 0"],"unorderedlist":["InsertUnorderedList","Insert Unordered List","list_unordered.gif","list_unordered_on.gif","-400px 0","-420px 0"],"orderedlist":["InsertOrderedList","Insert Ordered List","list_ordered.gif","list_ordered_on.gif","-440px 0","-460px 0"],"outdent":["Outdent","Outdent","indent_left.gif","indent_left_on.gif","-480px 0","-500px 0"],"indent":["Indent","Indent","indent_right.gif","indent_right_on.gif","-520px 0","-540px 0"],"cut":["Cut","Cut","cut.gif","cut_on.gif","-560px 0","-580px 0"],"copy":["Copy","Copy","copy.gif","copy_on.gif","-600px 0","-620px 0"],"paste":["Paste","Paste","paste.gif","paste_on.gif","-640px 0","-660px 0"],"forecolor":["ForeColor","Fore Color","forecolor.gif","forecolor_on.gif","-680px 0","-700px 0"],"backcolor":["BackColor","Back Color","backcolor.gif","backcolor_on.gif","-720px 0","-740px 0"],"undo":["Undo","Undo","undo.gif","undo_on.gif","-760px 0","-780px 0"],"redo":["Redo","Redo","redo.gif","redo_on.gif","-800px 0","-820px 0"],"inserttable":["InsertTable","Insert Table","insert_table.gif","insert_table_on.gif","-840px 0","-860px 0"],"insertimage":["InsertImage","Insert Image","insert_picture.gif","insert_picture_on.gif","-880px 0","-900px 0"],"createlink":["CreateLink","Create Link","insert_hyperlink.gif","insert_hyperlink_on.gif","-920px 0","-940px 0"],"viewSource":["ViewSource","View Source","view_source.gif","view_source_on.gif","-960px 0","-980px 0"],"viewText":["ViewText","View Text","view_text.gif","view_text_on.gif","-1000px 0","-1020px 0"],"selectfont":["SelectFont","Select Font","select_font.gif","select_font_on.gif","-1040px 0","-1125px 0"],"selectsize":["SelectSize","Select Size","select_size.gif","select_size_on.gif","-1210px 0","-1260px 0"],"preview":["Preview","Preview","preview.gif","preview_on.gif","-1430px 0","-1450px 0"],"print":["Print","Print","print.gif","print_on.gif","-1310px 0","-1330px 0"],"removeformat":["RemoveFormat","Strip Word HTML","remove_format.gif","remove_format_on.gif","-1350px 0","-1370px 0"],"delete":["Delete","Delete","delete.gif","delete_on.gif","-1390px 0","-1410px 0"]},config:new Array(),viewTextMode:new Array(),getRange:function(A){return A.createRange?A.createRange():A.getRangeAt(0)},getEditor:function(A){return $g("wysiwyg"+A)},getEditorWindow:function(A){return this.getEditor(A).contentWindow},attach:function(C,A){if(C!="all"){this.setSettings(C,A);WYSIWYG_Core.addEvent(window,"load",function B(){WYSIWYG._generate(C,A)})}else{WYSIWYG_Core.addEvent(window,"load",function B(){WYSIWYG.attachAll(A)})}},attachAll:function(C){var A=document.getElementsByTagName("textarea");for(var B=0;B<A.length;B++){var D=A[B].getAttribute("id");if(D==null||D==""){continue}this.setSettings(D,C);WYSIWYG._generate(D,C)}},display:function(C,B){if(C!="all"){this.setSettings(C,B);WYSIWYG_Core.addEvent(window,"load",function A(){WYSIWYG._display(C,B)})}else{WYSIWYG_Core.addEvent(window,"load",function A(){WYSIWYG.displayAll(B)})}},displayAll:function(C){var A=document.getElementsByTagName("textarea");for(var B=0;B<A.length;B++){var D=A[B].getAttribute("id");if(D==null||D==""){continue}this.setSettings(D,C);WYSIWYG._display(D,C)}},setSettings:function(B,A){if(typeof (A)!="object"){this.config[B]=new this.Settings()}else{this.config[B]=A}},insertImage:function(A,B,M,K,F,J,N,E,D){var L=this.doc;var C=this.getSelection(D);var I=this.getRange(C);var H=this.findParentTag("img",I);var G=(H==null)?false:true;if(!G){H=L.createElement("img")}WYSIWYG_Core.setAttribute(H,"src",mj.glb.uploadPath+A);WYSIWYG_Core.setAttribute(H,"style","width:"+B+";height:"+M);if(K!=""){WYSIWYG_Core.setAttribute(H,"align",K)}else{H.removeAttribute("align")}WYSIWYG_Core.setAttribute(H,"border",F);WYSIWYG_Core.setAttribute(H,"alt",J);WYSIWYG_Core.setAttribute(H,"hspace",N);WYSIWYG_Core.setAttribute(H,"vspace",E);WYSIWYG_Core.setAttribute(H,"rel",A);WYSIWYG_Core.setAttribute(H,"class","mj-wysiwyg-image");H.removeAttribute("width");H.removeAttribute("height");if(G){return }if(WYSIWYG_Core.isMSIE){I.pasteHTML(H.outerHTML)}else{this.insertNodeAtSelection(H,D)}},insertLink:function(C,K,A,J,B,F){var M=this.getEditorWindow(F).document;var E=this.getSelection(F);var I=this.getRange(E);var D=null;if(WYSIWYG_Core.isMSIE){if(E.type=="Control"&&I.length==1){I=this.getTextRange(I(0));I.select()}}D=this.findParentTag("a",I);var H=(D==null)?false:true;if(!H){D=M.createElement("a")}WYSIWYG_Core.setAttribute(D,"href",C);WYSIWYG_Core.setAttribute(D,"class",J);WYSIWYG_Core.setAttribute(D,"className",J);WYSIWYG_Core.setAttribute(D,"target",K);WYSIWYG_Core.setAttribute(D,"name",B);WYSIWYG_Core.setAttribute(D,"style",A);if(H){return }if(WYSIWYG_Core.isMSIE){I.select();D.innerHTML=I.htmlText;I.pasteHTML(D.outerHTML)}else{var G=I.startContainer;var L=I.startOffset;if(G.nodeType!=3){G=G.childNodes[L]}if(G.tagName){D.appendChild(G)}else{D.innerHTML=E}this.insertNodeAtSelection(D,F)}},removeFormat:function(C){if(!confirm(this.config[C].RemoveFormatConfMessage)){return }var A=this.getEditorWindow(C).document;var B=A.body.innerHTML;B=B.replace(/<span([^>])*>(&nbsp;)*\s*<\/span>/gi,"");B=B.replace(/<span[^>]*>/gi,"");B=B.replace(/<\/span[^>]*>/gi,"");B=B.replace(/<p([^>])*>(&nbsp;)*\s*<\/p>/gi,"");B=B.replace(/<p[^>]*>/gi,"");B=B.replace(/<\/p[^>]*>/gi,"");B=B.replace(/<h([^>])[0-9]>(&nbsp;)*\s*<\/h>/gi,"");B=B.replace(/<h[^>][0-9]>/gi,"");B=B.replace(/<\/h[^>][0-9]>/gi,"");B=B.replace(/<B [^>]*>/ig,"<b>");B=B.replace(/<DIV[^>]*>/ig,"");B=B.replace(/<\/DIV>/gi,"");B=B.replace(/<[\/\w?]+:[^>]*>/ig,"");B=B.replace(/(&nbsp;){2,}/ig,"&nbsp;");B=B.replace(/<STRONG>/ig,"");B=B.replace(/<\/STRONG>/ig,"");B=B.replace(/<TT>/ig,"");B=B.replace(/<\/TT>/ig,"");B=B.replace(/<FONT [^>]*>/ig,"");B=B.replace(/<\/FONT>/ig,"");B=B.replace(/STYLE=\"[^\"]*\"/ig,"");B=B.replace(/<([\w]+) class=([^ |>]*)([^>]*)/gi,"<$1$3");B=B.replace(/<([\w]+) style="([^"]*)"([^>]*)/gi,"<$1$3");B=B.replace(/width=([^ |>]*)([^>]*)/gi,"");B=B.replace(/classname=([^ |>]*)([^>]*)/gi,"");B=B.replace(/align=([^ |>]*)([^>]*)/gi,"");B=B.replace(/valign=([^ |>]*)([^>]*)/gi,"");B=B.replace(/<\\?\??xml[^>]>/gi,"");B=B.replace(/<\/?\w+:[^>]*>/gi,"");B=B.replace(/<st1:.*?>/gi,"");B=B.replace(/o:/gi,"");B=B.replace(/<!--([^>])*>(&nbsp;)*\s*<\/-->/gi,"");B=B.replace(/<!--[^>]*>/gi,"");B=B.replace(/<\/--[^>]*>/gi,"");A.body.innerHTML=B},_display:function(C,E){var J=$g(C);if(J==null){alert("No textarea found with the given identifier (ID: "+C+").");return }if(!WYSIWYG_Core.isBrowserCompatible()){if(this.config[C].NoValidBrowserMessage!=""){alert(this.config[C].NoValidBrowserMessage)}return }if(typeof (E)!="object"){this.config[C]=new this.Settings()}else{this.config[C]=E}J.style.display="none";if(J.style.width){this.config[C].Width=J.style.width}if(J.style.height){this.config[C].Height=J.style.height}var B=this.config[C].Width;var D=this.config[C].Height;var G="100%";var A="100%";if(B.search(/%/)==-1){G=B;A=D}var F='<table cellpadding="0" cellspacing="0" border="0" style="width:'+B+"; height:"+D+';" class="tableTextareaEditor"><tr><td valign="top">\n<iframe  frameborder="0" id="wysiwyg'+C+'" class="iframeText" style="width:'+G+";height:"+A+';"></iframe>\n</td></tr></table>\n';J.insertAdjacentHTML("afterEnd",F);var H=J.value;var I=this.getEditorWindow(C).document;if(this.config[C].ReplaceLineBreaks){H=H.replace(/(\r\n)|(\n)/ig,"<br>")}I.open();I.write(H);I.close();WYSIWYG_Core.setAttribute(I.body,"style",this.config[C].DefaultStyle)},_generate:function(O,U){this.stores={};this.wins=[];this.id=O;var L=$g(O);if(L==null){alert("No textarea found with the given identifier (ID: "+O+").");return }if(!WYSIWYG_Core.isBrowserCompatible()){if(this.config[O].NoValidBrowserMessage!=""){alert(this.config[O].NoValidBrowserMessage)}return }L.style.display="none";if(L.style.width){this.config[O].Width=L.style.width}if(L.style.height){this.config[O].Height=L.style.height}var G=this.config[O].Width;var D=this.config[O].Height;var M=G;var T="100%";var H="100%";if(G.search(/%/)==-1){M=G.replace(/px/gi,"");M=(parseFloat(M)-2)+"px";T=G;H=D}var F="";F+='<table border="0" cellpadding="0" cellspacing="0" class="tableTextareaEditor" id="wysiwyg_table_'+O+'" style="width:'+G+"; height:"+D+';">';F+='<tr><td style="height:25px;">';for(var Q=0;Q<this.config[O].Toolbar.length;Q++){if(this.config[O].Toolbar[Q]&&this.config[O].Toolbar[Q].length>0){var J=this.config[O].Toolbar[Q];F+='<table border="0" cellpadding="0" cellspacing="0" class="toolbar1" style="width:'+M+';" id="toolbar'+Q+"_"+O+'">';F+='<tr><td style="width: 6px;"><div class="seperator2"></div></td>';for(var R=0;R<J.length;R++){if(J[R]){if(J[R]=="font"){F+='<td style="width: 90px;"><span id="FontSelect'+O+'"></span></td>'}else{if(J[R]=="fontsize"){F+='<td style="width: 60px;"><span id="FontSizes'+O+'"></span></td>'}else{var Y=this.ToolbarList[J[R]];var a=Y[0];var A=Y[1];var W=false;if(Y[4]){W='<div alt="'+A+'" id="'+a+'" class="divbuttonEditor" style="background-position:'+Y[4]+"\" onmouseover=\"this.className='divbuttonEditorOver'; this.style.backgroundPosition='"+Y[5]+"';\" onmouseout=\"this.className='divbuttonEditor'; this.style.backgroundPosition='"+Y[4]+"';\" onclick=\"WYSIWYG.formatText('"+a+"','"+O+'\');" unselectable="on" width="20" height="20">'+mj.insertSpacer(20,20)+"</div>"}else{var N=this.config[O].ImagesDir+Y[2];var B=this.config[O].ImagesDir+Y[3]}if(J[R]=="seperator"){F+='<td style="width: 12px;" align="center">';F+='<div class="seperator"></div>';F+="</td>"}else{if(J[R]=="viewSource"){F+='<td style="width: 22px;">';F+='<span id="HTMLMode'+O+'"><div alt="'+A+'" id="'+a+'" class="divbuttonEditor" style="background-position:'+Y[4]+"\" onmouseover=\"this.className='divbuttonEditorOver'; this.style.backgroundPosition='"+Y[5]+"';\" onmouseout=\"this.className='divbuttonEditor'; this.style.backgroundPosition='"+Y[4]+"';\" onclick=\"WYSIWYG.formatText('"+a+"','"+O+'\');" unselectable="on" width="20" height="20">'+mj.insertSpacer(20,20)+"</div></span>";F+='<span id="textMode'+O+'"><div alt="View Text" id="ViewText" class="divbuttonEditor" style="background-position:-1000px 0" onmouseover="this.className=\'divbuttonEditorOver\'; this.style.backgroundPosition=\'-1020px 0\';" onmouseout="this.className=\'divbuttonEditor\'; this.style.backgroundPosition=\'-1000px 0\';" onclick="WYSIWYG.formatText(\'ViewText\',\''+O+'\');" unselectable="on" width="20" height="20">'+mj.insertSpacer(20,20)+"</div></span>";F+="</td>"}else{if(W){F+='<td style="width: 22px;">';F+=W;F+="</td>"}else{F+='<td style="width: 22px;">';F+='<img src="'+N+'" border=0 unselectable="on" title="'+A+'" id="'+a+'" class="buttonEditor" onmouseover="this.className=\'buttonEditorOver\'; this.src=\''+B+"';\" onmouseout=\"this.className='buttonEditor'; this.src='"+N+"';\" onclick=\"WYSIWYG.formatText('"+a+"','"+O+'\');" unselectable="on" width="20" height="20">';F+="</td>"}}}}}}}F+="<td>&nbsp;</td></tr></table>"}}F+='</td></tr><tr><td valign="top">\n';var X=(parseInt(D)-90)+"px";F+='<iframe  onmouseover="this.contentWindow.document.designMode=\'on\'" frameborder="0" id="wysiwyg'+O+'" class="iframeText" style="width:100%;height:'+X+';"></iframe>\n</td></tr>';if(this.config[O].StatusBarEnabled){F+='<tr><td class="wysiwyg-statusbar" style="height:10px;" id="wysiwyg_statusbar_'+O+'">&nbsp;</td></tr>'}F+="</table>\n";var V="<div id='"+(O+"_1")+"' class='mj-rich-text-area' style='height:"+this.config[O].Height+";width:"+this.config[O].Width+";'>"+F+"</div>";L.insertAdjacentHTML("afterEnd",V);this.outputFontSelect(O);this.outputFontSizes(O);this.hideFonts(O);this.hideFontSizes(O);if($g("textMode"+O)){$g("textMode"+O).style.display="none"}var P=L.value;var Z=this.getEditorWindow(O).document;this.doc=Z;if(this.config[O].ReplaceLineBreaks){P=P.replace(/\n\r|\n/ig,"<br>")}Z.open();Z.write(P);Z.close();if(Z.body.contentEditable){Z.body.contentEditable=true}else{}WYSIWYG_Core.setAttribute(Z.body,"style",this.config[O].DefaultStyle);for(var K=0;K<document.forms.length;K++){WYSIWYG_Core.addEvent(document.forms[K],"submit",function E(){WYSIWYG.updateTextArea(O)})}WYSIWYG_Core.addEvent(Z,"mouseover",function I(){WYSIWYG.hideFonts(O);WYSIWYG.hideFontSizes(O)});if(this.config[O].InvertIELineBreaks){WYSIWYG_Core.addEvent(Z,"keypress",function S(){WYSIWYG.invertIELineBreakCapability(O)})}if(this.config[O].StatusBarEnabled){WYSIWYG_Core.addEvent(Z,"mouseup",function C(){WYSIWYG.updateStatusBar(O)})}if(this.config[O].ContextMenu){WYSIWYG_ContextMenu.init(O)}this.viewTextMode[O]=false},disable:function(B){var C=B;var A=this.getEditorWindow(C);if(A==null){alert("No editor found with the given identifier (ID: "+C+").");return }if(A){if(A.document.body.contentEditable){A.document.body.contentEditable=false}else{A.document.designMode="Off"}WYSIWYG_Core.setAttribute(A.document.body,"style",this.config[C].DisabledStyle);this.hideStatusBar(C);this.hideToolbars(C)}},enable:function(B){var C=B;var A=this.getEditorWindow(C);if(A==null){alert("No editor found with the given identifier (ID: "+C+").");return }if(A){if(A.document.body.contentEditable){A.document.body.contentEditable=true}else{A.document.designMode="On"}WYSIWYG_Core.setAttribute(A.document.body,"style",this.config[C].DefaultStyle);this.showStatusBar(C);this.showToolbars(C)}},getNodeTree:function(G){var F=this.getSelection(G);var B=this.getRange(F);var A=this.getTag(B);if(A==null){return }var D=this.getParent(A);var E=new Array(A);var C=1;while(D!=null&&D.nodeName!="#document"){E[C]=D;D=this.getParent(D);C++}return E},removeNode:function(E){var D=this.getSelection(E);var B=this.getRange(D);var A=this.getTag(B);var C=A.parentNode;if(A==null||C==null){return }if(A.nodeName=="HTML"||A.nodeName=="BODY"){return }C.removeChild(A);if(C.nodeName=="A"&&!C.hasChildNodes()){if(C.parentNode){C.parentNode.removeChild(C)}}this.updateStatusBar(E)},getSelection:function(D){var A=this.getEditorWindow(D);var C=A.document;var B=null;if(A.getSelection){B=A.getSelection()}else{if(C.getSelection){B=C.getSelection()}else{if(C.selection){B=C.selection}}}return B},updateStatusBar:function(F){var E=this.getNodeTree(F);if(E==null){return }var C="";var A=E.length-1;for(var B=A;B>=0;B--){if(E[B].nodeName!="HTML"&&E[B].nodeName!="BODY"){C+='<a class="wysiwyg-statusbar" href="javascript:WYSIWYG.selectNode(\''+F+"',"+B+');">'+E[B].nodeName+"</a>"}else{C+=E[B].nodeName}if(B>0){C+=" > "}}var D=$g("wysiwyg_statusbar_"+F);if(D){D.innerHTML=C}},disableDesignMode:function(A,C){var B=this.getEditorWindow(C).document;if(A.which==3){B.designMode="off";return false}else{if(A.which!=3&&B.designMode=="off"){B.designMode="on";return true}}},formatText:function(B,A,F){this.getEditorWindow(A).focus();var L=new Array("FontSize","FontName","Bold","Italic","Underline","Subscript","Superscript","Strikethrough","Justifyleft","Justifyright","Justifycenter","InsertUnorderedList","InsertOrderedList","Indent","Outdent","ForeColor","BackColor","InsertImage","InsertTable","CreateLink","Preview","RemoveFormat");for(var G=0;G<L.length;G++){if(L[G]==B){var I=1}}var H=WYSIWYG_Core.isMSIE?WYSIWYG_Core._dec_to_rgb:WYSIWYG_Core.toHexColor;var D={left:parseInt(window.screen.availWidth/3),top:parseInt(window.screen.availHeight/3)};if(this.viewTextMode[A]==true&&I==1){alert("You are in TEXT Mode. This feature has been disabled.");return }var J=this.config[A].PopupsDir+"insert_image.html";var C=400;var M=210;if(typeof this.config[A].ImagePopupFile!="undefined"&&this.config[A].ImagePopupFile!=""){J=this.config[A].ImagePopupFile}if(typeof this.config[A].ImagePopupWidth&&this.config[A].ImagePopupWidth>0){C=this.config[A].ImagePopupWidth}if(typeof this.config[A].ImagePopupHeight&&this.config[A].ImagePopupHeight>0){M=this.config[A].ImagePopupHeight}switch(B){case"FontSize":this.getEditorWindow(A).document.execCommand("FontSize",false,F);break;case"FontName":this.getEditorWindow(A).document.execCommand("FontName",false,F);break;case"ForeColor":var K=this.getEditorWindow(A).document.queryCommandValue(B);var E=K!=""?H(this.getEditorWindow(A).document.queryCommandValue(B)):"000000";window.open(this.config[A].PopupsDir+"select_color.html?color="+E+"&command="+B+"&wysiwyg="+A,"popup","location=0,status=0,scrollbars=0,width=210,height=165,top="+D.top+",left="+D.left).focus();break;case"BackColor":var E=H(this.getEditorWindow(A).document.queryCommandValue(B));window.open(this.config[A].PopupsDir+"select_color.html?color="+E+"&command="+B+"&wysiwyg="+A,"popup","location=0,status=0,scrollbars=0,width=210,height=165,top="+D.top+",left="+D.left).focus();break;case"InsertImage":this.showUploadForm();break;case"RemoveImage":this.removeImage(A);break;case"RemoveLink":this.removeLink(A);break;case"RemoveNode":this.removeNode(A);break;case"CreateLink":window.open(this.config[A].PopupsDir+"insert_hyperlink.html?wysiwyg="+A,"popup","location=0,status=0,scrollbars=0,resizable=0,width=350,height=160,top="+D.top+",left="+D.left).focus();break;case"InsertTable":window.open(this.config[A].PopupsDir+"create_table.html?wysiwyg="+A,"popup","location=0,status=0,scrollbars=0,resizable=0,width=400,height=360,top="+D.top+",left="+D.left).focus();break;case"ViewSource":this.viewSource(A);break;case"ViewText":this.viewText(A);break;case"RemoveFormat":this.removeFormat(A);break;case"Preview":window.open(this.config[A].PopupsDir+"preview.html?wysiwyg="+A,"popup","location=0,status=0,scrollbars=1,resizable=1,width="+this.config[A].PreviewWidth+",height="+this.config[A].PreviewHeight+",top="+D.top+",left="+D.left).focus();break;case"Print":this.print(A);break;default:WYSIWYG_Core.execCommand(A,B)}this.hideFonts(A);this.hideFontSizes(A)},insertHTML:function(A,C){if(WYSIWYG_Core.isMSIE){this.getEditorWindow(C).document.selection.createRange().pasteHTML(A)}else{var B=this.getEditorWindow(C).document.createElement("span");B.innerHTML=A;this.insertNodeAtSelection(B,C)}},insertNodeAtSelection:function(F,C){var L=this.getEditorWindow(C).document;var B=this.getSelection(C);var G=B.getRangeAt(0);B.removeAllRanges();G.deleteContents();var A=G.startContainer;var K=G.startOffset;G=L.createRange();if(A.nodeType==3&&F.nodeType==3){A.insertData(K,F.data);G.setEnd(A,K+F.length);G.setStart(A,K+F.length)}else{var D;var J;if(A.nodeType==3){var E=A;A=E.parentNode;var M=E.nodeValue;var I=M.substr(0,K);var H=M.substr(K);J=document.createTextNode(I);D=document.createTextNode(H);A.insertBefore(D,E);A.insertBefore(F,D);A.insertBefore(J,F);A.removeChild(E)}else{D=A.childNodes[K];A.insertBefore(F,D)}G.setEnd(D,0);G.setStart(D,0)}B.addRange(G)},print:function(F){if(document.all&&navigator.appVersion.substring(22,23)==4){var C=this.getEditorWindow(F).document;C.focus();var A=6;var E=2;var B=1;var D='<object id="WebBrowser1" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>';C.body.insertAdjacentHTML("beforeEnd",D);D.ExecWB(A,E);D.outerHTML=""}else{this.getEditorWindow(F).print()}},outputFontSelect:function(H){var C=$g("FontSelect"+H);if(C==null){return }var G=this.config[H].Fonts;var A=this.ToolbarList["selectfont"];var B=this.config[H].ImagesDir+A[2];var E=this.config[H].ImagesDir+A[3];G.sort();var F=new Array;F[H]='<table border="0" cellpadding="0" cellspacing="0"><tr><td><div alt="'+A[1]+'" id="'+A[0]+'" class="editorbackground" style="background-position:'+A[4]+';width:85px;height:20px;" onmouseover="this.style.backgroundPosition=\''+A[5]+"';\" onmouseout=\"this.style.backgroundPosition='"+A[4]+"';\" onclick=\"WYSIWYG.showFonts('"+H+'\');" unselectable="on" width="85" height="20">'+mj.insertSpacer(20,20)+"</div>";F[H]+='<span id="Fonts'+H+'" class="dropdown" style="width: 145px;">';for(var D=0;D<G.length;D++){if(G[D]){F[H]+="<button type=\"button\" onClick=\"WYSIWYG.formatText('FontName','"+H+"','"+G[D]+'\');" onMouseOver="this.className=\'mouseOver\'" onMouseOut="this.className=\'mouseOut\'" class="mouseOut" style="width: 120px;"><table cellpadding="0" cellspacing="0" border="0"><tr><td align="left" style="font-family:'+G[D]+'; font-size: 12px;">'+G[D]+"</td></tr></table></button><br>"}}F[H]+="</span></td></tr></table>";C.insertAdjacentHTML("afterBegin",F[H])},outputFontSizes:function(H){var F=$g("FontSizes"+H);if(F==null){return }var D=this.config[H].Fontsizes;var G=this.ToolbarList["selectsize"];var E=this.config[H].ImagesDir+G[2];var C=this.config[H].ImagesDir+G[3];D.sort();var A=new Array;A[H]='<table border="0" cellpadding="0" cellspacing="0"><tr><td onMouseOver="$g(\'selectSize'+H+"').src='"+C+"';\" onMouseOut=\"$g('selectSize"+H+"').src='"+E+'\';"><div alt="'+G[1]+'" class="editorbackground" id="selectSize'+H+'" style="background-position:'+G[4]+';width:49px;height:20px;" onmouseover="this.style.backgroundPosition=\''+G[5]+"';\" onmouseout=\"this.style.backgroundPosition='"+G[4]+"';\" onclick=\"WYSIWYG.showFontSizes('"+H+'\');" unselectable="on" width="49" height="20">'+mj.insertSpacer(20,20)+"</div>";A[H]+='<span id="Sizes'+H+'" class="dropdown" style="width: 170px;">';for(var B=0;B<D.length;B++){if(D[B]){A[H]+="<button type=\"button\" onClick=\"WYSIWYG.formatText('FontSize','"+H+"','"+D[B]+'\');" onMouseOver="this.className=\'mouseOver\'" onMouseOut="this.className=\'mouseOut\'" class="mouseOut" style="width: 145px;"><table cellpadding="0" cellspacing="0" border="0"><tr><td align="left" style="font-family: arial, verdana, helvetica;"><font size="'+D[B]+'">size '+D[B]+"</font></td></tr></table></button><br>"}}A[H]+="</span></td></tr></table>";F.insertAdjacentHTML("afterBegin",A[H])},hideFonts:function(A){if($g("Fonts"+A)){$g("Fonts"+A).style.display="none"}},hideFontSizes:function(A){if($g("Sizes"+A)){$g("Sizes"+A).style.display="none"}},showFonts:function(A){if($g("Fonts"+A)==null){return }if($g("Fonts"+A).style.display=="block"){$g("Fonts"+A).style.display="none"}else{$g("Fonts"+A).style.display="block";$g("Fonts"+A).style.position="absolute"}this.hideFontSizes(A)},showFontSizes:function(A){if($g("Sizes"+A)==null){return }if($g("Sizes"+A).style.display=="block"){$g("Sizes"+A).style.display="none"}else{$g("Sizes"+A).style.display="block";$g("Sizes"+A).style.position="absolute"}this.hideFonts(A)},viewSource:function(D){var C=this.getEditorWindow(D).document;if(WYSIWYG_Core.isMSIE){var A=C.body.innerHTML;A=this.stripURLPath(D,A);A=WYSIWYG_Core.replaceRGBWithHexColor(A);C.body.innerText=A}else{var B=WYSIWYG_Core.replaceRGBWithHexColor(C.body.innerHTML);B=document.createTextNode(B);C.body.innerHTML="";C.body.appendChild(B)}if($g("HTMLMode"+D)){$g("HTMLMode"+D).style.display="none"}if($g("textMode"+D)){$g("textMode"+D).style.display="block"}C.body.style.fontSize="12px";C.body.style.fontFamily="Courier New";this.viewTextMode[D]=true},viewText:function(D){var B=this.getEditorWindow(D).document;if(WYSIWYG_Core.isMSIE){var C=B.body.innerText;C=this.stripURLPath(D,C);C=WYSIWYG_Core.replaceRGBWithHexColor(C);B.body.innerHTML=C}else{var A=B.body.ownerDocument.createRange();A.selectNodeContents(B.body);A=WYSIWYG_Core.replaceRGBWithHexColor(A.toString());B.body.innerHTML=A}if($g("textMode"+D)){$g("textMode"+D).style.display="none"}if($g("HTMLMode"+D)){$g("HTMLMode"+D).style.display="block"}WYSIWYG_Core.setAttribute(B.body,"style",this.config[D].DefaultStyle);this.viewTextMode[D]=false},getDocumentPathOfUrl:function(A){var B=null;A=A.replace(/file:\/\//gi,"file:///");A=A.replace(/\\/gi,"/");var C=A.lastIndexOf("/");if(C!=-1){B=A.substring(0,C+1)}return B},getDocumentUrl:function(B){var A=B.URL;A=A.replace(/file:\/\//gi,"file:///");A=A.replace(/\\/gi,"/");return A},stripURLPath:function(n,content,exact){if(typeof exact=="undefined"){exact=true}var stripImgageUrl=null;var stripAnchorUrl=null;if(this.config[n].AnchorPathToStrip=="auto"){stripAnchorUrl=this.getDocumentUrl(document)}else{if(this.config[n].AnchorPathToStrip!=""){stripAnchorUrl=this.config[n].AnchorPathToStrip}}if(this.config[n].ImagePathToStrip=="auto"){stripImgageUrl=this.getDocumentUrl(document)}else{if(this.config[n].ImagePathToStrip!=""){stripImgageUrl=this.config[n].ImagePathToStrip}}var url;var regex;var result;if(stripImgageUrl){url=WYSIWYG_Core.stringToRegex(this.getDocumentPathOfUrl(stripImgageUrl));if(exact){regex=eval('/(src=")('+url+')([^"]*)/gi');content=content.replace(regex,"$1$3")}else{regex=eval("/("+url+")(.+)/gi");content=content.replace(regex,"$2")}result=this.getDocumentPathOfUrl(stripImgageUrl).match(/.+[\/]{2,3}[^\/]*/,"");if(result){url=WYSIWYG_Core.stringToRegex(result[0]);if(exact){regex=eval('/(src=")('+url+')([^"]*)/gi');content=content.replace(regex,"$1$3")}else{regex=eval("/("+url+")(.+)/gi");content=content.replace(regex,"$2")}}}if(stripAnchorUrl){url=WYSIWYG_Core.stringToRegex(this.getDocumentPathOfUrl(stripAnchorUrl));if(exact){regex=eval('/(href=")('+url+')([^"]*)/gi');content=content.replace(regex,"$1$3")}else{regex=eval("/("+url+")(.+)/gi");content=content.replace(regex,"$2")}result=this.getDocumentPathOfUrl(stripAnchorUrl).match(/.+[\/]{2,3}[^\/]*/,"");if(result){url=WYSIWYG_Core.stringToRegex(result[0]);if(exact){regex=eval('/(href=")('+url+')([^"]*)/gi');content=content.replace(regex,"$1$3")}else{regex=eval("/("+url+")(.+)/gi");content=content.replace(regex,"$2")}}url=WYSIWYG_Core.stringToRegex(stripAnchorUrl);if(exact){regex=eval('/(href=")('+url+')(#[^"]*)/gi');content=content.replace(regex,"$1$3")}else{regex=eval("/("+url+")(.+)/gi");content=content.replace(regex,"$2")}url=this.getDocumentUrl(document);var pos=url.lastIndexOf("/");if(pos!=-1){url=url.substring(pos+1,url.length);url=WYSIWYG_Core.stringToRegex(url);if(exact){regex=eval('/(href=")('+url+')(#[^"]*)/gi');content=content.replace(regex,"$1$3")}else{regex=eval("/("+url+")(.+)/gi");content=content.replace(regex,"$2")}}}return content},updateTextArea:function(B){if(this.viewTextMode[B]){this.viewText(B)}var A=this.getEditorWindow(B).document.body.innerHTML;A=this.stripURLPath(B,A);A=WYSIWYG_Core.replaceRGBWithHexColor(A);if(this.config[B].ReplaceLineBreaks){A=A.replace(/(\r\n)|(\n)/ig,"")}$g(B).value=A},hideToolbars:function(C){for(var A=0;A<this.config[C].Toolbar.length;A++){var B=$g("toolbar"+A+"_"+C);if(B){B.style.display="none"}}},showToolbars:function(C){for(var A=0;A<this.config[C].Toolbar.length;A++){var B=$g("toolbar"+A+"_"+C);if(B){B.style.display=""}}},hideStatusBar:function(B){var A=$g("wysiwyg_statusbar_"+B);if(A){A.style.display="none"}},showStatusBar:function(B){var A=$g("wysiwyg_statusbar_"+B);if(A){A.style.display=""}},findParentTag:function(A,C){A=A.toUpperCase();var B;var F=null;try{if(!WYSIWYG_Core.isMSIE){var D=C.startContainer;var G=C.startOffset;if(D.nodeType!=3){D=D.childNodes[G]}F=D;while(F.tagName!="HTML"){if(F.tagName==A){return F}F=F.parentNode}return null}else{if(C.length>0){F=C.item(0)}else{F=C.parentElement()}while(F.tagName!="HTML"){if(F.tagName==A){return F}else{F=F.parentElement}}B=C.duplicate();B.collapse(true);B.moveEnd("character",1);if(B.text.length>0){while(B.compareEndPoints("EndToEnd",C)<0){B.move("Character");if(null!=this.findParentTag(A,B)){return this.findParentTag(A,B)}}}return null}}catch(E){return null}},getTag:function(A){try{if(!WYSIWYG_Core.isMSIE){var B=A.startContainer;var D=A.startOffset;if(B.nodeType!=3){B=B.childNodes[D]}if(B.nodeName&&B.nodeName.search(/#/)!=-1){return B.parentNode}return B}else{if(A.length>0){return A.item(0)}else{if(A.parentElement()){return A.parentElement()}}}return null}catch(C){return null}},getParent:function(A){if(A.parentNode){return A.parentNode}return null},getTextRange:function(B){var A=B.parentTextEdit.createTextRange();A.moveToElementText(B);return A},invertIELineBreakCapability:function(C){var A=this.getEditorWindow(C);var B;if(A.event.keyCode==13){if(!A.event.shiftKey){B=this.getRange(this.getSelection(C));B.pasteHTML("<br>");A.event.cancelBubble=true;A.event.returnValue=false;B.select();B.moveEnd("character",1);B.moveStart("character",1);B.collapse(false);return false}else{B=this.getRange(this.getSelection(C));B.pasteHTML("<p>");A.event.cancelBubble=true;A.event.returnValue=false;B.select();B.moveEnd("character",1);B.moveStart("character",1);B.collapse(false);return false}}},selectNode:function(G,F){var E=this.getSelection(G);var A=this.getRange(E);var B=this.getTag(A);var C=0;for(var D=B;(D&&(D.nodeType==1));D=D.parentNode){if(C==F){this.nodeSelection(G,D)}C++}this.updateStatusBar(G)},nodeSelection:function(F,B){var E=this.getEditorWindow(F).document;var C=this.getSelection(F);var A=this.getRange(C);if(!WYSIWYG_Core.isMSIE){if(B.nodeName=="BODY"){A.selectNodeContents(B)}else{A.selectNode(B)}if(C){C.removeAllRanges()}if(C){C.addRange(A)}}else{if((B.nodeName=="TABLE")||(B.nodeName=="IMG")||(B.nodeName=="INPUT")||(B.nodeName=="SELECT")||(B.nodeName=="TEXTAREA")){try{A=E.body.createControlRange();A.addElement(B);A.select()}catch(D){}}else{A=E.body.createTextRange();if(A){A.collapse();if(A.moveToElementText){try{A.moveToElementText(B);A.select()}catch(D){try{A=E.body.createTextRange();A.moveToElementText(B);A.select()}catch(D){}}}else{try{A=E.body.createTextRange();A.moveToElementText(B);A.select()}catch(D){}}}}}},showUploadForm:function(){this.browseImage.call(this,function(A){var B=this.imageForm.getValue();this.insertImage(A,B.width,B.height,B.alignment,B.border,B.alt,B.hspace,B.vspace,this.id);this.bWin.close()},this)},browseImage:function(A,D){var C=this;C.bWinCallback=function(){var F=C.bWin.getFile.call(this);if(F){A.call(D||this,F);C.bWin.hide()}};if(!C.bWin){var B=700,E=420;C.bWin=new mj.window({renderTo:mj.NE(),title:mj.lng.objects.browseImage.winTitle,modal:true,width:B,height:E,minWidth:520,minHeight:420,buttons:[{title:mj.lng.titles.buttons.cancel,scope:this,handler:function(){C.bWin.hide()}},{title:mj.lng.titles.buttons.ok,handler:C.bWinCallback}]});B=B-14;E=E-58;C.waitMask=$(mj.NE(C.bWin.getBody(),{cls:"mj-page-wait-mask mj-opacity-8",style:"display:none;width:"+B+"px;height:"+E+"px;",html:'<table width="100%" height="100%"><tr><td align="center" valign="middle"><img src="'+mj.glb.imagePath+'ajax-loader.gif"/><br/><br/><span class="mj-page-wait-title">LÃ¼tfen Bekleyin...</span></td></tr></table>'}));C.waitMaskShow=function(){C.waitMaskActive=true;C.waitMask[0].style.display="block"};C.waitMaskHide=function(){C.waitMaskActive=false;C.waitMask[0].style.display="none"};C.waitMaskShow();C.init=function(){if(this!=arguments.callee._oScope){return arguments.callee.apply(arguments.callee._oScope,arguments)}var G=this;G.bWin.getFile=function(){switch(G.bWinTab.activeTab){case 0:if(G.bWinView.selections.length>0){return G.bWinView.selections[0].store.fileName}break;case 1:if(G.bWinTree.selectedNode){G.bWinUploadForm.setValue({"klasor":mj.glb.uploadPath+G.bWinTree.selectedNode.id});G.bWinUploadForm.submit({url:mj.glb.functionsPath,params:{event:"upload"},success:function(I){G.bWinView.store.load();G.bWinTab.setActive(0)},failure:function(I){mj.message(I.msg)},scope:G,encoded:true})}else{new mj.message({title:mj.lng.glb.info,msg:mj.lng.objects.browseImage.selectFolderBefore,modal:true})}break;case 2:var H=G.bWinURL.getValue();if(H){return H}break}return false};G.mainLayout=new mj.layout({renderTo:mj.NE(G.bWin.getBody()),layout:"border",items:[{region:"south",initial:85,min:85,max:195,split:true,collapsible:true}]});G.imageForm=new mj.form({renderTo:G.mainLayout.getBody("south"),layout:"border",items:[new mj.form.fieldSet({title:mj.lng.objects.wysiwyg.imageProperties,items:[new mj.form.textField({dataIndex:"url",title:mj.lng.glb.url,labelWidth:"90px",width:320,readOnly:true}),new mj.form.textField({dataIndex:"alt",title:mj.lng.objects.wysiwyg.altText,labelWidth:"90px",width:320})]}),new mj.form.fieldSet({title:mj.lng.objects.wysiwyg.layout,items:[new mj.form.textField({dataIndex:"width",title:mj.lng.glb.width,labelWidth:"90px",width:110}),new mj.form.combo({dataIndex:"alignment",title:mj.lng.glb.alignment,labelWidth:"90px",width:110,right:true,clearOnTriggerClick:true,store:new mj.store({data:[{id:"left",text:mj.lng.glb.left},{id:"right",text:mj.lng.glb.right},{id:"texttop",text:mj.lng.objects.wysiwyg.texttop},{id:"absmiddle",text:mj.lng.objects.wysiwyg.absmiddle},{id:"baseline",text:mj.lng.objects.wysiwyg.baseline},{id:"absbottom",text:mj.lng.objects.wysiwyg.absbottom},{id:"bottom",text:mj.lng.glb.bottom},{id:"middle",text:mj.lng.glb.middle},{id:"top",text:mj.lng.glb.top}]})}),new mj.form.textField({dataIndex:"height",title:mj.lng.glb.height,labelWidth:"90px",width:110}),new mj.form.textField({dataIndex:"hspace",title:mj.lng.objects.wysiwyg.hspace,right:true,labelWidth:"90px",width:110}),new mj.form.numberField({dataIndex:"border",title:mj.lng.objects.wysiwyg.border,labelWidth:"90px",width:110}),new mj.form.textField({dataIndex:"vspace",title:mj.lng.objects.wysiwyg.vspace,right:true,labelWidth:"90px",width:110})]})]});G.bWinLayout=new mj.layout({renderTo:G.mainLayout.getBody("center"),layout:"border",items:[{region:"west",initial:190,min:100,max:190,split:false,collapsible:true}]});G.bWinWestPanel=new mj.panel({renderTo:G.bWinLayout.getBody("west"),fitToParent:true});G.stores["bWinTree"]=new mj.store({url:mj.glb.functionsPath,params:{myRoot:mj.glb.uploadPath,node:mj.glb.uploadFolder,event:"getDirTree",fileTypes:"*"}});G.bWinTree=new mj.tree({renderTo:G.bWinWestPanel.getBody(),store:G.stores.bWinTree,mode:"remote",icon:true});G.bWinTab=new mj.tab({renderTo:G.bWinLayout.getBody("center"),activeTab:0,tabWidth:120,border:false,items:[{title:mj.lng.objects.browseImage.files,iconCls:"tabs",closable:false},{title:mj.lng.objects.browseImage.upload,iconCls:"tabs",closable:false}]});G.bWinTab.on("tabchange",function(H,J,I){G.bWin.buttons[1].setTitle(J==1?mj.lng.objects.browseImage.upload:mj.lng.objects.browseImage.select);if(J==1){G.bWinUploadPanelBody.empty();G.bWinUploadForm=new mj.form({renderTo:G.bWinUploadPanelBody,items:[new mj.form.textField({hidden:true,type:"hidden",name:"klasor"}),new mj.form.fileInput({id:"resim",name:"resim",maxFile:10,title:mj.lng.objects.browseImage.browse,labelWidth:"110px"})]})}},G);var F=['<div class="thumb-wrap">','<div class="thumb"><table width="80" height="80" cellpadding="0" cellspacing="0"><tr><td align="center" valign="middle"><img src="{url}" title="{name}" style="width:{width}px;height:{height}px;"/></td></tr></table></div>',"</div>"];G.bWinViewPanel=new mj.panel({renderTo:G.bWinTab.tabs[0].getBody(),fitToParent:true});G.stores["bWinView"]=new mj.store({url:mj.glb.functionsPath,params:{myRoot:mj.glb.uploadPath,node:mj.glb.uploadFolder,fileTypes:"*",event:"getImageView"}});G.bWinView=new mj.view({renderTo:G.bWinViewPanel.getBody(),store:G.stores.bWinView,pbar:new mj.pager({limit:15,pos:"bottom"}),tpl:new mj.template(F),selector:"div.thumb-wrap"});G.bWinView.on("itemclick",function(H,I){G.imageForm.clear();var J=I.store;G.imageForm.setValue({url:J.fileName,alt:J.name,width:J.width+"px",height:J.height+"px"})},G);G.bWinView.on("dblclick",function(H){G.bWinCallback()},G);G.bWinTree.on("nodeclick",function(H,I){var J=H.selectedNode;G.bWinView.store.params.start=0;G.bWinView.pbar.params.start=0;G.bWinView.store.params.current=1;G.bWinView.pbar.params.current=1;G.bWinView.store.params.node=J.id;G.bWinView.store.load()},G);G.bWinUploadPanelBody=G.bWinTab.tabs[1].getBody();G.bWin.buttons[1].setHandler(G.bWinCallback,D);if(!G.bWinTree.store.loaded){G.bWinTree.load()}G.wins.push(G.bWin);G.bWin.show();G.bWinTree.store.on("beforeload",function(){G.waitMaskShow()},G);G.bWinTree.store.on("load",function(){G.waitMaskHide()},G);G.bWinView.store.on("beforeload",function(){G.waitMaskShow()},G);G.bWinView.store.on("load",function(){G.waitMaskHide()},G);G.waitMaskHide()};C.init._oScope=C;setTimeout(C.init,10)}else{C.bWin.buttons[1].setHandler(C.bWinCallback,D);if(!C.bWinTree.store.loaded){C.bWinTree.load()}C.wins.push(C.bWin);C.bWin.show()}}};var WYSIWYG_Core={isMSIE:navigator.appName=="Microsoft Internet Explorer"?true:false,isFF:!document.all&&document.getElementById&&!this.isOpera,isOpera:navigator.appName=="Opera"?true:false,trim:function(A){return A.replace(/^\s*|\s*$/g,"")},defined:function(A){return typeof A=="undefined"?false:true},isBrowserCompatible:function(){if((navigator.userAgent.indexOf("Safari")!=-1)||!document.getElementById||!document.designMode){return false}return true},_setStyleAttribute:function(D,B){var L=B.split(";");var J;for(var E=0;E<L.length;E++){var C=L[E].split(":");if(C.length==2){try{var H=WYSIWYG_Core.trim(C[0]);while((J=H.search(/-/))!=-1){var I=H.substring(0,J);var F=H.substring(J+1,J+2);var A=H.substring(J+2,H.length);H=I+F.toUpperCase()+A}var K=WYSIWYG_Core.trim(C[1]).toLowerCase();D.style[H]=K}catch(G){}}}},setAttribute:function(B,A,C){if(C==""){return }if(A.toLowerCase()=="style"){this._setStyleAttribute(B,C)}else{B.setAttribute(A,C)}},cancelEvent:function(A){if(!A){return false}if(this.isMSIE){A.returnValue=false;A.cancelBubble=true}else{A.preventDefault();A.stopPropagation&&A.stopPropagation()}return false},toHexColor:function(B){B=B.replace(/^rgb/g,"");B=B.replace(/\(/g,"");B=B.replace(/\)/g,"");B=B.replace(/ /g,"");B=B.split(",");var D=parseFloat(B[0]).toString(16).toUpperCase();var C=parseFloat(B[1]).toString(16).toUpperCase();var A=parseFloat(B[2]).toString(16).toUpperCase();if(D.length<2){D="0"+D}if(C.length<2){C="0"+C}if(A.length<2){A="0"+A}return D+C+A},_dec_to_rgb:function(D){var B="";for(var A=0;A<3;A++){var C=D&255;D>>=8;var E=C&15;var F=(C>>4)&15;B+=F.toString(16);B+=E.toString(16)}return B.toUpperCase()},replaceRGBWithHexColor:function(str){var matcher=str.match(/rgb\([0-9 ]+,[0-9 ]+,[0-9 ]+\)/gi);if(matcher){for(var j=0;j<matcher.length;j++){var regex=eval("/"+WYSIWYG_Core.stringToRegex(matcher[j])+"/gi");str=str.replace(regex,"#"+this.toHexColor(matcher[j]))}}return str},execCommand:function(D,B,A){if(typeof (A)=="undefined"){A=null}if(B=="BackColor"&&WYSIWYG_Core.isFF){B="HiliteColor"}if(WYSIWYG_Core.isFF&&(B=="Cut"||B=="Paste"||B=="Copy")){try{WYSIWYG.getEditorWindow(D).document.execCommand(B,false,A)}catch(C){if(confirm("Copy/Cut/Paste is not available in Mozilla and Firefox\nDo you want more information about this issue?")){window.open("http://www.mozilla.org/editor/midasdemo/securityprefs.html")}}}else{WYSIWYG.getEditorWindow(D).document.execCommand(B,false,A)}},stringToRegex:function(A){A=A.replace(/\//gi,"\\/");A=A.replace(/\(/gi,"\\(");A=A.replace(/\)/gi,"\\)");A=A.replace(/\[/gi,"\\[");A=A.replace(/\]/gi,"\\]");A=A.replace(/\+/gi,"\\+");A=A.replace(/\$/gi,"\\$");A=A.replace(/\*/gi,"\\*");A=A.replace(/\?/gi,"\\?");A=A.replace(/\^/gi,"\\^");A=A.replace(/\\b/gi,"\\\\b");A=A.replace(/\\B/gi,"\\\\B");A=A.replace(/\\d/gi,"\\\\d");A=A.replace(/\\B/gi,"\\\\B");A=A.replace(/\\D/gi,"\\\\D");A=A.replace(/\\f/gi,"\\\\f");A=A.replace(/\\n/gi,"\\\\n");A=A.replace(/\\r/gi,"\\\\r");A=A.replace(/\\t/gi,"\\\\t");A=A.replace(/\\v/gi,"\\\\v");A=A.replace(/\\s/gi,"\\\\s");A=A.replace(/\\S/gi,"\\\\S");A=A.replace(/\\w/gi,"\\\\w");A=A.replace(/\\W/gi,"\\\\W");return A},addEvent:function(B,A,C){if(B.attachEvent){B.attachEvent("on"+A,C)}else{B.addEventListener(A,C,false)}},removeEvent:function(B,A,C){if(B.attachEvent){B.detachEvent("on"+A,C)}else{B.removeEventListener(A,C,false)}},includeJS:function(C){var A=document.createElement("script");this.setAttribute(A,"type","text/javascript");this.setAttribute(A,"src",C);var D=document.getElementsByTagName("head");for(var B=0;B<D.length;B++){D[B].appendChild(A)}},includeCSS:function(D){var C=document.createElement("link");this.setAttribute(C,"rel","stylesheet");this.setAttribute(C,"type","text/css");this.setAttribute(C,"href",D);var B=document.getElementsByTagName("head");for(var A=0;A<B.length;A++){B[A].appendChild(C)}},getElementPosition:function(B,A){var D=0,C=0;while(B&&B!=A){C+=B.offsetLeft;D+=B.offsetTop;B=B.offsetParent}return{left:C,top:D}}};var WYSIWYG_ContextMenu={html:"",contextMenuDiv:null,init:function(C){var B=WYSIWYG.getEditorWindow(C).document;this.contextMenuDiv=document.createElement("div");this.contextMenuDiv.className="wysiwyg-context-menu-div";this.contextMenuDiv.setAttribute("class","wysiwyg-context-menu-div");this.contextMenuDiv.style.display="none";this.contextMenuDiv.style.position="absolute";this.contextMenuDiv.style.zindex=1000;this.contextMenuDiv.style.left="0";this.contextMenuDiv.style.top="0";this.contextMenuDiv.unselectable="on";document.body.insertBefore(this.contextMenuDiv,document.body.firstChild);WYSIWYG_Core.addEvent(B,"contextmenu",function A(D){WYSIWYG_ContextMenu.show(D,C)});WYSIWYG_Core.addEvent(B,"click",function A(D){WYSIWYG_ContextMenu.close()});WYSIWYG_Core.addEvent(B,"keydown",function A(D){WYSIWYG_ContextMenu.close()});WYSIWYG_Core.addEvent(document,"click",function A(D){WYSIWYG_ContextMenu.close()})},show:function(D,G){if(this.contextMenuDiv==null){return false}var B=WYSIWYG.getEditor(G);var C=WYSIWYG.getEditorWindow(G).document;var F=WYSIWYG_Core.getElementPosition(B);var A=WYSIWYG_Core.isMSIE?F.left+D.clientX:F.left+(D.pageX-C.body.scrollLeft);var E=WYSIWYG_Core.isMSIE?F.top+D.clientY:F.top+(D.pageY-C.body.scrollTop);this.contextMenuDiv.style.left=A+"px";this.contextMenuDiv.style.top=E+"px";this.contextMenuDiv.style.visibility="visible";this.contextMenuDiv.style.display="block";window.setTimeout("WYSIWYG_ContextMenu.output('"+G+"')",10);WYSIWYG_Core.cancelEvent(D);return false},output:function(B){var A=WYSIWYG.getSelection(B);var F=WYSIWYG.getRange(A);var M=WYSIWYG.getTag(F);if(M==null){return }this.clear();var D=(M.nodeName=="IMG")?true:false;var C=(M.nodeName=="A")?true:false;var G=0;if(WYSIWYG_Core.isMSIE){G=(document.selection&&F.text)?F.text.length:0}else{G=F.toString().length}var A=G!=0||D;var E={enabled:WYSIWYG.config[B].ImagesDir+WYSIWYG.ToolbarList["createlink"][3],disabled:WYSIWYG.config[B].ImagesDir+WYSIWYG.ToolbarList["createlink"][2]};var K={enabled:WYSIWYG.config[B].ImagesDir+WYSIWYG.ToolbarList["insertimage"][3],disabled:WYSIWYG.config[B].ImagesDir+WYSIWYG.ToolbarList["insertimage"][2]};var L={enabled:WYSIWYG.config[B].ImagesDir+WYSIWYG.ToolbarList["delete"][3],disabled:WYSIWYG.config[B].ImagesDir+WYSIWYG.ToolbarList["delete"][2]};var J={enabled:WYSIWYG.config[B].ImagesDir+WYSIWYG.ToolbarList["copy"][3],disabled:WYSIWYG.config[B].ImagesDir+WYSIWYG.ToolbarList["copy"][2]};var I={enabled:WYSIWYG.config[B].ImagesDir+WYSIWYG.ToolbarList["cut"][3],disabled:WYSIWYG.config[B].ImagesDir+WYSIWYG.ToolbarList["cut"][2]};var H={enabled:WYSIWYG.config[B].ImagesDir+WYSIWYG.ToolbarList["paste"][3],disabled:WYSIWYG.config[B].ImagesDir+WYSIWYG.ToolbarList["paste"][2]};this.html+='<table class="wysiwyg-context-menu" border="0" cellpadding="0" cellspacing="0">';this.addItem(B,"Copy",J,"Copy",A);this.addItem(B,"Cut",I,"Cut",A);this.addItem(B,"Paste",H,"Paste",true);this.addSeperator();this.addItem(B,"InsertImage",K,"Modify Image Properties...",D);this.addItem(B,"CreateLink",E,"Create or Modify Link...",A||C);this.addItem(B,"RemoveNode",L,"Remove",true);this.html+="</table>";this.contextMenuDiv.innerHTML=this.html},close:function(){this.contextMenuDiv.style.visibility="hidden";this.contextMenuDiv.style.display="none"},clear:function(){this.contextMenuDiv.innerHTML="";this.html=""},addItem:function(F,D,B,E,A){var C="";if(A){C+="<tr>";C+='<td class="icon"><a href="javascript:WYSIWYG.formatText(\''+D+"','"+F+'\', null);"><img src="'+B.enabled+'" border="0"></a></td>';C+="<td onmouseover=\"this.className='mouseover'\" onmouseout=\"this.className=''\" onclick=\"WYSIWYG.formatText('"+D+"','"+F+'\', null);WYSIWYG_ContextMenu.close();"><a href="javascript:void(0);">'+E+"</a></td>";C+="</tr>"}else{C+="<tr>";C+='<td class="icon"><img src="'+B.disabled+'" border="0"></td>';C+='<td onmouseover="this.className=\'mouseover\'" onmouseout="this.className=\'\'"><span class="disabled">'+E+"</span></td>";C+="</tr>"}this.html+=C},addSeperator:function(){var A="";A+="<tr>";A+='<td colspan="2" style="text-align:center;"><hr size="1" color="#C9C9C9" width="95%"></td>';A+="</tr>";this.html+=A}};function $g(A){return document.getElementById(A)}if(typeof HTMLElement!="undefined"&&!HTMLElement.prototype.insertAdjacentElement){HTMLElement.prototype.insertAdjacentElement=function(A,B){switch(A){case"beforeBegin":this.parentNode.insertBefore(B,this);break;case"afterBegin":this.insertBefore(B,this.firstChild);break;case"beforeEnd":this.appendChild(B);break;case"afterEnd":if(this.nextSibling){this.parentNode.insertBefore(B,this.nextSibling)}else{this.parentNode.appendChild(B)}break}};HTMLElement.prototype.insertAdjacentHTML=function(B,D){var C=this.ownerDocument.createRange();C.setStartBefore(this);var A=C.createContextualFragment(D);this.insertAdjacentElement(B,A)};HTMLElement.prototype.insertAdjacentText=function(B,C){var A=document.createTextNode(C);this.insertAdjacentElement(B,A)}}mj.designer=function(A){mj.designer.superclass.constructor.call(this,A)};mj.designer.prototype={componentClass:"mj.designer",dataURL:"",textURL:"",showFontManager:false,showTags:false,init:function(){var t=this,renderTo=t.renderTo,_renderTo=t._renderTo=$(renderTo);window.dropEls=[];t.width=648;t.height=460;t.designSides=[];t.activeSide=0;t.layout=new mj.layout({renderTo:renderTo,layout:"border",items:[{region:"west",initial:215}]});t.westTabs=new mj.tab({renderTo:t.layout.getBody("west"),activeTab:0,tabWidth:70,border:false,items:[{title:"Resim",closable:false},{title:"YazÄ±",closable:false},{title:"Ãzellikler",closable:false}]});t.resimTabs=new mj.tab({renderTo:t.westTabs.tabs[0].getBody(),activeTab:0,tabWidth:103,tabPosition:"bottom",items:[{title:"Galeri",closable:false},{title:"Resim YÃ¼kle",iconCls:"g-upload",closable:false}]});var galleryTemplate=['<div class="thumb-wrap" id="{id}">','<table cellpadding="0" cellspacing="0"><tr><td align="center" valign="center" width="80px" height="80px"><img src="{url}" {widthHeight}/></td></tr></table>',"</div>"];t.imagesLayout=new mj.layout({renderTo:t.resimTabs.tabs[0].getBody(),layout:"border",border:false,items:[{region:"north",split:true,collapsible:true,initial:80,min:60,max:260}]});var cnt=$(t.imagesLayout.getBody("north"));cnt.addClass("combo-list");cnt.css({overflowY:"scroll",background:"#fff"});var cmbTpl='<div class="combo-list-item mj-unselectable">{text}</div>';t.imagesFilter=new mj.view({renderTo:cnt,store:new mj.store({url:t.dataURL,params:{event:"getTagList"}}),tpl:new mj.template(cmbTpl),selector:"div.combo-list-item",overClass:"combo-over",selectedClass:"combo-selected",multiSelect:true,filter:false,scope:t,border:false});t.imagesFilter.on("itemclick",function(){var s=[];for(var i=0,l=t.imagesFilter.selections.length;i<l;i++){s.push(t.imagesFilter.selections[i].store.id)}t.imagesView.store.params.tags="("+s.join(",")+")";t.imagesView.store.load()});t.imagesViewPanel=new mj.panel({renderTo:t.imagesLayout.getBody("center"),border:false});t.imagesView=new mj.view({renderTo:t.imagesViewPanel.getBody(),store:new mj.store({url:t.dataURL,params:{event:"getGalleryImages"}}),pbar:new mj.pager({limit:20,pos:"bottom",elements:{prev:true,next:true,refresh:true},pageInfo:false}),tpl:new mj.template(galleryTemplate),selector:"div.thumb-wrap",border:false});t.uploadedImagesPanel=new mj.panel({renderTo:t.resimTabs.tabs[1].getBody(),border:false});t.uploadedImages=new mj.view({renderTo:t.uploadedImagesPanel.getBody(),store:new mj.store({url:t.dataURL,params:{event:"getUserImages"}}),pbar:new mj.pager({limit:20,pos:"bottom",elements:{prev:true,next:true,refresh:true},pageInfo:false}),tpl:new mj.template(galleryTemplate),selector:"div.thumb-wrap",border:false});t.uploadedImages.pbar.tbar.addSplitter();t.uploadedImages.pbar.tbar.addButton({iconCls:"g-upload",alt:"BilgisayarÄ±mdan resim yÃ¼kle",handler:function(){if(!t.uploadWindow){t.uploadWindow=new mj.window({title:"YÃ¼klenecek Resimleri SeÃ§in",width:500,height:400,modal:true,buttons:[{title:"GÃ¶nder",handler:function(){if(t.currentTags){var tags=[];for(var i=0,l=t.currentTags.length;i<l;i++){tags.push(t.currentTags[i].value)}}else{var tags=false}t.uploadWindow.uploadForm.setValue({"tags":tags.toJSONString(),"event":"uploadGalleryImage"});t.uploadWindow.uploadForm.submit({url:"/design",success:function(data){t.uploadedImages.store.load();mj.message(data.msg);t.uploadWindow.close()},failure:function(data){mj.message(data.msg)},scope:this,encoded:true})}},{title:"VazgeÃ§",handler:function(){t.uploadWindow.hide()}}]});var cnt=t.uploadWindow.getBody();cnt=mj.NE(cnt,{style:"padding:5px;",html:"Resim yÃ¼kleme talimatlarÄ±..."});t.uploadWindow.formCnt=$(mj.NE(cnt,{style:"height:70px"}));if(t.showTags){t.tagcombo=new mj.form.combo({renderTo:cnt,title:"Etiketler",mode:"remote",dataIndex:"tag",store:new mj.store({url:t.dataURL,params:{event:"getTagList"}}),width:250});t.tagcombo._el.width(340);t.tagcombo._el.css("float","left");t.addTagBtn=new mj.button({renderTo:mj.NE(cnt,{style:"padding-top:3px"}),title:"Etiketi Ekle",handler:function(){var selectedId=t.tagcombo.getValue(),selectedValue=t.tagcombo.getElValue().toString().trim();if(selectedValue!=""){if(t.tagcombo.displayValue!=selectedValue){id=""}if(mj.getIndex(t.currentTags,"value",selectedValue)==-1){t.insertTag(selectedId,selectedValue)}t.tagcombo.setValue();t.tagcombo.setElValue("")}}});t.removeTagBtn=new mj.button({renderTo:mj.NE(cnt,{style:"padding-top:3px"}),title:"Sil",handler:function(){if(t.selectedTag){var tag=t.selectedTag;tag.selected=false;t.currentTags.remove(tag);tag.cnt.remove();tag=null;t.selectedTag=null;t.removeTagBtn._el.hide()}}});mj.NE(cnt,{style:"clear:both",html:"&nbsp;"});t.currentTags=[];t.tagDiv=$(mj.NE(cnt,{style:"padding:3px"}));t.insertTag=function(id,value){var index=t.currentTags.push({"id":id,"value":value})-1;var tag=t.currentTags[index],itemCnt=tag.cnt=$(mj.NE(t.tagDiv,{cls:"tag-container",children:[{cls:"tag-icon",html:mj.insertSpacer(16,16)},{style:"float:left;",html:value}]}));itemCnt.bind("mouseover",{scope:tag},function(e){var tag=e.data.scope;if(!tag.selected){tag.cnt.addClass("tag-hover")}});itemCnt.bind("mouseout",{scope:tag},function(e){var tag=e.data.scope;if(!tag.selected){tag.cnt.removeClass("tag-hover")}});itemCnt.bind("click",{scope:tag},function(e){var tag=e.data.scope;if(t.selectedTag){t.selectedTag.cnt.removeClass("tag-selected");t.selectedTag.selected=false}t.selectedTag=tag;tag.selected=true;tag.cnt.removeClass("tag-hover");tag.cnt.addClass("tag-selected");t.removeTagBtn._el.show()})}}}if(t.removeTagBtn){t.removeTagBtn._el.hide()}t.uploadWindow.formCnt.empty();t.uploadWindow.uploadForm=new mj.form({renderTo:t.uploadWindow.formCnt,items:[new mj.form.textField({hidden:true,"type":"hidden",name:"event"}),new mj.form.textField({hidden:true,"type":"hidden",name:"tags"}),new mj.form.fileInput({id:"resim",name:"resim",maxFile:3,title:"DosyalarÄ± SeÃ§in",labelWidth:"110px"}),new mj.form.checkBox({labelWidth:160,title:"Bu resim genel galeriye eklenebilir",name:"uploadAgreementCheck"})]});mj.NE(t.uploadWindow.uploadForm.items[2].input.parent(),{style:"clear:both",html:"&nbsp"});t.currentTags=[];if(t.tagDiv){t.tagDiv.empty()}t.uploadWindow.show()}});t.uploadedImages.pbar.tbar.addButton({iconCls:"mj-delete",alt:"SeÃ§ili resmimi sil",handler:function(){if(t.uploadedImages.selected.length>0){var p=t.uploadedImages.store.params;t.uploadedImages.store.params={event:"deleteGalleryImage",id:t.uploadedImages.items[t.uploadedImages.selected[0].index].store.id,width:t.designItem.area.width,height:t.designItem.area.height};t.uploadedImages.store.load();t.uploadedImages.store.params=p}}});t.centerLayoutPanel=new mj.panel({renderTo:t.layout.getBody("center"),border:false});t.centerLayout=new mj.layout({renderTo:t.centerLayoutPanel.getBody(),layout:"border",border:false,items:[{region:"south",initial:27}]});t.bbar=new mj.menu({renderTo:t.centerLayout.getBody("south"),items:[{id:"btnfront",iconCls:"g-bringtofront",handler:function(){if(t.selectedItem){var selectedIndex=t.selectedItem.zIndex;var next=mj.getIndex(t.designSides[t.activeSide].designElements,"zIndex",selectedIndex+1);if(next>-1){t.designSides[t.activeSide].designElements[next].zIndex=selectedIndex;t.designSides[t.activeSide].designElements[next].cnt.css("z-index",selectedIndex);t.selectedItem.zIndex+=1;t.selectedItem.cnt.css("z-index",t.selectedItem.zIndex)}}},alt:"Ãste getir"},{id:"btnback",iconCls:"g-sendtoback",handler:function(){if(t.selectedItem){var selectedIndex=t.selectedItem.zIndex;if(selectedIndex>0){var next=mj.getIndex(t.designSides[t.activeSide].designElements,"zIndex",selectedIndex-1);if(next>-1){t.designSides[t.activeSide].designElements[next].zIndex=selectedIndex;t.designSides[t.activeSide].designElements[next].cnt.css("z-index",selectedIndex);t.selectedItem.zIndex-=1;t.selectedItem.cnt.css("z-index",t.selectedItem.zIndex)}}}},alt:"Alta gÃ¶nder"},{id:"btndelete",iconCls:"mj-delete",handler:function(){if(t.selectedItem){var selectedIndex=t.selectedItem.zIndex;if(selectedIndex>-1){t.designSides[t.activeSide].designElements.remove(t.selectedItem);t.selectedItem.cnt.remove();t.selectedItem=null;for(var i=0,l=t.designSides[t.activeSide].designElements.length;i<l;i++){if(t.designSides[t.activeSide].designElements[i].zIndex>selectedIndex){t.designSides[t.activeSide].designElements[i].zIndex=t.designSides[t.activeSide].designElements[i].zIndex-1;t.designSides[t.activeSide].designElements[i].cnt.css("z-index",t.designSides[t.activeSide].designElements[i].zIndex)}}t.z--;t.calcPrice()}}},alt:"Sil"},"|",{id:"btnfinish",iconCls:"g-accept",title:"&nbsp;Kaydet",alt:"TasarÄ±mÄ± Kaydet",handler:function(){var elements=[];for(var i=0,l=t.designSides.length;i<l;i++){var side=t.designSides[i];for(var j=0,sideElLength=side.designElements.length;j<sideElLength;j++){var item=side.designElements[j];elements.push({designSideId:side.designSideId,itemId:item.elementId,pTop:item.area.top,pLeft:item.area.left,width:item.area.width,height:item.area.height,zIndex:item.zIndex,fontId:item.font,text:item.text,cR:item.color.r,cG:item.color.g,cB:item.color.b,scale:side.scale})}}var cnt=$(mj.NE(mj.bd,{style:"display:none"}));var mask=new mj.mask({zIndex:15});var infoDiv=$(mj.NE(mj.bd,{style:"position:absolute;left:50%;top:50%;margin-left:-125px;mergin-top:-21px;width:250px;height:42px;z-index:16;background:#FFFFFF;border:2px dashed #20558A;padding:10px;",children:[{tag:"img",src:t.ajaxIndicator,style:"float:left"},{html:"TasarÄ±mÄ±nÄ±z hazÄ±rlanÄ±yor. LÃ¼tfen bekleyin. Bu iÅlem bir kaÃ§ dakika sÃ¼rebilir.",style:"float:left;width:200px;margin-left:10px;"}]}));mask.show(15);mj.load(cnt,{url:t.dataURL,params:{event:"saveDesign",designItemId:t.designItemId,elements:elements.toJSONString(),size:(t.sizeForm.getValue()).size,color:t.colorView.selections[0].store.id},callback:function(data){data=eval(data);t.trigger("save",data.id);cnt.remove();infoDiv.remove();mask.destroy()},dataType:"json"})}},{id:"btncancel",iconCls:"g-cancel",title:"&nbsp;VazgeÃ§",alt:"TasarÄ±mÄ± kaydetmeden Ã§Ä±k",handler:function(){document.location.href="/"}}]});t.priceEl=$(mj.NE(t.bbar.el,{html:"Fiyat: YTL",cls:"mj-page-before-text mj-unselectable",style:"float:right;padding-bottom:5px;padding-top:5px;text-align:right;cursor:default;"}));t.z=0;t.imagesView.store.on("load",function(){for(var i=0,l=t.imagesView.items.length;i<l;i++){var dragItem=t.imagesView.items[i];dragItem.drag=new mj.drag({el:dragItem.el,parent:mj.bd,position:"absolute",appendParent:true,moving:false});$(dragItem.el).css("position","relative");dragItem.drag.on("dragstop",function(e,toW,fromW){var dragItem=this,data=dragItem.store;t.addGalleryImage({elementId:data.id,src:data.url,area:{top:0,left:0,width:data.width,height:data.height,maxWidth:data.width,maxHeight:data.height}},t.activeSide)},dragItem)}});t.uploadedImages.store.on("load",function(){for(var i=0,l=t.uploadedImages.items.length;i<l;i++){var dragItem=t.uploadedImages.items[i];dragItem.drag=new mj.drag({el:dragItem.el,parent:mj.bd,position:"absolute",appendParent:true,moving:false});$(dragItem.el).css("position","relative");dragItem.drag.on("dragstop",function(e,toW,fromW){var dragItem=this,data=dragItem.store;t.addGalleryImage({elementId:data.id,src:data.url,area:{top:0,left:0,width:data.width,height:data.height,maxWidth:data.width,maxHeight:data.height}},t.activeSide)},dragItem)}});t.textLayoutPanel=new mj.panel({renderTo:t.westTabs.tabs[1].getBody()});t.textLayout=new mj.layout({renderTo:t.textLayoutPanel.getBody(),layout:"border",items:[{region:"north",split:false,collapsible:false,initial:50}]});var cnt=$(t.textLayout.getBody("north"));cnt.css({background:"#fff",paddingLeft:"7px"});t.textForm=new mj.form({renderTo:cnt,items:[new mj.form.textField({hidden:true,"type":"hidden",name:"event"}),new mj.form.textField({hidden:true,"type":"hidden",name:"font"}),new mj.form.textField({hidden:true,"type":"hidden",name:"fontcolor",id:"fontcolor"}),new mj.form.textField({name:"text",title:"Eklemek istediÄiniz metni girin",labelWidth:"110px",width:130})]});t.textForm.items[3].input.css({marginTop:2});cnt=t.textForm.items[3]._el;window.pickColor=function(a){return true};mj.NE(cnt,{tag:"a",rel:"colorpicker&objcode=fontcolor&objshow=showcolor&showrgb=1&okfunc=pickColor",style:"text-decoration:none",children:[{id:"showcolor",style:"margin:2px;width:20px;height:20px;border:1px solid #C6C6C6;background:#fff;float:left;cursor:pointer;",html:mj.insertSpacer(22,22),title:"Renk seÃ§mek iÃ§in tÄ±klayÄ±n"}]});$.ColorPicker.init();var _r=30,_g=135,_b=178;$.ColorPicker.currentColor={r:_r,g:_g,b:_b};jQuery("#showcolor").css("background-color","rgb("+_r+","+_g+","+_b+")");t.addTextBtn=new mj.button({renderTo:mj.NE(cnt),title:"Ekle",handler:function(){var text=t.textForm.items[3].getValue();if(!text||text.toString().trim()==""){mj.message("LÃ¼tfen eklemek istediÄiniz metni girin!")}else{if(!t.textView.selections||!t.textView.selections[0]||t.textView.selections[0].store.id<1){mj.message("LÃ¼tfen yazÄ± tipini seÃ§in!")}else{var c=$.ColorPicker.currentColor,fontId=t.textView.selections[0].store.id;var dragItem=this,data=dragItem.store,maxWidth=t.designSides[t.activeSide].designItem.area.width;var cnt=$(mj.NE(mj.bd,{style:"display:none"}));mj.load(cnt,{url:t.textURL,params:{t:text,f:fontId,w:maxWidth,r:c.r,g:c.g,b:c.b,c:1,m:1},callback:function(data){var textItem=$("img",cnt)[0],dataarr=data.split("|");if(dataarr&&dataarr.length==3&&parseInt(dataarr[0])>0){var maxWidth=dataarr[0],maxHeight=dataarr[1];t.addText.call(t,{src:t.textURL+"?t="+mj.escape(text)+"&f="+fontId+"&w="+maxWidth+"&r="+c.r+"&g="+c.g+"&b="+c.b+"&m=1",area:{top:0,left:0,width:maxWidth,height:maxHeight,maxWidth:maxWidth,maxHeight:maxHeight},text:text,font:fontId,color:{r:c.r,g:c.g,b:c.b}},t.activeSide);t.textForm.items[3].clear()}}});cnt.remove()}}}});cnt=t.textLayout.getBody("center");var fontTemplate=['<div class="thumb-wrap" id="{id}" title="{fontname}">','<table cellpadding="0" cellspacing="0"><tr><td align="center" valign="center" width="175px"><img src="{url}" width="{width}px"/></td></tr></table>',"</div>"];t.textViewPanel=new mj.panel({renderTo:t.textLayout.getBody("center")});t.textView=new mj.view({renderTo:t.textViewPanel.getBody(),store:new mj.store({url:t.dataURL,params:{event:"getFonts"}}),pbar:new mj.pager({limit:20,pos:"bottom",elements:{prev:true,next:true,refresh:true},pageInfo:false}),tpl:new mj.template(fontTemplate),selector:"div.thumb-wrap"});t.textView.pbar.tbar.addSplitter();if(t.showFontManager){t.textView.pbar.tbar.addButton({iconCls:"g-upload-font",handler:function(){if(!t.uploadFontWindow){t.uploadFontWindow=new mj.window({title:"YÃ¼klenecek YazÄ± Tiplerini SeÃ§in",width:400,height:250,modal:true,buttons:[{title:"GÃ¶nder",handler:function(){t.uploadFontWindow.uploadForm.setValue({"event":"uploadFont"});t.uploadFontWindow.uploadForm.submit({url:"/design",success:function(data){t.textView.store.load();mj.message(data.msg);t.uploadFontWindow.close()},failure:function(data){mj.message(data.msg)},scope:this,encoded:true})}},{title:"VazgeÃ§",handler:function(){t.uploadFontWindow.hide()}}]});var cnt=t.uploadFontWindow.getBody();cnt=mj.NE(cnt,{style:"padding:5px;",html:"YazÄ± tipi yÃ¼kleme talimatlarÄ±..."});t.uploadFontWindow.formCnt=$(mj.NE(cnt,{style:"height:120px"}))}t.uploadFontWindow.formCnt.empty();t.uploadFontWindow.uploadForm=new mj.form({renderTo:t.uploadFontWindow.formCnt,items:[new mj.form.textField({hidden:true,"type":"hidden",name:"event"}),new mj.form.fileInput({id:"font",name:"font",maxFile:5,title:"DosyalarÄ± SeÃ§in",labelWidth:"110px"})]});t.uploadFontWindow.show()}});t.textView.pbar.tbar.addButton({iconCls:"g-delete-font",handler:function(){if(t.textView.selections&&t.textView.selections[0]&&t.textView.selections[0].store.id>0){t.textView.store.params.event="deleteFont";t.textView.store.params.font=t.textView.selections[0].store.id;t.textView.store.load();t.textView.store.params.event="getFonts"}}})}if(t.sides.length>0){var sides=[];for(var i=0,l=t.sides.length;i<l;i++){sides.push({title:t.sides[i].title,closable:false})}t.designSideTabs=new mj.tab({renderTo:t.centerLayout.getBody("center"),activeTab:0,tabWidth:120,items:sides});t.designSideTabs.on("tabchange",function(tab,newtab,oldtab){t.clearSelection();t.activeSide=newtab});for(var i=0,l=t.sides.length;i<l;i++){var cnt=t.designSideTabs.tabs[i].getBody().css("overflow","hidden"),s=t.sides[i];cnt=$((new mj.panel({renderTo:cnt})).getBody()).css("overflow","hidden");var dA=$(mj.NE(cnt,{style:"background:white;width:"+(t.width-219)+"px;height:"+(t.height-57)+"px;position:relative;overflow:hidden"}));t.designSides.push({designSideId:s.designSideId,designElements:[],designArea:dA,scale:s.scale});t.setDesignItem({src:s.src,area:{top:s.area.top,left:s.area.left,width:s.area.width,height:s.area.height},borderWidth:s.borderWidth,colors:{border:s.colors.border,selected:s.colors.selected,hover:s.colors.hover}},i)}}var cnt=$((new mj.panel({renderTo:t.westTabs.tabs[2].getBody()})).getBody());if(t.designSize){t.sizeForm=new mj.form({renderTo:mj.NE(cnt,{style:"padding:3px"}),items:[t.sizeRadio=new mj.form.radio({title:"Beden",dataIndex:"size",items:t.designSize})]});t.sizeRadio.setValue(t.designSize[0].id)}if(t.designColor.length>1){var colorTemplate=['<div class="thumb-wrap" id="{id}">','<table cellpadding="0" cellspacing="0"><tr><td align="center" valign="center" width="80px" height="100px"><img src="{src}" width="80px"/><br/>','<div style="width:10px;height:10px;background:{color};float:left;border:1px solid #808080;margin-top:2px">',mj.insertSpacer(10,10),"</div>","{title}</td></tr></table>","</div>"];t.colorView=new mj.view({renderTo:mj.NE(cnt,{style:"padding:3px"}),store:t.designColor,tpl:new mj.template(colorTemplate),selector:"div.thumb-wrap"});t.colorView.load();t.colorView.on("itemclick",function(){t.setColor.call(t,t.colorView.selections[0].store)});t.colorView.select(0)}t.designPhotoStore=new mj.store({data:t.designPhoto});t.designPhotoStore.load();t.imagesFilter.store.load();t.textView.store.load()},calcPrice:function(){var C=this;C.total=C.price;for(var B=0,A=C.designSides.length;B<A;B++){var D=C.designSides[B].designElements.length;if(D>0){C.total+=C.sides[B].priceAdd;C.total+=D*C.sides[B].pricePerItem}}C.priceEl.attr("title",C.total+" YTL");C.priceEl[0].innerHTML="Fiyat: "+mj.format.float2Money(C.total,2,",",".")+" YTL&nbsp;"},setDesignItem:function(A,C){var B=this;B.designSides[C].designItem=A;B.designSides[C].designItem.area.top-=B.designSides[C].designItem.borderWidth;B.designSides[C].designItem.area.left-=B.designSides[C].designItem.borderWidth;B.designSides[C].designBackground=$(mj.NE(B.designSides[C].designArea,{tag:"img",style:"position:absolute;",src:B.designSides[C].designItem.src}));B.designSides[C].designSpace=$(mj.NE(B.designSides[C].designArea,{tag:"div",style:"position:absolute;top:"+B.designSides[C].designItem.area.top+"px;left:"+B.designSides[C].designItem.area.left+"px;width:"+B.designSides[C].designItem.area.width+"px;height:"+B.designSides[C].designItem.area.height+"px;border:"+B.designSides[C].designItem.borderWidth+"px dashed "+B.designSides[C].designItem.colors.border,html:"&nbsp;"}));B.designSides[C].mWidth=B.designSides[C].designItem.area.width;B.designSides[C].mHeight=B.designSides[C].designItem.area.height;window.dropEls.push(B.designSides[C].designSpace);$(B.designSides[C].designSpace).bind("mousedown",function(){B.clearSelection()});B.imagesView.store.params.width=B.designSides[C].designItem.area.width;B.imagesView.store.params.height=B.designSides[C].designItem.area.height;B.uploadedImages.store.params.width=B.designSides[C].designItem.area.width;B.uploadedImages.store.params.height=B.designSides[C].designItem.area.height;B.uploadedImages.store.load();B.calcPrice()},setColor:function(C){var F=this;for(var E=0,B=F.designSides.length;E<B;E++){var D=F.designSides[E];F.designPhotoStore.filter("designColorId",C.id.toString());F.designPhotoStore.filter("designSideId",D.designSideId.toString(),true);var A=F.designPhotoStore.data[0];D.designBackground.attr("src",A.src);D.designSpace.css({borderWidth:A.borderWidth,borderColor:A.borderColor});D.designItem.colors={border:A.borderColor,selected:A.selectedColor,hover:A.hoverColor}}},clearSelection:function(){if(this.selectedItem){this.selectedItem.border.css("border-color","transparent");this.selectedItem.selected=false;this.selectedItem=null}},addItem:function(D,C){var B=this,E=B.designSides[C].designElements;var A=E.push(D);D=E[A-1];D.zIndex=B.z++;D.cnt=$(mj.NE(B.designSides[C].designSpace,{style:"position:absolute;z-index:"+D.zIndex+";top:"+D.area.top+"px;left:"+D.area.left+"px;width:"+D.area.width+"px;height:"+D.area.height+"px;"}));D.border=$(mj.NE(D.cnt,{style:"border-color:transparent;border-style:dashed;border-width:1px;position:absolute;width:"+D.area.width+"px;height:"+D.area.height+"px;"}));D.img=$(mj.NE(D.cnt,{tag:"img",src:D.src,style:"width:"+D.area.width+"px;height:"+D.area.height+"px;"}));D.cnt.bind("mouseover",{scope:D},function(G){var F=G.data.scope;if(!F.selected){F.border.css("border-color",B.designSides[C].designItem.colors.hover)}});D.cnt.bind("mouseout",{scope:D},function(G){var F=G.data.scope;if(!F.selected){F.border.css("border-color","transparent")}});D.cnt.bind("click",{scope:D},function(G){var F=G.data.scope;B.selectedItem=F;F.selected=true;F.border.css("border-color",B.designSides[C].designItem.colors.selected)});D.resizer=new mj.resizer({el:D.cnt,proxy:true,keepAspectRatio:true,maxWidth:D.area.maxWidth,maxHeight:D.area.maxHeight,parentBorders:{maxWidth:B.designSides[C].mWidth,maxHeight:B.designSides[C].mHeight}});D.resizer.se.on("resize",function(H,G,F){D.area.width=G;D.area.height=F});D.dragger=new mj.drag({el:D.cnt,dragEl:$.browser.msie?D.img:D.border,parent:B.designSides[C].designSpace,resizer:D.resizer});D.dragger.on("dragafterstop",function(){D.area.left=parseInt(D.dragger._el.css("left"));D.area.top=parseInt(D.dragger._el.css("top"))});D.cnt.bind("resize",{scope:D},function(I){var H=I.data.scope,F=H.cnt.width(),G=H.cnt.height();H.img.width(F);H.img.height(G);H.border.width(F);H.border.height(G)});B.calcPrice()},addGalleryImage:function(B,A){B.color={};this.addItem(B,A)},addText:function(B,A){this.addItem(B,A)}};mj.extend(mj.designer,mj.component)
