﻿    if(location.protocol.toLowerCase() =='http:' && 
        location.href.toLowerCase().indexOf('login') > -1 )  
             location.href = location.href.replace('http:','https:');

    if(location.protocol.toLowerCase() =='https:' && 
         location.href.toLowerCase().indexOf('login') == -1 )
             location.href = location.href.replace('https:','http:');

