Added Javascript IF for PhamtomJS testing