
	var menuArray = new Array();
	var urlArray = new Array();
	var speed = 2;
	var curPos = 0;
	var endPos = 0;
	
	///////// MENU DEFINITIONS - CHANGE THE MENU ITEMS BELOW //////////////////////////////////////////////
	
	menuArray.push('Home', '', 'default.htm');
	
	menuArray.push('About Damh the Bard', '', '');
	menuArray.push('subitem', 'Biography', 'biography.html');
	menuArray.push('subitem', 'Discography', 'discography.html');
	menuArray.push('subitem', 'Links', 'links.html');
	menuArray.push('subitem', 'Press & Booking', 'booking.html');
	
	menuArray.push('Albums & Songbook', '', '');
	menuArray.push('subitem', 'Tales from the Crow Man', 'albumcrow.html');
	menuArray.push('subitem', 'The Cauldron Born', 'albumborn.html');
	menuArray.push('subitem', 'Spirit of Albion', 'albumsoa.html');
	menuArray.push('subitem', 'The Hills they are Hollow', 'albumhills.html');	
	menuArray.push('subitem', 'Herne\'s Apprentice', 'albumherne.html');
	menuArray.push('subitem', 'Damh the Bard Songbook', 'songbook.html');

	menuArray.push('Where to Buy Music', '', '');
	menuArray.push('subitem', 'Cds from Damh/iTunes', 'http://www.bardicarts.com/store.htm');
	menuArray.push('subitem', 'CDBaby', 'http://cdbaby.com/all/damhbard');
	
	menuArray.push('The Bardic Blog', '', 'blog.html');

	menuArray.push('DruidCast Podcast', '', 'druidcast.html');
	
	menuArray.push('Videos & Pics', '', '');
	menuArray.push('subitem', 'YouTube channel', 'http://www.youtube.com/damhbard');
	menuArray.push('subitem', 'Photo Gallery', 'photos.html');

	menuArray.push('Facebook/MySpace etc', '', 'weblinks.html');
	
	menuArray.push('Live Concerts', '', 'concerts.html');

	menuArray.push('Poetry and Prose', '', '');
	menuArray.push('subitem', 'Poetry', 'poetry.html');
	menuArray.push('subitem', 'Prose', 'prose.html');	

	menuArray.push('Druidry', '', '');
	menuArray.push('subitem', 'Anderida Gorsedd', 'http://www.anderidagorsedd.org');
	menuArray.push('subitem', 'Order of Bards Ovates & Druids', 'http://www.druidry.org');
	menuArray.push('subitem', 'Druidry', 'druidry.html');		
	
	menuArray.push('Contact', '', '');
	menuArray.push('subitem', 'E-mail', 'mailto:paganbard@gmail.com');
	
		
	///////// END IF MENU DEFINITIONS - CHANGE NOTHING BELOW THIS!! ////////////////////////////////////////
		
		
	function getAbsPos( oId, tl ) {
		var o = ( typeof oId == 'String' ) ? document.getElementById( oId ) : oId;
		var val = 0;
		while ( o.nodeName != "BODY" ) {
			val += parseInt( ( tl == 'top' ) ? o.offsetTop : o.offsetLeft );
			o = o.parentNode;
		}
		return val;
	}

	function moveDiv (obj) {
		obj.style.top = curPos;
		curPos += 1	

		if (curPos == 0) {
			obj.style.zIndex = 2;
		}
	}
	
	function closeDiv (obj) {
		obj.style.top = curPos;
		curPos -= 1	
		
		if (curPos == endPos) {
			obj.style.display = 'none';
			obj.style.zIndex = 2;
		}
	}	
	
	
	
	function slideDiv (divID) {
		var showDiv = false;
	
		temp = eval(getDocObject('sm'+divID));
		temp2 = eval(getDocObject('m'+divID));
		
		if (temp.style.display == 'none') {
			temp.style.display = 'block';	
			temp.style.zIndex = 0;

			tempTop = 0;
			temp.style.top = tempTop - temp.offsetHeight;

			startPos = parseInt(temp.style.top);
			endPos = startPos + temp.offsetHeight;
			curPos = startPos;
			diff = (endPos - startPos) + 2;
			
			for (i=1; i<diff;i++) {					
				var to = setTimeout('moveDiv(temp)', speed * i);
			}
		} else {
			temp.style.zIndex = 0;		
			
			temp.style.top = 0;
			
			startPos = parseInt(temp.style.top);
			endPos = startPos - temp.offsetHeight;
			curPos = startPos;
			diff = (startPos - endPos) + 2;
					
			for (i=1; i<diff;i++) {					
				var to = setTimeout('closeDiv(temp)', speed * i);
			}			

		}		
	}

	
	function showDiv(div) {	
		var temp = div;		
		
		if (temp.style.display == 'none') {
			temp.style.display = 'block';	
		} else {
			temp.style.display = 'none';	
		}
	
	}

	
	function writeMenu (curMenuItem, curSubMenuItem) {
		var temp
		var lastMenuID;
		var refresh = Math.random();
				
		if (BrowserDetect.browser != 'Safari') {
		
			temp = '<div id="main" style="z-index:0;">\r'				
			temp += '<table cellpadding=0 cellspacing=0 border=0 >\r';
		
			for (var i=0;i<menuArray.length;i++) {
				if (menuArray[i] != 'subitem') {			
					lastMenuID = i;
					
					// ITS A MAIN MENU ITEM				
					temp += '<tr><td align="left" >\r';
					temp += '<div id="m' + lastMenuID + '" style="background-color:ffffff; position:relative;z-index:3;">\r'				
					temp += '<table ';
					
					if (menuArray[i+2].length > 0) {
						// CREATE THE NAVIGATE CLICK
						tempURL = menuArray[i+2];
						
						if (tempURL.indexOf('?') != -1 ) {
							tempURL += '&mid=' + i + '&r=' + refresh;
						} else {
							tempURL += '?mid=' + i + '&r=' + refresh;
						}					
						
						temp += 'onClick="document.location.href=\'' + tempURL + '\'"';
					} else {
						// CREATE THE SUBITEM SLIDE CLICK
						temp += 'onClick="slideDiv(' + i + ')"  ';
					}
					
					temp += 'id="mt' + i + '" ';
					if (curMenuItem == i) {
						temp += ' class="navmenuitemsel" ';
					} else {
						temp += ' onmouseover="changeClass(mt' + i + ',\'navmenuitemover\')" onmouseout="changeClass(mt' + i + ',\'navmenuitem\')" class="navmenuitem" ';
					}
					temp += ' cellpadding=0 cellspacing=0 border=0>\r';					
						
					temp += '<tr>\r';
					temp += '<td width=18 ><img src="images/clear.gif" border=0 width=18 height=1 ></td>\r';
					temp += '<td>' + menuArray[i] + '</td>\r';
					temp += '</tr>\r';
					temp += '</table>\r';
					temp += '</div>\r';
					temp += '</td></tr>\r';
					
					if (i+3 < menuArray.length) {
						if (menuArray[i+3] == 'subitem') { 
							temp += '<tr><td>\r';
							temp += '<div id="sm' + lastMenuID + '" style="';
							if (curMenuItem == i) {
								temp += 'display:block;';
							} else {
								temp += 'display:none;';
							}
							temp += 'position:relative;z-index:1;">\r';		
						}
					}
					
				} else {
				
					// ITS A SUBITEM
					temp += '<table ';
					tempURL = menuArray[i+2];
					
					if (tempURL.indexOf('?') != -1 ) {
						tempURL += '?mid=' + lastMenuID + '&smid=' + i + '&r=' + refresh;
					} else {
						tempURL += '?mid=' + lastMenuID + '&smid=' + i + '&r=' + refresh;
					}
									
					temp += 'onClick="document.location.href=\'' + tempURL + '\'"';
					temp += 'id="sm' + i + '" ';
					if (curSubMenuItem == i) {
						temp += ' class="navsubmenuitemsel" ';
					} else {
						temp += ' onmouseover="changeClass(sm' + i + ',\'navsubmenuitemover\')" onmouseout="changeClass(sm' + i + ',\'navsubmenuitem\')" class="navsubmenuitem" ';
					}
					temp += ' cellpadding=0 cellspacing=0 border=0>\r';
					temp += '<tr>\r';
					temp += '<td width=18 ><img src="images/clear.gif" border=0 width=18 height=1 ></td>\r'
					temp += '<td>' + menuArray[i+1] + '</td>\r';
					temp += '</tr>\r';
					temp += '</table>\r';
					
					if (i+3 < menuArray.length) {
						if (menuArray[i+3] != 'subitem') { 
							temp += '</td></tr>\r';
							temp += '</div>\r';
						}
					} else {
							temp += '</td></tr>\r';
							temp += '</div>\r';				
					}
				}			
				
				i += 2
				
			}
		
			temp += '</table>\r';	
			temp += '</div>';
			
		} else {
			//// SAFARI ///////////////////////////////////////////
			temp = '<div id="main" style="z-index:0;">\r'				
			temp += '<table cellpadding=0 cellspacing=0 border=0 >\r';
		
			for (var i=0;i<menuArray.length;i++) {
				if (menuArray[i] != 'subitem') {			
					lastMenuID = i;
					
					// ITS A MAIN MENU ITEM				
					temp += '<tr><td align="left" >\r';
					temp += '<div id="m' + lastMenuID + '" style="background-color:ffffff; position:relative;z-index:3;">\r'				
					temp += '<table ';
					
					if (menuArray[i+2].length > 0) {
						// CREATE THE NAVIGATE CLICK
						tempURL = menuArray[i+2];
						
						if (tempURL.indexOf('?') != -1 ) {
							tempURL += '&mid=' + i + '&r=' + refresh;
						} else {
							tempURL += '?mid=' + i + '&r=' + refresh;
						}					
						
						temp += 'onClick="document.location.href=\'' + tempURL + '\'"';
					} else {
						// CREATE THE SUBITEM SLIDE CLICK
						temp += 'onClick="showDiv(sm' + i + ')"  ';
					}
					
					temp += 'id="mt' + i + '" ';
					if (curMenuItem == i) {
						temp += ' class="navmenuitemsel" ';
					} else {
						temp += ' onmouseover="changeClass(mt' + i + ',\'navmenuitemover\')" onmouseout="changeClass(mt' + i + ',\'navmenuitem\')" class="navmenuitem" ';
					}
					temp += ' cellpadding=0 cellspacing=0 border=0>\r';					
						
					temp += '<tr>\r';
					temp += '<td width=18 ><img src="images/clear.gif" border=0 width=18 height=1 ></td>\r';
					temp += '<td>' + menuArray[i] + '</td>\r';
					temp += '</tr>\r';
					temp += '</table>\r';
					temp += '</div>\r';
					temp += '</td></tr>\r';
					
					if (i+3 < menuArray.length) {
						if (menuArray[i+3] == 'subitem') { 
							temp += '<tr><td>\r';
							temp += '<div id="sm' + lastMenuID + '" style="';
							if (curMenuItem == i) {
								temp += 'display:block;';
							} else {
								temp += 'display:none;';
							}
							temp += 'position:relative;z-index:1;">\r';		
						}
					}
					
				} else {
				
					// ITS A SUBITEM
					temp += '<table ';
					tempURL = menuArray[i+2];
					
					if (tempURL.indexOf('?') != -1 ) {
						tempURL += '?mid=' + lastMenuID + '&smid=' + i + '&r=' + refresh;
					} else {
						tempURL += '?mid=' + lastMenuID + '&smid=' + i + '&r=' + refresh;
					}
									
					temp += 'onClick="document.location.href=\'' + tempURL + '\'"';
					temp += 'id="sm' + i + '" ';
					if (curSubMenuItem == i) {
						temp += ' class="navsubmenuitemsel" ';
					} else {
						temp += ' onmouseover="changeClass(sm' + i + ',\'navsubmenuitemover\')" onmouseout="changeClass(sm' + i + ',\'navsubmenuitem\')" class="navsubmenuitem" ';
					}
					temp += ' cellpadding=0 cellspacing=0 border=0>\r';
					temp += '<tr>\r';
					temp += '<td width=18 ><img src="images/clear.gif" border=0 width=18 height=1 ></td>\r'
					temp += '<td>' + menuArray[i+1] + '</td>\r';
					temp += '</tr>\r';
					temp += '</table>\r';
					
					if (i+3 < menuArray.length) {
						if (menuArray[i+3] != 'subitem') { 
							temp += '</td></tr>\r';
							temp += '</div>\r';
						}
					} else {
							temp += '</td></tr>\r';
							temp += '</div>\r';				
					}
				}			
				
				i += 2
				
			}
		
			temp += '</table>\r';	
			temp += '</div>';
	
		}
		
		//// NEWSLETTER TABLE ////	
			temp += '<embed type="application/x-shockwave-flash" src="http://cache.reverbnation.com/widgets/swf/30/fancollector.swf?page_object_id=artist_233310&backgroundcolor=eff0cb&font_color=000000&posted_by=artist_233310" height="180" width="170"/><br/>';
		temp += '<a href="http://www.reverbnation.com/c./a4/30/233310/Artist/233310/Artist/link"><img alt="Damh%20the%20Bard" border="0" height="12" src="http://cache.reverbnation.com/widgets/content/30/footer.png" width="170" /></a><br/>';
		temp += '<img style="visibility:hidden;width:0px;height:0px;" border=0 width=0 height=0 src="http://www.reverbnation.com/widgets/trk/30/artist_233310/artist_233310/t.gif">';
		temp += '<a href="http://www.quantcast.com/p-05---xoNhTXVc" target="_blank"><img src="http://pixel.quantserve.com/pixel/p-05---xoNhTXVc.gif" style="display: none" border="0" height="1" width="1" alt="Quantcast"/></a>';
		temp += '<img style="visibility:hidden;width:0px;height:0px;" border=0 width=0 height=0 src="http://counters.gigya.com/wildfire/IMP/CXNID=2000002.11NXC/bT*xJmx*PTEyMzI1Mzg3NDMxOTgmcHQ9MTIzMjUzODc*OTExNCZwPTI3MDgxJmQ9ZmFuJTVGY29sbGVjdG9yJTVGZmlyc3QlNUZnZW4mZz*xJnQ9.gif" />';
		

		
	
	
		document.write(temp);	
	}
	






