// JavaScript Document

function showAddToGB(way,user){
  if(way==1){
  var rand=Math.floor(1000000 * Math.random());
  document.getElementById("go-mess-on").style.display = 'none';
  document.getElementById("szn-gb-insert").style.display = 'block';
  $("#szn-gb-insert").load("http://www.kl2.cz/ajax/setProfile.php?id=3&user="+encodeURIComponent(user)+"&rand="+encodeURIComponent(rand));
  } else {
  document.getElementById("szn-gb-insert").style.display = 'none';
  document.getElementById("addnew2").style.display = 'none';
  document.getElementById("go-mess-on").style.display = 'block';
  }
return false;
}

function checkGuestbookForm(){
  var guestbookSend = ge("guestbookSend").value; 
  if(guestbookSend==1){
  return false;
  }
  var zprava = ge("contZprava").value;
  if(isEmpty(zprava)){
    alert("Doplňte Váš vzkaz.");
    focus("contZprava");
    return false;
  }
document.getElementById("guestbookSend").value = 1;
return true;
}

function profileStart(user){
  var rand=Math.floor(1000000 * Math.random());
  $("#intercom").load("http://www.kl2.cz/ajax/intercom.php?user="+encodeURIComponent(user)+"&rand="+encodeURIComponent(rand));
  $("#checkPodnikHodnoceni").load("http://www.kl2.cz/ajax/hodnoceniProfilu.php?user="+encodeURIComponent(user)+"&rand="+encodeURIComponent(rand));
  $("#szn-status").load("http://www.kl2.cz/ajax/setProfile.php?id=2&user="+encodeURIComponent(user)+"&rand="+encodeURIComponent(rand));
return false;
}

function ivkCheckUser(type,user,way){
  var rand=Math.floor(1000000 * Math.random());
  if((type=='f' && way!=1)||(type=='o' && way==0)||(type=='i' && way==0)){
  if(!overeniVolby('Opravdu smazat z daného seznamu?')){
  return false;
  }
  }
  if(type=='i' && way==1){
  if(!overeniVolby('Opravdu přidat na daný seznam?')){
  return false;
  }
  }
  if(way==1&&(type=='f' || type=='o' || type=='i')){
  var about = window.prompt("Můžeš zadat krátký popisek nebo poznámku", "");
  }
  document.getElementById("icm2").style.display = 'none';
  $("#intercom").load("http://www.kl2.cz/ajax/intercom.php?user="+encodeURIComponent(user)+"&type="+encodeURIComponent(type)+"&way="+encodeURIComponent(way)+"&about="+encodeURIComponent(about)+"&rand="+encodeURIComponent(rand));
return false;
}

function FrVdStart(user){
  var rand=Math.floor(1000000 * Math.random());
  $("#intercom").load("http://www.kl2.cz/ajax/intercom.php?user="+encodeURIComponent(user)+"&rand="+encodeURIComponent(rand));
return false;
}

function hdn(hodnoceni)
{
for (i=1;i<=5;i++){
document.getElementById('hdn' + i).checked = '';
}
document.getElementById(hodnoceni).checked = 'checked';
return false;
}

function checkPodnik(user){
var rand=Math.floor(1000000 * Math.random());
var znamka = null;
var hodnoceni = null;
for (i=1;i<=5;i++){
znamka = ge('hdn' + i).checked;
if(znamka){
hodnoceni = ge('hdn' + i).value;
document.getElementById('checkPodnikHodnoceni2').style.display = "none";
$("#checkPodnikHodnoceni").load("http://www.kl2.cz/ajax/hodnoceniProfilu.php?go=check&hodnoceni="+encodeURIComponent(hodnoceni)+"&user="+encodeURIComponent(user)+"&rand="+encodeURIComponent(rand));
return false;
}
}
return false;
}