//ukrywanie i wyswietlanie diva dla listy targów
function shDiv(id){

	//lapanie elementu
	elem = document.getElementById(id);
	if(elem.style.display == 'none') {
		elem.style.display='block';
	} else {
		elem.style.display = 'none';
	}

}


function pokazAlboUkryjSpec(id,max) {
  for(i=0; i<=max; i++){
    if(i==id && document.getElementById( 'specs'+i )){
      document.getElementById( 'specs'+i ).style.display = 'block';
	  jQuery('.specs'+i).removeAttr("disabled");
    } 
    else if (i!=id && document.getElementById( 'specs'+i )) {
      document.getElementById( 'specs'+i ).style.display = 'none';
	  jQuery('.specs'+i).attr("disabled", "true");
    }
    if(i==id && document.getElementById( 'speco'+i )){
      document.getElementById( 'speco'+i ).style.display = 'block';
	  jQuery('.speco'+i).removeAttr("disabled");
    } 
    else if (i!=id && document.getElementById( 'speco'+i )) {
      document.getElementById( 'speco'+i ).style.display = 'none';
	  jQuery('.speco'+i).attr("disabled", "true");
    }
  }
}


//popup
function popup(url,width, height)
{
   LeftPosition=(screen.width)?(screen.width-width)/2:100;
   TopPosition=(screen.height)?(screen.height-height)/2:100;
   var Win = window.open(url,'popup','width=' + width + ',height=' + height + ',top='+TopPosition+',left='+LeftPosition+',resizable=0,scrollbars=yes,menubar=no,toolbar=no,status=no')
}

function popup1(url,width, height, name)
{
   LeftPosition=(screen.width)?(screen.width-width)/2:100;
   TopPosition=(screen.height)?(screen.height-height)/2:100;
   var Win = window.open(url,name,'width=' + width + ',height=' + height + ',top='+TopPosition+',left='+LeftPosition+',resizable=0,scrollbars=yes,menubar=no,toolbar=no,status=no')
}

function refreshParent() {
  window.opener.location.href = window.opener.location.href;
  if (window.opener.progressWindow)
    window.opener.progressWindow.close();
  window.close();
}
