nn4=(document.layers) ? true : false; 
ie4=(document.all) ? true : false; 
okienko=null 
function noweokno(url,wys,szer,toolbar,scrollbars,location,directories,status,menubar,resizable,left,top){
  if (okienko) { 
    if (ie4) okienko.close(); 
    else if (nn4) okienko.closed; 
    okienko=null 
  }; 
  okienko = window.open(url,'wpr','toolbar='+toolbar+',scrollbars='+scrollbars+',location='+location+',directories='+directories+',status='+status+',menubar='+menubar+',resizable='+resizable+',width='+szer+',height='+wys+',left='+left+',top='+top+'');
  okienko.focus() 
}     
function gotourlbaner(r,typ){
	switch(r){
		case 1:
			if(target=='_self') {
                window.location=addres;
			}else{
				    linkwindow = window.open(addres,target,"");
			}
			break;
		case 2:
			openocen();
			break;
	}
}
  

function setcolor(theRow, thePointerColor, theNormalBgColor) {
  var theCells = null;
  
  if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
    return false;
  }
  if (typeof(document.getElementsByTagName) != 'undefined') {
    theCells = theRow.getElementsByTagName('td');
  }
  else if (typeof(theRow.cells) != 'undefined') {
    theCells = theRow.cells;
  }
  else {
    return false;
  }
  
  var rowCellsCnt  = theCells.length;
  var currentColor = null;
  var newColor     = null;
  
  if (typeof(window.opera) == 'undefined'
      && typeof(theCells[0].getAttribute) != 'undefined' && typeof(theCells[0].getAttribute) != 'undefined') {
    currentColor = theCells[0].getAttribute('bgcolor');
    newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
      ? theNormalBgColor
      : thePointerColor;
    for (var c = 0; c < rowCellsCnt; c++) {
      theCells[c].setAttribute('bgcolor', newColor, 0);
    }
  }
  else {
    currentColor = theCells[0].style.backgroundColor;
    newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
      ? theNormalBgColor
      : thePointerColor;
        for (var c = 0; c < rowCellsCnt; c++) {
	  theCells[c].style.backgroundColor = newColor;
        }
  }
  
  return true;
}

function duzy(id,s,w){
  var scr='no';
  
  if(s>=screen.width){s=screen.width-10;scr='yes';}else{var lewa=(screen.width-s)/2;}
  if(w>=screen.height){w=screen.height-58;scr='yes';}else{var gora=(screen.height-w)/4;}
  if (okienko) { 
    if (ie4) okienko.close(); 
    else if (nn4) okienko.closed; 
    okienko=null 
      }; 
  okienko=window.open('pokaz_foto.php?id='+id+'', 'Produkt','toolbar=no,menubar=no,scrollbars='+scr+',resizable,height='+w+',width='+s+',left='+lewa+',top='+gora+',resizable=no');
  okienko.focus() 
    }



function zmien_kolor_obiektu(id, color) {
  var obj = document.getElementById(id);
  obj.style.color=color;
} 

