(function(){
var _1=this,_2,_3=_1.jQuery,_$=_1.$,_5=_1.jQuery=_1.$=function(_6,_7){
return new _5.fn.init(_6,_7);
},_8=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,_9=/^.[^:#\[\.,]*$/;
_5.fn=_5.prototype={init:function(_a,_b){
_a=_a||document;
if(_a.nodeType){
this[0]=_a;
this.length=1;
this.context=_a;
return this;
}
if(typeof _a==="string"){
var _c=_8.exec(_a);
if(_c&&(_c[1]||!_b)){
if(_c[1]){
_a=_5.clean([_c[1]],_b);
}else{
var _d=document.getElementById(_c[3]);
if(_d){
if(_d.id!=_c[3]){
return _5().find(_a);
}
var _e=_5(_d);
_e.context=document;
_e.selector=_a;
return _e;
}
_a=[];
}
}else{
return _5(_b).find(_a);
}
}else{
if(_5.isFunction(_a)){
return _5(document).ready(_a);
}
}
if(_a.selector&&_a.context){
this.selector=_a.selector;
this.context=_a.context;
}
return this.setArray(_5.makeArray(_a));
},selector:"",jquery:"1.3",size:function(){
return this.length;
},get:function(_f){
return _f===_2?_5.makeArray(this):this[_f];
},pushStack:function(_10,_11,_12){
var ret=_5(_10);
ret.prevObject=this;
ret.context=this.context;
if(_11==="find"){
ret.selector=this.selector+(this.selector?" ":"")+_12;
}else{
if(_11){
ret.selector=this.selector+"."+_11+"("+_12+")";
}
}
return ret;
},setArray:function(_14){
this.length=0;
Array.prototype.push.apply(this,_14);
return this;
},each:function(_15,_16){
return _5.each(this,_15,_16);
},index:function(_17){
return _5.inArray(_17&&_17.jquery?_17[0]:_17,this);
},attr:function(_18,_19,_1a){
var _1b=_18;
if(typeof _18==="string"){
if(_19===_2){
return this[0]&&_5[_1a||"attr"](this[0],_18);
}else{
_1b={};
_1b[_18]=_19;
}
}
return this.each(function(i){
for(_18 in _1b){
_5.attr(_1a?this.style:this,_18,_5.prop(this,_1b[_18],_1a,i,_18));
}
});
},css:function(key,_1e){
if((key=="width"||key=="height")&&parseFloat(_1e)<0){
_1e=_2;
}
return this.attr(key,_1e,"curCSS");
},text:function(_1f){
if(typeof _1f!=="object"&&_1f!=null){
return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(_1f));
}
var ret="";
_5.each(_1f||this,function(){
_5.each(this.childNodes,function(){
if(this.nodeType!=8){
ret+=this.nodeType!=1?this.nodeValue:_5.fn.text([this]);
}
});
});
return ret;
},wrapAll:function(_21){
if(this[0]){
var _22=_5(_21,this[0].ownerDocument).clone();
if(this[0].parentNode){
_22.insertBefore(this[0]);
}
_22.map(function(){
var _23=this;
while(_23.firstChild){
_23=_23.firstChild;
}
return _23;
}).append(this);
}
return this;
},wrapInner:function(_24){
return this.each(function(){
_5(this).contents().wrapAll(_24);
});
},wrap:function(_25){
return this.each(function(){
_5(this).wrapAll(_25);
});
},append:function(){
return this.domManip(arguments,true,function(_26){
if(this.nodeType==1){
this.appendChild(_26);
}
});
},prepend:function(){
return this.domManip(arguments,true,function(_27){
if(this.nodeType==1){
this.insertBefore(_27,this.firstChild);
}
});
},before:function(){
return this.domManip(arguments,false,function(_28){
this.parentNode.insertBefore(_28,this);
});
},after:function(){
return this.domManip(arguments,false,function(_29){
this.parentNode.insertBefore(_29,this.nextSibling);
});
},end:function(){
return this.prevObject||_5([]);
},push:[].push,find:function(_2a){
if(this.length===1&&!/,/.test(_2a)){
var ret=this.pushStack([],"find",_2a);
ret.length=0;
_5.find(_2a,this[0],ret);
return ret;
}else{
var _2c=_5.map(this,function(_2d){
return _5.find(_2a,_2d);
});
return this.pushStack(/[^+>] [^+>]/.test(_2a)?_5.unique(_2c):_2c,"find",_2a);
}
},clone:function(_2e){
var ret=this.map(function(){
if(!_5.support.noCloneEvent&&!_5.isXMLDoc(this)){
var _30=this.cloneNode(true),_31=document.createElement("div");
_31.appendChild(_30);
return _5.clean([_31.innerHTML])[0];
}else{
return this.cloneNode(true);
}
});
var _32=ret.find("*").andSelf().each(function(){
if(this[expando]!==_2){
this[expando]=null;
}
});
if(_2e===true){
this.find("*").andSelf().each(function(i){
if(this.nodeType==3){
return;
}
var _34=_5.data(this,"events");
for(var _35 in _34){
for(var _36 in _34[_35]){
_5.event.add(_32[i],_35,_34[_35][_36],_34[_35][_36].data);
}
}
});
}
return ret;
},filter:function(_37){
return this.pushStack(_5.isFunction(_37)&&_5.grep(this,function(_38,i){
return _37.call(_38,i);
})||_5.multiFilter(_37,_5.grep(this,function(_3a){
return _3a.nodeType===1;
})),"filter",_37);
},closest:function(_3b){
var pos=_5.expr.match.POS.test(_3b)?_5(_3b):null;
return this.map(function(){
var cur=this;
while(cur&&cur.ownerDocument){
if(pos?pos.index(cur)>-1:_5(cur).is(_3b)){
return cur;
}
cur=cur.parentNode;
}
});
},not:function(_3e){
if(typeof _3e==="string"){
if(_9.test(_3e)){
return this.pushStack(_5.multiFilter(_3e,this,true),"not",_3e);
}else{
_3e=_5.multiFilter(_3e,this);
}
}
var _3f=_3e.length&&_3e[_3e.length-1]!==_2&&!_3e.nodeType;
return this.filter(function(){
return _3f?_5.inArray(this,_3e)<0:this!=_3e;
});
},add:function(_40){
return this.pushStack(_5.unique(_5.merge(this.get(),typeof _40==="string"?_5(_40):_5.makeArray(_40))));
},is:function(_41){
return !!_41&&_5.multiFilter(_41,this).length>0;
},hasClass:function(_42){
return !!_42&&this.is("."+_42);
},val:function(_43){
if(_43===_2){
var _44=this[0];
if(_44){
if(_5.nodeName(_44,"option")){
return (_44.attributes.value||{}).specified?_44.value:_44.text;
}
if(_5.nodeName(_44,"select")){
var _45=_44.selectedIndex,_46=[],_47=_44.options,one=_44.type=="select-one";
if(_45<0){
return null;
}
for(var i=one?_45:0,max=one?_45+1:_47.length;i<max;i++){
var _4b=_47[i];
if(_4b.selected){
_43=_5(_4b).val();
if(one){
return _43;
}
_46.push(_43);
}
}
return _46;
}
return (_44.value||"").replace(/\r/g,"");
}
return _2;
}
if(typeof _43==="number"){
_43+="";
}
return this.each(function(){
if(this.nodeType!=1){
return;
}
if(_5.isArray(_43)&&/radio|checkbox/.test(this.type)){
this.checked=(_5.inArray(this.value,_43)>=0||_5.inArray(this.name,_43)>=0);
}else{
if(_5.nodeName(this,"select")){
var _4c=_5.makeArray(_43);
_5("option",this).each(function(){
this.selected=(_5.inArray(this.value,_4c)>=0||_5.inArray(this.text,_4c)>=0);
});
if(!_4c.length){
this.selectedIndex=-1;
}
}else{
this.value=_43;
}
}
});
},html:function(_4d){
return _4d===_2?(this[0]?this[0].innerHTML:null):this.empty().append(_4d);
},replaceWith:function(_4e){
return this.after(_4e).remove();
},eq:function(i){
return this.slice(i,+i+1);
},slice:function(){
return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","));
},map:function(_50){
return this.pushStack(_5.map(this,function(_51,i){
return _50.call(_51,i,_51);
}));
},andSelf:function(){
return this.add(this.prevObject);
},domManip:function(_53,_54,_55){
if(this[0]){
var _56=(this[0].ownerDocument||this[0]).createDocumentFragment(),_57=_5.clean(_53,(this[0].ownerDocument||this[0]),_56),_58=_56.firstChild,_59=this.length>1?_56.cloneNode(true):_56;
if(_58){
for(var i=0,l=this.length;i<l;i++){
_55.call(root(this[i],_58),i>0?_59.cloneNode(true):_56);
}
}
if(_57){
_5.each(_57,evalScript);
}
}
return this;
function root(_5c,cur){
return _54&&_5.nodeName(_5c,"table")&&_5.nodeName(cur,"tr")?(_5c.getElementsByTagName("tbody")[0]||_5c.appendChild(_5c.ownerDocument.createElement("tbody"))):_5c;
}
}};
_5.fn.init.prototype=_5.fn;
function evalScript(i,_5f){
if(_5f.src){
_5.ajax({url:_5f.src,async:false,dataType:"script"});
}else{
_5.globalEval(_5f.text||_5f.textContent||_5f.innerHTML||"");
}
if(_5f.parentNode){
_5f.parentNode.removeChild(_5f);
}
}
function now(){
return +new Date;
}
_5.extend=_5.fn.extend=function(){
var _60=arguments[0]||{},i=1,_62=arguments.length,_63=false,_64;
if(typeof _60==="boolean"){
_63=_60;
_60=arguments[1]||{};
i=2;
}
if(typeof _60!=="object"&&!_5.isFunction(_60)){
_60={};
}
if(_62==i){
_60=this;
--i;
}
for(;i<_62;i++){
if((_64=arguments[i])!=null){
for(var _65 in _64){
var src=_60[_65],_67=_64[_65];
if(_60===_67){
continue;
}
if(_63&&_67&&typeof _67==="object"&&!_67.nodeType){
_60[_65]=_5.extend(_63,src||(_67.length!=null?[]:{}),_67);
}else{
if(_67!==_2){
_60[_65]=_67;
}
}
}
}
}
return _60;
};
var _68=/z-?index|font-?weight|opacity|zoom|line-?height/i,_69=document.defaultView||{},_6a=Object.prototype.toString;
_5.extend({noConflict:function(_6b){
_1.$=_$;
if(_6b){
_1.jQuery=_3;
}
return _5;
},isFunction:function(obj){
return _6a.call(obj)==="[object Function]";
},isArray:function(obj){
return _6a.call(obj)==="[object Array]";
},isXMLDoc:function(_6e){
return _6e.documentElement&&!_6e.body||_6e.tagName&&_6e.ownerDocument&&!_6e.ownerDocument.body;
},globalEval:function(_6f){
_6f=_5.trim(_6f);
if(_6f){
var _70=document.getElementsByTagName("head")[0]||document.documentElement,_71=document.createElement("script");
_71.type="text/javascript";
if(_5.support.scriptEval){
_71.appendChild(document.createTextNode(_6f));
}else{
_71.text=_6f;
}
_70.insertBefore(_71,_70.firstChild);
_70.removeChild(_71);
}
},nodeName:function(_72,_73){
return _72.nodeName&&_72.nodeName.toUpperCase()==_73.toUpperCase();
},each:function(_74,_75,_76){
var _77,i=0,_79=_74.length;
if(_76){
if(_79===_2){
for(_77 in _74){
if(_75.apply(_74[_77],_76)===false){
break;
}
}
}else{
for(;i<_79;){
if(_75.apply(_74[i++],_76)===false){
break;
}
}
}
}else{
if(_79===_2){
for(_77 in _74){
if(_75.call(_74[_77],_77,_74[_77])===false){
break;
}
}
}else{
for(var _7a=_74[0];i<_79&&_75.call(_7a,i,_7a)!==false;_7a=_74[++i]){
}
}
}
return _74;
},prop:function(_7b,_7c,_7d,i,_7f){
if(_5.isFunction(_7c)){
_7c=_7c.call(_7b,i);
}
return typeof _7c==="number"&&_7d=="curCSS"&&!_68.test(_7f)?_7c+"px":_7c;
},className:{add:function(_80,_81){
_5.each((_81||"").split(/\s+/),function(i,_83){
if(_80.nodeType==1&&!_5.className.has(_80.className,_83)){
_80.className+=(_80.className?" ":"")+_83;
}
});
},remove:function(_84,_85){
if(_84.nodeType==1){
_84.className=_85!==_2?_5.grep(_84.className.split(/\s+/),function(_86){
return !_5.className.has(_85,_86);
}).join(" "):"";
}
},has:function(_87,_88){
return _5.inArray(_88,(_87.className||_87).toString().split(/\s+/))>-1;
}},swap:function(_89,_8a,_8b){
var old={};
for(var _8d in _8a){
old[_8d]=_89.style[_8d];
_89.style[_8d]=_8a[_8d];
}
_8b.call(_89);
for(var _8d in _8a){
_89.style[_8d]=old[_8d];
}
},css:function(_8e,_8f,_90){
if(_8f=="width"||_8f=="height"){
var val,_92={position:"absolute",visibility:"hidden",display:"block"},_93=_8f=="width"?["Left","Right"]:["Top","Bottom"];
function getWH(){
val=_8f=="width"?_8e.offsetWidth:_8e.offsetHeight;
var _94=0,_95=0;
_5.each(_93,function(){
_94+=parseFloat(_5.curCSS(_8e,"padding"+this,true))||0;
_95+=parseFloat(_5.curCSS(_8e,"border"+this+"Width",true))||0;
});
val-=Math.round(_94+_95);
}
if(_5(_8e).is(":visible")){
getWH();
}else{
_5.swap(_8e,_92,getWH);
}
return Math.max(0,val);
}
return _5.curCSS(_8e,_8f,_90);
},curCSS:function(_96,_97,_98){
var ret,_9a=_96.style;
if(_97=="opacity"&&!_5.support.opacity){
ret=_5.attr(_9a,"opacity");
return ret==""?"1":ret;
}
if(_97.match(/float/i)){
_97=styleFloat;
}
if(!_98&&_9a&&_9a[_97]){
ret=_9a[_97];
}else{
if(_69.getComputedStyle){
if(_97.match(/float/i)){
_97="float";
}
_97=_97.replace(/([A-Z])/g,"-$1").toLowerCase();
var _9b=_69.getComputedStyle(_96,null);
if(_9b){
ret=_9b.getPropertyValue(_97);
}
if(_97=="opacity"&&ret==""){
ret="1";
}
}else{
if(_96.currentStyle){
var _9c=_97.replace(/\-(\w)/g,function(all,_9e){
return _9e.toUpperCase();
});
ret=_96.currentStyle[_97]||_96.currentStyle[_9c];
if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){
var _9f=_9a.left,_a0=_96.runtimeStyle.left;
_96.runtimeStyle.left=_96.currentStyle.left;
_9a.left=ret||0;
ret=_9a.pixelLeft+"px";
_9a.left=_9f;
_96.runtimeStyle.left=_a0;
}
}
}
}
return ret;
},clean:function(_a1,_a2,_a3){
_a2=_a2||document;
if(typeof _a2.createElement==="undefined"){
_a2=_a2.ownerDocument||_a2[0]&&_a2[0].ownerDocument||document;
}
if(!_a3&&_a1.length===1&&typeof _a1[0]==="string"){
var _a4=/^<(\w+)\s*\/?>$/.exec(_a1[0]);
if(_a4){
return [_a2.createElement(_a4[1])];
}
}
var ret=[],_a6=[],div=_a2.createElement("div");
_5.each(_a1,function(i,_a9){
if(typeof _a9==="number"){
_a9+="";
}
if(!_a9){
return;
}
if(typeof _a9==="string"){
_a9=_a9.replace(/(<(\w+)[^>]*?)\/>/g,function(all,_ab,tag){
return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:_ab+"></"+tag+">";
});
var _ad=_5.trim(_a9).toLowerCase();
var _ae=!_ad.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!_ad.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||_ad.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!_ad.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!_ad.indexOf("<td")||!_ad.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!_ad.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!_5.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];
div.innerHTML=_ae[1]+_a9+_ae[2];
while(_ae[0]--){
div=div.lastChild;
}
if(!_5.support.tbody){
var _af=!_ad.indexOf("<table")&&_ad.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:_ae[1]=="<table>"&&_ad.indexOf("<tbody")<0?div.childNodes:[];
for(var j=_af.length-1;j>=0;--j){
if(_5.nodeName(_af[j],"tbody")&&!_af[j].childNodes.length){
_af[j].parentNode.removeChild(_af[j]);
}
}
}
if(!_5.support.leadingWhitespace&&/^\s/.test(_a9)){
div.insertBefore(_a2.createTextNode(_a9.match(/^\s*/)[0]),div.firstChild);
}
_a9=_5.makeArray(div.childNodes);
}
if(_a9.nodeType){
ret.push(_a9);
}else{
ret=_5.merge(ret,_a9);
}
});
if(_a3){
for(var i=0;ret[i];i++){
if(_5.nodeName(ret[i],"script")&&(!ret[i].type||ret[i].type.toLowerCase()==="text/javascript")){
_a6.push(ret[i].parentNode?ret[i].parentNode.removeChild(ret[i]):ret[i]);
}else{
if(ret[i].nodeType===1){
ret.splice.apply(ret,[i+1,0].concat(_5.makeArray(ret[i].getElementsByTagName("script"))));
}
_a3.appendChild(ret[i]);
}
}
return _a6;
}
return ret;
},attr:function(_b2,_b3,_b4){
if(!_b2||_b2.nodeType==3||_b2.nodeType==8){
return _2;
}
var _b5=!_5.isXMLDoc(_b2),set=_b4!==_2;
_b3=_b5&&_5.props[_b3]||_b3;
if(_b2.tagName){
var _b7=/href|src|style/.test(_b3);
if(_b3=="selected"&&_b2.parentNode){
_b2.parentNode.selectedIndex;
}
if(_b3 in _b2&&_b5&&!_b7){
if(set){
if(_b3=="type"&&_5.nodeName(_b2,"input")&&_b2.parentNode){
throw "type property can't be changed";
}
_b2[_b3]=_b4;
}
if(_5.nodeName(_b2,"form")&&_b2.getAttributeNode(_b3)){
return _b2.getAttributeNode(_b3).nodeValue;
}
if(_b3=="tabIndex"){
var _b8=_b2.getAttributeNode("tabIndex");
return _b8&&_b8.specified?_b8.value:_b2.nodeName.match(/^(a|area|button|input|object|select|textarea)$/i)?0:_2;
}
return _b2[_b3];
}
if(!_5.support.style&&_b5&&_b3=="style"){
return _5.attr(_b2.style,"cssText",_b4);
}
if(set){
_b2.setAttribute(_b3,""+_b4);
}
var _b9=!_5.support.hrefNormalized&&_b5&&_b7?_b2.getAttribute(_b3,2):_b2.getAttribute(_b3);
return _b9===null?_2:_b9;
}
if(!_5.support.opacity&&_b3=="opacity"){
if(set){
_b2.zoom=1;
_b2.filter=(_b2.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(_b4)+""=="NaN"?"":"alpha(opacity="+_b4*100+")");
}
return _b2.filter&&_b2.filter.indexOf("opacity=")>=0?(parseFloat(_b2.filter.match(/opacity=([^)]*)/)[1])/100)+"":"";
}
_b3=_b3.replace(/-([a-z])/ig,function(all,_bb){
return _bb.toUpperCase();
});
if(set){
_b2[_b3]=_b4;
}
return _b2[_b3];
},trim:function(_bc){
return (_bc||"").replace(/^\s+|\s+$/g,"");
},makeArray:function(_bd){
var ret=[];
if(_bd!=null){
var i=_bd.length;
if(i==null||typeof _bd==="string"||_5.isFunction(_bd)||_bd.setInterval){
ret[0]=_bd;
}else{
while(i){
ret[--i]=_bd[i];
}
}
}
return ret;
},inArray:function(_c0,_c1){
for(var i=0,_c3=_c1.length;i<_c3;i++){
if(_c1[i]===_c0){
return i;
}
}
return -1;
},merge:function(_c4,_c5){
var i=0,_c7,pos=_c4.length;
if(!_5.support.getAll){
while((_c7=_c5[i++])!=null){
if(_c7.nodeType!=8){
_c4[pos++]=_c7;
}
}
}else{
while((_c7=_c5[i++])!=null){
_c4[pos++]=_c7;
}
}
return _c4;
},unique:function(_c9){
var ret=[],_cb={};
try{
for(var i=0,_cd=_c9.length;i<_cd;i++){
var id=_5.data(_c9[i]);
if(!_cb[id]){
_cb[id]=true;
ret.push(_c9[i]);
}
}
}
catch(e){
ret=_c9;
}
return ret;
},grep:function(_cf,_d0,inv){
var ret=[];
for(var i=0,_d4=_cf.length;i<_d4;i++){
if(!inv!=!_d0(_cf[i],i)){
ret.push(_cf[i]);
}
}
return ret;
},map:function(_d5,_d6){
var ret=[];
for(var i=0,_d9=_d5.length;i<_d9;i++){
var _da=_d6(_d5[i],i);
if(_da!=null){
ret[ret.length]=_da;
}
}
return ret.concat.apply([],ret);
}});
var _db=navigator.userAgent.toLowerCase();
_5.browser={version:(_db.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(_db),opera:/opera/.test(_db),msie:/msie/.test(_db)&&!/opera/.test(_db),mozilla:/mozilla/.test(_db)&&!/(compatible|webkit)/.test(_db)};
_5.each({parent:function(_dc){
return _dc.parentNode;
},parents:function(_dd){
return _5.dir(_dd,"parentNode");
},next:function(_de){
return _5.nth(_de,2,"nextSibling");
},prev:function(_df){
return _5.nth(_df,2,"previousSibling");
},nextAll:function(_e0){
return _5.dir(_e0,"nextSibling");
},prevAll:function(_e1){
return _5.dir(_e1,"previousSibling");
},siblings:function(_e2){
return _5.sibling(_e2.parentNode.firstChild,_e2);
},children:function(_e3){
return _5.sibling(_e3.firstChild);
},contents:function(_e4){
return _5.nodeName(_e4,"iframe")?_e4.contentDocument||_e4.contentWindow.document:_5.makeArray(_e4.childNodes);
}},function(_e5,fn){
_5.fn[_e5]=function(_e7){
var ret=_5.map(this,fn);
if(_e7&&typeof _e7=="string"){
ret=_5.multiFilter(_e7,ret);
}
return this.pushStack(_5.unique(ret),_e5,_e7);
};
});
_5.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(_e9,_ea){
_5.fn[_e9]=function(){
var _eb=arguments;
return this.each(function(){
for(var i=0,_ed=_eb.length;i<_ed;i++){
_5(_eb[i])[_ea](this);
}
});
};
});
_5.each({removeAttr:function(_ee){
_5.attr(this,_ee,"");
if(this.nodeType==1){
this.removeAttribute(_ee);
}
},addClass:function(_ef){
_5.className.add(this,_ef);
},removeClass:function(_f0){
_5.className.remove(this,_f0);
},toggleClass:function(_f1,_f2){
if(typeof _f2!=="boolean"){
_f2=!_5.className.has(this,_f1);
}
_5.className[_f2?"add":"remove"](this,_f1);
},remove:function(_f3){
if(!_f3||_5.filter(_f3,[this]).length){
_5("*",this).add([this]).each(function(){
_5.event.remove(this);
_5.removeData(this);
});
if(this.parentNode){
this.parentNode.removeChild(this);
}
}
},empty:function(){
_5(">*",this).remove();
while(this.firstChild){
this.removeChild(this.firstChild);
}
}},function(_f4,fn){
_5.fn[_f4]=function(){
return this.each(fn,arguments);
};
});
function num(_f6,_f7){
return _f6[0]&&parseInt(_5.curCSS(_f6[0],_f7,true),10)||0;
}
var _f8="jQuery"+now(),_f9=0,_fa={};
_5.extend({cache:{},data:function(_fb,_fc,_fd){
_fb=_fb==_1?_fa:_fb;
var id=_fb[_f8];
if(!id){
id=_fb[_f8]=++_f9;
}
if(_fc&&!_5.cache[id]){
_5.cache[id]={};
}
if(_fd!==_2){
_5.cache[id][_fc]=_fd;
}
return _fc?_5.cache[id][_fc]:id;
},removeData:function(_ff,name){
_ff=_ff==_1?_fa:_ff;
var id=_ff[_f8];
if(name){
if(_5.cache[id]){
delete _5.cache[id][name];
name="";
for(name in _5.cache[id]){
break;
}
if(!name){
_5.removeData(_ff);
}
}
}else{
try{
delete _ff[_f8];
}
catch(e){
if(_ff.removeAttribute){
_ff.removeAttribute(_f8);
}
}
delete _5.cache[id];
}
},queue:function(elem,type,data){
if(elem){
type=(type||"fx")+"queue";
var q=_5.data(elem,type);
if(!q||_5.isArray(data)){
q=_5.data(elem,type,_5.makeArray(data));
}else{
if(data){
q.push(data);
}
}
}
return q;
},dequeue:function(elem,type){
var _108=_5.queue(elem,type),fn=_108.shift();
if(!type||type==="fx"){
fn=_108[0];
}
if(fn!==_2){
fn.call(elem);
}
}});
_5.fn.extend({data:function(key,_10b){
var _10c=key.split(".");
_10c[1]=_10c[1]?"."+_10c[1]:"";
if(_10b===_2){
var data=this.triggerHandler("getData"+_10c[1]+"!",[_10c[0]]);
if(data===_2&&this.length){
data=_5.data(this[0],key);
}
return data===_2&&_10c[1]?this.data(_10c[0]):data;
}else{
return this.trigger("setData"+_10c[1]+"!",[_10c[0],_10b]).each(function(){
_5.data(this,key,_10b);
});
}
},removeData:function(key){
return this.each(function(){
_5.removeData(this,key);
});
},queue:function(type,data){
if(typeof type!=="string"){
data=type;
type="fx";
}
if(data===_2){
return _5.queue(this[0],type);
}
return this.each(function(){
var _111=_5.queue(this,type,data);
if(type=="fx"&&_111.length==1){
_111[0].call(this);
}
});
},dequeue:function(type){
return this.each(function(){
_5.dequeue(this,type);
});
}});
(function(){
var _113=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|[^[\]]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,done=0,_6a=Object.prototype.toString;
var _115=function(_116,_117,_118,seed){
_118=_118||[];
_117=_117||document;
if(_117.nodeType!==1&&_117.nodeType!==9){
return [];
}
if(!_116||typeof _116!=="string"){
return _118;
}
var _11a=[],m,set,_11d,_11e,mode,_120,_121=true;
_113.lastIndex=0;
while((m=_113.exec(_116))!==null){
_11a.push(m[1]);
if(m[2]){
_120=RegExp.rightContext;
break;
}
}
if(_11a.length>1&&Expr.match.POS.exec(_116)){
if(_11a.length===2&&Expr.relative[_11a[0]]){
var _123="",_124;
while((_124=Expr.match.POS.exec(_116))){
_123+=_124[0];
_116=_116.replace(Expr.match.POS,"");
}
set=_115.filter(_123,_115(/\s$/.test(_116)?_116+"*":_116,_117));
}else{
set=Expr.relative[_11a[0]]?[_117]:_115(_11a.shift(),_117);
while(_11a.length){
var _125=[];
_116=_11a.shift();
if(Expr.relative[_116]){
_116+=_11a.shift();
}
for(var i=0,l=set.length;i<l;i++){
_115(_116,set[i],_125);
}
set=_125;
}
}
}else{
var ret=seed?{expr:_11a.pop(),set:_129(seed)}:_115.find(_11a.pop(),_11a.length===1&&_117.parentNode?_117.parentNode:_117);
set=_115.filter(ret.expr,ret.set);
if(_11a.length>0){
_11d=_129(set);
}else{
_121=false;
}
while(_11a.length){
var cur=_11a.pop(),pop=cur;
if(!Expr.relative[cur]){
cur="";
}else{
pop=_11a.pop();
}
if(pop==null){
pop=_117;
}
Expr.relative[cur](_11d,pop,_12c(_117));
}
}
if(!_11d){
_11d=set;
}
if(!_11d){
throw "Syntax error, unrecognized expression: "+(cur||_116);
}
if(_6a.call(_11d)==="[object Array]"){
if(!_121){
_118.push.apply(_118,_11d);
}else{
if(_117.nodeType===1){
for(var i=0;_11d[i]!=null;i++){
if(_11d[i]&&(_11d[i]===true||_11d[i].nodeType===1&&_12d(_117,_11d[i]))){
_118.push(set[i]);
}
}
}else{
for(var i=0;_11d[i]!=null;i++){
if(_11d[i]&&_11d[i].nodeType===1){
_118.push(set[i]);
}
}
}
}
}else{
_129(_11d,_118);
}
if(_120){
_115(_120,_117,_118,seed);
}
return _118;
};
_115.matches=function(expr,set){
return _115(expr,null,null,set);
};
_115.find=function(expr,_131){
var set,_133;
if(!expr){
return [];
}
for(var i=0,l=Expr.order.length;i<l;i++){
var type=Expr.order[i],_133;
if((_133=Expr.match[type].exec(expr))){
var left=RegExp.leftContext;
if(left.substr(left.length-1)!=="\\"){
_133[1]=(_133[1]||"").replace(/\\/g,"");
set=Expr.find[type](_133,_131);
if(set!=null){
expr=expr.replace(Expr.match[type],"");
break;
}
}
}
}
if(!set){
set=_131.getElementsByTagName("*");
}
return {set:set,expr:expr};
};
_115.filter=function(expr,set,_13a,not){
var old=expr,_13d=[],_13e=set,_13f,_140;
while(expr&&set.length){
for(var type in Expr.filter){
if((_13f=Expr.match[type].exec(expr))!=null){
var _142=Expr.filter[type],_143=null,_144=0,_145,item;
_140=false;
if(_13e==_13d){
_13d=[];
}
if(Expr.preFilter[type]){
_13f=Expr.preFilter[type](_13f,_13e,_13a,_13d,not);
if(!_13f){
_140=_145=true;
}else{
if(_13f===true){
continue;
}else{
if(_13f[0]===true){
_143=[];
var last=null,elem;
for(var i=0;(elem=_13e[i])!==_2;i++){
if(elem&&last!==elem){
_143.push(elem);
last=elem;
}
}
}
}
}
}
if(_13f){
for(var i=0;(item=_13e[i])!==_2;i++){
if(item){
if(_143&&item!=_143[_144]){
_144++;
}
_145=_142(item,_13f,_144,_143);
var pass=not^!!_145;
if(_13a&&_145!=null){
if(pass){
_140=true;
}else{
_13e[i]=false;
}
}else{
if(pass){
_13d.push(item);
_140=true;
}
}
}
}
}
if(_145!==_2){
if(!_13a){
_13e=_13d;
}
expr=expr.replace(Expr.match[type],"");
if(!_140){
return [];
}
break;
}
}
}
expr=expr.replace(/\s*,\s*/,"");
if(expr==old){
if(_140==null){
throw "Syntax error, unrecognized expression: "+expr;
}else{
break;
}
}
old=expr;
}
return _13e;
};
var Expr=_115.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(elem){
return elem.getAttribute("href");
}},relative:{"+":function(_14c,part){
for(var i=0,l=_14c.length;i<l;i++){
var elem=_14c[i];
if(elem){
var cur=elem.previousSibling;
while(cur&&cur.nodeType!==1){
cur=cur.previousSibling;
}
_14c[i]=typeof part==="string"?cur||false:cur===part;
}
}
if(typeof part==="string"){
_115.filter(part,_14c,true);
}
},">":function(_152,part,_154){
if(typeof part==="string"&&!/\W/.test(part)){
part=_154?part:part.toUpperCase();
for(var i=0,l=_152.length;i<l;i++){
var elem=_152[i];
if(elem){
var _158=elem.parentNode;
_152[i]=_158.nodeName===part?_158:false;
}
}
}else{
for(var i=0,l=_152.length;i<l;i++){
var elem=_152[i];
if(elem){
_152[i]=typeof part==="string"?elem.parentNode:elem.parentNode===part;
}
}
if(typeof part==="string"){
_115.filter(part,_152,true);
}
}
},"":function(_159,part,_15b){
var _15c="done"+(done++),_15d=dirCheck;
if(!part.match(/\W/)){
var _15e=part=_15b?part:part.toUpperCase();
_15d=dirNodeCheck;
}
_15d("parentNode",part,_15c,_159,_15e,_15b);
},"~":function(_15f,part,_161){
var _162="done"+(done++),_163=dirCheck;
if(typeof part==="string"&&!part.match(/\W/)){
var _164=part=_161?part:part.toUpperCase();
_163=dirNodeCheck;
}
_163("previousSibling",part,_162,_15f,_164,_161);
}},find:{ID:function(_165,_166){
if(_166.getElementById){
var m=_166.getElementById(_165[1]);
return m?[m]:[];
}
},NAME:function(_168,_169){
return _169.getElementsByName?_169.getElementsByName(_168[1]):null;
},TAG:function(_16a,_16b){
return _16b.getElementsByTagName(_16a[1]);
}},preFilter:{CLASS:function(_16c,_16d,_16e,_16f,not){
_16c=" "+_16c[1].replace(/\\/g,"")+" ";
for(var i=0;_16d[i];i++){
if(not^(" "+_16d[i].className+" ").indexOf(_16c)>=0){
if(!_16e){
_16f.push(_16d[i]);
}
}else{
if(_16e){
_16d[i]=false;
}
}
}
return false;
},ID:function(_172){
return _172[1].replace(/\\/g,"");
},TAG:function(_173,_174){
for(var i=0;!_174[i];i++){
}
return _12c(_174[i])?_173[1]:_173[1].toUpperCase();
},CHILD:function(_176){
if(_176[1]=="nth"){
var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(_176[2]=="even"&&"2n"||_176[2]=="odd"&&"2n+1"||!/\D/.test(_176[2])&&"0n+"+_176[2]||_176[2]);
_176[2]=(test[1]+(test[2]||1))-0;
_176[3]=test[3]-0;
}
_176[0]="done"+(done++);
return _176;
},ATTR:function(_178){
var name=_178[1];
if(Expr.attrMap[name]){
_178[1]=Expr.attrMap[name];
}
if(_178[2]==="~="){
_178[4]=" "+_178[4]+" ";
}
return _178;
},PSEUDO:function(_17a,_17b,_17c,_17d,not){
if(_17a[1]==="not"){
if(_17a[3].match(_113).length>1){
_17a[3]=_115(_17a[3],null,null,_17b);
}else{
var ret=_115.filter(_17a[3],_17b,_17c,true^not);
if(!_17c){
_17d.push.apply(_17d,ret);
}
return false;
}
}else{
if(Expr.match.POS.test(_17a[0])){
return true;
}
}
return _17a;
},POS:function(_180){
_180.unshift(true);
return _180;
}},filters:{enabled:function(elem){
return elem.disabled===false&&elem.type!=="hidden";
},disabled:function(elem){
return elem.disabled===true;
},checked:function(elem){
return elem.checked===true;
},selected:function(elem){
elem.parentNode.selectedIndex;
return elem.selected===true;
},parent:function(elem){
return !!elem.firstChild;
},empty:function(elem){
return !elem.firstChild;
},has:function(elem,i,_189){
return !!_115(_189[3],elem).length;
},header:function(elem){
return /h\d/i.test(elem.nodeName);
},text:function(elem){
return "text"===elem.type;
},radio:function(elem){
return "radio"===elem.type;
},checkbox:function(elem){
return "checkbox"===elem.type;
},file:function(elem){
return "file"===elem.type;
},password:function(elem){
return "password"===elem.type;
},submit:function(elem){
return "submit"===elem.type;
},image:function(elem){
return "image"===elem.type;
},reset:function(elem){
return "reset"===elem.type;
},button:function(elem){
return "button"===elem.type||elem.nodeName.toUpperCase()==="BUTTON";
},input:function(elem){
return /input|select|textarea|button/i.test(elem.nodeName);
}},setFilters:{first:function(elem,i){
return i===0;
},last:function(elem,i,_199,_19a){
return i===_19a.length-1;
},even:function(elem,i){
return i%2===0;
},odd:function(elem,i){
return i%2===1;
},lt:function(elem,i,_1a1){
return i<_1a1[3]-0;
},gt:function(elem,i,_1a4){
return i>_1a4[3]-0;
},nth:function(elem,i,_1a7){
return _1a7[3]-0==i;
},eq:function(elem,i,_1aa){
return _1aa[3]-0==i;
}},filter:{CHILD:function(elem,_1ac){
var type=_1ac[1],_1ae=elem.parentNode;
var _1af="child"+_1ae.childNodes.length;
if(_1ae&&(!_1ae[_1af]||!elem.nodeIndex)){
var _1b0=1;
for(var node=_1ae.firstChild;node;node=node.nextSibling){
if(node.nodeType==1){
node.nodeIndex=_1b0++;
}
}
_1ae[_1af]=_1b0-1;
}
if(type=="first"){
return elem.nodeIndex==1;
}else{
if(type=="last"){
return elem.nodeIndex==_1ae[_1af];
}else{
if(type=="only"){
return _1ae[_1af]==1;
}else{
if(type=="nth"){
var add=false,_1b3=_1ac[2],last=_1ac[3];
if(_1b3==1&&last==0){
return true;
}
if(_1b3==0){
if(elem.nodeIndex==last){
add=true;
}
}else{
if((elem.nodeIndex-last)%_1b3==0&&(elem.nodeIndex-last)/_1b3>=0){
add=true;
}
}
return add;
}
}
}
}
},PSEUDO:function(elem,_1b6,i,_1b8){
var name=_1b6[1],_1ba=Expr.filters[name];
if(_1ba){
return _1ba(elem,i,_1b6,_1b8);
}else{
if(name==="contains"){
return (elem.textContent||elem.innerText||"").indexOf(_1b6[3])>=0;
}else{
if(name==="not"){
var not=_1b6[3];
for(var i=0,l=not.length;i<l;i++){
if(not[i]===elem){
return false;
}
}
return true;
}
}
}
},ID:function(elem,_1be){
return elem.nodeType===1&&elem.getAttribute("id")===_1be;
},TAG:function(elem,_1c0){
return (_1c0==="*"&&elem.nodeType===1)||elem.nodeName===_1c0;
},CLASS:function(elem,_1c2){
return _1c2.test(elem.className);
},ATTR:function(elem,_1c4){
var _1c5=Expr.attrHandle[_1c4[1]]?Expr.attrHandle[_1c4[1]](elem):elem[_1c4[1]]||elem.getAttribute(_1c4[1]),_1c6=_1c5+"",type=_1c4[2],_1c8=_1c4[4];
return _1c5==null?false:type==="="?_1c6===_1c8:type==="*="?_1c6.indexOf(_1c8)>=0:type==="~="?(" "+_1c6+" ").indexOf(_1c8)>=0:!_1c4[4]?_1c5:type==="!="?_1c6!=_1c8:type==="^="?_1c6.indexOf(_1c8)===0:type==="$="?_1c6.substr(_1c6.length-_1c8.length)===_1c8:type==="|="?_1c6===_1c8||_1c6.substr(0,_1c8.length+1)===_1c8+"-":false;
},POS:function(elem,_1ca,i,_1cc){
var name=_1ca[2],_1ce=Expr.setFilters[name];
if(_1ce){
return _1ce(elem,i,_1ca,_1cc);
}
}}};
for(var type in Expr.match){
Expr.match[type]=RegExp(Expr.match[type].source+/(?![^\[]*\])(?![^\(]*\))/.source);
}
var _129=function(_1d0,_1d1){
_1d0=Array.prototype.slice.call(_1d0);
if(_1d1){
_1d1.push.apply(_1d1,_1d0);
return _1d1;
}
return _1d0;
};
try{
Array.prototype.slice.call(document.documentElement.childNodes);
}
catch(e){
_129=function(_1d2,_1d3){
var ret=_1d3||[];
if(_6a.call(_1d2)==="[object Array]"){
Array.prototype.push.apply(ret,_1d2);
}else{
if(typeof _1d2.length==="number"){
for(var i=0,l=_1d2.length;i<l;i++){
ret.push(_1d2[i]);
}
}else{
for(var i=0;_1d2[i];i++){
ret.push(_1d2[i]);
}
}
}
return ret;
};
}
(function(){
var form=document.createElement("form"),id="script"+(new Date).getTime();
form.innerHTML="<input name='"+id+"'/>";
var root=document.documentElement;
root.insertBefore(form,root.firstChild);
if(!!document.getElementById(id)){
Expr.find.ID=function(_1da,_1db){
if(_1db.getElementById){
var m=_1db.getElementById(_1da[1]);
return m?m.id===_1da[1]||m.getAttributeNode&&m.getAttributeNode("id").nodeValue===_1da[1]?[m]:_2:[];
}
};
Expr.filter.ID=function(elem,_1de){
var node=elem.getAttributeNode&&elem.getAttributeNode("id");
return elem.nodeType===1&&node&&node.nodeValue===_1de;
};
}
root.removeChild(form);
})();
(function(){
var div=document.createElement("div");
div.appendChild(document.createComment(""));
if(div.getElementsByTagName("*").length>0){
Expr.find.TAG=function(_1e1,_1e2){
var _1e3=_1e2.getElementsByTagName(_1e1[1]);
if(_1e1[1]==="*"){
var tmp=[];
for(var i=0;_1e3[i];i++){
if(_1e3[i].nodeType===1){
tmp.push(_1e3[i]);
}
}
_1e3=tmp;
}
return _1e3;
};
}
div.innerHTML="<a href='#'></a>";
if(div.firstChild.getAttribute("href")!=="#"){
Expr.attrHandle.href=function(elem){
return elem.getAttribute("href",2);
};
}
})();
if(document.querySelectorAll){
(function(){
var _1e7=_115;
_115=function(_1e8,_1e9,_1ea,seed){
_1e9=_1e9||document;
if(!seed&&_1e9.nodeType===9){
try{
return _129(_1e9.querySelectorAll(_1e8),_1ea);
}
catch(e){
}
}
return _1e7(_1e8,_1e9,_1ea,seed);
};
_115.find=_1e7.find;
_115.filter=_1e7.filter;
_115.selectors=_1e7.selectors;
_115.matches=_1e7.matches;
})();
}
if(document.documentElement.getElementsByClassName){
Expr.order.splice(1,0,"CLASS");
Expr.find.CLASS=function(_1ec,_1ed){
return _1ed.getElementsByClassName(_1ec[1]);
};
}
function dirNodeCheck(dir,cur,_1f0,_1f1,_1f2,_1f3){
for(var i=0,l=_1f1.length;i<l;i++){
var elem=_1f1[i];
if(elem){
elem=elem[dir];
var _1f7=false;
while(elem&&elem.nodeType){
var done=elem[_1f0];
if(done){
_1f7=_1f1[done];
break;
}
if(elem.nodeType===1&&!_1f3){
elem[_1f0]=i;
}
if(elem.nodeName===cur){
_1f7=elem;
break;
}
elem=elem[dir];
}
_1f1[i]=_1f7;
}
}
}
function dirCheck(dir,cur,_1fb,_1fc,_1fd,_1fe){
for(var i=0,l=_1fc.length;i<l;i++){
var elem=_1fc[i];
if(elem){
elem=elem[dir];
var _202=false;
while(elem&&elem.nodeType){
if(elem[_1fb]){
_202=_1fc[elem[_1fb]];
break;
}
if(elem.nodeType===1){
if(!_1fe){
elem[_1fb]=i;
}
if(typeof cur!=="string"){
if(elem===cur){
_202=true;
break;
}
}else{
if(_115.filter(cur,[elem]).length>0){
_202=elem;
break;
}
}
}
elem=elem[dir];
}
_1fc[i]=_202;
}
}
}
var _12d=document.compareDocumentPosition?function(a,b){
return a.compareDocumentPosition(b)&16;
}:function(a,b){
return a!==b&&(a.contains?a.contains(b):true);
};
var _12c=function(elem){
return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;
};
_5.find=_115;
_5.filter=_115.filter;
_5.expr=_115.selectors;
_5.expr[":"]=_5.expr.filters;
_115.selectors.filters.hidden=function(elem){
return "hidden"===elem.type||_5.css(elem,"display")==="none"||_5.css(elem,"visibility")==="hidden";
};
_115.selectors.filters.visible=function(elem){
return "hidden"!==elem.type&&_5.css(elem,"display")!=="none"&&_5.css(elem,"visibility")!=="hidden";
};
_115.selectors.filters.animated=function(elem){
return _5.grep(_5.timers,function(fn){
return elem===fn.elem;
}).length;
};
_5.multiFilter=function(expr,_20d,not){
if(not){
expr=":not("+expr+")";
}
return _115.matches(expr,_20d);
};
_5.dir=function(elem,dir){
var _211=[],cur=elem[dir];
while(cur&&cur!=document){
if(cur.nodeType==1){
_211.push(cur);
}
cur=cur[dir];
}
return _211;
};
_5.nth=function(cur,_214,dir,elem){
_214=_214||1;
var num=0;
for(;cur;cur=cur[dir]){
if(cur.nodeType==1&&++num==_214){
break;
}
}
return cur;
};
_5.sibling=function(n,elem){
var r=[];
for(;n;n=n.nextSibling){
if(n.nodeType==1&&n!=elem){
r.push(n);
}
}
return r;
};
return;
_1.Sizzle=_115;
})();
_5.event={add:function(elem,_21c,_21d,data){
if(elem.nodeType==3||elem.nodeType==8){
return;
}
if(elem.setInterval&&elem!=_1){
elem=_1;
}
if(!_21d.guid){
_21d.guid=this.guid++;
}
if(data!==_2){
var fn=_21d;
_21d=this.proxy(fn);
_21d.data=data;
}
var _220=_5.data(elem,"events")||_5.data(elem,"events",{}),_221=_5.data(elem,"handle")||_5.data(elem,"handle",function(){
return typeof _5!=="undefined"&&!_5.event.triggered?_5.event.handle.apply(arguments.callee.elem,arguments):_2;
});
_221.elem=elem;
_5.each(_21c.split(/\s+/),function(_222,type){
var _224=type.split(".");
type=_224.shift();
_21d.type=_224.slice().sort().join(".");
var _225=_220[type];
if(_5.event.specialAll[type]){
_5.event.specialAll[type].setup.call(elem,data,_224);
}
if(!_225){
_225=_220[type]={};
if(!_5.event.special[type]||_5.event.special[type].setup.call(elem,data,_224)===false){
if(elem.addEventListener){
elem.addEventListener(type,_221,false);
}else{
if(elem.attachEvent){
elem.attachEvent("on"+type,_221);
}
}
}
}
_225[_21d.guid]=_21d;
_5.event.global[type]=true;
});
elem=null;
},guid:1,global:{},remove:function(elem,_227,_228){
if(elem.nodeType==3||elem.nodeType==8){
return;
}
var _229=_5.data(elem,"events"),ret,_22b;
if(_229){
if(_227===_2||(typeof _227==="string"&&_227.charAt(0)==".")){
for(var type in _229){
this.remove(elem,type+(_227||""));
}
}else{
if(_227.type){
_228=_227.handler;
_227=_227.type;
}
_5.each(_227.split(/\s+/),function(_22d,type){
var _22f=type.split(".");
type=_22f.shift();
var _230=RegExp("(^|\\.)"+_22f.slice().sort().join(".*\\.")+"(\\.|$)");
if(_229[type]){
if(_228){
delete _229[type][_228.guid];
}else{
for(var _231 in _229[type]){
if(_230.test(_229[type][_231].type)){
delete _229[type][_231];
}
}
}
if(_5.event.specialAll[type]){
_5.event.specialAll[type].teardown.call(elem,_22f);
}
for(ret in _229[type]){
break;
}
if(!ret){
if(!_5.event.special[type]||_5.event.special[type].teardown.call(elem,_22f)===false){
if(elem.removeEventListener){
elem.removeEventListener(type,_5.data(elem,"handle"),false);
}else{
if(elem.detachEvent){
elem.detachEvent("on"+type,_5.data(elem,"handle"));
}
}
}
ret=null;
delete _229[type];
}
}
});
}
for(ret in _229){
break;
}
if(!ret){
var _232=_5.data(elem,"handle");
if(_232){
_232.elem=null;
}
_5.removeData(elem,"events");
_5.removeData(elem,"handle");
}
}
},trigger:function(_233,data,elem,_236){
var type=_233.type||_233;
if(!_236){
_233=typeof _233==="object"?_233[_f8]?_233:_5.extend(_5.Event(type),_233):_5.Event(type);
if(type.indexOf("!")>=0){
_233.type=type=type.slice(0,-1);
_233.exclusive=true;
}
if(!elem){
_233.stopPropagation();
if(this.global[type]){
_5.each(_5.cache,function(){
if(this.events&&this.events[type]){
_5.event.trigger(_233,data,this.handle.elem);
}
});
}
}
if(!elem||elem.nodeType==3||elem.nodeType==8){
return _2;
}
_233.result=_2;
_233.target=elem;
data=_5.makeArray(data);
data.unshift(_233);
}
_233.currentTarget=elem;
var _238=_5.data(elem,"handle");
if(_238){
_238.apply(elem,data);
}
if((!elem[type]||(_5.nodeName(elem,"a")&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false){
_233.result=false;
}
if(!_236&&elem[type]&&!_233.isDefaultPrevented()&&!(_5.nodeName(elem,"a")&&type=="click")){
this.triggered=true;
try{
elem[type]();
}
catch(e){
}
}
this.triggered=false;
if(!_233.isPropagationStopped()){
var _239=elem.parentNode||elem.ownerDocument;
if(_239){
_5.event.trigger(_233,data,_239,true);
}
}
},handle:function(_23a){
var all,_23c;
_23a=arguments[0]=_5.event.fix(_23a||_1.event);
var _23d=_23a.type.split(".");
_23a.type=_23d.shift();
all=!_23d.length&&!_23a.exclusive;
var _23e=RegExp("(^|\\.)"+_23d.slice().sort().join(".*\\.")+"(\\.|$)");
_23c=(_5.data(this,"events")||{})[_23a.type];
for(var j in _23c){
var _240=_23c[j];
if(all||_23e.test(_240.type)){
_23a.handler=_240;
_23a.data=_240.data;
var ret=_240.apply(this,arguments);
if(ret!==_2){
_23a.result=ret;
if(ret===false){
_23a.preventDefault();
_23a.stopPropagation();
}
}
if(_23a.isImmediatePropagationStopped()){
break;
}
}
}
},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 toElement view wheelDelta which".split(" "),fix:function(_242){
if(_242[_f8]){
return _242;
}
var _243=_242;
_242=_5.Event(_243);
for(var i=this.props.length,prop;i;){
prop=this.props[--i];
_242[prop]=_243[prop];
}
if(!_242.target){
_242.target=_242.srcElement||document;
}
if(_242.target.nodeType==3){
_242.target=_242.target.parentNode;
}
if(!_242.relatedTarget&&_242.fromElement){
_242.relatedTarget=_242.fromElement==_242.target?_242.toElement:_242.fromElement;
}
if(_242.pageX==null&&_242.clientX!=null){
var doc=document.documentElement,body=document.body;
_242.pageX=_242.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);
_242.pageY=_242.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);
}
if(!_242.which&&((_242.charCode||_242.charCode===0)?_242.charCode:_242.keyCode)){
_242.which=_242.charCode||_242.keyCode;
}
if(!_242.metaKey&&_242.ctrlKey){
_242.metaKey=_242.ctrlKey;
}
if(!_242.which&&_242.button){
_242.which=(_242.button&1?1:(_242.button&2?3:(_242.button&4?2:0)));
}
return _242;
},proxy:function(fn,_249){
_249=_249||function(){
return fn.apply(this,arguments);
};
_249.guid=fn.guid=fn.guid||_249.guid||this.guid++;
return _249;
},special:{ready:{setup:bindReady,teardown:function(){
}}},specialAll:{live:{setup:function(_24a,_24b){
_5.event.add(this,_24b[0],liveHandler);
},teardown:function(_24c){
if(_24c.length){
var _24d=0,name=RegExp("(^|\\.)"+_24c[0]+"(\\.|$)");
_5.each((_5.data(this,"events").live||{}),function(){
if(name.test(this.type)){
_24d++;
}
});
if(_24d<1){
_5.event.remove(this,_24c[0],liveHandler);
}
}
}}}};
_5.Event=function(src){
if(!this.preventDefault){
return new _5.Event(src);
}
if(src&&src.type){
this.originalEvent=src;
this.type=src.type;
this.timeStamp=src.timeStamp;
}else{
this.type=src;
}
if(!this.timeStamp){
this.timeStamp=now();
}
this[_f8]=true;
};
function returnFalse(){
return false;
}
function returnTrue(){
return true;
}
_5.Event.prototype={preventDefault:function(){
this.isDefaultPrevented=returnTrue;
var e=this.originalEvent;
if(!e){
return;
}
if(e.preventDefault){
e.preventDefault();
}
e.returnValue=false;
},stopPropagation:function(){
this.isPropagationStopped=returnTrue;
var e=this.originalEvent;
if(!e){
return;
}
if(e.stopPropagation){
e.stopPropagation();
}
e.cancelBubble=true;
},stopImmediatePropagation:function(){
this.isImmediatePropagationStopped=returnTrue;
this.stopPropagation();
},isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse};
var _252=function(_253){
var _254=_253.relatedTarget;
while(_254&&_254!=this){
try{
_254=_254.parentNode;
}
catch(e){
_254=this;
}
}
if(_254!=this){
_253.type=_253.data;
_5.event.handle.apply(this,arguments);
}
};
_5.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(orig,fix){
_5.event.special[fix]={setup:function(){
_5.event.add(this,orig,_252,fix);
},teardown:function(){
_5.event.remove(this,orig,_252);
}};
});
_5.fn.extend({bind:function(type,data,fn){
return type=="unload"?this.one(type,data,fn):this.each(function(){
_5.event.add(this,type,fn||data,fn&&data);
});
},one:function(type,data,fn){
var one=_5.event.proxy(fn||data,function(_25e){
_5(this).unbind(_25e,one);
return (fn||data).apply(this,arguments);
});
return this.each(function(){
_5.event.add(this,type,one,fn&&data);
});
},unbind:function(type,fn){
return this.each(function(){
_5.event.remove(this,type,fn);
});
},trigger:function(type,data){
return this.each(function(){
_5.event.trigger(type,data,this);
});
},triggerHandler:function(type,data){
if(this[0]){
var _265=_5.Event(type);
_265.preventDefault();
_265.stopPropagation();
_5.event.trigger(_265,data,this[0]);
return _265.result;
}
},toggle:function(fn){
var args=arguments,i=1;
while(i<args.length){
_5.event.proxy(fn,args[i++]);
}
return this.click(_5.event.proxy(fn,function(_269){
this.lastToggle=(this.lastToggle||0)%i;
_269.preventDefault();
return args[this.lastToggle++].apply(this,arguments)||false;
}));
},hover:function(_26a,_26b){
return this.mouseenter(_26a).mouseleave(_26b);
},ready:function(fn){
bindReady();
if(_5.isReady){
fn.call(document,_5);
}else{
_5.readyList.push(fn);
}
return this;
},live:function(type,fn){
var _26f=_5.event.proxy(fn);
_26f.guid+=this.selector+type;
_5(document).bind(liveConvert(type,this.selector),this.selector,_26f);
return this;
},die:function(type,fn){
_5(document).unbind(liveConvert(type,this.selector),fn?{guid:fn.guid+this.selector+type}:null);
return this;
}});
function liveHandler(_272){
var _273=RegExp("(^|\\.)"+_272.type+"(\\.|$)"),stop=true,_275=[];
_5.each(_5.data(this,"events").live||[],function(i,fn){
if(_273.test(fn.type)){
var elem=_5(_272.target).closest(fn.data)[0];
if(elem){
_275.push({elem:elem,fn:fn});
}
}
});
_5.each(_275,function(){
if(!_272.isImmediatePropagationStopped()&&this.fn.call(this.elem,_272,this.fn.data)===false){
stop=false;
}
});
return stop;
}
function liveConvert(type,_27a){
return ["live",type,_27a.replace(/\./g,"`").replace(/ /g,"|")].join(".");
}
_5.extend({isReady:false,readyList:[],ready:function(){
if(!_5.isReady){
_5.isReady=true;
if(_5.readyList){
_5.each(_5.readyList,function(){
this.call(document,_5);
});
_5.readyList=null;
}
_5(document).triggerHandler("ready");
}
}});
var _27b=false;
function bindReady(){
if(_27b){
return;
}
_27b=true;
if(document.addEventListener){
document.addEventListener("DOMContentLoaded",function(){
document.removeEventListener("DOMContentLoaded",arguments.callee,false);
_5.ready();
},false);
}else{
if(document.attachEvent){
document.attachEvent("onreadystatechange",function(){
if(document.readyState==="complete"){
document.detachEvent("onreadystatechange",arguments.callee);
_5.ready();
}
});
if(document.documentElement.doScroll&&!_1.frameElement){
(function(){
if(_5.isReady){
return;
}
try{
document.documentElement.doScroll("left");
}
catch(error){
setTimeout(arguments.callee,0);
return;
}
_5.ready();
})();
}
}
}
_5.event.add(_1,"load",_5.ready);
}
_5.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,"+"change,select,submit,keydown,keypress,keyup,error").split(","),function(i,name){
_5.fn[name]=function(fn){
return fn?this.bind(name,fn):this.trigger(name);
};
});
_5(_1).bind("unload",function(){
for(var id in _5.cache){
if(id!=1&&_5.cache[id].handle){
_5.event.remove(_5.cache[id].handle.elem);
}
}
});
(function(){
_5.support={};
var root=document.documentElement,_281=document.createElement("script"),div=document.createElement("div"),id="script"+(new Date).getTime();
div.style.display="none";
div.innerHTML="   <link/><table></table><a href=\"/a\" style=\"color:red;float:left;opacity:.5;\">a</a><select><option>text</option></select><object><param/></object>";
var all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0];
if(!all||!all.length||!a){
return;
}
_5.support={leadingWhitespace:div.firstChild.nodeType==3,tbody:!div.getElementsByTagName("tbody").length,objectAll:!!div.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/red/.test(a.getAttribute("style")),hrefNormalized:a.getAttribute("href")==="/a",opacity:a.style.opacity==="0.5",cssFloat:!!a.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};
_281.type="text/javascript";
try{
_281.appendChild(document.createTextNode("window."+id+"=1;"));
}
catch(e){
}
root.insertBefore(_281,root.firstChild);
if(_1[id]){
_5.support.scriptEval=true;
delete _1[id];
}
root.removeChild(_281);
if(div.attachEvent&&div.fireEvent){
div.attachEvent("onclick",function(){
_5.support.noCloneEvent=false;
div.detachEvent("onclick",arguments.callee);
});
div.cloneNode(true).fireEvent("onclick");
}
_5(function(){
var div=document.createElement("div");
div.style.width="1px";
div.style.paddingLeft="1px";
document.body.appendChild(div);
_5.boxModel=_5.support.boxModel=div.offsetWidth===2;
document.body.removeChild(div);
});
})();
var _287=_5.support.cssFloat?"cssFloat":"styleFloat";
_5.props={"for":"htmlFor","class":"className","float":_287,cssFloat:_287,styleFloat:_287,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};
_5.fn.extend({_load:_5.fn.load,load:function(url,_289,_28a){
if(typeof url!=="string"){
return this._load(url);
}
var off=url.indexOf(" ");
if(off>=0){
var _28c=url.slice(off,url.length);
url=url.slice(0,off);
}
var type="GET";
if(_289){
if(_5.isFunction(_289)){
_28a=_289;
_289=null;
}else{
if(typeof _289==="object"){
_289=_5.param(_289);
type="POST";
}
}
}
var self=this;
_5.ajax({url:url,type:type,dataType:"html",data:_289,complete:function(res,_290){
if(_290=="success"||_290=="notmodified"){
self.html(_28c?_5("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(_28c):res.responseText);
}
if(_28a){
self.each(_28a,[res.responseText,_290,res]);
}
}});
return this;
},serialize:function(){
return _5.param(this.serializeArray());
},serializeArray:function(){
return this.map(function(){
return this.elements?_5.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=_5(this).val();
return val==null?null:_5.isArray(val)?_5.map(val,function(val,i){
return {name:elem.name,value:val};
}):{name:elem.name,value:val};
}).get();
}});
_5.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){
_5.fn[o]=function(f){
return this.bind(o,f);
};
});
var jsc=now();
_5.extend({get:function(url,data,_29c,type){
if(_5.isFunction(data)){
_29c=data;
data=null;
}
return _5.ajax({type:"GET",url:url,data:data,success:_29c,dataType:type});
},getScript:function(url,_29f){
return _5.get(url,null,_29f,"script");
},getJSON:function(url,data,_2a2){
return _5.get(url,data,_2a2,"json");
},post:function(url,data,_2a5,type){
if(_5.isFunction(data)){
_2a5=data;
data={};
}
return _5.ajax({type:"POST",url:url,data:data,success:_2a5,dataType:type});
},ajaxSetup:function(_2a7){
_5.extend(_5.ajaxSettings,_2a7);
},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){
return _1.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();
},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=_5.extend(true,s,_5.extend(true,{},_5.ajaxSettings,s));
var _2a9,jsre=/=\?(&|$)/g,_2ab,data,type=s.type.toUpperCase();
if(s.data&&s.processData&&typeof s.data!=="string"){
s.data=_5.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))){
_2a9="jsonp"+jsc++;
if(s.data){
s.data=(s.data+"").replace(jsre,"="+_2a9+"$1");
}
s.url=s.url.replace(jsre,"="+_2a9+"$1");
s.dataType="script";
_1[_2a9]=function(tmp){
data=tmp;
success();
complete();
_1[_2a9]=_2;
try{
delete _1[_2a9];
}
catch(e){
}
if(head){
head.removeChild(_2b0);
}
};
}
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&&!_5.active++){
_5.event.trigger("ajaxStart");
}
var _2b3=/^(\w+:)?\/\/([^\/?#]+)/.exec(s.url);
if(s.dataType=="script"&&type=="GET"&&_2b3&&(_2b3[1]&&_2b3[1]!=location.protocol||_2b3[2]!=location.host)){
var head=document.getElementsByTagName("head")[0];
var _2b0=document.createElement("script");
_2b0.src=s.url;
if(s.scriptCharset){
_2b0.charset=s.scriptCharset;
}
if(!_2a9){
var done=false;
_2b0.onload=_2b0.onreadystatechange=function(){
if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){
done=true;
success();
complete();
head.removeChild(_2b0);
}
};
}
head.appendChild(_2b0);
return _2;
}
var _2b5=false;
var xhr=s.xhr();
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",_5.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){
if(s.global&&!--_5.active){
_5.event.trigger("ajaxStop");
}
xhr.abort();
return false;
}
if(s.global){
_5.event.trigger("ajaxSend",[xhr,s]);
}
var _2b7=function(_2b8){
if(xhr.readyState==0){
if(ival){
clearInterval(ival);
ival=null;
if(s.global&&!--_5.active){
_5.event.trigger("ajaxStop");
}
}
}else{
if(!_2b5&&xhr&&(xhr.readyState==4||_2b8=="timeout")){
_2b5=true;
if(ival){
clearInterval(ival);
ival=null;
}
_2ab=_2b8=="timeout"?"timeout":!_5.httpSuccess(xhr)?"error":s.ifModified&&_5.httpNotModified(xhr,s.url)?"notmodified":"success";
if(_2ab=="success"){
try{
data=_5.httpData(xhr,s.dataType,s);
}
catch(e){
_2ab="parsererror";
}
}
if(_2ab=="success"){
var _2ba;
try{
_2ba=xhr.getResponseHeader("Last-Modified");
}
catch(e){
}
if(s.ifModified&&_2ba){
_5.lastModified[s.url]=_2ba;
}
if(!_2a9){
success();
}
}else{
_5.handleError(s,xhr,_2ab);
}
complete();
if(s.async){
xhr=null;
}
}
}
};
if(s.async){
var ival=setInterval(_2b7,13);
if(s.timeout>0){
setTimeout(function(){
if(xhr){
if(!_2b5){
_2b7("timeout");
}
if(xhr){
xhr.abort();
}
}
},s.timeout);
}
}
try{
xhr.send(s.data);
}
catch(e){
_5.handleError(s,xhr,null,e);
}
if(!s.async){
_2b7();
}
function success(){
if(s.success){
s.success(data,_2ab);
}
if(s.global){
_5.event.trigger("ajaxSuccess",[xhr,s]);
}
}
function complete(){
if(s.complete){
s.complete(xhr,_2ab);
}
if(s.global){
_5.event.trigger("ajaxComplete",[xhr,s]);
}
if(s.global&&!--_5.active){
_5.event.trigger("ajaxStop");
}
}
return xhr;
},handleError:function(s,xhr,_2bd,e){
if(s.error){
s.error(xhr,_2bd,e);
}
if(s.global){
_5.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;
}
catch(e){
}
return false;
},httpNotModified:function(xhr,url){
try{
var _2c2=xhr.getResponseHeader("Last-Modified");
return xhr.status==304||_2c2==_5.lastModified[url];
}
catch(e){
}
return false;
},httpData:function(xhr,type,s){
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(s&&s.dataFilter){
data=s.dataFilter(data,type);
}
if(typeof data==="string"){
if(type=="script"){
_5.globalEval(data);
}
if(type=="json"){
data=_1["eval"]("("+data+")");
}
}
return data;
},param:function(a){
var s=[];
function add(key,_2cc){
s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(_2cc);
}
if(_5.isArray(a)||a.jquery){
_5.each(a,function(){
add(this.name,this.value);
});
}else{
for(var j in a){
if(_5.isArray(a[j])){
_5.each(a[j],function(){
add(j,this);
});
}else{
add(j,_5.isFunction(a[j])?a[j]():a[j]);
}
}
}
return s.join("&").replace(/%20/g,"+");
}});
var _2ce={},_2cf=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];
function genFx(type,num){
var obj={};
_5.each(_2cf.concat.apply([],_2cf.slice(0,num)),function(){
obj[this]=type;
});
return obj;
}
_5.fn.extend({show:function(_2d3,_2d4){
if(_2d3){
return this.animate(genFx("show",3),_2d3,_2d4);
}else{
for(var i=0,l=this.length;i<l;i++){
var old=_5.data(this[i],"olddisplay");
this[i].style.display=old||"";
if(_5.css(this[i],"display")==="none"){
var _2d8=this[i].tagName,_2d9;
if(_2ce[_2d8]){
_2d9=_2ce[_2d8];
}else{
var elem=_5("<"+_2d8+" />").appendTo("body");
_2d9=elem.css("display");
if(_2d9==="none"){
_2d9="block";
}
elem.remove();
_2ce[_2d8]=_2d9;
}
this[i].style.display=_5.data(this[i],"olddisplay",_2d9);
}
}
return this;
}
},hide:function(_2db,_2dc){
if(_2db){
return this.animate(genFx("hide",3),_2db,_2dc);
}else{
for(var i=0,l=this.length;i<l;i++){
var old=_5.data(this[i],"olddisplay");
if(!old&&old!=="none"){
_5.data(this[i],"olddisplay",_5.css(this[i],"display"));
}
this[i].style.display="none";
}
return this;
}
},_toggle:_5.fn.toggle,toggle:function(fn,fn2){
var bool=typeof fn==="boolean";
return _5.isFunction(fn)&&_5.isFunction(fn2)?this._toggle.apply(this,arguments):fn==null||bool?this.each(function(){
var _2e3=bool?fn:_5(this).is(":hidden");
_5(this)[_2e3?"show":"hide"]();
}):this.animate(genFx("toggle",3),fn,fn2);
},fadeTo:function(_2e4,to,_2e6){
return this.animate({opacity:to},_2e4,_2e6);
},animate:function(prop,_2e8,_2e9,_2ea){
var _2eb=_5.speed(_2e8,_2e9,_2ea);
return this[_2eb.queue===false?"each":"queue"](function(){
var opt=_5.extend({},_2eb),p,_2ee=this.nodeType==1&&_5(this).is(":hidden"),self=this;
for(p in prop){
if(prop[p]=="hide"&&_2ee||prop[p]=="show"&&!_2ee){
return opt.complete.call(this);
}
if((p=="height"||p=="width")&&this.style){
opt.display=_5.css(this,"display");
opt.overflow=this.style.overflow;
}
}
if(opt.overflow!=null){
this.style.overflow="hidden";
}
opt.curAnim=_5.extend({},prop);
_5.each(prop,function(name,val){
var e=new _5.fx(self,opt,name);
if(/toggle|show|hide/.test(val)){
e[val=="toggle"?_2ee?"show":"hide":val](prop);
}else{
var _2f3=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),_2f4=e.cur(true)||0;
if(_2f3){
var end=parseFloat(_2f3[2]),unit=_2f3[3]||"px";
if(unit!="px"){
self.style[name]=(end||1)+unit;
_2f4=((end||1)/e.cur(true))*_2f4;
self.style[name]=_2f4+unit;
}
if(_2f3[1]){
end=((_2f3[1]=="-="?-1:1)*end)+_2f4;
}
e.custom(_2f4,end,unit);
}else{
e.custom(_2f4,val,"");
}
}
});
return true;
});
},stop:function(_2f7,_2f8){
var _2f9=_5.timers;
if(_2f7){
this.queue([]);
}
this.each(function(){
for(var i=_2f9.length-1;i>=0;i--){
if(_2f9[i].elem==this){
if(_2f8){
_2f9[i](true);
}
_2f9.splice(i,1);
}
}
});
if(!_2f8){
this.dequeue();
}
return this;
}});
_5.each({slideDown:genFx("show",1),slideUp:genFx("hide",1),slideToggle:genFx("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(name,_2fc){
_5.fn[name]=function(_2fd,_2fe){
return this.animate(_2fc,_2fd,_2fe);
};
});
_5.extend({speed:function(_2ff,_300,fn){
var opt=typeof _2ff==="object"?_2ff:{complete:fn||!fn&&_300||_5.isFunction(_2ff)&&_2ff,duration:_2ff,easing:fn&&_300||_300&&!_5.isFunction(_300)&&_300};
opt.duration=_5.fx.off?0:typeof opt.duration==="number"?opt.duration:_5.fx.speeds[opt.duration]||_5.fx.speeds._default;
opt.old=opt.complete;
opt.complete=function(){
if(opt.queue!==false){
_5(this).dequeue();
}
if(_5.isFunction(opt.old)){
opt.old.call(this);
}
};
return opt;
},easing:{linear:function(p,n,_305,diff){
return _305+diff*p;
},swing:function(p,n,_309,diff){
return ((-Math.cos(p*Math.PI)/2)+0.5)*diff+_309;
}},timers:[],timerId:null,fx:function(elem,_30c,prop){
this.options=_30c;
this.elem=elem;
this.prop=prop;
if(!_30c.orig){
_30c.orig={};
}
}});
_5.fx.prototype={update:function(){
if(this.options.step){
this.options.step.call(this.elem,this.now,this);
}
(_5.fx.step[this.prop]||_5.fx.step._default)(this);
if((this.prop=="height"||this.prop=="width")&&this.elem.style){
this.elem.style.display="block";
}
},cur:function(_30e){
if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){
return this.elem[this.prop];
}
var r=parseFloat(_5.css(this.elem,this.prop,_30e));
return r&&r>-10000?r:parseFloat(_5.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;
var self=this;
function t(_314){
return self.step(_314);
}
t.elem=this.elem;
_5.timers.push(t);
if(t()&&_5.timerId==null){
_5.timerId=setInterval(function(){
var _315=_5.timers;
for(var i=0;i<_315.length;i++){
if(!_315[i]()){
_315.splice(i--,1);
}
}
if(!_315.length){
clearInterval(_5.timerId);
_5.timerId=null;
}
},13);
}
},show:function(){
this.options.orig[this.prop]=_5.attr(this.elem.style,this.prop);
this.options.show=true;
this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());
_5(this.elem).show();
},hide:function(){
this.options.orig[this.prop]=_5.attr(this.elem.style,this.prop);
this.options.hide=true;
this.custom(this.cur(),0);
},step:function(_317){
var t=now();
if(_317||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(_5.css(this.elem,"display")=="none"){
this.elem.style.display="block";
}
}
if(this.options.hide){
_5(this.elem).hide();
}
if(this.options.hide||this.options.show){
for(var p in this.options.curAnim){
_5.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=_5.easing[this.options.easing||(_5.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;
}};
_5.extend(_5.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(fx){
_5.attr(fx.elem.style,"opacity",fx.now);
},_default:function(fx){
if(fx.elem.style&&fx.elem.style[fx.prop]!=null){
fx.elem.style[fx.prop]=fx.now+fx.unit;
}else{
fx.elem[fx.prop]=fx.now;
}
}}});
if(document.documentElement["getBoundingClientRect"]){
_5.fn.offset=function(){
if(!this[0]){
return {top:0,left:0};
}
if(this[0]===this[0].ownerDocument.body){
return _5.offset.bodyOffset(this[0]);
}
var box=this[0].getBoundingClientRect(),doc=this[0].ownerDocument,body=doc.body,_322=doc.documentElement,_323=_322.clientTop||body.clientTop||0,_324=_322.clientLeft||body.clientLeft||0,top=box.top+(self.pageYOffset||_5.boxModel&&_322.scrollTop||body.scrollTop)-_323,left=box.left+(self.pageXOffset||_5.boxModel&&_322.scrollLeft||body.scrollLeft)-_324;
return {top:top,left:left};
};
}else{
_5.fn.offset=function(){
if(!this[0]){
return {top:0,left:0};
}
if(this[0]===this[0].ownerDocument.body){
return _5.offset.bodyOffset(this[0]);
}
_5.offset.initialized||_5.offset.initialize();
var elem=this[0],_328=elem.offsetParent,_329=elem,doc=elem.ownerDocument,_32b,_32c=doc.documentElement,body=doc.body,_69=doc.defaultView,_32e=_69.getComputedStyle(elem,null),top=elem.offsetTop,left=elem.offsetLeft;
while((elem=elem.parentNode)&&elem!==body&&elem!==_32c){
_32b=_69.getComputedStyle(elem,null);
top-=elem.scrollTop,left-=elem.scrollLeft;
if(elem===_328){
top+=elem.offsetTop,left+=elem.offsetLeft;
if(_5.offset.doesNotAddBorder&&!(_5.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(elem.tagName))){
top+=parseInt(_32b.borderTopWidth,10)||0,left+=parseInt(_32b.borderLeftWidth,10)||0;
}
_329=_328,_328=elem.offsetParent;
}
if(_5.offset.subtractsBorderForOverflowNotVisible&&_32b.overflow!=="visible"){
top+=parseInt(_32b.borderTopWidth,10)||0,left+=parseInt(_32b.borderLeftWidth,10)||0;
}
_32e=_32b;
}
if(_32e.position==="relative"||_32e.position==="static"){
top+=body.offsetTop,left+=body.offsetLeft;
}
if(_32e.position==="fixed"){
top+=Math.max(_32c.scrollTop,body.scrollTop),left+=Math.max(_32c.scrollLeft,body.scrollLeft);
}
return {top:top,left:left};
};
}
_5.offset={initialize:function(){
if(this.initialized){
return;
}
var body=document.body,_332=document.createElement("div"),_333,_334,_335,td,_337,prop,_339=body.style.marginTop,html="<div style=\"position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;\"><div></div></div><table style=\"position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;\"cellpadding=\"0\"cellspacing=\"0\"><tr><td></td></tr></table>";
_337={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};
for(prop in _337){
_332.style[prop]=_337[prop];
}
_332.innerHTML=html;
body.insertBefore(_332,body.firstChild);
_333=_332.firstChild,_334=_333.firstChild,td=_333.nextSibling.firstChild.firstChild;
this.doesNotAddBorder=(_334.offsetTop!==5);
this.doesAddBorderForTableAndCells=(td.offsetTop===5);
_333.style.overflow="hidden",_333.style.position="relative";
this.subtractsBorderForOverflowNotVisible=(_334.offsetTop===-5);
body.style.marginTop="1px";
this.doesNotIncludeMarginInBodyOffset=(body.offsetTop===0);
body.style.marginTop=_339;
body.removeChild(_332);
this.initialized=true;
},bodyOffset:function(body){
_5.offset.initialized||_5.offset.initialize();
var top=body.offsetTop,left=body.offsetLeft;
if(_5.offset.doesNotIncludeMarginInBodyOffset){
top+=parseInt(_5.curCSS(body,"marginTop",true),10)||0,left+=parseInt(_5.curCSS(body,"marginLeft",true),10)||0;
}
return {top:top,left:left};
}};
_5.fn.extend({position:function(){
var left=0,top=0,_340;
if(this[0]){
var _341=this.offsetParent(),_342=this.offset(),_343=/^body|html$/i.test(_341[0].tagName)?{top:0,left:0}:_341.offset();
_342.top-=num(this,"marginTop");
_342.left-=num(this,"marginLeft");
_343.top+=num(_341,"borderTopWidth");
_343.left+=num(_341,"borderLeftWidth");
_340={top:_342.top-_343.top,left:_342.left-_343.left};
}
return _340;
},offsetParent:function(){
var _344=this[0].offsetParent||document.body;
while(_344&&(!/^body|html$/i.test(_344.tagName)&&_5.css(_344,"position")=="static")){
_344=_344.offsetParent;
}
return _5(_344);
}});
_5.each(["Left","Top"],function(i,name){
var _347="scroll"+name;
_5.fn[_347]=function(val){
if(!this[0]){
return null;
}
return val!==_2?this.each(function(){
this==_1||this==document?_1.scrollTo(!i?val:_5(_1).scrollLeft(),i?val:_5(_1).scrollTop()):this[_347]=val;
}):this[0]==_1||this[0]==document?self[i?"pageYOffset":"pageXOffset"]||_5.boxModel&&document.documentElement[_347]||document.body[_347]:this[0][_347];
};
});
_5.each(["Height","Width"],function(i,name){
var tl=i?"Left":"Top",br=i?"Right":"Bottom";
_5.fn["inner"+name]=function(){
return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);
};
_5.fn["outer"+name]=function(_34d){
return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(_34d?num(this,"margin"+tl)+num(this,"margin"+br):0);
};
var type=name.toLowerCase();
_5.fn[type]=function(size){
return this[0]==_1?document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(document.documentElement["client"+name],document.body["scroll"+name],document.documentElement["scroll"+name],document.body["offset"+name],document.documentElement["offset"+name]):size===_2?(this.length?_5.css(this[0],type):null):this.css(type,typeof size==="string"?size:size+"px");
};
});
})();
if(typeof (Quill)=="undefined"){
Quill={};
}
Quill.toolbar={};
Quill.toolbar.settings={"bold":["-230px 0px;","Bold"],"italic":["-254px 0px","Italic"],"underline":["-282px 0px","Underline"],"fg_color":["-318px 0","Font Color"],"bg_color":["-424px 0","Background Color"]};
Quill.toolbar.defaultValues={"englishFonts":["Arial","Courier New","Georgia","Times New Roman","Verdana","Trebuchet MS","Lucida Sans"],"LangFonts":{"Bengali":"Vrinda","Gujarati":"Shruti","Hindi":"Mangal","Kannada":"Tunga","Malayalam":"Kartika","Marathi":"Mangal","Tamil":"Latha","Telugu":"Gautami","Punjabi":"Raavi","Nepali":"Mangal"},"fontSize_width":40,"font_width":60,"imagesPath":"http://server.quillpad.in/quillAPI/images","formatOptions":["bold","italic","underline","fontSize","font","align_left","align_right","align_center","listify","incIndent","decIndent","fg_color","bg_color"],"englishFonts":["Arial","Courier New","Georgia","Verdana","Trebuchet MS","Lucida Sans"],"fontSizeList":[12,14,16,18,24,32,48]};
Quill.toolbar.Button=function(id,_351,conf,_353){
this.init_=function(id,_355,_356){
this.id_=id;
this.active_=false;
var _357=conf.imagesPath?conf.imagesPath:Quill.toolbar.defaultValues.imagesPath;
this.element_=$("<a href=\"#\" style=\"float:left; cursor:pointer; width:26px; height:25px; display:inline-block\" id="+id+" title=\""+Quill.toolbar.settings[id][1]+"\"></a>",_356);
this.span_=$("<span style=\"border:1px solid #f1f1f1; background: transparent url("+_357+"/toolbar.gif) no-repeat 20px 20px;width:24px; height:25px; background-position:"+Quill.toolbar.settings[id][0]+"; display:inline-block; \"></span>",_356);
$(this.element_).append(this.span_);
$(this.element_).click(function(evt){
_355(evt);
evt.preventDefault();
});
var self=this;
$(this.element_).hover(function(){
self.set_hover(true);
},function(){
self.set_hover(false);
self.set_pressed(false);
});
$(this.element_).mousedown(function(){
self.set_pressed(true);
});
$(this.element_).mouseup(function(){
self.set_pressed(false);
});
this.color_="#000000";
this.hover_=false;
this.pressed_=false;
this.active_=false;
this.set_hover(false);
this.set_pressed(false);
this.set_active(false);
if(this.id_=="fg_color"){
this.set_bgcolor("#000000");
}else{
this.set_bgcolor("#FFFFFF");
}
};
this.update_color_=function(){
var c;
var b;
if(this.pressed_&&this.active_){
c="#B0EEEE";
b="1px solid #000000";
p="0px";
}else{
if(this.pressed_){
c="#E5E9F2";
b="1px solid #9EBCE4";
p="0px";
}else{
if(this.hover_&&this.active_){
c="#C5CEE4";
b="1px solid #729BD1";
p="0px";
}else{
if(this.hover_){
c="";
b="1px solid #729BD1";
p="0px";
}else{
if(this.active_){
c="#DDE1EB";
b="1px solid #729BD1";
p="0px";
}else{
c="";
b="1px solid #f1f1f1";
p="1px";
}
}
}
}
}
$(this.element_).css({"background":c});
$(this.span_).css({"border":b});
if(this.id_=="fg_color"){
if(this.color_==="none"){
this.color_="#000000";
}else{
if(this.color_===null){
this.color_="#000000";
}
}
$(this.element_).css({"background":this.color_});
}
if(this.id_=="bg_color"){
if(this.color_==="none"){
this.color_="#FFFFFF";
}else{
if(this.color_===null){
this.color_="#FFFFFF";
}
}
$(this.element_).css({"background":this.color_});
}
};
this.set_hover=function(flag){
this.hover_=flag;
this.update_color_();
};
this.set_pressed=function(flag){
this.pressed_=flag;
this.update_color_();
};
this.active=function(){
return this.active_;
};
this.set_active=function(flag){
this.active_=flag;
this.update_color_();
};
this.set_bgcolor=function(c){
this.color_=c;
this.update_color_();
};
this.toggle=function(){
this.set_active(!this.active_);
};
this.init_(id,_353,_351);
};
Quill.toolbar.ListBox=function(id,_361,_362,_363,_364){
this.init_=function(id,_366,_367,_368,_369){
this.id_=id;
this.label=_366;
this.item_groups=_367;
this.items=[];
this.wraper=$("<span style=\"padding:5px; float:left\"></span>",_368);
this.element_=$("<select id="+id+" style=\"font-size:10px\"></select>",_368);
$(this.wraper).append(this.element_);
for(var i=0;i<this.item_groups.length;i++){
var _36b=this.item_groups[i].list;
var _36c=$("<optgroup label="+this.item_groups[i].group+"></optgroup>",_368);
for(var j=0;j<_36b.length;j++){
var _36e=$("<option>"+_36b[j]+"</option>",_368);
this.items.push(_36b[j]);
$(_36c).append(_36e);
}
$(this.element_).append(_36c);
}
$(this.element_).change(_369);
};
this.set_value=function(val){
for(var i=0;i<this.items.length;++i){
if(this.items[i]==val){
this.element_[0].selectedIndex=i;
return;
}
}
this.element_[0].selectedIndex=-1;
};
this.init_(id,_361,_362,_363,_364);
};
Quill.toolbar.addFormatOptions=function(conf,_372,_373){
};
Quill.toolbar.colorPalette=function(_374){
this.visible=false;
this.init_=function(_375){
var _376=[["#ffffff","#ffcccc","#ffffcc","#99ff99","#ccffff"],["#cccccc","#ff6666","#ffff99","#66ff99","#66ffff"],["#cccccc","#ff0000","#ffff00","#33ff33","#33ccff"],["#000000","#cc0000","#ffcc00","#00cc00","#3366ff"]];
var _377=$("<tbody></tbody>");
var tr;
var self=this;
for(var j=0;j<_376.length;j++){
var _37b=_376[j];
tr=$("<tr></tr>");
for(var i=0;i<_37b.length;i++){
a=$("<a></a>").attr({"id":_37b[i],"href":"javascript:;","style":"display:block; width: 16px; border:1px solid white; height: 16px;"});
a.css({"backgroundColor":_37b[i]});
a.click(function(e){
if(self.cal_bak){
self.cal_bak(e.target.id);
}
self.show(false);
});
tr.append($("<td></td>").append(a));
}
_377.append(tr);
}
this.table=$("<table cellspacing=\"2\" cellpadding=\"1\" style=\"display: none; position: absolute; border: 1px solid #BFDCFC; font-size: 11px; background: white;\"></table>").append(_377);
var that=this;
_375.set_focus_callback(function(){
that.show(false);
});
};
this.show=function(show){
if(show){
this.table.show();
}else{
this.table.hide();
}
this.visible=show;
};
this.call_back=function(fun){
this.cal_bak=fun;
};
this.move_to=function(pos){
this.table.css(pos);
};
this.is_visible=function(){
return this.visible;
};
this.init_(_374);
};
Quill.toolbar.panel=function(id,doc,_384,conf){
this.font_list_box;
this.bold_button;
this.italic_button;
this.underline_button;
this.font_size_list_box;
this.align_left;
this.align_right;
this.align_center;
this.listify_button;
this.unlistify_button;
this.undo_button;
this.redo_button;
this.incIndent;
this.decIndent;
this.color_palette;
this.doc=doc;
this.panel=doc.getElementById(id+"_toolbar");
$(this.panel).css({"float":"left","width":"100%","padding":"0px","padding-top":"3px","padding-bottom":"3px"});
this.editor=_384;
this.id=id;
var _386=(conf.fullPanel||!conf.buttonList)?Quill.toolbar.defaultValues.formatOptions:conf.buttonList;
$(this.panel).append("<span style=\"float:left\">&nbsp</span>");
for(var i=0;i<_386.length;i++){
var self=this;
switch(_386[i]){
case "bold":
this.bold_button=new Quill.toolbar.Button("bold",this.doc,conf,function(){
self.bold_button.toggle();
self.editor.set_bold(self.bold_button.active());
self.editor.grab_focus();
});
$(this.panel).append(this.bold_button.element_);
break;
case "italic":
this.italic_button=new Quill.toolbar.Button("italic",this.doc,conf,function(){
self.italic_button.toggle();
self.editor.set_italic(self.italic_button.active());
self.editor.grab_focus();
});
$(this.panel).append(this.italic_button.element_);
break;
case "underline":
this.underline_button=new Quill.toolbar.Button("underline",this.doc,conf,function(){
self.underline_button.toggle();
self.editor.set_underline(self.underline_button.active());
self.editor.grab_focus();
});
$(this.panel).append(this.underline_button.element_);
break;
case "fontSize":
var _389=conf.fontSizeList?conf.fontSizeList:Quill.toolbar.defaultValues.fontSizeList;
var _38a=[{"group":"Font Size","list":_389}];
this.font_size_list_box=new Quill.toolbar.ListBox("fontSize","",_38a,this.doc,function(){
var size=self.font_size_list_box.element_.val();
self.editor.set_font_size(size);
var that=self;
setTimeout("$(this).focus();",0);
setTimeout(function(){
that.editor.grab_focus();
},0);
});
$(this.panel).append(this.font_size_list_box.wraper);
break;
case "font":
var _38d=conf.englishFonts?conf.englishFonts:Quill.toolbar.defaultValues.englishFonts;
var _38e=[{"group":"Languages","list":conf.languageList},{"group":"English","list":_38d}];
this.font_list_box=new Quill.toolbar.ListBox("font","",_38e,this.doc,function(){
var lang=self.font_list_box.element_.val();
var _390=Quill.toolbar.defaultValues["LangFonts"][lang];
if(!_390){
_390=lang;
lang="English";
}
self.editor.set_lang(lang.toLowerCase());
self.editor.set_font_name(_390);
var that=self;
setTimeout("$(this).focus();",0);
setTimeout(function(){
that.editor.grab_focus();
},0);
});
$(this.panel).append(this.font_list_box.wraper);
break;
case "fg_color":
if(!this.color_palette){
this.color_palette=new Quill.toolbar.colorPalette(this.editor);
}
this.fg_color_button=new Quill.toolbar.Button("fg_color",this.doc,conf,function(){
if(self.color_palette.is_visible()){
self.color_palette.show(false);
return;
}
var pos={"top":0,"left":0};
var off=$(self.fg_color_button.element_).offset();
pos["top"]=off.top+$(self.fg_color_button.element_).height()+2;
pos.left=off.left;
self.color_palette.move_to(pos);
var that=self;
self.color_palette.call_back(function(c){
that.editor.set_color(c);
that.fg_color_button.set_bgcolor(c);
that.editor.grab_focus();
});
self.color_palette.show(true);
});
$(document.body).append(this.color_palette.table);
$(this.panel).append("<span style=\"float:left\">&nbsp</span>");
$(this.panel).append(this.fg_color_button.element_);
break;
case "bg_color":
if(!this.color_palette){
this.color_palette=new Quill.toolbar.colorPalette(this.editor);
}
this.bg_color_button=new Quill.toolbar.Button("bg_color",this.doc,conf,function(){
if(self.color_palette.is_visible()){
self.color_palette.show(false);
return;
}
var pos={"top":0,"left":0};
var off=$(self.bg_color_button.element_).offset();
pos["top"]=off.top+$(self.bg_color_button.element_).height()+2;
pos.left=off.left;
self.color_palette.move_to(pos);
var that=self;
self.color_palette.call_back(function(c){
that.editor.set_bg_color(c);
that.bg_color_button.set_bgcolor(c);
that.editor.grab_focus();
});
self.color_palette.show(true);
});
$(document.body).append(this.color_palette.table);
$(this.panel).append("<span style=\"float:left\">&nbsp</span>");
$(this.panel).append(this.bg_color_button.element_);
break;
}
}
var ifr=doc.getElementById(id);
var _39b=doc.getElementById(id+"_container");
var _39c=doc.getElementById(id+"_footer");
var _39d=$(_39b).height()-$(this.panel).height()-$(_39c).height()-3-5;
if($.browser.msie&&$.browser.version.match("^6")){
_39d=$(_39b).height()-$(this.panel).height()-3-5-41;
}
$(ifr).css({"height":_39d+"px"});
this.toggle_indent=function(left,_39f,_3a0){
if(this.align_left){
this.align_left.set_active(left);
}
if(this.align_center){
this.align_center.set_active(_39f);
}
if(this.align_right){
this.align_right.set_active(_3a0);
}
};
this.update_panel=function(){
var a=this.editor.get_selection_item_attributes();
if(a==null){
a=this.editor.get_new_item_attributes();
}
if(this.font_list_box){
if(a.lang==null||a.font_name==null){
this.font_list_box.set_value("");
}else{
if(a.lang=="english"){
this.font_list_box.set_value(a.font_name);
}else{
this.font_list_box.set_value(a.lang.charAt(0).toUpperCase()+a.lang.substr(1).toLowerCase());
}
}
}
if(this.font_size_list_box){
this.font_size_list_box.set_value(a.font_size);
}
if(this.bold_button){
this.bold_button.set_active(a.bold==true);
}
if(this.italic_button){
this.italic_button.set_active(a.italic==true);
}
if(this.underline_button){
this.underline_button.set_active(a.underline==true);
}
if(this.fg_color_button){
this.fg_color_button.set_bgcolor(a.color);
}
if(this.bg_color_button){
this.bg_color_button.set_bgcolor(a.bg_color);
}
var b=this.editor.get_line_attributes();
if(this.align_left){
this.align_left.set_active(b.align=="QAlign.LEFT");
}
if(this.align_center){
this.align_center.set_active(b.align=="QAlign.CENTER");
}
if(this.align_right){
this.align_right.set_active(b.align=="QAlign.RIGHT");
}
if(this.listify_button){
this.listify_button.set_active(b.type=="QLineType.BULLET");
}
};
};
if(typeof (Quill)=="undefined"){
Quill={};
}
Quill.objects={};
Quill.init=function(id,key,conf){
Quill.key=key;
if(!Quill.lang){
Quill.lib.getLangList(id,conf,Quill.start_init);
}else{
Quill.start_init(id,Quill.lang,key,conf);
}
};
Quill.start_init=function(id,lang,key,conf){
Quill.key=key;
var ta=document.getElementById(id);
var _3ab=ta.offsetWidth;
var _3ac=ta.offsetHeight;
var _3ad=$(ta).offset();
var top=_3ad.top;
var left=_3ad.left;
var _3b0=$(ta).attr("type")!=="text";
var _3b1=_3b0?5:0;
var uid="Quill"+id;
var _3b3=$("<div id="+uid+"_container>  </div>",ta.ownerDocument);
$(_3b3).css({"width":_3ab+"px","height":_3ac+"px","border":"1px solid #7f9db9","background-color":"white"});
var _3b4=$("<iframe id="+uid+" frameborder=0 maringwidth=0 maringheight=0 scrolling='auto'>  </iframe>",ta.ownerDocument);
if(_3b0){
_3b4.css({"width":_3ab-_3b1+"px","height":_3ac+"px","overflow":"auto","padding-left":_3b1+"px"});
}else{
_3b4.css({"width":_3ab-_3b1+"px","height":_3ac+"px","padding-left":_3b1+"px"});
}
if(!_3b0){
conf.showFormatPanel=false;
}
if(conf&&conf.showFormatPanel){
var _3b5=$("<div id="+uid+"_toolbar style='background-color:#f1f1f1; padding:2px; border-bottom:1px solid #cccccc;'></div>");
$(_3b3).append(_3b5);
}
$(_3b3).append(_3b4);
var _3b6=0;
if(_3b0){
var _3b7=$("<div id=\""+uid+"_footer\" style=\"height:14px;line-height:11px;font-size:10px;font-family:Arial, sans-serif;background-color:#f1f1f1;border-top:1px solid #cccccc\"><span style=\"float:right;padding:1px\"><a target=_blank href=\"http://quillpad.in\">Powered by Quillpad</a></span></div>");
$(_3b3).append(_3b7);
_3b6=$(_3b7).height();
}
var vari=0;
if($.browser.mozilla){
vari=2;
}
$(ta).after(_3b3);
$(ta).css({"display":"none"});
var h=$(_3b3).height()-_3b6-vari;
var ifr=ta.ownerDocument.getElementById(uid);
$(ifr).css({"height":h+"px"});
_3b4[0].contentWindow.setTimeout(function(){
var doc=_3b4[0].contentWindow.document;
var _3bc=$("body",doc);
if(_3b0){
_3bc.html("<div style='width:99%; height:99%; outline-style:none' tabindex='-1' id="+uid+"_div></div>",doc);
_3bc.css({"margin":"0px"});
}else{
_3bc.html("<div style='width:99%; height:99%; outline-style:none; white-space:nowrap;' tabindex='-1' id="+uid+"_div></div>",doc);
_3bc.css({"margin":"0px","overflow-x":"hidden","overflow-y":"hidden"});
}
var ed=new Quill.do_init(uid,lang,null,left,top,ta.ownerDocument,conf);
var ta1=_3b4[0].contentWindow.document.createElement("TEXTAREA");
ta1.setAttribute("id","paste");
ta1.style.display="none";
ta1.style.position="absolute";
ta1.style.overflow="hidden";
ta1.style.top="1px";
ta1.style.left="30px";
ta1.style.height="1px";
ta1.style.width="1px";
ta1.style.backgroundColor="#ffffff";
ta1.style.border="0px #ffffff";
_3b4[0].contentWindow.document.body.appendChild(ta1);
if(!_3b0){
ed.editor_.SPACE_CHAR="\xa0";
}
Quill.objects[uid]=ed;
},0);
};
Quill.update_ui_state=function(id){
var _3c0=Quill.objects[id].toolbar_;
if(_3c0){
_3c0.update_panel();
}
};
Quill.keycode_name=function(_3c1){
var name=null;
if(_3c1==37){
name="left";
}else{
if(_3c1==39){
name="right";
}else{
if(_3c1==38){
name="up";
}else{
if(_3c1==40){
name="down";
}else{
if(_3c1==36){
name="home";
}else{
if(_3c1==35){
name="end";
}else{
if(_3c1==33){
name="pageup";
}else{
if(_3c1==34){
name="pagedown";
}else{
if(_3c1==46){
name="delete";
}else{
if(_3c1==8){
name="backspace";
}else{
if(_3c1==13){
name="enter";
}else{
if(_3c1==9){
name="tab";
}
}
}
}
}
}
}
}
}
}
}
}
return name;
};
Quill.handle_key_code=function(id,_3c4,_3c5,_3c6,_3c7,_3c8){
var _3c9=Quill.objects[id].editor_;
if(_3c6||_3c7||_3c8){
return false;
}
var name=Quill.keycode_name(_3c4);
if(name==null){
return false;
}
switch(name){
case "left":
_3c9.move_left(_3c5);
break;
case "right":
_3c9.move_right(_3c5);
break;
case "home":
_3c9.move_home(_3c5);
break;
case "end":
_3c9.move_end(_3c5);
break;
case "up":
_3c9.move_up(_3c5);
break;
case "down":
_3c9.move_down(_3c5);
break;
case "pageup":
for(var i=0;i<10;++i){
_3c9.move_up(_3c5);
}
break;
case "pagedown":
for(var i=0;i<10;++i){
_3c9.move_down(_3c5);
}
break;
case "delete":
_3c9.key_delete();
break;
case "backspace":
_3c9.key_backspace();
break;
case "enter":
_3c9.key_enter();
break;
case "tab":
_3c9.key_tab();
break;
default:
Quill.lib.assert(false);
}
return true;
};
Quill.handle_key_char=function(id,_3cd,_3ce,_3cf,_3d0,_3d1){
var _3d2=Quill.objects[id].editor_;
var _3d3={"z":_3d2.undo,"y":_3d2.redo,"v":_3d2.paste,"x":_3d2.internal_cut,"c":_3d2.internal_copy,"a":_3d2.select_all};
var ch=String.fromCharCode(_3cd);
var lch=ch.toLowerCase();
var _3d6=_3d3[lch];
if((_3cf||_3d1)&&(!_3d0)&&(_3d6)){
_3d6.call(_3d2);
if((lch=="z")||(lch=="y")||(lch=="a")){
return true;
}
}
if(_3cf||_3d0||_3d1){
return false;
}
if(_3cd==32){
_3d2.key_space(ch);
}else{
if((_3cd>=65)&&(_3cd<65+26)){
_3d2.key_xlit_char(ch);
}else{
if((_3cd>=97)&&(_3cd<97+26)){
_3d2.key_xlit_char(ch);
}else{
_3d2.key_simple_char(ch);
}
}
}
return true;
};
Quill.do_init=function(id,lang,_3d9,_3da,_3db,_3dc,conf){
popup_doc=_3dc;
this.id_=id;
var that=this;
this.on_popup_choice=function(){
that.editor_.grab_focus();
that.editor_.move_right();
};
this.editor_popup_=new QuillPopup(popup_doc,this.on_popup_choice);
this.editor_popup_.set_offset(_3da,_3db);
var ifr=_3dc.getElementById(this.id_);
var te=$(ifr).offset();
var doc=ifr.contentDocument?ifr.contentDocument:ifr.contentWindow.document;
this.editor_root_=doc.getElementById(this.id_+"_div");
if(conf){
if(typeof (lang)==="string"){
conf.languageList=[lang.charAt(0).toUpperCase()+lang.substr(1).toLowerCase()];
}else{
lang1=lang[0].charAt(0).toUpperCase()+lang[0].substr(1).toLowerCase();
conf.languageList=[lang1];
lang=lang1;
}
}
this.editor_=new QuillEditor(doc,this.editor_root_,this.editor_popup_,lang,ifr.contentWindow);
this.editor_.find_xy=function(){
var ifr=_3dc.getElementById(that.id_);
var te=$(ifr).offset();
return te;
};
this.editor_.set_textarea_update_callback(function(){
$("#"+that.id_.substring(5),_3dc).attr("value",that.editor_.get_language_text());
});
this.dragging_=false;
var that=this;
var tb;
if(conf&&conf.showFormatPanel){
tb=new Quill.toolbar.panel(this.id_,_3dc,this.editor_,conf);
}
this.toolbar_=tb;
ifr.contentWindow.setInterval(function(){
if(typeof (Quill)!="undefined"){
var ed=Quill.objects[that.id_].editor_;
if(ed){
ed.toggle_caret_blink();
}
}
},500);
this.focus_listener=this.editor_root_;
if($.browser.safari){
$(this.focus_listener).click(function(e){
that.editor_.set_has_focus(true);
});
}else{
$(this.focus_listener).focus(function(e){
that.editor_.set_has_focus(true);
});
}
$(this.focus_listener).blur(function(e){
that.editor_.set_has_focus(false);
});
$(ifr.contentWindow).resize(function(e){
that.editor_.update_on_resize();
});
$(this.focus_listener).change(function(e){
});
$(this.editor_root_).mousedown(function(e){
that.editor_.grab_focus();
if(that.dragging_){
return;
}
that.dragging_=true;
var then=that;
$(that.editor_root_).mousemove(function(e){
then.editor_.move_caret_to_xy(e.pageX,e.pageY,true);
Quill.update_ui_state(then.id_);
});
that.editor_.move_caret_to_xy(e.pageX,e.pageY,false);
Quill.update_ui_state(that.id_);
});
$(that.editor_root_).mouseup(function(e){
that.dragging_=false;
$(that.editor_root_).unbind("mousemove");
});
$(this.focus_listener).keypress(function(e){
var _3f0=false;
if(e.which>=32){
if((!(doc.parentWindow&&doc.parentWindow.event))||(!e.ctrlKey)){
_3f0=Quill.handle_key_char(that.id_,e.which,e.shiftKey,e.ctrlKey,e.altKey,e.metaKey);
}
}else{
if((!(doc.parentWindow&&doc.parentWindow.event))&&((e.which==0)||(e.which==8)||(e.which==13))){
_3f0=Quill.handle_key_code(that.id_,e.keyCode,e.shiftKey,e.ctrlKey,e.altKey,e.metaKey);
}
}
if(_3f0){
e.preventDefault();
Quill.update_ui_state(that.id_);
}
});
$(this.focus_listener).keydown(function(e){
var _3f2;
if(!(doc.parentWindow&&doc.parentWindow.event)){
return;
}
_3f2=Quill.handle_key_code(that.id_,e.keyCode,e.shiftKey,e.ctrlKey,e.altKey,e.metaKey);
if((!_3f2)&&e.ctrlKey&&(e.keyCode>=32)){
_3f2=Quill.handle_key_char(that.id_,e.keyCode,e.shiftKey,e.ctrlKey,e.altKey,e.metaKey);
}
if(_3f2){
e.preventDefault();
Quill.update_ui_state(that.id_);
}
});
if($.browser.msie){
$(this.editor_root_).bind("selectstart",function(e){
var src=e.target.id;
if(src!=="paste"){
e.preventDefault();
}
});
}else{
$(this.editor_root_).mousedown(function(e){
e.preventDefault();
});
}
};
Quill.getText=function(key){
if(Quill.getObject(key)){
return Quill.getObject(key).editor_.get_language_text();
}else{
setTimeout(function(){
Quill.getText(key);
},200);
}
};
Quill.getObject=function(key){
if(Quill.objects.hasOwnProperty("Quill"+key)){
return this.objects["Quill"+key];
}
};
Quill.show=function(key,show){
if(Quill.getObject(key)){
if(show){
$("#"+key).hide();
$("#Quill"+key+"_container").show();
}else{
$("#"+key).show();
$("#Quill"+key+"_container").hide();
}
}else{
setTimeout(function(){
Quill.show(key,show);
},200);
}
};
if(typeof (Quill)=="undefined"){
Quill={};
}
Quill.lib={};
Quill.lib.assert=function(cond,msg){
if(!cond){
alert("assertion failed: "+msg);
}
};
Quill.lib.parent_index=function(node){
Quill.lib.assert(node.parentNode,"no parent");
var _3fd=node.parentNode;
var i=0;
while(i<_3fd.childNodes.length){
if(_3fd.childNodes[i]===node){
return i;
}
++i;
}
Quill.lib.assert(false);
};
Quill.lib.unique_id=function(doc,_400){
var id;
do{
id=Math.floor(Math.random()*10000);
}while(document.getElementById(_400+id)!==null);
return id;
};
Quill.lib.node_path_string=function(node){
if(!node.parentNode){
return node.nodeName;
}else{
return Quill.lib.node_path_string(node.parentNode)+"->"+node.nodeName;
}
};
Quill.lib.bind_this=function(obj,func){
return function(){
return func.apply(obj,arguments);
};
};
Quill.lib.Logger=function(_405){
var _406=document.getElementById(_405);
var win=_406.contentWindow;
var doc=win.document;
var body=doc.getElementsByTagName("body")[0];
this.print=function(msg){
var node=doc.createElement("tt");
var text=doc.createTextNode(msg);
node.appendChild(text);
var div=doc.createElement("div");
div.appendChild(node);
body.appendChild(div);
div.scrollIntoView();
};
this.clear=function(){
while(body.lastChild!==null){
body.removeChild(body.lastChild);
}
};
};
Quill.lib.add_script_request=function(url){
var head=document.getElementsByTagName("head")[0];
var _410=Quill.lib.unique_id(document,"scr");
var _411=document.createElement("script");
_411.setAttribute("type","text/javascript");
_411.setAttribute("id","scr"+_410);
_411.setAttribute("src",url);
head.appendChild(_411);
return _410;
};
Quill.lib.remove_script_request=function(id){
var head=document.getElementsByTagName("head")[0];
var _414=document.getElementById("scr"+id);
head.removeChild(_414);
};
Quill.lib.Cache=new function(){
this.cache={};
this.supported_langs={};
var _415=["bengali","gujarati","hindi","kannada","malayalam","marathi","tamil","telugu","english","punjabi","nepali"];
for(var i=0;i<_415.length;i++){
this.cache[_415[i]]={};
this.supported_langs[_415[i]]=1;
}
};
Quill.lib.add_to_cache=function(lang,eng,data,c){
if(c.supported_langs[lang]){
c.cache[lang][eng]=data;
}
};
Quill.lib.check_cache=function(lang,eng,c){
var data;
if(c.supported_langs[lang]){
data=c.cache[lang][eng];
}
if(data){
return data;
}
return null;
};
Quill.lib._quill_request_next_id=0;
Quill.lib._quill_requests=new Object();
Quill.lib._quill_callback=function(data,id){
function work(){
var qr=Quill.lib._quill_requests["qr"+id];
if(qr){
qr.on_response(data);
}
}
setTimeout(work,0);
};
Quill.lib.quill_url=function(lang,_423,_424,id){
return "http://quillpad.in/quillpad_backend2/processAPIWord"+"?lang="+lang+"&inString="+_423+"&callback="+_424+"&scid="+id+"&key="+Quill.key;
};
Quill.lib.QuillRequest=function(lang,_427,_428){
var _429=Quill.lib.check_cache(lang,_427,Quill.lib.Cache);
var _42a=false;
var _42b=Quill.lib._quill_request_next_id++;
Quill.lib._quill_requests["qr"+_42b]=this;
if(_429){
_42a=true;
Quill.lib._quill_callback(_429,_42b);
}else{
var url=Quill.lib.quill_url(lang,_427,"Quill.lib._quill_callback",_42b);
var _42d=Quill.lib.add_script_request(url);
}
function cleanup(){
if(!_42a){
Quill.lib.remove_script_request(_42d);
}
delete Quill.lib._quill_requests["qr"+_42b];
}
this.on_response=function(data){
cleanup();
if(!_42a){
Quill.lib.add_to_cache(lang,_427,data,Quill.lib.Cache);
}
_428(data.twords[0].options,data.itrans);
};
this.cancel=function(){
cleanup();
};
};
Quill.lib.colorstring_to_rgb=function(_42f){
var _430=[];
if(_42f.charAt(0)==="#"){
var rgb=_42f.slice(1);
for(var i=0;i<rgb.length;i+=2){
var _433=rgb.slice(i,i+2);
_430.push(Number("0x"+_433));
}
}else{
if(_42f.slice(0,3)==="rgb"){
var _434=_42f.match(/[0-9]+/g);
for(var i=0;i<_434.length;++i){
_430.push(parseInt(_434[i],10));
}
}else{
_430=[255,255,255];
}
}
return _430;
};
Quill.lib.blend=function(_435,_436,_437){
var _438=Quill.lib.colorstring_to_rgb(_435);
var _439=Quill.lib.colorstring_to_rgb(_436);
var rgb=[];
for(var i=0;i<_438.length;++i){
var col=parseInt(_439[i]*_437+_438[i]*(1-_437),10);
rgb.push(col>255?255:col);
}
return "rgb("+rgb[0]+","+rgb[1]+","+rgb[2]+")";
};
Quill.lib.gotlang=function(lang,id){
function work2(){
var qr=Quill.lib._quill_requests["lang"+id];
if(qr){
if(lang.indexOf("Error")==-1){
Quill.lang=lang.split(",");
Quill.start_init(qr.id,Quill.lang,Quill.key,qr.conf);
}else{
}
}
delete Quill.lib._quill_requests["lang"+id];
}
setTimeout(work2,0);
};
Quill.lib.getLangList=function(id,conf,_442){
var _443=Quill.lib._quill_request_next_id++;
var url="http://quillpad.in/quillpad_backend2/GetAPILang?key="+Quill.key+"&callback=Quill.lib.gotlang&id="+_443;
Quill.lib._quill_requests["lang"+_443]=new function(){
this.id=id;
this.conf=conf;
this.on_response=function(data){
if(data.indexOf("Error")!=-1){
lang=data.split(",");
_442(id,lang,Quill.key,conf);
}
};
};
var _446=Quill.lib.add_script_request(url);
};
var Total_time=0;
var Total_count=0;
var SPACE_CHAR=" ";
var SPACE_CHAR=$.browser.msie?"\xa0":" ";
var SPACE_CHAR="\xa0";
var NBSP_CHAR="\xa0";
function reset_count(){
Total_time=0;
Total_count=0;
}
function QRect(x,y,_449,_44a){
this.left_=x;
this.top_=y;
this.right_=x+_449;
this.bottom_=y+_44a;
this.left=function(){
return this.left_;
};
this.top=function(){
return this.top_;
};
this.right=function(){
return this.right_;
};
this.bottom=function(){
return this.bottom_;
};
this.width=function(){
return this.right_-this.left_;
};
this.height=function(){
return this.bottom_-this.top_;
};
this.contains=function(x,y){
if(x<this.left_){
return false;
}
if(x>this.right_){
return false;
}
if(y<this.top_){
return false;
}
if(y>this.bottom_){
return false;
}
return true;
};
this.equals=function(rect){
if(this.left()!=rect.left()){
return false;
}
if(this.top()!=rect.left()){
return false;
}
if(this.right()!=rect.right()){
return false;
}
if(this.bottom()!=rect.bottom()){
return false;
}
return true;
};
this.above=function(rect){
return (this.bottom()<=rect.top());
};
this.below=function(rect){
return (this.top()>=rect.bottom());
};
this.y_distance=function(y){
if(y<=this.top_){
return this.top_-y;
}
if(y>=this.bottom_){
return y-this.bottom_;
}
return 0;
};
this.x_distance=function(x){
if(x<=this.left_){
return this.left_-x;
}
if(x>=this.right_){
return x-this.right_;
}
return 0;
};
}
var _get_rect_counter=0;
var _element_offsets={};
function refresh_get_rect(){
++_get_rect_counter;
_element_offsets={};
}
function QNode(){
this.get_rect_buggy=function(){
var x=0;
var y=0;
var e=this.element();
var w=e.offsetWidth;
var h=e.offsetHeight;
while(e!=null){
x+=e.offsetLeft;
y+=e.offsetTop;
e=e.offsetParent;
}
return new QRect(x,y,w,h);
};
this.last_get_rect_counter=-1;
this.get_scroll=function(win,doc){
var _459=0;
if(typeof (win.pageYOffset)=="number"){
_459=win.pageYOffset;
}else{
if(doc.body&&(doc.body.scrollLeft||doc.body.scrollTop)){
_459=doc.body.scrollTop;
}else{
if(doc.documentElement&&(doc.documentElement.scrollLeft||doc.documentElement.scrollTop)){
_459=doc.documentElement.scrollTop;
}
}
}
return _459;
};
this.my_offset=function(ele,doc){
var _45c=self;
if($.browser.mozilla){
self=doc.defaultView;
}
var t=$(ele).offset();
if($.browser.mozilla){
self=_45c;
}
return t;
};
this.get_rect=function(){
if(this.last_get_rect_counter==_get_rect_counter){
return this.saved_get_rect;
}
var _45e=this.element();
var _45f=this.my_offset(_45e,this.ctx_.html_doc);
var left=_45f.left;
var top=_45f.top;
var _462=_45e.offsetWidth;
var _463=_45e.offsetHeight;
var _464=new QRect(left,top,_462,_463);
this.saved_get_rect=_464;
this.last_get_rect_counter=_get_rect_counter;
return _464;
};
}
function QDocContext(_465,root){
this.init_=function(_467,root){
this.html_doc=_467;
this.root=root;
this.doc=new QDoc(this);
this.xlit_update_callback_=[];
this.textarea_update_callback_=null;
};
this.add_xlit_update_callback=function(cb){
this.xlit_update_callback_.push(cb);
};
this.on_xlit_update=function(){
for(var i=0;i<this.xlit_update_callback_.length;i++){
this.xlit_update_callback_[i]();
}
};
this.new_element=function(tag){
return this.html_doc.createElement(tag);
};
this.new_text_node=function(text){
return this.html_doc.createTextNode(text);
};
this.new_line=function(type,_46e){
return new QLine(this,type,_46e);
};
this.new_text_item=function(s){
return new QTextItem(this,s);
};
this.new_xlit_item=function(){
return new QXlitItem(this);
};
this.init_(_465,root);
}
function QDoc(ctx){
this.init_=function(ctx){
this.ctx_=ctx;
this.element_=ctx.root;
this.lines_=[];
};
this.element=function(){
return this.element_;
};
this.line_count=function(){
return this.lines_.length;
};
this.line=function(i){
Quill.lib.assert((i>=0)&&(i<this.line_count()));
return this.lines_[i];
};
this.line_index=function(line){
var n=this.line_count();
for(var i=0;i<n;++i){
if(this.lines_[i]===line){
return i;
}
}
return -1;
};
this.insert_line=function(i,line){
Quill.lib.assert((i>=0)&&(i<=this.line_count()));
var _478=null;
if(i<this.line_count()){
_478=this.lines_[i].element();
}
this.element_.insertBefore(line.element(),_478);
this.lines_.splice(i,0,line);
line.set_parent(this);
};
this.append_line=function(line){
this.insert_line(this.line_count(),line);
};
this.remove_line_at=function(i){
Quill.lib.assert((i>=0)&&(i<this.line_count()));
var line=this.lines_[i];
this.lines_.splice(i,1);
this.element_.removeChild(line.element());
line.set_parent(null);
return line;
};
this.remove_line=function(line){
return this.remove_line_at(this.line_index(line));
};
this.begin=function(){
return new QCursor(this,0,0,0);
};
this.end=function(){
var _47d=this.line_count()-1;
var line=this.line(_47d);
var _47f=line.item_count()-1;
return new QCursor(this,_47d,_47f,0);
};
this.init_(ctx);
}
var QLineType={SIMPLE:"QLineType.SIMPLE",BULLET:"QLineType.BULLET"};
var QAlign={LEFT:"QAlign.LEFT",CENTER:"QAlign.CENTER",RIGHT:"QAlign.RIGHT"};
function QLineAttributes(type,_481,_482){
this.type=type;
this.level=_481;
this.align=_482;
this.merge=function(a){
if((this.type!=null)&&(this.type!=a.type)){
this.type=null;
}
if((this.level!=null)&&(this.level!=a.level)){
this.level=null;
}
if((this.align!=null)&&(this.align!=a.align)){
this.align=null;
}
};
}
function QLine(ctx,type,_486){
this.init_=function(ctx,type,_489){
this.ctx_=ctx;
this.parent_=null;
this.type_=type;
this.level_=_489;
this.align_=QAlign.LEFT;
this.items_=[];
this.init_elements_();
QNode.call(this);
this.set_align(this.align_);
};
this.make_core_elements_=function(){
var _48a,_48b;
if(this.type_==QLineType.SIMPLE){
_48a=this.ctx_.new_element("div");
_48b=_48a;
}else{
var ul=this.ctx_.new_element("ul");
_48a=ul;
ul.style.marginTop="0";
ul.style.marginBottom="0";
_48b=this.ctx_.new_element("li");
ul.appendChild(_48b);
}
_48a.style.marginLeft=""+(2*this.level_)+"em";
var _48d=$(this.ctx_.root).css("white-space");
if($.browser.msie){
_48a.style.wordWrap="break-word";
}else{
_48a.style.whiteSpace=_48d;
}
return {"e_child":_48a,"c_parent":_48b};
};
this.init_elements_=function(){
var core=this.make_core_elements_();
this.element_=this.ctx_.new_element("span");
this.element_.appendChild(core.e_child);
this.container_=this.ctx_.new_element("span");
core.c_parent.appendChild(this.container_);
};
this.reinit_elements_=function(){
var core=this.make_core_elements_();
this.container_.parentNode.removeChild(this.container_);
core.c_parent.appendChild(this.container_);
this.element_.replaceChild(core.e_child,this.element_.firstChild);
this.set_align(this.align_);
};
this.element=function(){
return this.element_;
};
this.parent=function(){
return this.parent_;
};
this.set_parent=function(p){
this.parent_=p;
};
this.type=function(){
return this.type_;
};
this.level=function(){
return this.level_;
};
this.set_type_and_level=function(type,_492){
this.type_=type;
this.level_=_492;
this.reinit_elements_();
};
this.align=function(){
return this.align_;
};
this.set_align=function(a){
this.align_=a;
var v;
if(a==QAlign.LEFT){
v="left";
}else{
if(a==QAlign.CENTER){
v="center";
}else{
if(a==QAlign.RIGHT){
v="right";
}else{
Quill.lib.assert(false,"invalid alignment: "+a);
}
}
}
this.element_.firstChild.style.textAlign=v;
};
this.get_attributes=function(){
return new QLineAttributes(this.type_,this.level_,this.align_);
};
this.set_attributes=function(a){
if((a.type!=null)||(a.level!=null)){
var _496=(a.type!=null)?a.type:this.type();
var _497=(a.level!=null)?a.level:this.level();
this.set_type_and_level(_496,_497);
}
if(a.align!=null){
this.set_align(a.align);
}
};
this.item_count=function(){
return this.items_.length;
};
this.item=function(i){
Quill.lib.assert((i>=0)&&(i<this.item_count()));
return this.items_[i];
};
this.item_index=function(item){
var n=this.item_count();
for(var i=0;i<n;++i){
if(this.items_[i]===item){
return i;
}
}
return -1;
};
this.insert_item=function(i,item){
Quill.lib.assert((i>=0)&&(i<=this.item_count()));
var _49e=null;
if(i<this.item_count()){
_49e=this.items_[i].element();
}
this.container_.insertBefore(item.element(),_49e);
this.items_.splice(i,0,item);
item.set_parent(this);
};
this.append_item=function(item){
this.insert_item(this.item_count(),item);
};
this.remove_item_at=function(i){
Quill.lib.assert((i>=0)&&(i<this.item_count()));
var item=this.items_[i];
this.items_.splice(i,1);
this.container_.removeChild(item.element());
item.set_parent(null);
return item;
};
this.remove_item=function(item){
return this.remove_item_at(this.item_index(item));
};
this.init_(ctx,type,_486);
}
function QItemAttributes(lang,_4a4,_4a5,bold,_4a7,_4a8,_4a9,_4aa){
this.lang=lang;
this.font_name=_4a4;
this.font_size=_4a5;
this.bold=bold;
this.italic=_4a7;
this.underline=_4a8;
this.color=_4a9;
this.bg_color=_4aa;
this.merge=function(a){
if((this.lang!=null)&&(this.lang!=a.lang)){
this.lang=null;
}
if((this.font_name!=null)&&(this.font_name!=a.font_name)){
this.font_name=null;
}
if((this.font_size!=null)&&(this.font_size!=a.font_size)){
this.font_size=null;
}
if((this.bold!=null)&&(this.bold!=a.bold)){
this.bold=null;
}
if((this.italic!=null)&&(this.italic!=a.italic)){
this.italic=null;
}
if((this.underline!=null)&&(this.underline!=a.underline)){
this.underline=null;
}
if((this.underline!=null)&&(this.underline!=a.underline)){
this.underline=null;
}
if((this.color!=null)&&(this.color!=a.color)){
this.color=null;
}
if((this.bg_color!=null)&&(this.bg_color!=a.bg_color)){
this.bg_color=null;
}
};
this.set_lang=function(s){
this.lang=s;
};
this.set_font_name=function(v){
this.font_name=v;
};
this.set_font_size=function(v){
this.font_size=v;
};
this.set_bold=function(flag){
this.bold=flag;
};
this.set_italic=function(flag){
this.italic=flag;
};
this.set_underline=function(flag){
this.underline=flag;
};
this.set_color=function(_4b2){
this.color=_4b2;
};
this.set_bg_color=function(_4b3){
this.bg_color=_4b3;
};
}
function QFormat(){
this.lang_="";
this.font_name_="";
this.font_size_=12;
this.bold_=false;
this.italic_=false;
this.underline_=false;
this.color_="#000000";
this.bg_color_="#FFFFFF";
this.selection_color_=null;
this.lang=function(){
return this.lang_;
};
this.font_name=function(){
return this.font_name_;
};
this.font_size=function(){
return this.font_size_;
};
this.bold=function(){
return this.bold_;
};
this.italic=function(){
return this.italic_;
};
this.underline=function(){
return this.underline_;
};
this.color=function(){
return this.color_;
};
this.bg_color=function(){
return this.bg_color_;
};
this.selection_color=function(){
return this.selection_color_;
};
this.set_lang=function(s){
this.lang_=s;
};
this.set_font_name=function(fn){
this.font_name_=fn;
this.element().style.fontFamily=this.font_name_;
};
this.set_font_size=function(fs){
this.font_size_=fs;
this.element().style.fontSize=""+this.font_size_+"pt";
};
this.set_bold=function(flag){
this.bold_=flag;
this.element().style.fontWeight=this.bold_?"bold":"normal";
};
this.set_italic=function(flag){
this.italic_=flag;
this.element().style.fontStyle=this.italic_?"italic":"normal";
};
this.set_underline=function(flag){
this.underline_=flag;
this.element().style.textDecoration=this.underline_?"underline":"none";
};
this.update_color_=function(){
var c=(this.selection_color_==null)?this.color_:Quill.lib.blend(this.color_,this.selection_color_,0.35);
this.element().style.color=c;
};
this.update_background_=function(){
var c=(this.selection_color_==null)?this.bg_color_:Quill.lib.blend(this.bg_color_,this.selection_color_,0.35);
this.element().style.backgroundColor=c;
};
this.set_color=function(v){
this.color_=v;
this.update_color_();
};
this.set_bg_color=function(v){
this.bg_color_=v;
this.update_background_();
};
this.set_selection_color=function(v){
this.selection_color_=v;
this.update_color_();
this.update_background_();
};
this.set_font_size(this.font_size_);
this.get_attributes=function(){
return new QItemAttributes(this.lang_,this.font_name_,this.font_size_,this.bold_,this.italic_,this.underline_,this.color_,this.bg_color_);
};
this.set_attributes=function(a){
if(a.lang!=null){
this.set_lang(a.lang);
}
if(a.font_name!=null){
this.set_font_name(a.font_name);
}
if(a.font_size!=null){
this.set_font_size(a.font_size);
}
if(a.bold!=null){
this.set_bold(a.bold);
}
if(a.italic!=null){
this.set_italic(a.italic);
}
if(a.underline!=null){
this.set_underline(a.underline);
}
if(a.color!=null){
this.set_color(a.color);
}
if(a.bg_color!=null){
this.set_bg_color(a.bg_color);
}
};
}
function QItem(ctx){
this.init_=function(ctx){
this.ctx_=ctx;
this.element_=this.ctx_.new_element("span");
this.parent_=null;
if($.browser.msie){
this.element_.style.display="inline-block";
}
QFormat.call(this);
QNode.call(this);
};
this.element=function(){
return this.element_;
};
this.parent=function(){
return this.parent_;
};
this.set_parent=function(p){
this.parent_=p;
};
this.set_content_=function(s){
var e=this.element_;
while(e.firstChild){
e.removeChild(e.firstChild);
}
this.element_.appendChild(this.ctx_.new_text_node(s));
};
this.set_selected_all=function(_4c5){
var _4c6=_4c5?"#316AC5":"#000000";
this.set_selection_color(_4c6);
};
this.set_selected_none=function(){
this.set_selection_color(null);
};
this.init_(ctx);
}
function QTextItem(ctx,s){
this.init_=function(ctx,s){
this.is_QTextItem=true;
QItem.call(this,ctx);
if(s==NBSP_CHAR){
this.element_.style.display="";
}
this.set_text(s);
};
this.text=function(){
return this.text_;
};
this.set_text=function(s){
this.text_=s;
this.set_content_(s);
};
this.init_(ctx,s);
}
function QXlitItem(ctx){
this.init_=function(ctx){
this.is_QXlitItem=true;
QItem.call(this,ctx);
this.element().style.padding="1px";
this.set_lang=this.set_lang_for_xlit;
this.english_="";
this.options_=[];
this.index_=0;
this.request_=null;
};
this.english=function(){
return this.english_;
};
this.options=function(){
return this.options_;
};
this.index=function(){
return this.index_;
};
this.is_updating=function(){
return this.request_!==null;
};
this.set_english=function(s){
this.english_=s;
};
this.set_lang_for_xlit=function(s){
if(this.lang_!=s&&this.lang_!=""){
this.lang_=s;
this.update_xlit();
}
this.lang_=s;
};
this.set_options=function(a){
this.options_=a;
};
this.set_index=function(i){
this.index_=i;
};
this.get_text_=function(){
if((this.english_.length==0)||(this.lang_.length==0)){
return "-";
}
if(this.lang_=="english"){
return this.english_;
}
var t="";
if((this.index_>=0)&&(this.index_<this.options_.length)){
t=this.options_[this.index_];
}
if(this.is_updating()){
t+=".";
}
return t;
};
this.update_text=function(){
this.set_content_(this.get_text_());
var self=this;
function notify_callback(){
self.ctx_.on_xlit_update();
}
setTimeout(notify_callback,0);
};
this.update_xlit=function(){
if(this.request_!=null){
this.request_.cancel();
this.request_=null;
}
if((this.english_=="")||(this.lang_=="")||(this.lang_=="english")){
this.options_=[];
this.index_=0;
}else{
this.request_=new Quill.lib.QuillRequest(this.lang_,this.english_,Quill.lib.bind_this(this,this.on_response_));
}
this.update_text();
};
this.on_response_=function(_4d4,_4d5){
this.request_=null;
function has_uppercase_char(str){
for(var i=1;i<str.length;i++){
if(str.charCodeAt(i)>=65&&str.charCodeAt(i)<=90){
return true;
}
}
return false;
}
function has_lowercase_char(str){
for(var i=1;i<str.length;i++){
if(str.charCodeAt(i)>=97&&str.charCodeAt(i)<=122){
return true;
}
}
return false;
}
if(has_uppercase_char(this.english_)&&has_lowercase_char(this.english_)){
_4d4.unshift(_4d5);
}else{
_4d4.push(_4d5);
}
this.options_=_4d4;
this.index_=0;
this.update_text();
};
this.choose_option=function(_4da){
this.index_=_4da;
this.update_text();
};
this.get_text=function(){
return this.get_text_();
};
this.init_(ctx);
}
function QDocFragment(_4db,_4dc){
this.initial=_4db;
this.lines=_4dc;
}
function QDFLine(_4dd,attr){
this.items=_4dd;
this.attr=attr;
}
function QDFText(text,attr){
this.is_QDFText=true;
this.text=text;
this.attr=attr;
this.get_text=function(){
return this.text;
};
}
function QDFXlit(_4e1,attr,_4e3,_4e4,_4e5){
this.is_QDFXlit=true;
this.english=_4e1;
this.attr=attr;
this.options=_4e3;
this.index=_4e4;
this.is_updating=_4e5;
this.get_text=function(){
if(this.english.length==0){
return "-";
}
if(this.is_updating){
return ".";
}
if((this.index>=0)&&(this.index<this.options.length)){
return this.options[this.index];
}
return ".";
};
this.get_english=function(){
return this.english;
};
}
function item_to_df_(item){
Quill.lib.assert(item.is_QTextItem||item.is_QXlitItem);
if(item.is_QTextItem){
return new QDFText(item.text(),item.get_attributes());
}else{
return new QDFXlit(item.english(),item.get_attributes(),item.options(),item.index(),item.is_updating());
}
}
function QCursor(doc,u,v){
this.doc=doc;
this.u=u;
this.v=v;
this.clone=function(){
return new QCursor(this.doc,this.u,this.v);
};
this.compare=function(_4ea){
if(this.u<_4ea.u){
return -1;
}
if(this.u>_4ea.u){
return 1;
}
if(this.v<_4ea.v){
return -1;
}
if(this.v>_4ea.v){
return 1;
}
return 0;
};
this.equals=function(_4eb){
return this.compare(_4eb)==0;
};
this.not_equals=function(_4ec){
return this.compare(_4ec)!=0;
};
this.lesser=function(_4ed){
return this.compare(_4ed)<0;
};
this.lesser_equal=function(_4ee){
return this.compare(_4ee)<=0;
};
this.greater=function(_4ef){
return this.compare(_4ef)>0;
};
this.greater_equal=function(_4f0){
return this.compare(_4f0)>=0;
};
this.line=function(){
return this.doc.line(this.u);
};
this.item=function(){
var line=this.line();
return line.item(this.v);
};
this.previous_item=function(){
Quill.lib.assert(!this.is_line_begin());
var line=this.line();
return line.item(this.v-1);
};
this.is_xlit=function(){
if(this.item().is_QXlitItem){
return true;
}else{
return false;
}
};
this.has_previous_xlit=function(){
if(!this.is_line_begin()&&(this.previous_item().is_QXlitItem)){
return true;
}else{
return false;
}
};
this.is_line_begin=function(){
return this.v==0;
};
this.is_line_end=function(){
var line=this.doc.line(this.u);
return this.v==line.item_count()-1;
};
this.is_first_line=function(){
return this.u==0;
};
this.is_last_line=function(){
return this.u==this.doc.line_count()-1;
};
this.is_begin=function(){
return this.is_first_line()&&this.is_line_begin();
};
this.is_end=function(){
return this.is_last_line()&&this.is_line_end();
};
this.go_line_begin=function(){
this.v=0;
};
this.go_line_end=function(){
var line=this.doc.line(this.u);
this.v=line.item_count()-1;
};
this.go_next=function(){
if(this.is_line_end()){
this.u++;
this.go_line_begin();
}else{
this.v++;
}
};
this.go_previous=function(){
if(this.is_line_begin()){
this.u--;
this.go_line_end();
}else{
this.v--;
}
};
this.go_next_line=function(){
this.u++;
this.go_line_begin();
};
this.go_previous_line=function(){
this.u--;
this.go_line_begin();
};
this.go_begin=function(){
this.u=0;
this.v=0;
};
this.go_end=function(){
this.u=this.doc.line_count()-1;
this.go_line_end();
};
this.get_rect=function(){
var rect;
if((!this.is_line_begin())&&this.is_line_end()){
rect=this.previous_item().get_rect();
return new QRect(rect.right(),rect.top(),0,rect.height());
}
rect=this.item().get_rect();
return new QRect(rect.left(),rect.top(),0,rect.height());
};
}
function QOpAddFragment(_4f6,_4f7){
this.cursor=_4f6;
this.fragment=_4f7;
this.add_item_=function(ctx,_4f9,_4fa){
var item;
if(_4fa.is_QDFXlit){
item=ctx.new_xlit_item();
item.set_english(_4fa.english);
item.set_options(_4fa.options);
item.set_index(_4fa.index);
item.set_attributes(_4fa.attr);
if(_4fa.is_updating){
item.update_xlit();
}
item.update_text();
}else{
if(_4fa.is_QDFText){
item=ctx.new_text_item(_4fa.text);
item.set_attributes(_4fa.attr);
}else{
Quill.lib.assert(false);
}
}
_4f9.line().insert_item(_4f9.v,item);
};
this.add_blank_line_=function(ctx,_4fd,_4fe){
var a=_4fe.attr;
var line=ctx.new_line(a.type,a.level);
line.set_align(a.align);
line.append_item(ctx.new_text_item(NBSP_CHAR));
ctx.doc.insert_line(_4fd,line);
};
this.perform=function(ctx){
var c=this.cursor.clone();
var i,j;
for(i=0;i<_4f7.initial.length;++i){
this.add_item_(ctx,c,_4f7.initial[i]);
c.v++;
}
var c2=c.clone();
for(i=0;i<_4f7.lines.length;++i){
var line=_4f7.lines[i];
this.add_blank_line_(ctx,c2.u+1,line);
c2.go_next_line();
for(j=0;j<line.items.length;++j){
this.add_item_(ctx,c2,line.items[j]);
c2.v++;
}
}
if(_4f7.lines.length>0){
while(!c.is_line_end()){
var item=c.line().remove_item_at(c.v);
c2.line().insert_item(c2.v,item);
c2.v++;
}
}
};
this.get_ending_cursor=function(ctx){
var _509=this.fragment.lines.length;
var _50a=this.cursor.u+_509;
var _50b;
if(_509>0){
_50b=this.fragment.lines[_509-1].items.length;
}else{
_50b=this.cursor.v+this.fragment.initial.length;
}
return new QCursor(ctx.doc,_50a,_50b);
};
this.perform_and_invert=function(ctx){
this.perform(ctx);
return new QOpDelFragment(this.cursor,this.get_ending_cursor(ctx));
};
}
function QOpDelFragment(_50d,_50e){
this.cursor1=_50d;
this.cursor2=_50e;
this.perform=function(ctx){
this.perform_and_invert(ctx);
};
this.move_items_=function(_510,_511,i,j){
var _514=j-i;
for(;_514>0;--_514){
var item=_511.remove_item_at(i);
_510.push(item_to_df_(item));
}
};
this.move_items_till_line_end_=function(_516,_517){
var line=_517.line();
var end=_517.clone();
end.go_line_end();
this.move_items_(_516,line,_517.v,end.v);
};
this.perform_and_invert=function(ctx){
var _51b=new QDocFragment([],[]);
var c=this.cursor1.clone();
var _51d=this.cursor2.u-c.u;
if(_51d==0){
this.move_items_(_51b.initial,c.line(),c.v,this.cursor2.v);
}else{
this.move_items_till_line_end_(_51b.initial,c);
c.go_next_line();
for(;_51d>0;--_51d){
var line=c.line();
var _51f=new QDFLine([],line.get_attributes());
_51b.lines.push(_51f);
if(_51d>1){
this.move_items_till_line_end_(_51f.items,c);
}else{
this.move_items_(_51f.items,line,c.v,this.cursor2.v);
var _520=this.cursor1.clone();
while(!c.is_line_end()){
var item=line.remove_item_at(c.v);
_520.line().insert_item(_520.v,item);
_520.v++;
}
}
ctx.doc.remove_line_at(c.u);
}
}
return new QOpAddFragment(this.cursor1,_51b);
};
}
function QOpChangeXlitItem(_522,_523,_524,_525,_526){
this.cursor=_522;
this.english=_523;
this.options=_524;
this.index=_525;
this.should_update=_526;
this.perform=function(ctx){
var item=this.cursor.item();
item.set_english(this.english);
item.set_options(this.options);
item.set_index(this.index);
if(this.should_update){
item.update_xlit();
}
item.update_text();
};
this.perform_and_invert=function(ctx){
var item=this.cursor.item();
var inv=new QOpChangeXlitItem(this.cursor,item.english(),item.options(),item.index(),item.is_updating());
this.perform(ctx);
return inv;
};
}
function QOpFormatItem(_52c,_52d){
this.cursor=_52c;
this.item_attributes=_52d;
this.perform=function(ctx){
this.cursor.item().set_attributes(this.item_attributes);
};
this.perform_and_invert=function(ctx){
var item=this.cursor.item();
var inv=new QOpFormatItem(this.cursor,item.get_attributes());
this.perform(ctx);
return inv;
};
}
function QOpFormatLine(_532,_533){
this.line_index=_532;
this.line_attributes=_533;
this.perform=function(ctx){
ctx.doc.line(_532).set_attributes(this.line_attributes);
};
this.perform_and_invert=function(ctx){
var line=ctx.doc.line(this.line_index);
var inv=new QOpFormatLine(this.line_index,line.get_attributes());
this.perform(ctx);
return inv;
};
}
function QOpGroup(ops){
this.ops=ops;
this.perform=function(ctx){
for(var i=0;i<this.ops.length;++i){
this.ops[i].perform(ctx);
}
};
this.perform_and_invert=function(ctx){
var _53c=[];
for(var i=0;i<this.ops.length;++i){
var _53e=this.ops[i].perform_and_invert(ctx);
_53c.push(_53e);
}
_53c.reverse();
return new QOpGroup(_53c);
};
}
function QuillPopup(hdoc,_540){
this.init_=function(hdoc,_542){
this.hdoc_=hdoc;
this.choice_callback_=_542;
var e=this.hdoc_.createElement("div");
e.style.position="absolute";
e.style.border="1px solid #40759C";
e.style.background="#F4F6FF";
this.hdoc_.body.appendChild(e);
this.element_=e;
this.container_=e;
this.visible_=true;
this.set_visible_(false);
this.offset_x_=0;
this.offset_y_=0;
this.demo=false;
this.disabled_=false;
this.max_options_=4;
this.editor_;
};
this.set_editor=function(ed){
this.editor_=ed;
};
this.set_offset=function(ox,oy){
this.offset_x_=ox;
this.offset_y_=oy;
};
this.clear_=function(){
var e=this.container_;
while(e.firstChild){
e.removeChild(e.firstChild);
}
};
this.set_visible_=function(flag){
if(flag&&!this.disabled_){
if(this.visible_){
return;
}
this.visible_=true;
this.element_.style.visibility="visible";
}else{
if(!this.visible_){
return;
}
this.visible_=false;
this.element_.style.visibility="hidden";
this.clear_();
}
};
this.show=function(){
this.set_visible_(true);
};
this.hide=function(){
this.set_visible_(false);
};
this.add_english_=function(s){
var d=this.hdoc_.createElement("div");
d.style.background="#86ABD5";
d.style.padding="3px";
var e=this.hdoc_.createElement("span");
e.style.fontSize="8pt";
if(this.demo){
e.style.color="red";
}else{
e.style.color="#404040";
}
e.style.paddingLeft="10px";
e.style.paddingRight="10px";
e.appendChild(this.hdoc_.createTextNode(s));
d.appendChild(e);
this.container_.appendChild(d);
};
this.add_option_=function(s,_54d,_54e){
var d=this.hdoc_.createElement("div");
d.style.background="transparent";
var e=this.hdoc_.createElement("span");
if(_54d==_54e.index()){
e.style.fontWeight="bold";
}
e.style.fontSize="10pt";
e.style.color="#000000";
e.style.paddingLeft="10px";
e.style.paddingRight="10px";
e.style.lineHeight="20px";
e.appendChild(this.hdoc_.createTextNode(s));
d.appendChild(e);
this.container_.appendChild(d);
var self=this;
$(e).hover(function(){
d.style.background="#DAE9FB";
},function(){
d.style.background="transparent";
});
$(e).mousedown(function(){
_54e.choose_option(_54d);
window.setTimeout(self.choice_callback_,0);
});
};
this.update_position_=function(_552){
var ifr=this.editor_.find_xy();
this.offset_x_=ifr.left;
this.offset_y_=ifr.top;
var e=this.element_;
var r=_552.get_rect();
e.style.left=""+(r.left()-this.editor_.get_scroll("VERTICAL")+10+this.offset_x_)+"px";
e.style.top=""+(r.bottom()-this.editor_.get_scroll("HORIZONTAL")+10+this.offset_y_)+"px";
};
this.update=function(_556){
this.clear_();
this.add_english_(_556.english());
var _557=_556.options();
for(var i=0;i<_557.length&&i<this.max_options_;++i){
this.add_option_(_557[i],i,_556);
}
this.update_position_(_556);
};
this.disable=function(val){
this.disabled_=val;
};
this.init_(hdoc,_540);
}
function QuillEditor(_55a,root,_55c,lang,win){
this.init_=function(_55f,root,_561,win){
this.ctx_=new QDocContext(_55f,root);
this.ctx_.add_xlit_update_callback(Quill.lib.bind_this(this,this.update_on_resize));
this.doc_=this.ctx_.doc;
var line=this.ctx_.new_line(QLineType.SIMPLE,0);
line.append_item(this.ctx_.new_text_item(NBSP_CHAR));
this.doc_.append_line(line);
this.transient_attributes_=null;
this.blink_on_count_=0;
this.anchor_=null;
this.caret_=new QCursor(this.doc_,0,0);
this.caret_on_word_=false;
this.on_which_word_=null;
this.has_focus_=false;
this.undo_list_=[];
this.redo_list_=[];
this.internal_clipboard;
this.external_clipboard="";
this.window_=win;
this.ignore_on_resize=false;
this.caret_widget_=this.ctx_.new_element("div");
this.caret_widget_.style.position="absolute";
this.caret_widget_.style.fontSize="0px";
this.caret_widget_.style.background="#000000";
this.ctx_.html_doc.body.appendChild(this.caret_widget_);
this.popup_=_561;
this.popup_.hide();
this.popup_.set_editor(this);
this.popup_enabled_=false;
this.update_on_move();
this.enter_callback_=null;
this.focus_callback_=null;
this.textarea_update_callback_=null;
this.init_lang_=lang.toLowerCase();
this.SPACE_CHAR=$.browser.msie?"\xa0":" ";
};
this.grab_focus=function(){
if(this.focus_callback_){
this.focus_callback_();
}
if(!this.has_focus_){
this.ctx_.root.focus();
if($.browser.safari){
this.set_has_focus(true);
}
}
};
this.has_focus=function(){
return this.has_focus_;
};
this.toggle_caret_blink=function(){
if(this.blink_on_count_>0){
this.blink_on_count_--;
}else{
this.blink_on_count_++;
}
this.update_caret_visibility();
};
this.set_has_focus=function(flag){
this.has_focus_=flag;
if(this.anchor_){
this.add_selection_highlight_();
}
this.update_caret_visibility();
if(this.has_focus_){
this.update_caret_widget();
}
};
this.set_anchor=function(val){
this.anchor_=val;
this.update_caret_visibility();
};
this.update_caret_visibility=function(){
if((this.blink_on_count_>0)&&this.has_focus_&&((this.anchor_==null)||this.anchor_.equals(this.caret_))){
this.caret_widget_.style.background="#000000";
}else{
this.caret_widget_.style.background="transparent";
}
};
this.cursor_attributes=function(_566){
if(!_566.is_line_begin()){
return _566.previous_item().get_attributes();
}
if(!_566.is_line_end()){
return _566.item().get_attributes();
}
return null;
};
this.default_attributes=function(_567){
return new QItemAttributes(this.init_lang_,"Arial",12,false,false,false,"#000000","#FFFFFF");
};
this.set_transient_attributes=function(a){
this.transient_attributes_=a;
};
this.unset_transient_attributes=function(){
this.transient_attributes_=null;
};
this.disable_popup=function(val){
this.popup_.disable(val);
};
this.set_enter_callback=function(func){
this.enter_callback_=func;
};
this.set_focus_callback=function(func){
this.focus_callback_=func;
};
this.set_textarea_update_callback=function(func){
this.textarea_update_callback_=func;
this.ctx_.add_xlit_update_callback(func);
};
this.update_textarea=function(){
if(this.textarea_update_callback_){
this.textarea_update_callback_();
}
};
this.get_new_item_attributes=function(){
if(this.transient_attributes_){
return this.transient_attributes_;
}
var c=this.caret_;
if(this.caret_on_word_){
c=this.on_which_word_.clone();
c.go_next();
}
var a=this.cursor_attributes(c);
if(!a){
return this.default_attributes();
}
return a;
};
this.get_selection_item_attributes=function(){
if(this.anchor_==null){
return null;
}
var c1=this.anchor_.clone();
var c2=this.caret_.clone();
if(c1.greater(c2)){
var temp=c1;
c1=c2;
c2=temp;
}
while(c1.is_line_end()&&(c1.not_equals(c2))){
c1.go_next();
}
if(c1.equals(c2)){
return null;
}
var a=c1.item().get_attributes();
c1.go_next();
while(c1.not_equals(c2)){
if(!c1.is_line_end()){
a.merge(c1.item().get_attributes());
}
c1.go_next();
}
return a;
};
this.get_line_attributes=function(){
var _573=this.caret_.u;
var _574=_573;
if(this.anchor_!=null){
_574=this.anchor_.u;
if(_573>_574){
var temp=_573;
_573=_574;
_574=temp;
}
}
var a=this.doc_.line(_573).get_attributes();
while(_573<_574){
++_573;
var b=this.doc_.line(_573).get_attributes();
a.merge(b);
}
return a;
};
this.update_caret_widget=function(){
var cw=this.caret_widget_;
var rect,item;
var win=window;
var doc=document;
doc=this.ctx_.html_doc;
win=this.ctx_.html_doc.parentWindow?this.ctx_.html_doc.parentWindow:this.ctx_.html_doc;
if(this.caret_on_word_){
item=this.on_which_word_.item();
rect=item.get_rect();
cw.style.left=""+(rect.left()-1)+"px";
cw.style.top=""+(rect.bottom()-2)+"px";
cw.style.height="1px";
cw.style.width=""+(2+rect.width())+"px";
this.popup_.update(item);
if(this.has_focus_&&this.popup_enabled_){
this.popup_.show();
}
}else{
item=this.caret_.item();
rect=this.caret_.get_rect();
cw.style.top=""+rect.top()+"px";
cw.style.left=""+rect.left()+"px";
cw.style.height=""+rect.height()+"px";
cw.style.width="2px";
this.popup_.hide();
}
function get_window_dimensions(side){
var _57e=0;
if(typeof (win.innerWidth)=="number"){
_57e=(side=="HEIGHT")?win.innerHeight:win.innerWidth;
}else{
if(doc.documentElement&&(doc.documentElement.clientWidth||doc.documentElement.clientHeight)){
_57e=(side=="HEIGHT")?doc.documentElement.clientHeight:doc.documentElement.clientWidth;
}else{
if(doc.body&&(doc.body.clientWidth||doc.body.clientHeight)){
_57e=(side=="HEIGHT")?doc.body.clientHeight:doc.body.clientWidth;
}
}
}
return _57e;
}
function get_scroll(axis){
var _580=0;
if(typeof (win.pageYOffset)=="number"){
_580=(axis=="HORIZONTAL")?win.pageYOffset:win.pageXOffset;
}else{
if(doc.body&&(doc.body.scrollLeft||doc.body.scrollTop)){
_580=(axis=="HORIZONTAL")?doc.body.scrollTop:doc.body.scrollLeft;
}else{
if(doc.documentElement&&(doc.documentElement.scrollLeft||doc.documentElement.scrollTop)){
_580=(axis=="HORIZONTAL")?doc.documentElement.scrollTop:doc.documentElement.scrollLeft;
}
}
}
return _580;
}
var _581=get_window_dimensions("HEIGHT");
var _582=get_scroll("HORIZONTAL");
var _583=get_window_dimensions("WIDTH");
var _584=get_scroll("VERTICAL");
var _585=0;
if(rect.top()<_582){
var c=this.caret_.clone();
for(var i=0;i<_585;++i){
if(!c.is_first_line()){
c.go_previous_line();
}
}
this.window_.scrollBy(0,-1*(_582-rect.top()));
}else{
if(rect.bottom()>_582+_581){
var c=this.caret_.clone();
for(var i=0;i<_585;++i){
if(!c.is_last_line()){
c.go_next_line();
}
}
this.window_.scrollBy(0,rect.bottom()-(_582+_581));
}
}
if(rect.left()<_584){
this.window_.scrollBy(-1*(_584-rect.left()),0);
}else{
if(rect.left()+rect.width()>=_584+_583){
var c=this.caret_.clone();
c.go_previous();
var s=rect.left()+rect.width()-(_584+_583)+5;
this.window_.scrollBy(s,0);
}
}
};
this.update_on_move=function(_589){
this.blink_on_count_=2;
this.update_caret_visibility();
this.update_caret_widget();
if(!_589){
this.unset_transient_attributes();
}
};
this.update_on_resize=function(){
if(this.ignore_on_resize){
return;
}
refresh_get_rect();
this.update_caret_widget();
};
this.get_nearest_line=function(x,y){
var n=this.doc_.line_count();
Quill.lib.assert(n>0);
var _58d=0;
var line=this.doc_.line(_58d);
var rect=line.get_rect();
var _590=rect.y_distance(y);
for(var i=1;i<n;++i){
var _592=this.doc_.line(i);
var _593=_592.get_rect();
var _594=_593.y_distance(y);
if(_594>_590){
break;
}else{
if(_594<_590){
_58d=i;
line=_592;
rect=_593;
_590=_594;
}
}
}
return _58d;
};
this.get_nearest_cursor_in_range=function(_595,end,x,y){
Quill.lib.assert(_595.lesser_equal(end));
var c=_595.clone();
var rect=c.get_rect();
var _59b=rect.y_distance(y);
var _59c=rect.x_distance(x);
var _59d=c.clone();
while(c.not_equals(end)){
c.go_next();
var _59e=c.get_rect();
var _59f=_59e.y_distance(y);
if(_59f<_59b){
_59d=c.clone();
rect=_59e;
_59b=_59f;
_59c=_59e.x_distance(x);
}else{
if(_59f==_59b){
var _5a0=_59e.x_distance(x);
if(_5a0<_59c){
_59d=c.clone();
rect=_59e;
_59b=_59f;
_59c=_5a0;
}
}
}
}
return _59d;
};
this.get_nearest_cursor=function(x,y){
var _5a3=this.get_nearest_line(x,y);
var _5a4=new QCursor(this.doc_,_5a3,0);
var end=_5a4.clone();
end.go_line_end();
return this.get_nearest_cursor_in_range(_5a4,end,x,y);
};
this.update_selection_highlight_=function(c1,c2,_5a8){
if(c1.greater(c2)){
var temp=c1;
c1=c2;
c2=temp;
}
var c=c1.clone();
while(c.not_equals(c2)){
if(_5a8){
c.item().set_selected_all(this.has_focus_);
}else{
c.item().set_selected_none();
}
c.go_next();
}
};
this.add_selection_highlight_=function(){
this.update_selection_highlight_(this.anchor_,this.caret_,true);
};
this.remove_selection_highlight_=function(){
this.update_selection_highlight_(this.anchor_,this.caret_,false);
};
this.move_caret_to_xy=function(x,y,_5ad){
var _5ae=(this.anchor_!=null);
var _5af=this.get_nearest_cursor(x,y);
var _5b0=false;
if(_5af.equals(this.caret_)){
_5b0=true;
}
if(_5af.equals(this.caret_)&&_5ad&&_5ae){
return;
}
if(_5ae){
this.remove_selection_highlight_();
if(!_5ad){
this.set_anchor(null);
}
}
if(_5ad&&!this.anchor_){
this.set_anchor(this.caret_.clone());
}
this.caret_on_word_=false;
this.on_which_word_=null;
if(!_5ad){
if(_5af.is_xlit()&&_5af.item().get_rect().contains(x,y)){
this.caret_on_word_=true;
this.on_which_word_=_5af.clone();
this.popup_enabled_=true;
}else{
if(_5af.has_previous_xlit()&&(_5af.previous_item().get_rect().contains(x,y))){
this.caret_on_word_=true;
this.on_which_word_=_5af.clone();
this.on_which_word_.go_previous();
this.popup_enabled_=true;
}
}
}
this.caret_=_5af;
this.update_on_move(_5b0);
if(_5ad){
this.add_selection_highlight_();
}
};
this.MOVING_LEFT="MOVING_LEFT";
this.MOVING_RIGHT="MOVING_RIGHT";
this.adjust_caret_before_select_=function(_5b1){
if(!this.caret_on_word_){
return;
}
this.caret_on_word_=false;
this.caret_=this.on_which_word_;
this.on_which_word_=null;
Quill.lib.assert(this.caret_.is_xlit());
switch(_5b1){
case this.MOVING_LEFT:
this.caret_=this.caret_.clone();
this.caret_.go_next();
break;
case this.MOVING_RIGHT:
break;
default:
Quill.lib.assert(false);
}
};
this.prepare_before_move_=function(_5b2,_5b3){
if(_5b2){
if(this.anchor_==null){
this.adjust_caret_before_select_(_5b3);
this.set_anchor(this.caret_.clone());
}else{
this.remove_selection_highlight_();
}
}else{
if(this.anchor_!=null){
this.remove_selection_highlight_();
this.set_anchor(null);
}
}
this.popup_enabled_=false;
this.popup_.hide();
};
this.move_left=function(_5b4){
this.prepare_before_move_(_5b4,this.MOVING_LEFT);
var _5b5=false;
var _5b6=this.caret_;
if(this.caret_on_word_){
this.caret_on_word_=false;
this.caret_=this.on_which_word_;
this.on_which_word_=null;
}else{
if(!this.caret_.is_begin()){
this.caret_=this.caret_.clone();
this.caret_.go_previous();
if((!_5b4)&&this.caret_.is_xlit()){
this.caret_on_word_=true;
this.on_which_word_=this.caret_;
}
}
}
if(_5b4){
this.add_selection_highlight_();
}
if(_5b6.equals(this.caret_)){
_5b5=true;
}
this.update_on_move(_5b5);
};
this.move_right=function(_5b7){
this.prepare_before_move_(_5b7,this.MOVING_RIGHT);
var _5b8=false;
var _5b9=this.caret_;
if(this.caret_on_word_){
this.caret_on_word_=false;
this.caret_=this.on_which_word_.clone();
this.caret_.go_next();
this.on_which_word_=null;
}else{
if((!_5b7)&&(this.caret_.is_xlit())){
this.caret_on_word_=true;
this.on_which_word_=this.caret_;
}else{
if(!this.caret_.is_end()){
this.caret_=this.caret_.clone();
this.caret_.go_next();
}
}
}
if(_5b7){
this.add_selection_highlight_();
}
if(_5b9.equals(this.caret_)){
_5b8=true;
}
this.update_on_move(_5b8);
};
this.cursor_to_home=function(_5ba){
var rect=_5ba.get_rect();
var c=_5ba.clone();
_5ba=c.clone();
while(!c.is_line_begin()){
c.go_previous();
var _5bd=c.get_rect();
if(_5bd.right()>rect.left()){
break;
}
rect=_5bd;
_5ba=c.clone();
}
return _5ba;
};
this.cursor_to_end=function(_5be){
var rect=_5be.get_rect();
var c=_5be.clone();
_5be=c.clone();
while(!c.is_line_end()){
c.go_next();
var _5c1=c.get_rect();
if(_5c1.left()<rect.right()){
break;
}
rect=_5c1;
_5be=c.clone();
}
return _5be;
};
this.move_home=function(_5c2){
var _5c3=false;
var _5c4=this.caret_;
this.prepare_before_move_(_5c2,this.MOVING_LEFT);
this.caret_on_word_=false;
this.on_which_word_=null;
this.caret_=this.cursor_to_home(this.caret_);
if(_5c2){
this.add_selection_highlight_();
}
if(_5c4.equals(this.caret_)){
_5c3=true;
}
this.update_on_move(_5c3);
};
this.move_end=function(_5c5){
var _5c6=false;
var _5c7=this.caret_;
this.prepare_before_move_(_5c5,this.MOVING_RIGHT);
this.caret_on_word_=false;
this.on_which_word_=null;
this.caret_=this.cursor_to_end(this.caret_);
if(_5c5){
this.add_selection_highlight_();
}
if(_5c7.equals(this.caret_)){
_5c6=true;
}
this.update_on_move(_5c6);
};
this.move_up=function(_5c8){
var _5c9=false;
var _5ca=this.caret_;
if(this.popup_.visible_){
var item=this.on_which_word_.item();
var _5cc=item.index();
var _5cd=item.options().length;
if(_5cd>this.popup_.max_options_){
_5cd=this.popup_.max_options_;
}
_5cc=(_5cc-1)%(_5cd);
if(_5cc<0){
_5cc=_5cd-1;
}
item.choose_option(_5cc);
this.popup_.update(item);
return;
}
this.prepare_before_move_(_5c8,this.MOVING_LEFT);
this.caret_on_word_=false;
this.on_which_word_=null;
var prev=this.cursor_to_home(this.caret_);
if(!prev.is_begin()){
prev.go_previous();
var _5cf=this.cursor_to_home(prev);
var rect=this.caret_.get_rect();
var x=rect.left();
var y=(rect.top()+rect.bottom())/2;
this.caret_=this.get_nearest_cursor_in_range(_5cf,prev,x,y);
}else{
this.caret_=prev;
}
if(_5c8){
this.add_selection_highlight_();
}
this.update_on_move();
if(_5ca.equals(this.caret_)){
_5c9=true;
}
this.update_on_move(_5c9);
};
this.move_down=function(_5d3){
var _5d4=false;
var _5d5=this.caret_;
if(this.popup_.visible_){
var item=this.on_which_word_.item();
var _5d7=item.index();
var _5d8=item.options().length;
if(_5d8>this.popup_.max_options_){
_5d8=this.popup_.max_options_;
}
_5d7=(_5d7+1)%(_5d8);
item.choose_option(_5d7);
this.popup_.update(item);
return;
}
this.prepare_before_move_(_5d3,this.MOVING_RIGHT);
this.caret_on_word_=false;
this.on_which_word_=null;
var next=this.cursor_to_end(this.caret_);
if(!next.is_end()){
next.go_next();
var _5da=this.cursor_to_end(next);
var rect=this.caret_.get_rect();
var x=rect.left();
var y=(rect.top()+rect.bottom())/2;
this.caret_=this.get_nearest_cursor_in_range(next,_5da,x,y);
}else{
this.caret_=next;
}
if(_5d3){
this.add_selection_highlight_();
}
if(_5d5.equals(this.caret_)){
_5d4=true;
}
this.update_on_move(_5d4);
};
this.select_all=function(){
if(this.caret_on_word_){
this.caret_on_word_=false;
this.on_which_word_=null;
}
if(this.anchor_!=null){
this.remove_selection_highlight_();
}
var _5de=this.caret_.clone();
_5de.go_begin();
var end=this.caret_.clone();
end.go_end();
this.caret_=end;
this.set_anchor(_5de);
this.add_selection_highlight_();
this.update_on_move();
};
this.edit_function=function(func){
var _5e1=this.caret_;
var _5e2=this.caret_on_word_;
if(_5e2){
_5e1=this.on_which_word_;
}
var _5e3=[];
var _5e4=false;
if(this.anchor_){
this.remove_selection_highlight_();
var _5e5;
if(this.anchor_.lesser(this.caret_)){
_5e5=new QOpDelFragment(this.anchor_,this.caret_);
this.caret_=this.anchor_;
}else{
_5e5=new QOpDelFragment(this.caret_,this.anchor_);
}
_5e4=true;
this.anchor_=null;
this.caret_on_word_=false;
_5e3.push(_5e5.perform_and_invert(this.ctx_));
}
var edit={op:null,cursor:this.caret_,on_word:false,selection:_5e4};
Quill.lib.bind_this(this,func)(edit);
if(edit.op){
_5e3.push(edit.op.perform_and_invert(this.ctx_));
}
this.caret_=edit.cursor;
this.caret_on_word_=edit.on_word;
if(edit.on_word){
this.on_which_word_=edit.cursor;
}else{
this.on_which_word_=null;
}
refresh_get_rect();
this.update_on_move();
_5e3.reverse();
this.undo_list_.push({caret:_5e1,on_word:_5e2,op:new QOpGroup(_5e3)});
this.redo_list_=[];
this.update_textarea();
};
this.key_delete=function(){
this.edit_function(function(edit){
if(edit.selection){
return;
}
if(this.caret_on_word_){
var _5e8=this.on_which_word_;
var end=_5e8.clone();
end.go_next();
edit.op=new QOpDelFragment(_5e8,end);
}else{
if(!this.caret_.is_end()){
if(edit.cursor.is_xlit()){
edit.on_word=true;
}else{
var end=edit.cursor.clone();
end.go_next();
edit.op=new QOpDelFragment(edit.cursor,end);
}
}
}
});
};
this.key_backspace=function(){
var _5ea=null;
this.edit_function(function(edit){
if(edit.selection){
return;
}
var line=this.caret_.line();
if(this.caret_on_word_){
var item=this.on_which_word_.item();
var _5ee=item.english();
Quill.lib.assert(_5ee.length>0);
_5ee=_5ee.substring(0,_5ee.length-1);
if(_5ee.length==0){
var _5ef=this.on_which_word_;
var end=_5ef.clone();
end.go_next();
edit.op=new QOpDelFragment(_5ef,end);
edit.cursor=_5ef;
_5ea=this.get_new_item_attributes();
}else{
edit.op=new QOpChangeXlitItem(this.on_which_word_,_5ee,item.options(),item.index(),true);
edit.cursor=this.on_which_word_;
edit.on_word=true;
this.popup_enabled_=true;
}
}else{
if(this.caret_.is_line_begin()&&(line.type()==QLineType.BULLET)){
var _5f1=new QLineAttributes(QLineType.SIMPLE,line.level(),line.align());
edit.op=new QOpFormatLine(this.caret_.u,_5f1);
}else{
if(this.caret_.is_line_begin()&&(this.caret_.line().level()>0)){
var _5f1=new QLineAttributes(line.type(),line.level()-1,line.align());
edit.op=new QOpFormatLine(this.caret_.u,_5f1);
}else{
if(!this.caret_.is_begin()){
var end=this.caret_;
var _5ef=end.clone();
_5ef.go_previous();
edit.cursor=_5ef;
if(_5ef.is_xlit()){
edit.on_word=true;
}else{
edit.op=new QOpDelFragment(_5ef,end);
}
_5ea=this.get_new_item_attributes();
}
}
}
}
});
if(_5ea!=null){
this.set_transient_attributes(_5ea);
}
};
this.key_enter=function(){
if(this.enter_callback_!=null){
this.enter_callback_();
return;
}
var _5f2=null;
this.edit_function(function(edit){
if(this.caret_on_word_){
this.caret_=this.on_which_word_.clone();
this.caret_.go_next();
this.on_which_word_=null;
this.caret_on_word_=false;
}
var _5f4=new QDFLine([],this.get_line_attributes());
var _5f5=new QDocFragment([],[_5f4]);
edit.op=new QOpAddFragment(this.caret_,_5f5);
edit.cursor=this.caret_.clone();
edit.cursor.u++;
edit.cursor.v=0;
_5f2=this.get_new_item_attributes();
});
this.set_transient_attributes(_5f2);
};
this.key_tab=function(){
this.edit_function(function(edit){
if(this.caret_on_word_){
edit.cursor=this.on_which_word_;
var item=this.on_which_word_.item();
var _5f8=4;
if(item.options().length<5){
_5f8=item.options().length;
}
edit.op=new QOpChangeXlitItem(edit.cursor,item.english(),item.options(),(item.index()+1)%_5f8,item.is_updating());
edit.on_word=true;
this.popup_enabled_=true;
}
});
};
this.key_xlit_char=function(ch){
this.edit_function(function(edit){
var _5fb=this.get_new_item_attributes();
if(this.caret_on_word_){
edit.cursor=this.on_which_word_;
edit.on_word=true;
var item=edit.cursor.item();
edit.op=new QOpChangeXlitItem(edit.cursor,item.english()+ch,item.options(),item.index(),true);
this.popup_enabled_=true;
}else{
if(_5fb.lang=="english"){
var _5fd=new QDFText(ch,_5fb);
var _5fe=new QDocFragment([_5fd],[]);
edit.op=new QOpAddFragment(this.caret_,_5fe);
edit.cursor=this.caret_.clone();
edit.cursor.v++;
}else{
var self=this;
function try_itrans_merge(){
var c=self.caret_.clone();
if(c.is_line_begin()){
return false;
}
c.go_previous();
if(c.is_line_begin()){
return false;
}
var _601=c.item();
if(!_601.is_QTextItem){
return false;
}
var s=_601.text();
if((s!=".")&&(s!="/")&&(s!="^")&&(s!="~")){
return false;
}
var xlit=c.previous_item();
if(!xlit.is_QXlitItem){
return false;
}
var _604=new QOpDelFragment(c,self.caret_);
c=c.clone();
c.go_previous();
edit.cursor=c;
edit.on_word=true;
var _605=new QOpChangeXlitItem(c,xlit.english()+s+ch,xlit.options(),xlit.index(),true);
edit.op=new QOpGroup([_604,_605]);
return true;
}
if(!try_itrans_merge()){
var _5fd=new QDFXlit(ch,_5fb,[],0,true);
var _5fe=new QDocFragment([_5fd],[]);
edit.op=new QOpAddFragment(this.caret_,_5fe);
edit.cursor=this.caret_;
edit.on_word=true;
}
this.popup_enabled_=true;
}
}
});
};
this.key_space=function(ch){
this.key_simple_char(this.SPACE_CHAR);
};
this.key_simple_char=function(ch){
this.edit_function(function(edit){
if(this.caret_on_word_){
edit.cursor=this.on_which_word_.clone();
edit.cursor.go_next();
}
var _609=new QDFText(ch,this.get_new_item_attributes());
var _60a=new QDocFragment([_609],[]);
edit.op=new QOpAddFragment(edit.cursor,_60a);
edit.cursor=edit.cursor.clone();
edit.cursor.v++;
});
};
this.apply_item_format=function(func){
if(this.anchor_!=null){
var _60c=this.caret_;
var c1=this.anchor_.clone();
var c2=this.caret_.clone();
if(c1.greater(c2)){
var temp=c1;
c1=c2;
c2=temp;
}
var _610=new QItemAttributes(null,null,null,null,null,null,null);
func(_610);
var ops=[];
while(c1.not_equals(c2)){
if(!c1.is_line_end()){
ops.push(new QOpFormatItem(c1.clone(),_610));
}
c1.go_next();
}
var op=new QOpGroup(ops);
var _613=op.perform_and_invert(this.ctx_);
refresh_get_rect();
this.update_on_move();
this.undo_list_.push({caret:_60c,on_word:false,op:_613});
this.redo_list_=[];
}else{
var a=this.get_new_item_attributes();
func(a);
this.set_transient_attributes(a);
}
};
this.set_lang=function(lang){
this.apply_item_format(function(x){
x.set_lang(lang);
});
};
this.set_font_name=function(name){
this.apply_item_format(function(x){
x.set_font_name(name);
});
};
this.set_font_size=function(size){
this.apply_item_format(function(x){
x.set_font_size(size);
});
};
this.set_bold=function(flag){
this.apply_item_format(function(x){
x.set_bold(flag);
});
};
this.set_italic=function(flag){
this.apply_item_format(function(x){
x.set_italic(flag);
});
};
this.set_underline=function(flag){
this.apply_item_format(function(x){
x.set_underline(flag);
});
};
this.set_color=function(_621){
this.apply_item_format(function(x){
x.set_color(_621);
});
};
this.set_bg_color=function(_623){
this.apply_item_format(function(x){
x.set_bg_color(_623);
});
};
this.end_color_change=function(){
if(this.anchor_!=null){
this.add_selection_highlight_();
}
};
this.apply_line_format=function(func){
var _626=this.caret_;
var _627=this.caret_on_word_;
if(_627){
_626=this.on_which_word_;
}
var u1=this.caret_.u;
var u2=u1;
if(this.anchor_!=null){
u2=this.anchor_.u;
}
if(u1>u2){
var temp=u1;
u1=u2;
u2=temp;
}
var ops=[];
for(var i=u1;i<=u2;++i){
var a=this.doc_.line(i).get_attributes();
func(a);
var op=new QOpFormatLine(i,a);
ops.push(op);
}
var op=new QOpGroup(ops);
var _62f=op.perform_and_invert(this.ctx_);
refresh_get_rect();
this.update_on_move();
this.undo_list_.push({caret:_626,on_word:_627,op:_62f});
this.redo_list_=[];
};
this.set_align=function(_630){
this.apply_line_format(function(a){
a.align=_630;
});
};
this.listify=function(){
this.apply_line_format(function(a){
a.type=QLineType.BULLET;
});
};
this.unlistify=function(){
this.apply_line_format(function(a){
a.type=QLineType.SIMPLE;
});
};
this.increase_indent=function(){
this.apply_line_format(function(a){
a.level+=1;
});
};
this.decrease_indent=function(){
this.apply_line_format(function(a){
if(a.level>0){
a.level-=1;
}
});
};
this.can_undo=function(){
return this.undo_list_.length>0;
};
this.undo=function(){
if(this.undo_list_.length==0){
return;
}
if(this.anchor_){
this.remove_selection_highlight_();
this.anchor_=null;
}
var _636=this.caret_;
var _637=this.caret_on_word_;
if(_637){
_636=this.on_which_word_;
}
var obj=this.undo_list_.pop();
var _639=obj.op.perform_and_invert(this.ctx_);
this.caret_=obj.caret;
this.caret_on_word_=obj.on_word;
if(obj.on_word){
this.on_which_word_=obj.caret;
}else{
this.on_which_word_=null;
}
refresh_get_rect();
this.update_on_move();
this.redo_list_.push({caret:_636,on_word:_637,op:_639});
};
this.can_redo=function(){
return this.redo_list_.length>0;
};
this.redo=function(){
if(this.redo_list_.length==0){
return;
}
if(this.anchor_){
this.remove_selection_highlight_();
this.anchor_=null;
}
var _63a=this.caret_;
var _63b=this.caret_on_word_;
if(_63b){
_63a=this.on_which_word_;
}
var obj=this.redo_list_.pop();
var _63d=obj.op.perform_and_invert(this.ctx_);
this.caret_=obj.caret;
this.caret_on_word_=obj.on_word;
if(obj.on_word){
this.on_which_word_=obj.caret;
}else{
this.on_which_word_=null;
}
refresh_get_rect();
this.update_on_move();
this.undo_list_.push({caret:_63a,on_word:_63b,op:_63d});
};
this.make_doc_fragment=function(_63e,_63f){
function copy_items_(_640,_641,i,j){
var _644=j-i;
for(;_644>0;--_644){
var item=_641.item(i);
_640.push(item_to_df_(item));
i++;
}
}
function copy_items_till_line_end_(_646,_647){
var line=_647.line();
var end=_647.clone();
end.go_line_end();
copy_items_(_646,line,_647.v,end.v);
}
var _64a=new QDocFragment([],[]);
var c=_63e.clone();
var _64c=_63f.u-c.u;
if(_64c==0){
copy_items_(_64a.initial,c.line(),c.v,_63f.v);
}else{
copy_items_till_line_end_(_64a.initial,c);
c.go_next_line();
for(;_64c>0;--_64c){
var line=c.line();
var _64e=new QDFLine([],line.get_attributes());
_64a.lines.push(_64e);
if(_64c>1){
copy_items_till_line_end_(_64e.items,c);
}else{
copy_items_(_64e.items,line,c.v,_63f.v);
}
c.go_next_line();
}
}
return _64a;
};
this.doc_fragment_to_text=function(_64f,_650){
var _651=[];
function add_line(_652,_653){
var line=[];
for(var i=0;i<_652.length;++i){
var t;
if(_650&&_652[i].is_QDFXlit){
t=_652[i].get_english();
}else{
t=_652[i].get_text();
}
if(t==this.SPACE_CHAR){
t=" ";
}
line.push(t);
}
var s=line.join("");
if(_653){
s="- "+s;
}
_651.push(s);
}
add_line(_64f.initial,false);
for(var i=0;i<_64f.lines.length;++i){
var line=_64f.lines[i];
add_line(line.items,line.attr.type==QLineType.BULLET);
}
return _651.join("\n");
};
this.get_language_text=function(){
var _65a=this.caret_.clone();
_65a.go_begin();
var end=this.caret_.clone();
end.go_end();
var _65c=this.make_doc_fragment(_65a,end);
return this.doc_fragment_to_text(_65c);
};
this.get_english_text=function(){
var _65d=this.caret_.clone();
_65d.go_begin();
var end=this.caret_.clone();
end.go_end();
var _65f=this.make_doc_fragment(_65d,end);
return this.doc_fragment_to_text(_65f,true);
};
this.cut=function(c1,c2){
this.c1=c1;
this.c2=c2;
this.edit_function(function(edit){
});
};
this.internal_cut=function(){
if(this.anchor_==null){
return;
}
var _663=this.window_.document.getElementById("paste");
_663.style.display="block";
if(this.anchor_.lesser(this.caret_)){
this.internal_clipboard=this.make_doc_fragment(this.anchor_,this.caret_);
this.cut(this.anchor_,this.caret_);
}else{
this.internal_clipboard=this.make_doc_fragment(this.caret_,this.anchor_);
this.cut(this.caret_,this.anchor_);
}
_663.value=this.doc_fragment_to_text(this.internal_clipboard);
this.external_clipboard=_663.value;
_663.focus();
_663.select();
var that=this;
var _665=function(){
_663.style.display="none";
that.grab_focus();
};
setTimeout(_665,0);
};
this.paste=function(){
var _666=this.window_.document.getElementById("paste");
_666.style.display="block";
_666.style.top=this.caret_.get_rect().top();
_666.focus();
_666.value="";
var _667=this.external_clipboard;
var that=this;
var _669=function(){
if((jQuery.trim(_666.value)==jQuery.trim(that.external_clipboard)||(_666.value.length==0&&that.external_clipboard.length>0))&&that.internal_clipboard){
that.internal_paste();
that.grab_focus();
}else{
that.external_paste(_666.value);
that.grab_focus();
}
_666.value="";
_666.style.display="none";
};
setTimeout(_669,0);
};
this.internal_paste=function(){
this.edit_function(function(edit){
if(this.caret_on_word_){
edit.cursor=this.on_which_word_.clone();
edit.cursor.go_next();
}
edit.op=new QOpAddFragment(edit.cursor,this.internal_clipboard);
edit.cursor=edit.op.get_ending_cursor(this.ctx_);
});
};
this.external_paste=function(str){
this.edit_function(function(edit){
if(this.caret_on_word_){
this.caret_=this.on_which_word_.clone();
this.caret_.go_next();
this.on_which_word_=null;
this.caret_on_word_=false;
}
var _66d=new QDocFragment([],[]);
var _66e=true;
var _66f;
var _670=new QLineAttributes(QLineType.SIMPLE,0,QAlign.LEFT);
var _671=this.get_new_item_attributes();
var _672=str.split("\n");
this.word="";
this.xlit_word="";
this.move_items_=function(_673,word,_675,_676){
if(_676){
_673.push(new QDFText(word,_675));
}else{
if(_675.lang=="english"){
for(var k=0;k<word.length;k++){
_673.push(new QDFText(word.charAt(k),_675));
}
}else{
_673.push(new QDFXlit(word,_675,[],0,true));
}
}
};
this.is_alpha=function(ch){
var _679=ch.charCodeAt(0);
if((_679>=97&&_679<97+26)||(_679>=65&&_679<65+26)){
return true;
}
return false;
};
this.is_special=function(ch){
var _67b=ch.charCodeAt(0);
if(!this.is_alpha(ch)&&_67b>=32&&_67b<=126){
return true;
}
return false;
};
this.is_utf=function(ch){
if(!this.is_alpha(ch)&&!this.is_special(ch)){
return true;
}
return false;
};
this.push_word=function(wd){
if(wd=="xlit"&&this.xlit_word.length>0){
this.move_items_(_67e,this.xlit_word,_671,true);
this.xlit_word="";
}
if(wd=="word"&&this.word.length>0){
this.move_items_(_67e,this.word,_671,false);
this.word="";
}
};
for(var j=0;j<_672.length;j++){
var _67e=_66d.initial;
if(j>0){
_66f=new QDFLine([],_670);
_66d.lines.push(_66f);
_67e=_66f.items;
}
for(var i=0;i<_672[j].length;++i){
if(this.is_alpha(_672[j].charAt(i))){
this.push_word("xlit");
this.word+=_672[j].charAt(i);
}else{
if(this.is_utf(_672[j].charAt(i))){
this.push_word("word");
this.xlit_word+=_672[j].charAt(i);
}else{
this.push_word("xlit");
this.push_word("word");
if(_672[j].charAt(i)==" "){
this.move_items_(_67e,this.SPACE_CHAR,_671,true);
}else{
this.move_items_(_67e,_672[j].charAt(i),_671,true);
}
}
}
}
this.push_word("xlit");
this.push_word("word");
}
edit.op=new QOpAddFragment(this.caret_,_66d);
edit.cursor=edit.op.get_ending_cursor(this.ctx_);
});
};
this.internal_copy=function(){
var sel;
if(this.anchor_==null){
return;
}
var _682=this.window_.document.getElementById("paste");
_682.style.display="block";
if(this.anchor_.lesser(this.caret_)){
this.internal_clipboard=this.make_doc_fragment(this.anchor_,this.caret_);
}else{
this.internal_clipboard=this.make_doc_fragment(this.caret_,this.anchor_);
}
_682.value=this.doc_fragment_to_text(this.internal_clipboard);
this.external_clipboard=_682.value;
_682.focus();
_682.select();
if($.browser.msie){
document.execCommand("Copy");
}
var that=this;
var _684=function(){
_682.style.display="none";
that.grab_focus();
};
setTimeout(_684,0);
};
this.save=function(val){
var _686="http://quillpad.in/hindi/backend2/";
var ifra=document.getElementById("saveiFrame");
var _688=ifra.contentDocument?ifra.contentDocument:ifra.contentWindow.document;
var _689=this.ctx_.root.innerHTML;
var _68a=_688.getElementById("data");
var _68b=_688.getElementById("filename");
if(val=="text"){
_68a.value=this.get_language_text();
_686=_686+"save_as_text";
}else{
if(val=="html"){
_68a.value=_689;
_686=_686+"save";
}
}
_68b.value="Untitled";
var _68c=_688.getElementById("saveForm");
_68c.action=_686;
_68c.submit();
};
this.clear_doc=function(){
this.select_all();
if(this.anchor_.lesser(this.caret_)){
this.internal_clipboard=this.make_doc_fragment(this.anchor_,this.caret_);
this.cut(this.anchor_,this.caret_);
}else{
this.internal_clipboard=this.make_doc_fragment(this.caret_,this.anchor_);
this.cut(this.caret_,this.anchor_);
}
this.undo_list_=[];
this.redo_list_=[];
this.internal_clipboard;
this.external_clipboard="";
this.transient_attributes_=null;
this.anchor_=null;
this.caret_=new QCursor(this.doc_,0,0);
this.caret_on_word_=false;
this.on_which_word_=null;
};
this.init_(_55a,root,_55c,win);
this.get_scroll=function(axis){
win=this.window_;
doc=this.ctx_.html_doc;
var _68e=0;
if(typeof (win.pageYOffset)=="number"){
_68e=(axis=="HORIZONTAL")?win.pageYOffset:win.pageXOffset;
}else{
if(doc.body&&(doc.body.scrollLeft||doc.body.scrollTop)){
_68e=(axis=="HORIZONTAL")?doc.body.scrollTop:doc.body.scrollLeft;
}else{
if(doc.documentElement&&(doc.documentElement.scrollLeft||doc.documentElement.scrollTop)){
_68e=(axis=="HORIZONTAL")?doc.documentElement.scrollTop:doc.documentElement.scrollLeft;
}
}
}
return _68e;
};
}

