$(function(){ 
    $(document).pngFix();
    
    $("h2.faq").css({"cursor":"pointer","text-decoration":"underline"});
    $("h2.faq + div.faq").css({"display":"none"});
    $("h2.faq-open + div.faq").slideDown();
    $("h2.faq").click(
      function () {
        $(this).next("div.faq").slideToggle("300");
        }
    );
    
    $("a[rel=id-944]").click(function(){
      var url = $(this).attr("href");
      window.open( url );
      return false;
    });

    $("a[rel=id-1007]").click(function(){
      $(".thickbox.kniha").trigger("click");
      return false;
    });

    if($('form#login').next('.validation-message').children('.NoticerError').length)
      $('form#login').hide();
    else
      $('form#forgot').hide();
    $('#login a').click(function(){
      $('.NoticerError').remove();
      $('#forgot').show();
      $('#login').hide();
    });
    

    $("#yes_nejsemnic").click(function() {
    
      if ($("#yes_nejsemnic").attr("checked") == true) {        
        if ($("#yes_sms").attr("checked") == true) {
          $("#yes_sms").removeAttr("checked");
        }
        if ($("#yes_medea").attr("checked") == true) {
          $("#yes_medea").removeAttr("checked");
        }        
      }
    
    });

    $("#yes_sms, #yes_medea").click(function() {
    
      if ($("#yes_nejsemnic").attr("checked") == true) {        
        if ($("#yes_nejsemnic").attr("checked") == true) {
          $("#yes_nejsemnic").removeAttr("checked");
        }     
      }
    
    });

    /* -- jquery cookie -- */
    $('#jsem-odbornik').click(function() {
        var date = new Date();
        date.setTime(date.getTime() + (24 * 60 * 60 * 1000));
        $.cookie("magnesiaodbornik", '1', { path: '/', expires: date });
        return true;
    });


});