if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
 var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
 if (ieversion>=7)
  if ("https:" == document.location.protocol)
  {  document.write("Why is the bar green<br>");
     document.write(" ");
     document.write("Find out") }
  else
  {  document.write("Test the bar <br>");
     var newpg = "https://" + document.location.href.substring(7,document.location.href.length);
     document.write("<a href="+newpg+" title='test the bar'>test the bar</a>");
     document.write("Test the bar") }
}
