if (top.frames.length!=0)
top.location=self.document.location;

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}
var preloadFlag = false;

function preloadImages() {
	if (document.images) {
		handbook_on = newImage("/shared/tabs/hb_light16.gif");
		destin_on = newImage("/shared/tabs/des_light16.gif");
		faqmap_on = newImage("/shared/tabs/mf_light16.gif");
		blogorg_on = newImage("/shared/tabs/blog_light.gif");
		events_on = newImage("/shared/tabs/ev_light16.gif");
		photos_on = newImage("/shared/tabs/pho_light16.gif");
		catalog_on = newImage("/shared/tabs/cat_light16.gif");
		resource_on = newImage("/shared/tabs/res_light16.gif");

		preloadFlag = true;
	}
}

/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  Copyright 2001-3 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

function initImgRotation() {
  // create rotating image objects here 
  // arguments: image name, rotation speed
  var rotator1 = new rotateImgObj('series',2500);
  // add the images to rotate into that image object  
  rotator1.addImages("mh_pf7.jpg","mh_fj9.jpg");
  rotator1.rotate();
  
  rotateImgObj.start();
}

// If all the images you wish to display are in the same location, you can specify the path here 
rotateImgObj.imagesPath = "/shared/covers/";

// no need to edit code below 
/////////////////////////////////////////////////////////////////////
rotateImgObjs = []; // holds all rotating image objects defined
// constructor 
function rotateImgObj(nm,s) {
  this.speed=s; this.ctr=0; this.timer=0;  
  this.imgObj = document.images[nm]; // get reference to the image object
  this.index = rotateImgObjs.length; rotateImgObjs[this.index] = this;
  this.animString = "rotateImgObjs[" + this.index + "]";
}

rotateImgObj.prototype = {
  addImages: function() { // preloads images
    this.imgObj.imgs = [];
    for (var i=0; arguments[i]; i++) {
      this.imgObj.imgs[i] = new Image();
      this.imgObj.imgs[i].src = rotateImgObj.imagesPath + arguments[i];
    }
  },

  rotate: function() {
    if (this.ctr < this.imgObj.imgs.length-1) this.ctr++;
    else this.ctr = 0;
    this.imgObj.src = this.imgObj.imgs[this.ctr].src;
  }
}

// sets up rotation for all defined rotateImgObjs
rotateImgObj.start = function() {
  for (var i=0; i<rotateImgObjs.length; i++) 
    rotateImgObjs[i].timer = setInterval(rotateImgObjs[i].animString + ".rotate()", rotateImgObjs[i].speed);                     
}

// AutoBlink
// Puts Google's Autolink on the Blink :)
// (c) 2005 Chris Ridings   http://www.searchguild.com
// Redistribute at will but leave this message intact
// -
// 5th March - Implemented speed enhancement suggested by the guy who wrote
// http://www.dougaltoolbar.com/
// -
// 5th March - Added additional elements to reduce machine load
// 5th March - Added option to not remove links but to 
// rewrite ISBN links as amazon affiliate links!
// Fill in the following
// if you wish to do this. e.g.  var amazonaffiliate="goodlookingco-20"
// Leave as is to remove links in the normal way
var amazonaffiliate="";

var linkcount;
function checklinks() {
	if (!(linkcount==document.links.length)) {
		// Something changed the links!
		// Iterate for an id of _goog
		for (i=0; i < document.links.length; i++) {
			if (document.links[i].id.substring(0,5)=="_goog") {
				// If we find an id of _goog then do something
				if (amazonaffiliate=="") { 
					// No affiliate id defined so remove the links
					var tr = document.links[i].parentTextEdit.createTextRange();
					tr.moveToElementText(document.links[i]);
					tr.execCommand("Unlink",false);
					tr.execCommand("Unselect",false);
					i--;
				} else {
					// An affiliate id defined so rewrite ISBN links
					if (document.links[i].href.indexOf("isbn")>0) {
						var isbn=document.links[i].href.substring(document.links[i].href.indexOf("text")+5,document.links[i].href.length);
						document.links[i].href="http://www.amazon.com/exec/obidos/external-search?search-type=ss&tag=" + amazonaffiliate + "&keyword=" + isbn + "&index=books";
					}
				}
			}
		}
	}
		linkcount = document.links.length;
		setTimeout("checklinks()",500);
}
if (document.getElementById && document.createElement) {
	linkcount=document.links.length;
	setTimeout("checklinks()",500);
}

