var FBConnect={debugVerbose:window.location.href.indexOf("fbc_verbose_debug")!=-1,initialized:false,init:function(a,b,c,d,e,f){a||FBConnect.error("api_key is not set");b||FBConnect.error("plugin path not provided");this.debugVerbose&&document.getElementsByTagName("html").item(0).getAttribute("xmlns:fb")===null&&FBConnect.error("xmlns:fb not defined on html tag - check your templates");FBConnect.home_url=d||"/";FBConnect.plugin_path=b;FBConnect.template_bundle_id=c;FBConnect.wp_user=e;FB.init(a,b+ "xd_receiver.php",f);FBConnect.initialized=true},appconfig_reload:{reloadIfSessionStateChanged:true},appconfig_none:{},appconfig_ajaxy:{ifUserConnected:fbc_onlogin_noauto,ifUserNotConnected:fbc_onlogout_noauto},logout:function(){FB.ensureInit(function(){FB.Connect.logout()})},redirect_home:function(){window.location=FBConnect.home_url},setup_feedform:function(){if(FBConnect.template_bundle_id){var a=ge("commentform");if(a){var b=ge("submit");if(b&&b.getAttribute("name")==="submit"){var c=document.createElement("input"); c.setAttribute("name","fbc_submit_hack");c.setAttribute("type","submit");c.setAttribute("value","Submit Comment");a.appendChild(c);b.parentNode.replaceChild(c,b)}if(a.submit.nodeType)FBConnect.error("unable to find .submit() on commentform");else a.onsubmit=function(){return FBConnect.show_comment_feedform()}}else FBConnect.error("unable to locate id=commentform")}else FBConnect.error("no template id provided")},show_comment_feedform:function(){var a={"post-url":window.location.href,"post-title":FBConnect.article_title, "blog-name":FBConnect.blog_name,"blog-url":FBConnect.home_url},b="",c=ge("commentform");if(c)if(b=c.comment)b=b.value;else{FBConnect.error("unable to locate comment textarea");return true}else{FBConnect.error("unable to locate comment form, expected id=commentform");return true}if(b.length===0)return true;FB.Connect.showFeedDialog(FBConnect.template_bundle_id,a,null,null,null,FB.RequireConnect.promptConnect,function(){c.submit()},"Your comment: ",{value:b});return false},error:function(a){FBConnect.debugVerbose&& alert("Error: "+a)}};function fbc_onlogout_noauto(){fbc_set_visibility_by_class("fbc_hide_on_login","");fbc_set_visibility_by_class("fbc_hide_on_logout","none")}function fbc_onlogin_noauto(){fbc_set_visibility_by_class("fbc_hide_on_login","none");fbc_set_visibility_by_class("fbc_hide_on_logout","");FBConnect.setup_feedform()}function fbc_set_visibility_by_class(a,b){a=document.getElementsByClassName(a);for(var c=0;c<a.length;++c)a[c].style.visibility=b} function ge(a){return document.getElementById(a)}jQuery(document).ready(function(a){if($fb_connect_button=a("div.fb_connect a")){$fb_connect_button.attr("href","javascript:;");$fb_connect_button.click(function(){FB.Connect.requireSession()})}});