// Menu Object
function menuItem(type,text,file,path,target) {
	this.type = type;
	this.text = text;
	this.file = file;
	this.path = path;
	this.target = target;
} // end function

function _addItem(type,text,file,path,target) {
	this.menuArray[this.menuArray.length] = new menuItem(type,text,file,path,target);
} // end function

function _hMenu(max) {
	this.max = max;
	this.count = 0;
	this.url = '';
	var pagePath = window.location.pathname;

	for (var v = 0; v < this.menuArray.length; v++) {
		if (this.menuArray[v].type == 'subitem') {
			continue;
		} // end if
		if (this.count == this.max) {
			document.writeln('<br>');
			this.count = 0;
		} // end if
		if (this.count > 0) {
			document.writeln('&nbsp;|&nbsp;');
		} // end if
		this.url = '';
		if (pagePath == this.menuArray[v].path + this.menuArray[v].file) {
			this.url = this.menuArray[v].text;
			} else {
			this.url = '<a href="' + this.menuArray[v].path + this.menuArray[v].file + this.menuArray[v].target + '">' + this.menuArray[v].text + '</a>';
		} // end if
		document.writeln(this.url);
		this.count++;
	} // end for
} // end function

function _vMenu() {
	this.url = '';
	this.prefix = '';
	var pagePath = window.location.pathname;
	var pageHash = window.location.hash;

	document.writeln('<table cellpadding="1" cellspacing="0" border="0" width="100%">');
	for (var v = 0; v < this.menuArray.length; v++) {
		if (this.menuArray[v].type == 'subitem') {
			this.prefix = '&nbsp;&nbsp;&nbsp;';
			} else {
			this.prefix = '';
		} // end if
		this.url = '';
		if ((pagePath + pageHash) == (this.menuArray[v].path + this.menuArray[v].file + this.menuArray[v].target)) {
			this.url = this.menuArray[v].text;
			} else {
			this.url = '<a href="' + this.menuArray[v].path + this.menuArray[v].file + this.menuArray[v].target + '">' + this.menuArray[v].text + '</a>';
		} // end if
		document.writeln('<tr><td class="vMenu" align="left" valign="top" width="5" nowrap="nowrap">&nbsp;</td><td class="vMenu" align="left" valign="top" nowrap="nowrap">' + this.prefix + this.url + '</td></tr>'); 
	} // end for
	document.writeln('</table>');

} // end function

function _sMenu() {
} // end function

function _subMenu() {
	this.menuBar = '';
	this.count = this.menuArray.length;

	this.menuBar = this.menuBar + '<p class="subMenu">';
	if (this.menuArray.length > 0) {
		for (var b = 0; b < this.menuArray.length; b++) {
			this.count--;
			this.menuBar = this.menuBar + '<a href="' + this.menuArray[b].path + this.menuArray[b].file + this.menuArray[b].target + '">' + this.menuArray[b].text + '</a>';
			if (this.count > 0) {
				this.menuBar = this.menuBar + ' | ';
			} // end if
		} // end for
	} // end if
	this.menuBar = this.menuBar + '</p>';

	document.writeln(this.menuBar);

} // end function

function menuObject() {
	this.menuArray = new Array();
	this.addItem = _addItem;
	this.hMenu = _hMenu;
	this.vMenu = _vMenu;
	this.sMenu = _sMenu;
	this.subMenu = _subMenu;
} // end function menuObject

