function getRefToDivMod( divID, oDoc ) {
  if( !oDoc ) { oDoc = document; }
  if( document.layers ) {
    if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
      for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
        y = getRefToDivMod(divID,oDoc.layers[x].document); }
      return y; } }
  if( document.getElementById ) { return oDoc.getElementById(divID); }
  if( document.all ) { return oDoc.all[divID]; }
  return document[divID];
}

function openPerfectPopup(photo,oW,oTitle,oContent) {
  var x = window.open('','windowName','width=500,height=400,resizable=1');
  if( !x ) { return true; }
x.document.open();
x.document.write('<HTML><HEAD>');
x.document.write('<LINK href="http://www.aarontrotter.com.au/main.css" rel="stylesheet">');
x.document.write('<SCRIPT language="JavaScript" type="text/javascript" src="main.js"></script></head>');
x.document.write('<body><table cellpadding=20><TR><TD>');
x.document.write('<img src='+photo+' border=0>');
x.document.write('<BR><BR><center><input type=Button class=buttons value=Back onClick=self.close()>');
x.document.write('</TD></TR></table></body></HTML>');
x.document.close();

  var oH = getRefToDivMod( 'myID', x.document ); if( !oH ) { return false; }
  var oH = oH.clip ? oH.clip.height : oH.offsetHeight; if( !oH ) { return false; }
  x.resizeTo( oW + 200, oH + 200 );
  var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;
  if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }
  else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }
  else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }
  if( window.opera && !document.childNodes ) { myW += 16; }
  x.resizeTo( oW + ( ( oW + 200 ) - myW ), oH + ( (oH + 200 ) - myH ) );
  if( x.focus ) { x.focus(); }
  return false;
}




      function UpdateWindow(photo) {
popup = window.open('','Gallery','resizable=no,screenY=150,width=600,height=450,toolbar=yes,location=yes')

popup.document.write('<HTML><HEAD>');
popup.document.write('<LINK href="http://www.aarontrotter.com.au/main.css" rel="stylesheet">');
popup.document.write('<SCRIPT language="JavaScript" type="text/javascript" src="main.js"></script></head>');
popup.document.write('<body><table cellpadding=20><TR><TD>');
popup.document.write('<img src='+photo+' border=0>');
popup.document.write('<BR><BR><center><input type=Button class=buttons value=Back onClick=self.close()>');
popup.document.write('</TD></TR></table></body></HTML>');
      }




var message="Images are subject to copyright and can not be saved.";


if (navigator.appName == 'Microsoft Internet Explorer'){
function NOclickIE(e) {
if (event.button == 2 || event.button == 3) {
alert(message);
return false;
}
return true;
}
document.onmousedown=NOclickIE;
document.onmouseup=NOclickIE;
window.onmousedown=NOclickIE;
window.onmouseup=NOclickIE;
}
else {
function NOclickNN(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}}}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=NOclickNN; }
document.oncontextmenu=new Function("alert(message);return false")
}