var _jsObj, cJSLIB;
function JSLIB() {
	var a = arguments, l = arguments.length, r, f, c, i;
	if (!_jsObj) {
		_jsObj = new cJSLIB();
	}
	if ( l ) {
		f = "call@"+a[0]+"#"+l;
		if (!_jsObj[f] && _jsObj[a[0]]) {
			c = "return this."+a[0]+"(";
			for (i=1; i < l; ++i) {
				c += (i!=1?",":"") + "a["+i+"]";
			}
			c += ")";
			_jsObj[f] = new Function("a", c);
		}
		if ( _jsObj[f] ) {
			r = _jsObj[f]( a );
		}
	}
	return r;
}

cJSLIB = function() {
	this._pDf="location=no,menubar=no,toolbar=no,resizable=no,";
	this._bUa=navigator.userAgent.toLowerCase();
	this._bOp=(this._bUa.indexOf("opera")!=-1?true:false);
	this._bIe=(this._bUa.indexOf("msie")!=-1&&!this._bOp?true:false);
	this._bIe4=(this._bIe&&(this._bUa.indexOf("msie 2.")!=-1||this._bUa.indexOf("msie 3.")!=-1||this._bUa.indexOf("msie 4.")!=-1)&&!this._bOp?true:false);
	this._bN4=(document.layers?true:false);
	this._bMc=(this._bUa.indexOf("mac")!=-1?true:false);
}

cJSLIB.prototype.makePopup=function(o,n,w,h,e){if (o&&o.href&&o.href.indexOf("javascript")==-1) o.href="javascript:void (window.open('"+o.href+"'"+(n?",'"+n+"'":"")+(w||h||e?(n?"":",null")+",'"+(w?"width="+w+",":"")+(h?"height="+h+",":"")+this._pDf+(e?e+",":"")+"status=yes'":"")+")).focus()";}
cJSLIB.prototype.openWindow=function(u,n,w,h,e){var r=this.createWindow(u,n,w,h,e);if(r)r.focus();}
cJSLIB.prototype.openPopup=function(u,n,w,h,e){var r=this.createWindow(u,n,w,h,this._pDf+(e?","+e:""));if(r)r.focus();}
cJSLIB.prototype.createWindow=function(u,n,w,h,e){var r=null;if (w||h||e)r=window.open(u,n||null,(w?"width="+w+",":"")+(h?"height="+h+",":"")+(e?e+",":"")+"status=yes");else r=window.open(u,n||null);return r;}
cJSLIB.prototype.isOldIe=function(){return this._bIe4;}
cJSLIB.prototype.isOpera=function(){return this._bOp;}
cJSLIB.prototype.isOldNetscape=function(){return this._bN4;}
cJSLIB.prototype.isMac=function(){return this._bMc;}
cJSLIB.prototype.checkEmail=function(e,m) {var f = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; var v = $(e).value;t = f.test(v); if (!t) {if (m) alert('Podaj poprawny adres e-mail.');$(e).focus();return false;} else return true;}

function $(n){return document.getElementById(n);}
