
// vars

navloaded = false;

navbarstr = '';

var navbar = [
	['Home', 'index.shtm', 'white', 'red'],
	['Dag Salon', 'salon.shtm', 'white', 'red'],
	['Antechamber', 'antecham.shtm', 'white', 'red'],
	['Archives', 'archives.shtm', 'white', 'red'],
	['Dag Restoration', 'restoration.shtm', 'FFCC00', 'red'],
	['Case Repair', 'caserepair.shtm', 'FFCC00', 'red'],
	['Modern Dags', 'http://www.cdags.org/?page_id=2762', 'white', 'red'],
	['Terms of Sale', 'terms.shtm', 'white', 'red'],
	['Dag History', 'history.shtm', 'white', 'red'],
	['Company Profile', 'profile.shtm', 'white', 'red'],
	['Vignettes', 'vignette.shtm', 'white', 'red'],
	['Featured Sites', 'featured.shtm', '339933', 'red'],
	['Show Schedule', 'shows.shtm', '66FFFF', 'red'],
	['Browser Help', 'help.shtm', 'red', 'red'],
	['STOLEN DAGS', 'stolen.shtm', 'red', 'red']
	];

beginstr =
	'<!-- begin nav bar --><ul class="navbar">';

function blankstr (relref)
{
	return new String (
		'<li class="navbar"></li>'
		);
}

endstr = '</ul><!-- end nav bar -->';



// functions

function noRolloverLi (info, relref)
{
	liStr = '<li class="navbar"><a class="navbar" href="';
	if(info[1].indexOf('http:') == -1) {
		if(relref != '') {
			liStr += relref + '/';
		} else {
			liStr += 'http://' + window.location.hostname + '/';
		}
	}
	liStr += info[1] + '" style="color:' + info[3] + ';">' + info[0] + '</a></li>';
	return liStr;
}

function rolloverLi (info, relref)
{
	liStr = '<li class="navbar"><a class="navbar" href="';
	if(info[1].indexOf('http:') == -1) {
		if(relref != '') {
			liStr += relref + '/';
		} else {
			liStr += 'http://' + window.location.hostname + '/';
		}
	}
	liStr += info[1] + '" style="color:' + info[2] + ';" onmouseover="this.style.color = \''+ info[3] +'\'" onmouseout="this.style.color = \''+ info[2] +'\'">' + info[0] + '</a></li>';
	return liStr;
}

function donavbar (pageoride, relref)
{
	if (! navloaded) {
		thepage = pageoride;
		
		if (!thepage)
		{
			thepage = new String (window.location.href);

			if (thepage == 'http://www.finedags.com/'
				||
				thepage == 'http://www.finedags.com'
			)
			{
				thepage = thepage + 'index.shtm';
			}
		}

		if (!relref)
		{
			relref = new String ('');
		}

		navbarstr += beginstr + blankstr (relref);

		for (i=0; i<navbar.length; i++) {
			if (thepage.indexOf (navbar[i][1]) != -1) {
				navbarstr += noRolloverLi (navbar[i], relref);
			} else {
				navbarstr += rolloverLi (navbar[i], relref);
			}
		}
	
		navbarstr += blankstr (relref) + endstr;
	
		document.getElementById ("navbar").innerHTML = navbarstr;
		
		navloaded = true;
	}
}


