_dom = (document.getElementById) ? true : false;
_nn4 = (document.layers) ? true : false;
_ie = (document.all) ? true : false;
_ie4 = _ie && !_dom;
_opera = (window.opera) ? true : false;

if(_nn4) {
_oknoW = window.innerWidth;
_oknoH = window.innerHeight;
}
function reDo() {
if(window.innerWidth != _oknoW || window.innerHeight != _oknoH) { 
window.location.reload();
}
}

if(_dom){window.onresize = reDo;}
function resizeIE() {
window.location.reload();
}
if(_ie4){window.onresize = resizeIE;}

function show(ident,nest) {
if(_nn4) {  
nest ? document.layers[nest].document.layers[ident].visibility = "show" : document.layers[ident].visibility = "show";
} else if(_ie4) {  
document.all[ident].style.visibility = "visible";
} else if(_dom) {
aa = document.getElementById(ident);
aa.style.visibility = "visible";	
}
}

function hide(ident,nest) {
if(_nn4) {  
nest ? document.layers[nest].document.layers[ident].visibility = "hide" : document.layers[ident].visibility = "hide";
} else if(ie4) {
document.all[ident].style.visibility = "hidden";
} else if(_dom) {
aa = document.getElementById(ident);
aa.style.visibility = "hidden";	
}
}

function moveTo(ident,x,y,nest) {
if(nn4) {
nest ? document.layers[nest].document.layers[ident].left = x : document.layers[ident].left = x;
nest ? document.layers[nest].document.layers[ident].top = y : document.layers[ident].top = y;
} else if(_ie4) {
document.all[ident].style.left = x;
document.all[ident].style.top = y;
} else if(_dom) {
aa = document.getElementById(ident);
aa.style.left = x;
aa.style.top = y;
}
}

function clipTo(ident, t, r, b, l,nest) {
if(nn4) {
if(nest) {
document.layers[nest].document.layers[ident].clip.top = t;
document.layers[nest].document.layers[ident].clip.right = r;
document.layers[nest].document.layers[ident].clip.bottom = b;
document.layers[nest].document.layers[ident].clip.left = l;
} else {
document.layers[ident].clip.top = t;
document.layers[ident].clip.right = r;
document.layers[ident].clip.bottom = b;
document.layers[ident].clip.left = l;
}
} else if(_ie4) {
document.all[ident].style.clip = 
"rect(" + t + " " + r + " " + b + " " + l + ")";
}
}

function pozycja(ident,nest) {
if(nn4) {
l = nest ? document.layers[nest].document.layers[ident].left : document.layers[ident].left;
t = nest ? document.layers[nest].document.layers[ident].top : document.layers[ident].top;
} else if(_ie4) {
l = document.all[ident].offsetLeft;
t = document.all[ident].offsetTop;
}
}

function zmienZindex(ident, z, nest) {
if(nn4) {
if(nest) {
document.layers[nest].document.layers[ident].zIndex=z;
} else {
document.layers[ident].zIndex=z;
}
} else if(_ie4) {
document.all[ident].style.zIndex=z;
}
}

function costam(co, wys, szer){
window.open(co, '_blank', 'width='+szer+',height='+wys+',resizable=no,scrollbars=no,menubar=no,directories=no,toolbar=no,location=no,status=no');
}

function cc(n,s){
var src = "";
if (document.images){
src = "/package/1P5FM12H1PYI61HPL7C4S5UM/font/" + n +"_"+s+".gif";
document [n].src = src;
}
}

function replaceMe(str, text, by) {
var pattern = new RegExp (text,'ig');
return str.replace( pattern, by);
}

function formatValue(value) {
value+='';
if(	value.indexOf('.') > 3 )
value = value.substring(0, value.indexOf('.') + 3);
varr = value.split('');
ind = value.indexOf('.')

if(ind<0) {
newValue = '';
ind = value.length-1;
} else {
newValue =  value.substring(ind);		
ind--;
}
for(i=ind;i>=0;i--) {	
if((ind-i)%3==0 && ind!=i) {
newValue = " "+newValue;
}
newValue = varr[i]+newValue;
}
newValue = replaceMe(newValue, "\\." , ",");
return newValue;

} 

