
FB.init("5ca99c79efa98c0139416aa3e7677cb8", 
          "http://www.cheapirvine.com/connect/xd_receiver.htm",
          {"forceBrowserPopupForLogin":false}); 
          
$(document).ready(function()
{
  $('#fb_connect_link').click(function()
  {
    FB.Connect.requireSession(function ()
    {
      window.location="/system/verify_fb.php";
    });
    return false;
  });
  $('.fb_share_link').click(function()
  {
    var coupon_parent = $(this).parents('li');
    FB.Connect.showFeedDialog(112080182771, 
                              {"coupon" : $.trim(coupon_parent.find('h3').html()),
                               "coupon_store" : coupon_parent.find('.store_name').html().replace(/View /, '').replace(/'s profile/, '') ,
                               "coupon_description" : coupon_parent.find('.offer_desc').html(),
                               "images" : [{"src" : coupon_parent.find('.offer_logo a img').attr('src'), 
                                            "href" : coupon_parent.find('.offer_logo a').attr('href')}]}, 
                              '', 
                              '', 
                              null, 
                              FB.RequireConnect.promptConnect, 
                              '', 
                              'Why do you like this coupon?', 
                              '');
    return false;
  });
  $('.fb_share_link2').click(function()
  {
    var coupon_parent = $(this).parents('li');
    FB.Connect.showFeedDialog(112080182771, 
                              {"coupon" : $.trim(coupon_parent.find('h3').html()),
                               "coupon_store" : '<a href="'+location.href+'">'+$('#merchant_name').html()+'</a>',
                               "coupon_description" : coupon_parent.find('.offer_desc').html(),
                               "images" : [{"src" : $('#merchant_logo').attr('src'), 
                                            "href" : location.href}]}, 
                              '', 
                              '', 
                              null, 
                              FB.RequireConnect.promptConnect, 
                              '', 
                              'Why do you like this coupon?', 
                              '');
    return false;
  });
  $('.fb_share_link_store').click(function()
  {
    FB.Connect.showFeedDialog(112117502771, 
                              {"coupon_store" : '<a href="'+location.href+'">'+$('#merchant_name').html()+'</a>',
                              "store_desc" : $('.description').text(),
                               "images" : [{"src" : $('#merchant_logo').attr('src'), 
                                            "href" : location.href}]}, 
                              '', 
                              '', 
                              null, 
                              FB.RequireConnect.promptConnect, 
                              '', 
                              'Why do you like this store?', 
                              '');
    return false;
  });
 
});


