fixed javascript to accomodate for both IE9 and IE10. PITA