<!--

//if (top.location != self.location) {
//   top.location = self.location;
//}

var agt       = navigator.userAgent.toLowerCase();

var is_ie     = ((agt.indexOf("msie")       != -1) && (agt.indexOf("opera")   == -1));
var is_nav    = ((agt.indexOf('mozilla')    != -1) && (agt.indexOf('spoofer') == -1)
              && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')   == -1)
              && (agt.indexOf('webtv')      == -1) && (agt.indexOf('hotjava') == -1));

var is_win    = ((agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1));
var is_mac    = (agt.indexOf("mac")!=-1);

if ( is_mac && is_ie ) {
   document.write("<link rel=\"stylesheet\" title=\"Default\" href=\"/styles/home_mac_ie.css\" type=\"text/css\">");
} else if ( is_mac && is_nav ) {
   document.write("<link rel=\"stylesheet\" title=\"Default\" href=\"/styles/home_mac_nav.css\" type=\"text/css\">");
} else if ( is_win && is_nav ) {
   document.write("<link rel=\"stylesheet\" title=\"Default\" href=\"/styles/default_home.css\" type=\"text/css\">");
} else {
   document.write("<link rel=\"stylesheet\" title=\"Default\" href=\"/styles/default_home.css\" type=\"text/css\">");
}
if ( is_ie ) {
   document.write("<link rel=\"SHORTCUT ICON\" href=\"/images/icons/mutatis-mutandis.ico\">");
}


function takeShortcut() {
   var number   = document.forms['shortcuts'].jumpTo.selectedIndex;
   var url      = document.forms['shortcuts'].jumpTo.options[number].value; 
   if ( url != "none" ) {
      location.href = url;
   }
}


function openWindow(url, name) {
   popupWin = window.open(url, name, "toolbar,location,resizable,scrollbars,height=460,width=500,left=0,top=0");

   if (popupWin.opener == null) {
      popupWin.opener = window;
      popupWin.opener.name = "opener";
      popupWin.focus();
   }
}

function help(url) {
   popupWin = window.open(url, "helpWindow", "toolbar,location,resizable,scrollbars,height=460,width=500,left=0,top=0");

   if (popupWin.opener == null) {
      popupWin.opener = window;
      popupWin.opener.name = "opener";
      popupWin.focus();
   }
}

function detail(url) {
   var trueURL = "/gallery/archives/det_" + url + ".html?" + location.search.substring(1,location.search.length); 
   help(trueURL);
}

function popupClose() {
   window.close();
   window.opener.focus();
}

function popupRedirect(url) {
   window.opener.window.parent.location.href = url;
   window.opener.focus();
// popupClose();
}

function detailRedirect(url) {
   var trueURL = url + "?" + location.search.substring(1,location.search.length);
   popupRedirect(trueURL);
}

// Initialize variable for storing topnav down.
var topnavDown = "";
var snavDown   = "";

// Preload images for mosueovers.
if (document.images) {
   gallery_on           = new Image();
   gallery_on.src       = "/images/gnav/gnav_gallery_on.gif";
   about_on             = new Image();
   about_on.src         = "/images/gnav/gnav_about_on.gif";
   appearances_on       = new Image();
   appearances_on.src   = "/images/gnav/gnav_appearances_on.gif";
   contact_on           = new Image();
   contact_on.src       = "/images/gnav/gnav_contact_on.gif";

   gallery_off          = new Image();
   gallery_off.src      = "/images/gnav/gnav_gallery_off.gif";
   about_off            = new Image();
   about_off.src        = "/images/gnav/gnav_about_off.gif";
   appearances_off      = new Image();
   appearances_off.src  = "/images/gnav/gnav_appearances_off.gif";
   contact_off          = new Image();
   contact_off.src      = "/images/gnav/gnav_contact_off.gif";

   gallery_down         = new Image();
   gallery_down.src     = "/images/gnav/gnav_gallery_down.gif";
   about_down           = new Image();
   about_down.src       = "/images/gnav/gnav_about_down.gif";
   appearances_down     = new Image();
   appearances_down.src = "/images/gnav/gnav_appearances_down.gif";
   contact_down         = new Image();
   contact_down.src     = "/images/gnav/gnav_contact_down.gif";
}

// Functions for handling state changes in menu images.
// 
function imgOn(imgName) {   
   if ( (document.images) && (topnavDown != imgName) && (snavDown != imgName) ) {
      document[imgName].src = eval(imgName + "_on.src");
   }
}

function imgOff(imgName) {
   if ( (document.images) && (topnavDown != imgName) && (snavDown != imgName) ) {
      document[imgName].src = eval(imgName + "_off.src");
   }
}

function imgDown(imgName, locale) {
   if (document.images) {
      if (locale == "topnav") {
         topnavDown = imgName;    
      } else if (locale == "snav") {
         snavDown = imgName;
      }
      document[imgName].src = eval(imgName + "_down.src");      
   }
}


//-->

var message="All artwork copyright (c) 2009 Armand O'Meara  \nReproduction or use of any materials on this site\nwithout permission violates this copyright.\nContact the artist for purchase inquiry:  \nsend email to jennifer@dragondreams.com."; 

function click(e) {
   if (document.all) {
      if (event.button == 2) {
         alert(message);
         return false;
      }
   }
   if (document.layers) {
      if (e.which == 3) {
         alert(message);
         return false;
      }
   }
}

if (document.layers) {
   document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;

