Drupal.locale = { 'pluralFormula': function ($n) { return Number((((($n%10)==1)&&(($n%100)!=11))?(0):((((($n%10)>=2)&&(($n%10)<=4))&&((($n%100)<10)||(($n%100)>=20)))?(1):2))); }, 'strings': {"An AJAX HTTP error occurred.":"Objevila se AJAX HTTP chyba.","HTTP Result Code: !status":"V\u00fdsledn\u00fd k\u00f3d HTTP je: !status","An AJAX HTTP request terminated abnormally.":"AJAX HTTP po\u017eadavek skon\u010dil neobvykle.","Debugging information follows.":"N\u00e1sleduj\u00ed informace pro lad\u011bn\u00ed.","Path: !uri":"Cesta: !uri","StatusText: !statusText":"Text stavu: !statusText","ResponseText: !responseText":"Text odpov\u011bdi:  !responseText","ReadyState: !readyState":"ReadyState: !readyState","Loading":"Na\u010d\u00edt\u00e1n\u00ed","(active tab)":"(aktivn\u00ed z\u00e1lo\u017eka)","Hide":"Skr\u00fdt","Show":"Uk\u00e1zat","Re-order rows by numerical weight instead of dragging.":"Zm\u011b\u0148te po\u0159ad\u00ed \u0159\u00e1dk\u016f pomoc\u00ed \u010d\u00edseln\u00e9 v\u00e1hy m\u00edsto p\u0159eta\u017een\u00ed my\u0161\u00ed.","Show row weights":"Uka\u017e v\u00e1hy \u0159\u00e1dk\u016f","Hide row weights":"Skryj v\u00e1hy \u0159\u00e1dk\u016f","Drag to re-order":"Pro p\u0159eskupen\u00ed p\u0159et\u00e1hn\u011bte my\u0161\u00ed","Changes made in this table will not be saved until the form is submitted.":"Zm\u011bny proveden\u00e9 v t\u00e9to tabulce budou ulo\u017eeny a\u017e po odesl\u00e1n\u00ed  formul\u00e1\u0159e.","Cancel":"Zru\u0161it","Disabled":"Vypnuto","Enabled":"Zapnuto","Edit":"Upravit","none":"\u017e\u00e1dn\u00e9","Configure":"Nastaven\u00ed","Done":"Hotovo","Select all rows in this table":"Ozna\u010dit v\u0161echny \u0159\u00e1dky v t\u00e9to tabulce","Deselect all rows in this table":"Zru\u0161it ozna\u010den\u00ed v\u0161ech \u0159\u00e1dek v t\u00e9to tabulce","Not published":"Nevyd\u00e1no","Please wait...":"Pros\u00edm \u010dekejte...","Not enabled":"Nepovolen","By @name on @date":"U\u017eivatel @name dne @date","By @name":"Dle @name","Not in menu":"Nen\u00ed v menu","Alias: @alias":"Alias: @alias","No alias":"\u017d\u00e1dn\u00fd alias","New revision":"Nov\u00e1 revize","The changes to these blocks will not be saved until the \u003cem\u003eSave blocks\u003c\/em\u003e button is clicked.":"Zm\u011bny v t\u011bchto bloc\u00edch se neprojev\u00ed, dokud je neulo\u017e\u00edte pomoc\u00ed tla\u010d\u00edtka \u003cem\u003eUlo\u017eit bloky\u003c\/em\u003e.","Show shortcuts":"Zobrazit zkratky","This permission is inherited from the authenticated user role.":"Pr\u00e1va byla zd\u011bd\u011bna z ov\u011b\u0159en\u00e9 u\u017eivatelsk\u00e9 role.","No revision":"\u017d\u00e1dn\u00e1 revize","@number comments per page":"Po\u010det koment\u00e1\u0159\u016f na str\u00e1nku: @number","Requires a title":"Vy\u017eaduje n\u00e1zev","Not restricted":"Nen\u00ed omezeno","Not customizable":"Nelze p\u0159izp\u016fsobit","Restricted to certain pages":"Omezen\u00fd na ur\u010dit\u00fd str\u00e1nky","The block cannot be placed in this region.":"Blok nem\u016f\u017ee b\u00fdt um\u00edst\u011bn do tohoto regionu.","Customize dashboard":"P\u0159izp\u016fsobit ovl\u00e1dac\u00ed panel","Hide summary":"Skr\u00fdt souhrn","Edit summary":"Upravit souhrn","Don't display post information":"Nezobrazovat informace o p\u0159\u00edsp\u011bvku","@title dialog":"@title dialog","The selected file %filename cannot be uploaded. Only files with the following extensions are allowed: %extensions.":"Vybran\u00fd soubor %filename nelze nahr\u00e1t. Jsou povoleny pouze soubory s t\u011bmito p\u0159\u00edponami: %extensions.","Autocomplete popup":"Vyskakovac\u00ed okno automatick\u00e9ho dokon\u010dov\u00e1n\u00ed","Searching for matches...":"Hled\u00e1m shody...","Hide shortcuts":"Skr\u00fdt zkratky","Submit":"Ulo\u017eit","all":"v\u0161e","Select":"Vybrat"} };;

