[bug973119] - Forced 'https' and changed 'if' statement to pure javascript