<!-- Browser detection ------------------------------------------------- -->

intIEversion = -1; 
if (navigator.appName == 'Microsoft Internet Explorer')
{
   var ua = navigator.userAgent;
   var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
   if (re.exec(ua) != null)
      intIEversion = parseFloat( RegExp.$1 );
}
IE = (intIEversion > -1);

Chrome = (navigator.userAgent.indexOf('Chrome') != -1)
Safari = (navigator.userAgent.indexOf('Safari') != -1) &&
         (navigator.userAgent.indexOf('Chrome') == -1)

<!-- Adjusting to various screen sizes, iPad and iPhone ---------------- --> 
    
if (screen.width < 481)
{
   document.write('<meta name="viewport" ');
   document.write('content="width=device-width">');
}
if ((screen.width > 480) && (screen.width < 769))
{
   document.write('<meta name="viewport" ');
   document.write('content="width=device-width">');
   document.write('<link rel="stylesheet" type="text/css" ');
   document.write('href="Stylefiles/stylefile_centre_vertical.css">'); 
}

<!-- Page name and location -------------------------------------------- -->				 

strWinPath = window.location.pathname;
slash = "/";
if (window.location.protocol == 'file:')
   if (strWinPath.lastIndexOf(slash) < strWinPath.lastIndexOf("\\"))
      slash = "\\";
strPageName = CleanString(strWinPath.slice(strWinPath.lastIndexOf(slash) + 1, strWinPath.length - 5));
if (strPageName.length == 0)
   strPageName = "index"; 
   
<!-- Help functions ---------------------------------------------------- -->

function CleanString(str)
{
   str = str.replace(/%20/g,' ');
   if (IE)
      str = str.replace(/\//g,'\\');
   return str;		 
}

function EMailCorringham()
{
   document.write('<a href="mailto:information@corringham.eu"');
   document.write('	  class="textlink">');
   document.write('   information@corringham.eu');
   document.write('</a>');
}