var siteMenu = new menuObject();
siteMenu.addItem('item','SLA Texas Chapter Home','index.htm','/chapter/ctx/','');
siteMenu.addItem('item','Texas Chapter News','ctxChapterNews.htm','/chapter/ctx/','');
siteMenu.addItem('item','Texas Job Board','ctxJobs.htm','/chapter/ctx/','');
// siteMenu.addItem('subitem','Austin','ctxJobs.htm','/chapter/ctx/','#austin');
// siteMenu.addItem('subitem','Dallas/Ft. Worth','ctxJobs.htm','/chapter/ctx/','#dallas');
// siteMenu.addItem('subitem','Houston','ctxJobs.htm','/chapter/ctx/','#houston');
// siteMenu.addItem('subitem','San Antonio','ctxJobs.htm','/chapter/ctx/','#sanantonio');
// siteMenu.addItem('subitem','Other','ctxJobs.htm','/chapter/ctx/','#other');
siteMenu.addItem('item','Area Planning Group Events','ctxLpgEvents.htm','/chapter/ctx/','');
// siteMenu.addItem('subitem','Austin LPG','ctxLpgEvents.htm','/chapter/ctx/','#austin');
// siteMenu.addItem('subitem','DFW LPG','ctxLpgEvents.htm','/chapter/ctx/','#dallas');
// siteMenu.addItem('subitem','Houston LPG','ctxLpgEvents.htm','/chapter/ctx/','#houston');
// siteMenu.addItem('subitem','San Antonio LPG','ctxLpgEvents.htm','/chapter/ctx/','#sanantonio');
siteMenu.addItem('item','Other Events','ctxOtherEvents.htm','/chapter/ctx/','');
siteMenu.addItem('item','Discussion List','ctxList.htm','/chapter/ctx/','');
siteMenu.addItem('item','Chapter Documents','ctxChapterDocs.htm','/chapter/ctx/','');
// siteMenu.addItem('subitem','Welcome Letter','ctxWelcome.htm','/chapter/ctx/','');
siteMenu.addItem('subitem','Chapter Highlights','ctxHighlights.htm','/chapter/ctx/','');
siteMenu.addItem('subitem','Board &amp; Council Members','ctxBoard.htm','/chapter/ctx/','');
siteMenu.addItem('subitem','Board Meeting Minutes','ctxMinutes.htm','/chapter/ctx/','');
siteMenu.addItem('subitem','Governing Documents','ctxGovDoc.htm','/chapter/ctx/','');
siteMenu.addItem('subitem','Chapter Archives','ctxArchive.htm','/chapter/ctx/','');
// siteMenu.addItem('subitem','Newsletter Archive','index.htm','/chapter/ctx/lsl/','');
siteMenu.addItem('subitem','Strategic Plan','ctxStPlan.htm','/chapter/ctx/','');
// siteMenu.addItem('subitem','Chapter Bylaws','bylaws.htm','/chapter/ctx/','');
// siteMenu.addItem('subitem','More Documents ...','ctxChapterDocs.htm','/chapter/ctx/','');
siteMenu.addItem('item','How to Join SLA','ctxJoinSLA.htm','/chapter/ctx/','');
siteMenu.addItem('item','SLA Home','','http://www.sla.org','');

// Page Footer
function pageFooter(pageDate) {
document.writeln('Last Updated:<br>&nbsp;&nbsp;&nbsp;' + pageDate);
document.writeln('<br>&copy; 2010, Texas Chapter,');
document.writeln('<br>Special Libraries Association');
document.writeln('<br>Webmaster: <a href="mailto:sethdice@tx.rr.com">William Dice</a>');
document.writeln('<br><a href="/chapter/ctx/ctxDisclaim.htm">Disclaimer</a>');
} // end function

// SLA Logo and Link
function slaLogo(vAlign,hAlign) {
// document.writeln('<a href="http://www.sla.org"><img src="/chapter/ctx/images/slalogo4.gif" valign="' + vAlign + '" align="' + hAlign + '" border="0" width="130" height="79" vspace="0" hspace="0" alt="SLA Home"></a>');
document.writeln('<a href="http://www.sla.org"><img src="/chapter/ctx/images/SLA04sm-GIF.gif" valign="' + vAlign + '" align="' + hAlign + '" border="0" width="121" height="52" vspace="0" hspace="0" alt="SLA Home"></a>');
} // end function

// Sponsor Logo and Link
function sponsorLogo(url,src,vAlign,hAlign,bor,wid,hght,vspc,hspc,alt) {
document.writeln('<a href="' + url + '"><img src="' + src + '" valign="' + vAlign + '" align="' + hAlign + '" border="' + bor + '" width="' + wid + '" height="' + hght + '" vspace="' + vspc + '" hspace="' + hspc + '" alt="' + alt + '"></a>');
} // end function

// Site Update
function siteUpdate() {
document.writeln('<h1 class="small">The SLA-CTX Texas Chapter web site has been updated</h1>');
document.writeln('<h1 class="small">Please update your bookmarks</h1>');
document.writeln('<h1 class="small"><a href="index.htm">Click here</a> to go to the new site</h1>');
} // end function


