function setSelectOptions(/*the_form, */the_select, do_check) {
    var selectObject = document.getElementById(the_select); //forms[the_form].elements[the_select];
    var selectCount  = selectObject.length;
    for (var i = 0; i < selectCount; i++)
        selectObject.options[i].selected = do_check;
    return true;
}

function panelClick(obj) {
	var panelEmailW = document.getElementById('panelEmailW');
	panelEmailW.style.display = (panelEmailW.style.display == 'block' ? 'none' : 'block')
	//obj.style.borderColor = (obj.style.borderColor == 'E4E4E4' ? '000000' : 'E4E4E4');
}

function potwierdz() {
	return confirm('Jesteś pewien, że chcesz wywołać tę akcję?');
}

var dispwin;

function zdjecie(url, width, height, nr) {
	var dispwin = window.open("","dispwin",'width=' + width + ',height=' + (height+20) + ',resizable=1,scrollbars=no,menubar=no,left=10,top=10' );
	dispwin.window.focus();
	dispwin.document.open();
	dispwin.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" /><title>Rynek Budowlany PL</title></head><body style="margin: 0px; padding: 0px; text-align: center;">');
	dispwin.document.write('<img onload="window.resizeTo(this.width+50, this.height+100);" src="'+url+'"><br><div style="text-align: center; width: ' + width + '; height: 40px; background-color: #FFFFFF;">'+nr+'</div>');
	dispwin.document.write('</body></html>');
	dispwin.document.close(); 
}

  function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

  function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }