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

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

// Zmiana wyswietlania faq w kategorii
function changeDisplay(id)
{
  if(document.getElementById(id).style.display=="none") {
    //document.getElementById(id).style.display="block";
    Effect.BlindDown(id, {duration:0.1});
  } else {
    //document.getElementById(id).style.display="none";
    Effect.BlindUp(id, {duration:0.1});
  }
}

// Sprawdzanie czy zostala wybrana odpowiedz w sondzie przez zaglosowaniem
function checkPools(id)
{
  sonda = document.getElementById(id);
  tags = sonda.getElementsByTagName("input");
  for(i=0;i<tags.length;i++) {
    if(tags[i].checked) {
      sonda.submit();
      return;
    }
  }
  alert("Wybierz odpowiedź na którą chcesz zagłosować!");
}

// Sprawdzanie czy slowo kluczowe nie jest puste
function checkKeyword()
{
  if(document.getElementById("keyword").value == "") {
    return false;
  } else {
    return true;
  }
}

function checkAgreement()
{
  if( document.getElementById( "agreement" ).checked == true ) {
    return true;
  } else {
    alert( "Aby się zarejestrować, musisz wyrazić \nzgodę na przerwarzanie danych osobowych." );
    return false;
  }
}

function opinieChangeStatus()  {
  var oldStatus = document.getElementById( 'opinietable' ).style.display;
  //alert( oldStatus );
  if( oldStatus == 'block' )  {
    document.getElementById( 'opiniebuton' ).innerHTML = '(+)';
    document.getElementById( 'opinietable' ).style.display = 'none';
  }
  else  {
    document.getElementById( 'opiniebuton' ).innerHTML = '(-)';
    document.getElementById( 'opinietable' ).style.display = 'block';
  }
}

function SearcherSubmit()  {
  if( checkKeyword() && document.getElementById( "keyword" ).value != "Podaj frazę!" && document.getElementById( "keyword" ).value != "- wprowadź słowo -" )  {
    document.wyszukiwarka.submit () 
  }
  else  {
    document.getElementById( "keyword" ).value = "Podaj frazę!"
  }
}