(function(){if(zk._p=zkpi('bootstrap'))try{
/* button.js

	Purpose:
		
	Description:
		
	History:
		Wed, Aug 28, 2013 12:51:51 PM, Created by jumperchen

Copyright (C) 2013 Potix Corporation. All Rights Reserved.
*/
zk.afterLoad('zul.wgt', function () {
	var _button = {},
		_buttonMolds = {};

zk.override(zul.wgt.Button.molds, _buttonMolds, {
	'bs': zul.wgt.Button.molds['default']
});
	
zk.override(zul.wgt.Button.prototype, _button, {
	_inBSMold: function () {
		return this._mold == 'bs';
	},
	getSclass: function () {
		if (this._inBSMold()) {
			return this._sclass ? this._sclass : 'btn-default';
		} else
			return _button.getSclass.apply(this, arguments);
	},
	getZclass: function () {
		if (this._inBSMold())
			return this._zclass != null ? this._zclass : 'btn';
		return _button.getZclass.apply(this, arguments);
	}
});

});
/* progressbox.js
	
	Se modifica el progressbox original para que siempre muestre una mascara sobre toda la página del navegador
	
	El original de esto está en  zk/zk/src/archive/web/js/zk/utl.js 
	Se ha usado la versión que hay en zk 8.5.1

*/
	if (!zUtl._progressbox) {
	  zUtl._progressbox = zUtl.progressbox;
	  zUtl.progressbox = function (id, msg, mask, icon, _opts) {
	    //zUtl._progressbox(id, msg, true, icon, _opts);
		// Ponemos la máscara siempre a true
	    mask = true;
	    // Nuestras páginas son contenidas. Comentamos el siguiente bloque para que, aunque sean contenidas, 
	    // se aplique la máscara sobre toda la página visible en el navegador
	    /*
		if (mask && zk.Page.contained.length) {
			for (var c = zk.Page.contained.length, e = zk.Page.contained[--c]; e; e = zk.Page.contained[--c]) {
				if (!e._applyMask)
					e._applyMask = new zk.eff.Mask({
						id: e.uuid + '-mask',
						message: msg,
						anchor: e.$n()
					});
			}
			return;
		}
		*/

		if (_opts && _opts.busy) {
			zk.busy++;
			jq.focusOut(); //Bug 2912533
		}

		var x = jq.innerX(), y = jq.innerY(),
			style = ' style="left:' + x + 'px;top:' + y + 'px"',
			idtxt = id + '-t',
			idmsk = id + '-m',
			html = '<div id="' + id + '"';
		if (mask)
			html += '><div id="' + idmsk + '" class="z-modal-mask"' + style + '></div';
			html += '><div id="' + idtxt + '" class="z-loading"' + style
			+ '><div class="z-loading-indicator"><span class="z-loading-icon"></span> '
			+ msg + '</div></div>';
		if (icon)
			html += '<div class="' + icon + '"></div>';
		jq(document.body).append(html + '</div>');

		var $n = jq(id, zk),
			n = $n[0],
			$txt = jq(idtxt, zk),
			txt = $txt[0],
			st = txt.style;
		if (mask) {
			// old IE will get the auto value by default.
			var zIndex = $txt.css('z-index');
			if (zIndex == 'auto')
				zIndex = 1;
			n.z_mask = new zk.eff.FullMask({
				mask: jq(idmsk, zk)[0],
				zIndex: zIndex - 1
			});
		}

		if (mask && $txt.length) { //center
			st.left = jq.px((jq.innerWidth() - txt.offsetWidth) / 2 + x);
			st.top = jq.px((jq.innerHeight() - txt.offsetHeight) / 2 + y);
		} else {
			var pos = zk.progPos;
			if (pos) {
				var left,
					top,
					width = jq.innerWidth(),
					height = jq.innerHeight(),
					wdgap = width - zk(txt).offsetWidth(),
					hghgap = height - zk(txt).offsetHeight();

				if (pos.indexOf('mouse') >= 0) {
					var offset = zk.currentPointer;
					left = offset[0] + 10;
					top = offset[1] + 10;
				} else {
					if (pos.indexOf('left') >= 0) left = x;
					else if (pos.indexOf('right') >= 0)	left = x + wdgap - 1;
					else if (pos.indexOf('center') >= 0) left = x + wdgap / 2;
					else left = 0;
					
					if (pos.indexOf('top') >= 0) top = y;
					else if (pos.indexOf('bottom') >= 0) top = y + hghgap - 1;
					else if (pos.indexOf('center') >= 0) top = y + hghgap / 2;
					else top = 0;
					
					left = left < x ? x : left;
					top = top < y ? y : top;
				}
				st.left = jq.px(left);
				st.top = jq.px(top);
			}
		}

		$n.zk.cleanVisibility();	    
	  }
	}

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