function showCounter(ra) {
document.open();
ra = formatValue(ra)
var sp = "&nbsp;";
for(i=0;i<ra.length;i++) {
ab = ra.substring(i,i+1);
if(ab==',') document.write('<td style="color:#0060a9;" valign="bottom">,</td>');
else if(ab==' ') {
document.write('<td>'+sp+'</td> ');
sp="";	
} else
document.write("<td><img src=/package/32T40EDTR5B8DTWC45OFN46D/img/"+ab+".gif width=15 height=20></td>"); 
}
document.close();
}

function nowe_okno(co, wys, szer){
window.open(co, '_blank', 'width='+szer+',height='+wys+',resizable=no,scrollbars=no,menubar=no,directories=no,toolbar=no,location=no,status=no');
}

function stats(co, gdzie){
wy = screen.availHeight;
wx = screen.availWidth ;
gdzie += ' ';
if (gdzie.indexOf('?') != -1){
costam = gdzie.split('?');
zmienne = costam[1];
}else{
zmienne = '';
}
window.open ('/package/BN4X4KYDT3T2FT7ULXRUA330/statystyki.jsp?action='+co+'&'+zmienne, '_blank', 'screenX:'+wx +'; screenY:'+wy+';innerHeight:100px; innerWidth:100px;');
window.focus();		
}

function bookmarkit(){
if(client.ie) {
window.external.addFavorite(location.href, document.title)
stats('ADD_TO_FAVOURITES', document.location);
}else{
alert("Jeżeli posiadasz przeglądarke inną niż IE wciśnij ctrl+d aby dodać stronę do ulubionych");
}
}

function startowa(cos){
if(setHomePage(cos,document.location)) {
stats('SET_START_PAGE', document.location);
}else{
alert("Ustawienia przeglądarki uniemożliwiają automatyczne ustawienie strony startowej.");
}
}

function setHomePage (pageObject,url) {
if (client.ie) {
pageObject.style.behavior='url(#default#homepage)';
pageObject.setHomePage(url);
return true;
}  else if (client.nav && navigator.javaEnabled()) {
try{
netscape.security.PrivilegeManager.enablePrivilege('UniversalPreferencesWrite');
navigator.preference('browser.startup.homepage', url);
return true;
}catch(ex) {
return false;
}
}
return false;
}

function ClientSnifferJr(){
this.ua=navigator.userAgent.toLowerCase();
this.major=parseInt(navigator.appVersion);
this.minor=parseFloat(navigator.appVersion);
if (document.addEventListener && document.removeEventListener) this.dom2events=true;
if (document.getElementById) this.dom1getbyid=true;
if (window.opera){
this.opera=true;
this.opera5=(this.ua.indexOf("opera 5") !=-1 || this.ua.indexOf("opera/5") !=-1);
this.opera6=(this.ua.indexOf("opera 6") !=-1 || this.ua.indexOf("opera/6") !=-1);
this.opera5or6=this.opera5 || this.opera6;
this.opera7=(this.ua.indexOf("opera 7") !=-1 || this.ua.indexOf("opera/7") !=-1);
return;
}
this.konq=this.ua.indexOf('konqueror') !=-1;
this.ie=this.ua.indexOf('msie') !=-1;
if (this.ie){
this.ie3=this.major < 4;
this.ie4=(this.major==4 && this.ua.indexOf('msie 5')==-1 && this.ua.indexOf('msie 6')==-1);
this.ie4up=this.major >=4;
this.ie5=(this.major==4 && this.ua.indexOf('msie 5.0') !=-1);
this.ie5up=!this.ie3 && !this.ie4;
this.ie6=(this.major==4 && this.ua.indexOf('msie 6.0') !=-1);
this.ie6up=(!this.ie3 && !this.ie4 && !this.ie5 && this.ua.indexOf("msie 5.5")==-1);
return;
}
this.hotjava=this.ua.indexOf('hotjava') !=-1;
this.webtv=this.ua.indexOf('webtv') !=-1;
this.aol=this.ua.indexOf('aol') !=-1;
if (this.hotjava || this.webtv || this.aol) return;
this.gecko=this.ua.indexOf('gecko') !=-1;
this.nav=(this.ua.indexOf('mozilla') !=-1 && this.ua.indexOf('spoofer')==-1 && this.ua.indexOf('compatible')==-1);
if (this.nav){
this.nav4=this.major==4;
this.nav4up=this.major >=4;
this.nav5up=this.major >=5;
this.nav6=this.major==5;
this.nav6up=this.nav5up;
}
}

var client=new ClientSnifferJr();

function printPageContent() {
window.open('print.html','_blank','statusbar=no,menubar=no');
}
