#p_box includes #p_cont, when click anywhere in the #p_box area (including #p_cont), an event will be triggered. If you want to prevent an event from being triggered when the #p_cont area is clicked, you need to add code to prevent the event from bubbling in the #p_cont area.
becomes
function a(){
//Here is the code for a event
}
function stopBubble(e) {
if (e && e.stopPropagation) {//Non-IE browser
e.stopPropagation();
}
else {//IE browser
window.event.cancelBubble = true;
}
}