What you are doing here is not actually generating a jQuery object. You are actually just concatenating a string:
var clickedElement = '$("' + headParentID + parentClass + ' ' + thisNodeName + '")';
// result (note the quotes surrounding the object:
// clickedElement = '$("#navigation .logo img")'
What you want to do is something like this:
var clickedElement = $( headParentID + parentClass + ' ' + thisNodeName );
// result: clickedElement = $("#navigation .logo img")
The error you are getting is basically saying that a string object does not have the offset()
method.