/**
 * @file
 *
 * Javascript specific to facebook connect pages.  This means pages
 * which are not canvas pages, and where fb_connect.module has
 * initialized the facebook api. The user may or may not have
 * authorized the app, this javascript will still be loaded.
 *
 * Note (!) much of the work done here is deprecated, and moved to fb.js
 * (where code works equally well on both connect pages and canvas
 * pages).  If your app needs the features here, please report your
 * use case to our issue queue (http://drupal.org/project/issues/fb),
 * otherwise these features may go away...
 */
(function ($) {
  Drupal.behaviors.fb_connect = {
    attach: function(context, settings) {
      // Logout of facebook when logging out of drupal.
      jQuery("a[href^='" + Drupal.settings.basePath + "user/logout']", context).click(FB_Connect.logoutHandler);

      // Support markup for dialog boxes.
      FB_Connect.enablePopups(context);

      var events = jQuery(document).data('events');
      if (!events || !events.fb_session_change) {
        jQuery(document).bind('fb_session_change', FB_Connect.sessionChangeHandler);
      }
    }
  };
})(jQuery);

FB_Connect = function(){};

// JQuery pseudo-event handler.
FB_Connect.sessionChangeHandler = function(context, status) {
  jQuery('.block-fb_connect')
    .ajaxStart(function() {
      jQuery(this).html('<div class="progress fb_connect_pb"><div class="bar"><div class="filled"></div></div></div>');
    })
    .ajaxStop(function() {
      jQuery(this).html('');
    })
  ;

  // Call the default handler, too.
  FB_JS.sessionChangeHandler(context, status);
};

// click handler
FB_Connect.logoutHandler = function(event) {
  if (typeof(FB) != 'undefined') {
    FB.logout(function () {
      // Logged out of facebook.  Need we act on this?
    });
    // Facebook's invalid cookies persist if third-party cookies disabled.
    // Let's try to clean up the mess.
    // @TODO: is this still needed with newer oauth SDK???
    FB_JS.deleteCookie('fbs_' + FB._apiKey, '/', ''); // app id
    FB_JS.deleteCookie('fbs_' + Drupal.settings.fb.apikey, '/', ''); // apikey
  }
  if (FB.getUser()) { // @TODO: still needed with newer oauth SDK???
    // Facebook needs more time to log us out. (http://drupal.org/node/1164048)
    Drupal.settings.fb.reload_url = Drupal.settings.fb_connect.front_url;
    return false;
  }
};

/**
 * Move new dialogs to visible part of screen.
 **/
FB_Connect.centerPopups = function() {
  var scrollTop = $(window).scrollTop();
  $('.fb_dialog:not(.fb_popup_centered)').each(function() {
    var offset = $(this).offset();
    if (offset.left == 0) {
      // This is some facebook cruft that cannot be centered.
    }
    else if (offset.top < 0) {
      // Not yet visible, don't center.
    }
    else if (offset.top < scrollTop) {
      $(this).css('top', offset.top + scrollTop + 'px');
      $(this).addClass('fb_popup_centered'); // Don't move this dialog again.
    }
  });
};


FB_Connect.enablePopups = function(context) {
  // Support for easy fbml popup markup which degrades when javascript not enabled.
  // Markup is subject to change.  Currently...
  // <div class=fb_fbml_popup_wrap><a title="POPUP TITLE">LINK MARKUP</a><div class=fb_fbml_popup><fb:SOME FBML>...</fb:SOME FBML></div></div>
  jQuery('.fb_fbml_popup:not(.fb_fbml_popup-processed)', context).addClass('fb_fbml_popup-processed').prev().each(
    function() {
      this.fbml_popup = $(this).next().html();
      this.fbml_popup_width = parseInt($(this).next().attr('width'));
      this.fbml_popup_height = parseInt($(this).next().attr('height'));
      //console.log("stored fbml_popup markup: " + this.fbml_popup); // debug
      $(this).next().remove(); // Remove FBML so facebook does not expand it.
    })
    // Handle clicks on the link element.
    .bind('click',
	  function (e) {
	    var popup;
	    //console.log('Clicked!  Will show ' + this.fbml_popup); // debug

	    // http://forum.developers.facebook.net/viewtopic.php?pid=243983
	    var size = FB.UIServer.Methods["fbml.dialog"].size;
	    if (this.fbml_popup_width) {
	      size.width=this.fbml_popup_width;
	    }
	    if (this.fbml_popup_height) {
	      size.height=this.fbml_popup_height;
	    }
	    FB.UIServer.Methods['fbml.dialog'].size = size;

	    // http://forum.developers.facebook.net/viewtopic.php?id=74743
	    var markup = this.fbml_popup;
	    if ($(this).attr('title')) {
	      markup = '<fb:header icon="true" decoration="add_border">' + $(this).attr('title') + '</fb:header>' + this.fbml_popup;
	    }
	    var dialog = {
	      method: 'fbml.dialog', // triple-secret undocumented feature.
	      display: 'dialog',
	      fbml: markup,
	      width: this.fbml_popup_width,
	      height: this.fbml_popup_height
	    };
	    var popup = FB.ui(dialog, function (response) {
	      console.log(response);
	    });

	    // Start a timer to keep popups centered.
	    // @TODO - avoid starting timer more than once.
	    window.setInterval(FB_Connect.centerPopups, 500);

	    e.preventDefault();
	  })
    .parent().show();
};

;

