﻿if (location.protocol.toLowerCase() == 'http:' && location.href.toLowerCase().match(/(account|login|register|password|confirm|checkout)/))
    location.href = location.href.replace('http:', 'https:');
else if (location.protocol.toLowerCase() == 'https:' && !location.href.toLowerCase().match(/(account|login|register|password|confirm|checkout)/))
    location.href = location.href.replace('https:', 'http:');
