if (top!=self) top.location.href=self.location.href;

$(document).ready(function(){

 $(".captchaReload").click(function(){
  $("#cpta").attr("src", "/other/captcha.png?time="+(new Date()).getTime());
  $("#captcha").val("");
  $("#captcha").focus();
  return false;
 });

 $("#lgfrm").submit(function(){
  if ($("#heslo").val()) {
   $("#hash").val(md5($("#heslo").val()));
   $("#heslo").val("");
   return true;
  }
 });

 $("#post_f").submit(function(){
  if (!$("#nick").val()) {
   alert("Musíte zadat jméno");
   $("#nick").focus();
   return false;
  } else if (!$("#topic").val()) {
   alert("Musíte zadat nadpis");
   $("#topic").focus();
   return false;
  } else if (!$("#text").val()) {
   alert("Musíte zadat vzkaz");
   $("#text").focus();
   return false;
  } else
   return true; 
 });

 $("#wodonate").click(function(){
  return !window.open(this.href, 'Donate', 'width=400,height=520');
 });

 $("#wolink").click(function(){
  return !window.open(this.href, 'Link', 'width=400,height=410');
 });

 $(".wotestmail").click(function(){
  return !window.open(this.href, 'TestMail', 'width=500,height=500,resizable=1,scrollbars=1');
 });

 $("#gtp").click(function(){
  $("#gtp_f").attr("action", "/index.php?name=box&box=projects/get2post/genuri");
  return true;
 });

 $(".reload").click(function(){
  window.location.reload();
 });

 $(".gtmcollapse").next().next().hide();
 $(".gtmcollapse").click(function() {
  $(this).next().next().toggle();
  return false;
 });

 $(".confirm").click(function(){
  if (confirm('Opravdu chcete provést tuto akci?'))
   return true;
  else
   return false;
 });

 $(".pridej").click(function(){
   return pridej_click(this, document);
 });

});

