// Shockwave Flash Detection copyright Acro Media inc. 2003

var hasFlash = 0;

function noErrors() {
	return true;
}

// check with objects first
if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
	if (navigator.plugins && navigator.plugins["Shockwave Flash"]){
		hasFlash = 1;
	}
}
// check with IE objects
else if (navigator.userAgent && (navigator.userAgent.indexOf("MSIE")>=0)){
	if((navigator.userAgent.indexOf("Windows 95") != -1) || (navigator.userAgent.indexOf("Windows 98") != -1) || (navigator.userAgent.indexOf("Windows NT") != -1)) {
		with(document){
			writeln('<SCRIPT LANGUAGE=VBScript\>');
			writeln('on error resume next');
			writeln('hasFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash")))');
			writeln('<\/SCRIPT\>');
		}
	}
	// give Macs one last chance - Mac IE 4.5 cannot detect flash, but is guaranteed to have it.
	else if((navigator.userAgent.indexOf("Mac") != -1) && (parseFloat(navigator.appVersion) >= 4)){
		hasFlash = 1;
	}
}

function noErrors() {
	return true;
}

preloaded = 0;
var imageNames;
var imageOver;
graphicsDir = dirDepth+"graphics/toolbar/";

if (document.images) {

	imageNames = new initArray("button1", "button2", "button3", "button4", "button5", "button6", "button7", "button8", "button9", "button10", "button11", "button12");
	imageOver = new initArray("b_home_02.gif", "b_ask_02.gif", "b_make_02.gif", "b_resources_02.gif", "b_testimonials_02.gif", "b_bio_02.gif", "b2_books_02.gif", "b2_know_02.gif", "b2_duh_02.gif", "b2_exercise_02.gif", "b2_subscribe_02.gif", "b2_archives_02.gif");

}

function preloadImages(){
	if(document.images){
		var i, temp;

		for(i=0; i<imageNames.length; i++){
			document.images[imageNames[i]].offsrc = document.images[imageNames[i]].src;
		}

		for(i=0; i<imageNames.length; i++){
			temp = new Image();
			temp.src = graphicsDir + imageOver[i];
			document.images[imageNames[i]].oversrc = temp.src;
		}

		preloaded = 1;
	}
}

function initArray(){
      if (document.images) {
      this.length = initArray.arguments.length;
      for (var i=0;i<= this.length; i++)
         this[i] = initArray.arguments[i];
   }
}

function mouseOver(imageID) {
	if (document.images && (preloaded)) {
		document.images[imageNames[imageID]].src = document.images[imageNames[imageID]].oversrc;
	}
}

function mouseOut(imageID) {
	if (document.images && (preloaded)){
		document.images[imageNames[imageID]].src = document.images[imageNames[imageID]].offsrc;
	}
}

window.onerror = noErrors;