// check for given ids
if ($('dentistLink') && $('nurseLink'))
{
    // add the clicks in
}

// function to handle above clicks
function handleClicks()
{
}