
var flashvars = {};
var params = {
  wmode: 'transparent'
};
var attributes = {};

swfobject.embedSWF('/assets/flash/home/lansinoh_product_scroller_loader.swf', 'home_splash', '717', '430', '10.0.0', '/assets/flash/home/expressInstall.swf',flashvars,  params, attributes);

function dummyFunction() {

}

function log(message) {
  if (typeof console != 'undefined') {
    console.log(message);
  }
}

function recordEvent(category, action, label) {
  if (typeof _gaq != 'undefined') {
    _gaq.push(['_trackEvent', category, action, label]);
  } else {
    log('GA not active');
  }
}


//LANS-331, updated in LANS-337
function recordOutboundLink(link, category, action) {
  var hostname = window.location.hostname;
  if (hostname.indexOf('lansinoh.com') > -1) {
    recordEvent(category, action, link);
  }
  //if not in production, nothing should happen here.
  return true;
}

$(function() {
  //LANS-331
  $('a[href^=http]').not('a[href*="lansinoh"]').addClass('external');
  $('a.external').attr('target', '_blank');
  //$('a.external').removeAttr('target');
  $('a.external').click(function() {
    var link = $(this).attr('href');
    return recordOutboundLink(link, 'leave-site', 'click');
  });
});

$(document).ready(function()
{
  //hide the all of the element with class msg_body
  $(".source").hide();
  //toggle the componenet with class msg_body
  $(".sourceLink").click(function()
  {
    $(this).siblings(".source").slideToggle(600);
  });

  // Disabled at the request of Kat LANS-62
  //$('a[target=_blank]').leaveNotice({siteName:'Lansinoh.com',timeOut:5000, exitMessage:'This link will take you to a Web site to which this Privacy Policy does not apply. We encourage you to read the Privacy Policy of every Web site you visit.'});
  

  $("form#buy_form").submit(function() {

    if ($("#product").val() == "choose")
    {
      $("#retailerNarrowForm").prepend('<span class="error">Please Select a Product</span>');

      return false;
    }
    return true;
  });



});
