<!--
/**********************************************************************
 * file:    stdpgfnc.js
 * purpose: standard page functions
 * author:  Simon N. Anthony
 * date:    09 January 2004
 * notes:   initial version only handles right mouse click for IE.
 *
 * Copyright (c) Simon N. Anthony, 2004. All rights reserved.
 *
 * amendments:
 * 04 Mar 2004 Handle right mouse click for Gecko & IE browsers.
 *
 **********************************************************************/

var ownerDomain = 'sna-design.com';
var ownerDomainWeb = 'www.sna-design.com';

if ((document.domain != ownerDomain) && (document.domain != ownerDomainWeb) && (document.domain != 'd330308.preview55.siteaction.biz')) {
  alert('This page has been illegally referenced from outwith the owner domain.' + '\n' +
        'You will now be redirected to the root page of the owner domain.');
  location.href = 'http://' + ownerDomainWeb;
}

if (self.parent.frames.length != 0)
self.parent.location = document.location;


var gecko = (navigator.product == 'Gecko');

function msieVersion() {
  var userAgent = window.navigator.userAgent;
  var msie = userAgent.indexOf("MSIE ");
  if (msie > 0)
    // browser is Microsoft Internet Explorer - return version number
    return parseInt(userAgent.substring(msie + 5, userAgent.indexOf(".",  msie)));
  else
    // browser is other
    return 0;
}


function ieDocumentMouseDown() {
  // mouse buttons: left = 1, right = 3 - center = 2
  if ((event.button == 2) || (event.button == 3)) {
    alert(cprMsg);
    return false;
  }

  return true;
}


function geckoWindowClick(e) {
  // mouse buttons: left = 1, right = 3 - center = 2
  if ((e.which == 2) || (e.which == 3 )) {
    alert(cprMsg);
    e.cancelBubble = true;
    return false;
  }
  return true;
}


/**********************************************************************/

var cprMsg = 'Copyright (c) Simon N. Anthony, 1998 - 2009. All rights reserved.' +
             '\n\nCopyright details of photographs are as specified along with image.' +
             '\n\nYou are not permitted to make copies of any material contained on this web site.' +
             '\nTo do so is theft.';


var bDoesDHTML = (msieVersion() >= 4) || gecko;

if (gecko) {
  // gecko browsers
  window.captureEvents(Event.CLICK);
  window.onclick = geckoWindowClick;
}
else {
  // non-gecko browsers
  document.onmousedown = ieDocumentMouseDown;
}

// -->
