// code shared by index.html and account.html to set the url to https for login
// C# code in page_load handles it from there.  This logic scans the url from most restrictive
// to least and also sets login.aspx or MasterLogin.aspx as the target page

var url;
url = document.location.href.toLowerCase();
if (url.indexOf('http://skymail.pdvcorp.com') >=0) url= 'https://skymail.pdvcorp.com' + url.substring(26, url.length);
else if (url.indexOf('http://skymail.pacificdatavision.com') >=0) url= 'https://skymail.pacificdatavision.com' + url.substring(36, url.length);
else if (url.indexOf('http://skymail.') >=0) url= 'https://www.skymail.' + url.substring(15, url.length);
else if (url.indexOf('http://') >= 0) url = 'https://' + url.substring(7, url.length);

if (url.indexOf('/marketing/account.html') >= 0) url = url.substring(0, url.indexOf('/marketing')) + '/innm/MasterLogin.aspx';
else if (url.indexOf('/marketing') >= 0) url = url.substring(0, url.indexOf('/marketing')) + '/innm/login.aspx';

if (document.forms.length > 0) document.forms[0].action = url;

