function PopupSizes(nazwa,szer,wys,subtitle) {
  void newWin(nazwa,szer,wys,subtitle);
}
function Popup(nazwa, subtitle) {
  void newWin(nazwa,0,0,subtitle);
}
function Popup2(nazwa, subtitle) {
  void newWin(nazwa,0,0,subtitle, 'yes');
}
function myurlencode(string) {
    return escape(string).replace(/[+]/g, '%2B');
}
function doprint() {
  loc = document.location.href;
  if (loc.match(/[\?]/))
    inf = loc + '&print=1';
  else
    inf = loc + '?print=1';
  win = NewHtm(inf, 650, 650);
//  win.document.location.href = inf;
}
function dorecommend() {
  loc = document.location.href;
  NewHtm('recommend.php?qs='+escape(loc), 400, 515);
}
makeshowhidenum = 0;
function makeshowhide(id,state,visiblestate,tshow,thide) {
	var hstate;
	var sstate;
	var hidehref;
	var showhref;
	if (!thide) thide = 'Mniej';
	if (!tshow) tshow = 'Wiêcej';
	if (!visiblestate) visiblestate = 'block';
	showhref = "javascript: unrolldiv('"+id+"', '"+visiblestate+"');";
	hidehref = "javascript: rolldiv('"+id+"');";
	if (!(state > 0)) {
		sstate = 'display: block;';
		hstate = 'display: none;';
	} else  {
		hstate = 'display: block;';
		sstate = 'display: none;';
	}
	document.write("<a href=\""+hidehref+"\" class='hide' style='"+hstate+"' id='"+id+"_hide'><span>"+thide+"</span></a>");
	document.write("<a href=\""+showhref+"\" class='show' style='"+sstate+"' id='"+id+"_show'><span>"+tshow+"</span></a>");
}
function unrolldiv(id, visiblestate) {
	document.getElementById(id).style.display = visiblestate;
	document.getElementById(id+'_show').style.display = 'none';
	document.getElementById(id+'_hide').style.display = 'block';
}
function rolldiv(id) {
	document.getElementById(id).style.display = 'none';
	document.getElementById(id+'_hide').style.display = 'none';
	document.getElementById(id+'_show').style.display = 'block';
}
function newWin(nazwa,szer,wys,subtitle,scrolls) { 
var sizes = false;
if (!scrolls > 0) {
	scrolls = 'auto';
} else if (scrolls = -1) {
	scrolls = 'no';
} else if (scrolls = 0) {
	scrolls = 'yes';
}
if (wys>0) { 
    sizes = true;
    szer = szer+28;
    wys = wys+28;
    odlewa=(screen.width-szer)/2;
    odgory=(screen.height-wys)/2;
} else {
    szer = 800;
    wys = 660;
    odlewa=(screen.width)/4;
    odgory=(screen.height)/4;
}

var cmsbase = 'http://dlugopisyreklamowe.com.pl/';

config='left='+odlewa+',top='+odgory+',width='+szer+',height='+wys+',innerheight='+wys+',innerwidth='+szer+',toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars='+scrolls;
cel=window.open('','okno',config)
cel.document.write('<HTML><HEAD>');
cel.document.write('<base href="'+cmsbase+'" />');
cel.document.write('<link rel="stylesheet" href="css/style.css" type="text/css" />');
cel.document.write('<meta http-equiv="Content-Type" content="text/html; charset=utf-16">');
cel.document.write('<TITLE>'+document.title+'</title>');
if (!sizes) {
  cel.document.write('<script language="javascript">');
  cel.document.write('	var temp=self.location.href.split("?");');
  cel.document.write('	var picUrl = (temp.length>1)?temp[1]:"";');
  cel.document.write('	var NS = (navigator.appName=="Netscape")?true:false;');
  cel.document.write('	function fitPic() {');
  cel.document.write('		iImg1 = document.getElementById("img1");');
  cel.document.write('		iWidth = (NS)?window.innerWidth:document.body.clientWidth;');
  cel.document.write('		iHeight = (NS)?window.innerHeight:document.body.clientHeight;');
  cel.document.write('		if (iImg1.width>800) iWidth = 640 - iWidth; else { iWidth = iImg1.width + 22 - iWidth; }');
  cel.document.write('		if (iImg1.height>600) iHeight = 600 - iHeight; else { iHeight = iImg1.height + '+((subtitle)?'64':'24')+' - iHeight; }');
  cel.document.write('		window.resizeBy(iWidth, iHeight-1);');
  cel.document.write('		self.focus();');
  cel.document.write('	};');
  cel.document.write('	function setTitle() {');
  cel.document.write('		self.document.title = top.opener.document.title;');
  cel.document.write('	};');
  cel.document.write('</script>');
}
cel.document.write('</HEAD>');
cel.document.write('<body class="imagepopup" scroll="auto" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
cel.document.write('<div id="image"><a href="#" onclick="javascript:self.close();"><img src='+nazwa.replace('dreampen.best.net.pl', 'dreampen.pl')+' id="img1" class=obw alt="Kliknij aby zamkn±æ okno" onload="javascript: fitPic();" align=center style="border: none; margin: 10px 0 0 10px;"></a></div>');
if (subtitle)
	cel.document.write('<div id="subtitle">'+subtitle+'</div>');
//if (!sizes) {
//  cel.document.write('<script language="javascript">');
//  cel.document.write('	setTitle();');
//  cel.document.write('</script>');
//}
cel.document.write('</body></html>');
cel.document.close();
cel.focus();
}

function NewHtm(nazwa,szer,wys) {
var cmsbase = 'http://dlugopisyreklamowe.com.pl/';
odlewa=(screen.width-szer)/2;
odgory=(screen.height-wys)/2;		
config='left='+odlewa+',top='+odgory+',width='+szer+',height='+wys+',innerheight='+wys+',innerwidth='+szer+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes';
if (!nazwa.match(/^http:\/\//)) nazwa = cmsbase + nazwa;
stadion=window.open('about:blank','okno',config);
stadion.document.location.href = nazwa;
stadion.focus();
}
function NewHtmNoScr(nazwa,szer,wys) {
odlewa=(screen.width-szer)/2;
odgory=(screen.height-wys)/2;
config='left='+odlewa+',top='+odgory+',width='+szer+',height='+wys+',innerheight='+wys+',innerwidth='+szer+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes';
if (!nazwa.match(/^http:\/\//)) nazwa = cmsbase + nazwa;
stadion=window.open('about:blank','okno',config);
stadion.document.location.href = nazwa;
stadion.focus();
}

function gotables() {
    tables = document.getElementsByName('info');
    for (i=0; i<tables.length; i++) {
        trs = tables[i].getElementsByTagName('tr');
        for (j=0; j<trs.length; j++) {
            trs[j].className += ' line'+(j % 2);
        }
    }
}

function checkall(formularz, id) {
 var elementy = document.forms[formularz].elements;
 var ilosc = elementy.length;
 for (var i = 0; i<ilosc;i++) {
  if ((elementy[i].type=='checkbox') && (elementy[i].id==id)){
   elementy[i].checked=false;
  }
 }

}


function showdiv(id) {
plist=document.getElementById(id);
visible=plist.style.display=="block";
lists=document.getElementsByTagName('div');

prov=document.getElementById('prov_li');

if (prov) {
for (i = 0; i < prov.childNodes.length; i++) {
	var child = prov.childNodes[i];
	if (child && child.nodeName == 'DIV') {
		child.style.display="none";
	}
}
}
		
plist.style.display=visible?"none":"block";

while(plist=plist.parentNode)
if(plist.className=='list')
plist.style.display="block";
}

function toggle2(id, parentid, rozwinietaclass, zwinietaclass) {
plist=document.getElementById(id);
pli=document.getElementById(parentid); 
visible=plist.style.display=="block";
lists=document.getElementsByTagName('li');
for(i in lists){
if(lists[i].className=='list')
lists[i].style.display="none";
if(lists[i].className=='active')
lists[i].className=zwinietaclass;

}
plist.style.display=visible?"none":"block";
while(plist=plist.parentNode)
if(plist.className=='list')
plist.style.display="block";

pli.className=visible?zwinietaclass:rozwinietaclass;
// window.alert( pli.className);
}
