(function(){if(zk._p=zkpi('zul.breeze'))try{
jq(document.body).addClass('breeze');


zk.afterLoad('zul.grid', function(){
	
	zul.grid.Renderer.updateColumnMenuButton = function (wgt) {
		var n = wgt.$n(),
			btn;
	 	if (btn = wgt.$n('btn')) btn.style.height = zk.ie6_ || zk.ie7_  ? n.offsetHeight - 1  + 'px': n.offsetHeight + "px";
	};
});

zk.afterLoad('zul.inp', function(){
	
	
	zul.inp.Errorbox.prototype._fixarrow = function () {
		var parent = this.parent.$n(),
			node = this.$n(),
			
			pointer = this.$n('p'), 
			ptofs = zk(parent).revisedOffset(),
			nodeofs = zk(node).revisedOffset();
		var dx = nodeofs[0] - ptofs[0], dy = nodeofs[1] - ptofs[1], dir;
		
		if (dx >= parent.offsetWidth - 22) {
			dir = dy < 6 - node.offsetHeight ? "ld": dy >= parent.offsetHeight - 7 ? "lu": "l";
		} else if (dx < 20 - node.offsetWidth) {
			dir = dy < 6 - node.offsetHeight ? "rd": dy >= parent.offsetHeight - 7 ? "ru": "r";
		} else {
			dir = dy < 0 ? "d": "u";
		}
		
		
		if(dir == "d" || dir == "u") {
			var md = (Math.max(dx, 0) + Math.min(node.offsetWidth + dx, parent.offsetWidth))/2 - dx - 6,
				mx = node.offsetWidth - 11;
			pointer.style.left = (md>mx? mx : md<1? 1 : md) + "px";
			if(dir == "d") { 
				pointer.style.top = null;
				pointer.style.bottom = zk.ie6_? "-14px" : "-5px"; 
			} else { 
				pointer.style.top = "-5px"; 
			}
		} else if(dir == "l" || dir == "r") {
			var md = (Math.max(dy, 0) + Math.min(node.offsetHeight + dy, parent.offsetHeight))/2 - dy - 6,
				mx = node.offsetHeight - 11;
			pointer.style.top = (md>mx? mx : md<1? 1 : md) + "px";
			if(dir == "r") { 
				pointer.style.left = null;
				pointer.style.right = "-5px"; 
			} else { 
				pointer.style.left = "-5px"; 
			}
		} else {
			if(dir == "lu" || dir== "ld"){
				pointer.style.left = "5px";
			} else {
				pointer.style.left = null;
				pointer.style.right = "5px";
			}
			if(dir == "ru" || dir == "lu"){
				pointer.style.top = "-10px";
			} else {
				pointer.style.top = null;
				pointer.style.bottom = zk.ie6_? "-14px" : "-10px";
			}
		}
		
		
		pointer.className = 'z-pointer z-pointer-' + dir; 
	};
	
	zul.inp.Renderer.renderSpinnerButton = function (out, wgt) {
		var zcls = wgt.getZclass(),
			uuid = wgt.uuid;
		if(wgt.inRoundedMold()) return;
			out.push('<div id="', uuid, '-btn-up" class="', zcls, '-btn-upper"></div>',
					'<div id="', uuid, '-btn-down" class="', zcls, '-btn-lower"></div>');
		
	};
});


zk.afterLoad('zul.menu', function () {
	
	
	zul.menu.Menubar.prototype._syncChdWidth = function () {
		var max = -1;
		if (this.getOrient() == 'vertical') {
			var menus = [];
			for (var w = this.firstChild; w; w = w.nextSibling) {
				if (w.$instanceof(zul.menu.Menu)) {
					var btn = w.$n('b');
					if (btn) {
						menus.push(w);
						var width = btn.clientWidth;
						if (width > max)
							max = width;
					}
				}
			}
			var i = menus.length;
			while (i-- > 0) {
				var btn = menus[i].$n('b'),
					curWidth = btn.clientWidth;
				if (curWidth < max)
					jq(btn).css('width', max + 'px');
			}
		}
	};
	zul.menu.Menu.prototype._getArrowWidth = function () {
		return 20;
	};
});

zk.afterLoad('zul.tab', function(){
	
	
	zul.tab.TabRenderer.isFrameRequired = function(wgt){
		return false;
	}
});

zk.afterLoad('zul.wgt', function(){
	
	
	zul.wgt.PopupRenderer.isFrameRequired = function(wgt){
		return false;
	}
});

zk.afterLoad('zul.wnd', function(){
	
	
	zul.wnd.WindowRenderer.shallCheckBorder = function (wgt) {
		return wgt._mode != 'popup' && (wgt._mode != 'embedded' || wgt.getBorder() != "none");
	};
	
	
	
	
	
	zul.wnd.Panel.prototype._titleHeight = function (n) {
		var isFramable = this.isFramable(),
			cap = this.$n('cap'),
			top = isFramable || cap ? jq(n).find('> div:first-child')[0].offsetHeight: 0;
		return cap ? (isFramable ? jq(n).find('> div:first-child').next()[0].offsetHeight : cap.offsetHeight + 2) + top : top;
	};
	zul.wnd.PanelRenderer.isFrameRequired = function(wgt){
		return true;
	}
});

}finally{zk.setLoaded(zk._p.n);}})();
