Ext.namespace('Ext.JC');
Ext.JC.CustomizedDateField = function(config) {Ext.JC.CustomizedDateField.superclass.constructor.call(this, config)};
Ext.extend(Ext.JC.CustomizedDateField, Ext.form.DateField, {onTriggerClick:function() {
	Ext.JC.CustomizedDateField.superclass.onTriggerClick.apply(this);
	if (this.trigger.hasClass('disablePreviousDays')) {
		var today = new Date();
		var todaysDate = today.getDate();
		var thisMonth = today.getMonth();
		var thisYear = today.getFullYear();
		var currentPicker = this.menu.picker;
		var cal = this.menu.ul;
		this.menu.picker.minDate = today;
		if (currentPicker.activeDate.getMonth() == thisMonth && currentPicker.activeDate.getFullYear() == thisYear) {
			cal.select('td.x-date-prevday').each(function(e) {e.addClass('x-date-disabled')});
			cal.select('td.x-date-active').each(function(e) {if (Number(e.select('span').first().dom.innerHTML) < todaysDate)e.addClass('x-date-disabled')})
		}
	}
	this.fireEvent("triggerclick", this.menu);
},initTrigger:function() {
	this.trigger.on("click", this.onTriggerClick, this, {preventDefault:true});
	if (!this.trigger.hasClass('x-form-trigger-over'))this.trigger.addClassOnOver("x-form-trigger-over");
	this.trigger.addClassOnClick("x-form-trigger-click")
}});
Ext.JC.CustomizedComboBox = function(config) {Ext.JC.CustomizedDateField.superclass.constructor.call(this, config)};
Ext.extend(Ext.JC.CustomizedComboBox, Ext.form.ComboBox, {initTrigger:function() {
	this.trigger.on("click", this.onTriggerClick, this, {preventDefault:true});
	if (!this.trigger.hasClass('no-hover')) {
		this.trigger.addClassOnOver("x-form-trigger-over");
		this.trigger.addClassOnClick("x-form-trigger-click")
	}
}});

Ext.override(Ext.dd.PanelProxy,{
	show:function() {
		if (!this.ghost) {
			this.ghost = this.panel.createGhost(undefined, undefined, Ext.getBody());
			this.ghost.setXY(this.panel.el.getXY());
			if (this.insertProxy) {/*jcheck: added this part to enable drag and drop*/
				if (!Ext.isIE) { this.proxy = this.panel.el.insertSibling({ cls:"x-panel-dd-spacer", html:"<div class='in-spacer 'id='in-spacer1'></div>" }); }
				else { this.proxy = this.panel.el.insertSibling({ cls:"x-panel-dd-spacer" });}
				this.proxy.setSize(this.panel.getSize())
			}
			this.panel.el.dom.style.display = "none"
		}
	}
});

Ext.override(Ext.Panel,{
	createGhost:function(A, E, B) {
	var D = document.createElement("div");
	D.className = "x-panel-ghost " + (A ? A : "");
	if (this.header) {D.appendChild(this.el.dom.firstChild.cloneNode(true))}
	Ext.fly(D.appendChild(document.createElement("ul"))).setHeight(this.bwrap.getHeight());
	D.style.width = this.el.dom.offsetWidth + "px";
	D.style.height = this.el.dom.offsetHeight + "px";
	if (!B) {this.container.dom.appendChild(D)} else {Ext.getDom(B).appendChild(D)}
	if (E !== false && this.el.useShim !== false) {
		var C = new Ext.Layer({shadow:false,useDisplay:true,constrain:false}, D);
		C.show();
		return C
	} else {return new Ext.Element(D)}
}
})






