/* Very simple script to display a warning message if the screen resolution is less than 1024x768 and isn't an iPhone */

var width;
var height;
  
if (window.innerWidth) { //if browser supports window.innerWidth
  width = window.innerWidth;
  height = window.innerHeight;
} else if (document.all) { //else if browser supports document.all (IE 4+)
  width = document.body.clientWidth;
  height = document.body.clientHeight;
}
  
message  = '<p class="warning">Whoops! Your resolution is only ' + width + 'x' + height + '. This website ';
message += 'requires a minimum of 1024x768 to render correctly. You will still be able to navigate around, but it may';
message += ' look a littled "scrunched" in places. Maybe you could reset your graphics card to use a higher resolution?';
message += ' If you cannot, perhaps you could contact us with some details, so we can determine the best course of action';
message += ' we need to take to keep these pages as user-friendly as we can.</p>\n';
message += '<p class="warning">Please use this link to send an e-mail to the <a class="txt" href="mailto:webmaster@gites.org.uk"';
message += ' title="Send an e-mail to the Webmaster">&nbsp;webmaster@gites.org.uk&nbsp;</a> reporting the problem. Thank you.</p>';

var agent = navigator.userAgent.toLowerCase();
var is_iphone = (agent.indexOf('iphone') != -1);

if (width < 999 && ! is_iphone) { (width && height) ? document.write(message) : ''; }
