Added ssl/https switch to application javascript