// mark the connection //alert( document.getElementById(window.location.hostname.split(".")[0])); function accessedcolour(){ if (location.protocol === 'https:') { var x = document.getElementsByName(window.location.hostname.split(".")[0]); }else{ var x = document.getElementsByName('plaintext'); } console.log(x[0]); for (i = 0; i < x.length; i++) { x[i].style.backgroundColor = "#456048"; x[i].style.color = "#f3f3f3"; } } function changeaccess(dest){ // change the http vs https vs hostname (therefore cipher) whilst keeping the same page // messy, but difficult to avoid // plaintext, https, selfsigned, expired if(dest == "plaintext"){ window.location.href = window.location.href.replace(/^.*7blessings/, "http://www.7blessings"); }else if(dest == "https"){ window.location.href = window.location.href.replace(/^.*7blessings/, "https://www.7blessings"); }else if(dest == "selfsigned"){ window.location.href = window.location.href.replace(/^.*7blessings/, "https://selfsigned.7blessings"); }else if(dest == "expired"){ window.location.href = window.location.href.replace(/^.*7blessings/, "https://expired.7blessings"); }else{ alert("..."); } }