/*global WPOL, document, handleOnlinePackageExternalLink, handleOnlinePackageEmailFormLink, handleOnlinePackageExternalLink, handleOnlinePackageBodyLinksToExternalSitesOnClick, s, jQuery, namespace*/
namespace('WPOL.customerprofile').registerEventListeners = function ($, hostname) {
var listingName = $("#intro h1").text();
$('#intro .web-link a,.image-panel a').click(function () {
handleOnlinePackageExternalLink(s, this, listingName);
});
$('a.emailFormLink').click(function () {
handleOnlinePackageEmailFormLink(s, this, listingName);
});
$('.online-package-main-container div.module').each(function () {
var module = $(this);
module.find('a').each(function () {
if (hostname.toLowerCase() !== this.hostname.toLowerCase() && this.protocol.toLowerCase().match(/https?/)) {
$(this).click(function () {
handleOnlinePackageExternalLink(s, this, listingName);
});
}
});
});
$('#content a[href^=mailto:]').each(function () {
$(this).bind('click', WPOL.EventCapture.handleMailtoLinkClick);
});
$('#content a.mapLink').each(function () {
var mapLink = $(this);
mapLink.click(function () {
WPOL.EventCapture.handleCustomerProfileMapLinkClick(this);
});
});
};
WPOL.customerprofile.registerEventListeners(jQuery, document.location.hostname);
