now it works properly, fix cookie bugs, prototype bugs.
But still not clear why could not attach event to prototype, need ask help