/*	jsinit.js - v2.2 (c)h 040821, included in _head.html for all pages */

if (document.getElementById || document.all) {
	document.write('<link rel="stylesheet" type="text/css" href="/include/css/dynamic.css" />');
	}
var initOk = false; //no scripting before true
function init() {
	initNav();
	if (typeof initPage != "undefined") initPage();
	initOk = true;
	}
window.onload = init;

//nav highlight	
function initNav() {
	if (document.getElementById) {
		var url = document.location.pathname;
		//[navID, path] list
		var pages = [ 
			["navcdot", "/index.jsp"],
			["navabout", "/about.shtml"],
			["navcontact", "/contact.jsp"],
			["navsitemap", "/sitemap.shtml"],
			["navhistory", "/history.shtml"], 
			["navsubscribe", "/rss.shtml"], 
			["navcopyright", "/copyright.shtml"],
			["navfeatures", "/dotfeet/"],
			["navmischer", "/mischer/"],
			["navphoto", "/photo/"], 
			["navportrait", "/portrait/"], 
			["navstory", "/stories/"], 
			["naviyos", "/iyos_org/"],
			["navcontact", "/iyos_org/contact.jsp"],
			["navcopyright", "/iyos_org/copyright.shtml"]
			];
		var current = findPos(url, pages);
		if (current > -1) setClassName(pages[current][0]);
		//subnav
		pages = [ 
			["subnavstories", "/stories/tomdot"],
			["subnavstories", "/stories/index"],
			["subnavgiveaword", "/stories/giveaword.jsp"]
			];
		current = findPos(url, pages);
		if (current > -1) setClassName(pages[current][0]);
		}
	return true;
	}
function findPos(url, pages) {
	var i = pages.length;
	while (--i >= 0) {
		if (url.substring(0, pages[i][1].length) == pages[i][1]) return i;
		}
	return -1;
	}
function setClassName(navid) {
	var navObj = document.getElementById(navid);
	if (navObj) navObj.className = navObj.className + " thepage";
	return true;
	}

// set custom function to this if !dhtml
function dummy() {}

