Comet implemented

That was easy :O
Missing bracket + added quotes around ifs to support IE8
Fixed IE8 issues
Moved duplicate code to separate file