// Current directory that the scripts are going to look for files to work with.

var curDir;

function SetCurDir( theDir ) {
	curDir = theDir;
}


// Image rollovers

function SwapImages() {
	var theLength = SwapImages.arguments.length / 2;
	
	for ( var x = 0; x < theLength; x++ ) {
		document.images[SwapImages.arguments[x * 2]].src = curDir + SwapImages.arguments[(x * 2)+1];
	}
}


// Preload list of images

function PreloadImages() {
	var theLength = PreloadImages.arguments.length;
	
	for ( var x = 0; x < theLength; x++ ) {
		newImg = new Image();
		newImg.src = curDir + PreloadImages.arguments[x];
	}
}


// Honshus specific code

SetCurDir( '../Images/buttons/' );

PreloadImages( 'abouth.gif','announcementsh.gif','specialty.gif','championsh.gif','foundationh.gif','futureh.gif','awardsh.gif','plannedh.gif','puppiesh.gif','pedigreesh.gif','contacth.gif' );

function GenerateSideBar() {
	var items = new Array( "aboutus","announcements","specialty","champions","foundation","future","awards","planned","puppies","pedigrees","contact" );
	var parser = /\S*\/(\S*).html/ig;
	var file = parser.exec( window.location.href )[1];
	
	for ( x = 0; x < items.length; x++ ) {
		if ( file == items[x] ) {
			document.write( "<IMG SRC=\"../Images/buttons/"+items[x]+"h.gif\" NAME=\""+items[x]+"\" WIDTH=\"175\" HEIGHT=\"45\" BORDER=\"0\"><BR>" );
		} else {
			document.write( "<A HREF=\""+items[x]+".html\" onMouseOver=\"SwapImages( '"+items[x]+"','"+items[x]+"h.gif' )\" onMouseOut=\"SwapImages( '"+items[x]+"','"+items[x]+".gif' )\"><IMG SRC=\""+curDir+items[x]+".gif\" NAME=\""+items[x]+"\" WIDTH=\"175\" HEIGHT=\"45\" BORDER=\"0\"></A><BR>" );
		}
	}
}

// Netscape doesn't like being resized (any JavaScript generated HTML gets
// lost), so this is the workaround for this little bug.

var width = window.innerWidth;
var height = window.innerHeight;

window.onResize = new Function( "NSBugFix()" );

function NSBugFix() {
	if ( navigator.appName == 'Netscape' && (width != window.innerWidth || height != window.innerHeight) ) {
		location.href = location.href;
	}
}

