Ext.BLANK_IMAGE_URL="/presentation/images/common/blank.gif";
Ext.apply(Ext.form.VTypes,{daterange:function(F,E){var B=E.parseDate(F);
var D=function(G){var H=G.activeDate;
G.activeDate=null;
G.update(H);
};
if(E.startDateField){var C=Ext.getCmp(E.startDateField);
C.maxValue=B;
if(C.menu&&C.menu.picker){C.menu.picker.maxDate=B;
D(C.menu.picker);
}}else{if(E.endDateField){var A=Ext.getCmp(E.endDateField);
A.minValue=B;
if(A.menu&&A.menu.picker){A.menu.picker.minDate=B;
D(A.menu.picker);
}}}return true;
}});
Date.createParser=function(format){var funcName="parse"+Date.parseFunctions.count++;
var regexNum=Date.parseRegexes.length;
var currentGroup=1;
Date.parseFunctions[format]=funcName;
var code="Date."+funcName+" = function(input){\nvar y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, ms = -1, o, z, u, v;\ninput = String(input);var d = new Date();\ny = d.getFullYear();\nm = d.getMonth();\nd = d.getDate();\nvar results = input.match(Date.parseRegexes["+regexNum+"]);\nif (results && results.length > 0) {";
var regex="";
var special=false;
var ch="";
for(var i=0;
i<format.length;
++i){ch=format.charAt(i);
if(!special&&ch=="\\"){special=true;
}else{if(special){special=false;
regex+=String.escape(ch);
}else{var obj=Date.formatCodeToRegex(ch,currentGroup);
currentGroup+=obj.g;
regex+=obj.s;
if(obj.g&&obj.c){code+=obj.c;
}}}}code+="if (u){\nv = new Date(u * 1000);\n}else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0 && ms >= 0){\nv = new Date(y, m, d, h, i, s, ms);\n}else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0){\nv = new Date(y, m, d, h, i, s);\n}else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0){\nv = new Date(y, m, d, h, i);\n}else if (y >= 0 && m >= 0 && d > 0 && h >= 0){\nv = new Date(y, m, d, h);\n}else if (y >= 0 && m >= 0 && d > 0){\nv = new Date(y, m, d);\n}else if (y >= 0 && m >= 0){\nv = new Date(y, m);\n}else if (y >= 0){\nv = new Date(y);\n}\n}\nreturn (v && (z || o))? (Ext.type(z) == 'number' ? v.add(Date.SECOND, (v.getTimezoneOffset() * 60) + z) : v.add(Date.HOUR, (v.getGMTOffset() / 100) + (o / -100))) : v;\n}";
Date.parseRegexes[regexNum]=new RegExp("^"+regex+"$","i");
eval(code);
};
Ext.apply(Date.parseCodes,{j:{g:1,c:"d = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},M:function(){var A=[];
for(var B=0;
B<12;
B++){A.push(Date.getShortMonthName(B));
}return Ext.applyIf({s:"("+A.join("|")+")"},Date.formatCodeToRegex("F"));
},n:{g:1,c:"m = parseInt(results[{0}], 10) - 1;\n",s:"(\\d{1,2})"},o:function(){return Date.formatCodeToRegex("Y");
},g:function(){return Date.formatCodeToRegex("G");
},h:function(){return Date.formatCodeToRegex("H");
},P:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1);","var hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60);","var mn = o.substring(4,6) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+/-]\\d{2}:\\d{2})"}});
Date.formatCodeToRegex=function(B,A){var C=Date.parseCodes[B];
if(C){C=Ext.type(C)=="function"?C():C;
Date.parseCodes[B]=C;
}return C?Ext.applyIf({c:C.c?String.format(C.c,A||"{0}"):C.c},C):{g:0,c:null,s:Ext.escapeRe(B)};
};
Ext.ToolTip.override({adjustPosition:function(A,D){var C=this.targetXY[1],B=this.getSize().height;
if(this.constrainPosition&&D<=C&&(D+B)>=C){D=C-B-5;
}if(this.constrainPosition&&A>=((Ext.lib.Dom.getViewWidth()-this.getSize().width)-5)){A=A-25;
}return{x:A,y:D};
}});

