// keyword_mgr.js
// JavaScript routines from the NC Museum of History main web site
// for special keyword handling

CSAg = window.navigator.userAgent;
CSBVers = parseInt(CSAg.charAt(CSAg.indexOf("/")+1),10);

function CSFindElement(n,ly) { if (CSBVers < 4) return document[n];
	var curDoc = ly ? ly.document : document; var elem = curDoc[n];
	if (!elem) { for (var i=0;i<curDoc.layers.length;i++) {
		elem = CSFindElement(n,curDoc.layers[i]); if (elem) return elem; }}
	return elem;
}

// assumes keywordcontrol is set by invoking window

function DoWord(keyword) {
	newval = keyword;

	if (keywordcontrol) {

		if (keywordcontrol.value != '') {
			newval = newval + ' ' + keywordcontrol.value;
		}

		keywordcontrol.value = newval;
	}

	var bAgent = window.navigator.userAgent; 
	var bAppName = window.navigator.appName;
	if ((bAppName.indexOf("Explorer") >= 0) && (bAgent.indexOf("Mozilla/3") >= 0) && (bAgent.indexOf("Mac") >= 0))
		return true; // dont follow link
	else return false; // dont follow link
}
