function openNewWindow(width, height, url)
{
  x = Math.floor(screen.width/2)-(Math.floor(width/2));
  y = Math.floor(screen.height/2)-(Math.floor(height/2));
 
  my_window = window.open(url,'my_window','scrollbars=yes,resizable=no,toolbar=no,statusbar=no,menubar=no,top='+y+',left='+x+',width='+width+',height='+height);
  my_window.focus();
}

function potwierdzenie() {
  var sprawdz = window.confirm("Czy jesteś pewien?");
  
  if (sprawdz == true) {
    return true;
  }
  else if (sprawdz == false) {
    return false;
  }
}

function clear_login() {
  if(document.estudent.login.value=='Twój e-mail')
      document.estudent.login.value="";
}

function clear_haslo() {
  if(document.estudent.haslo.value=='haslo')
      document.estudent.haslo.value="";
}

function clear_login2() {
  if(document.pracodawca.login.value=='Twój e-mail')
      document.pracodawca.login.value="";
}

function clear_haslo2() {
  if(document.pracodawca.haslo.value=='haslo')
      document.pracodawca.haslo.value="";
}

function enableFormUstawieniaBazaCv(disable)
{
  var myForm = $('ustawieniaCVForm');
  var cnt = myForm.elements.length;
  for(var i = 0; i < cnt; i++)
  {
    if(myForm.elements[i].type != 'radio' && myForm.elements[i].type != 'submit') 
      myForm.elements[i].disabled = disable;
  }
}

function selectAllChecboxesByName(chName, checked)
{
  var elements = document.getElementsByTagName('INPUT');
  for(var i = 0; i < elements.length; i++)
    if(elements[i].type == 'checkbox' && elements[i].name == chName)
      elements[i].checked = checked;
}

function enableFormTwojaWww(disable)
{
  var myForm = $('twojaWwwUstawienia');
  var cnt = myForm.elements.length;
  for(var i = 0; i < cnt; i++)
  {
    if(myForm.elements[i].type != 'radio' && myForm.elements[i].type != 'submit') 
      myForm.elements[i].disabled = disable;
  }
   if(!disable && !$('twoja_www_cv_pl').checked && !$('twoja_www_cv_gb').checked)
     $('twoja_www_dane_kontaktowe').disabled = true;
}

function enableOtherOptionYourWww()
{
  if($('twoja_www_cv_pl').checked || $('twoja_www_cv_gb').checked)
    $('twoja_www_dane_kontaktowe').disabled = false
  else
    $('twoja_www_dane_kontaktowe').disabled = true
}