function writemenu(quarterly){
	var a, b, c
	
	a='<table class="headerTable">\
	<tr><td rowspan="2"><a href="index.html"><img src="'
	
	c='" width="350" height="112" align="left" valign="middle" border="0"></a></td>\
		<td colspan="2"><img src="img/contact.png" width="256" height="88" align="right" valign="bottom"></td></tr>\
	<tr><td align="right" valign="middle"><a class="headerLink" href="http://www.youtube.com/user/par5603" target="link">Visit us on YouTube</a></td>\
	<td align="right" valign="middle"><script>infoscramble()</script></td></tr>\
	<tr><td colspan="3"><div class="horizontalcssmenu"><ul id="cssmenu1">\
		<li style="width:32px; border-left: 1px solid #202020;"><a href="index.html"><img src="img/home.png" width="14" height="15" border="0"></a></li>\
		<li style="width:152px;"><a href="about.html">About Us</a></li>\
		<li style="width:152px;"><a href="services.html">Services</a></li>\
		<li style="width:152px;"><a href="featured.html">Featured Sites</a></li>\
		<li style="width:152px;"><a href="selectedproj.html">Selected Projects</a></li>\
		<li style="width:152px;"><a href="resources.html">Resources</a></li></ul></div></td></tr>\
	</table>'
	
	if (quarterly)
		b='news/quarterlylogo.png'
	else
		b='img/logo.png'
	
	document.write(a+b+c)
}


function writefooter(){
	document.write('<table align="center" border="0"><tr><td><script>webmasterscramble()</script></td></tr></table>')
}


function quarterlynavigator( prev, next ){
	var a, b, c, d
	
	a='<table width="768"px align="center" cellspacing="0" cellpadding="10" border="0" style="border: 1px solid #fff2cc;"><tr><td align="center">'
	
	if ( prev )
		b='<a href="' + prev + '.html"><img src="news/previssue.png" width="96"px height="16"px border="0"></a>'
	else
		b='<img src="news/noissue.png" width="96"px height="16"px border="0">'
	
	if ( next )
		c='<a href="' + next + '.html"><img src="news/nextissue.png" width="96"px height="16"px border="0"></a>'
	else
		c='<img src="news/noissue.png" width="96"px height="16"px border="0">'
	
	d='</td></tr></table><br>'
		
	document.write( a + b + c + d )
}


function newsItem( date, headline, bodyText ){
	var a, b, c, d, e, f
	
	a='<tr><td align=right><span class="bodytext"><span class="size14"><span class="normal">'
	b='</span></span></span></td></tr>'
	
	c='<tr><td align=center><span class="graytext"><span class="size20"><span class="thick">'
	d='</span></span></span></td></tr>'
	
	e='<tr><td><span class="bodytext"><span class="size18"><br>'
	f='</span></span><hr></td></tr>'
	
	document.write( a +date + b + c + headline + d + e + bodyText + f )
}


function selectedProject( ID, job, pic, headline, bodyText ){
var a, b, c, d, e, f, g, h

a='<li><span class="bodytext"><span class="size18"><a href="" onclick="return toggleMenu(\''

aa= '\')">'

b='</a></span></span></li>'


c='<span name="toggleMenu" class="menu" id="'

cc='">\
	<table width=100% cellpadding=8 border=0><tr>\
		<td width="300">\
			<img src="selectedproj/sitepics/'
d='">\
		</td>'
		
e=		'<td>\
			<span class="bodytext"><span class="size20"><span class="thick">'

f=			'</span></span></span>\
			</td>\
		</tr>'
		
g=		'<tr >\
			<td colspan="2"  align="justify">\
				<span class="bodytext"><span class="size18">'

h=				'</span></span>\
				<hr>\
			</td>\
		</tr>\
	</table>\
</span>'

document.write( a + ID + aa + job + b + c + ID + cc + pic + d + e + headline + f + g + bodyText + h )
}


function selectedProject2( phase, ID, job, pic, scope, site, client, affiliation, furtherWork, bodyText ){
	var a, b, c, d, e, f, g, h, i, j, k, l;
	
	// ID = 'menu00'
	// job = '11Co132 Phase II Evaluation (Coles County)'
	a =	'<li>\
		<span class="bodytext"><span class="size18">\
		<a href="" onclick="return toggleMenu(\'' + ID + '\')">' + job + '</a>\
		</span></span>\
		</li>'
	
	// ID = 'menu00'
	b=	'<span name="toggleMenu" class="menu" id="' + ID + '">'
	
	// <table> start
	c =	'<table width=100% cellpadding="8" border="0">\
			<tr>'
	
	// pic = '11Co132.jpg' or ''
	if ( pic != '' ){
		d =	'<td width="300">\
				<img src="selectedproj/sitepics/' + pic + '" style="border:1px solid black">\
			</td>'
	}
	else{
		d =	'<td width="300"><img src="selectedproj/sitepics/placeholder.gif"></td>'
	}
	
	// header stuff
	e = '<td valign="middle" align="center">\
		<span class="bodytext">'
	
	// scope = 'Phase II Evaluation (2007)'
	f = '<br><span class="size12">SCOPE OF WORK:</span>\
		<br><span class="size16"><span class="thick">' + scope + '</span></span>'
	
	// site = 'Site 11Co132 in Coles County, Illinois'
	g = '<br><span class="size12">of</span>\
		<br><span class="size16"><span class="thick">' + site + '</span></span>'

	// client = 'County Materials Corporation of Marathon, Wisconsin' or ''
	if ( client != '' ){
		h =	'<br><span class="size12">for</span>\
			<br><span class="size16"><span class="thick">' + client + '</span></span>'
	}
	else{
		h =''
	}
	
	// affiliation = 'Middle Woodland'
	if ( affiliation != '' ){
		i =	'<br>\
			<br><span class="size12">TEMPORAL AFFILIATION:</span>\
			<br><span class="size16"><span class="thick">' + affiliation + '</span></span>'
	}
	else
		i =	''
		
	// furtherWork = 'No'
	if ( (phase == 3) || furtherWork == '' ){
		j = ''	// not applicable for phase III, of course
	}
	else{
		j =	'<br>\
			<br><span class="size12">FURTHER WORK RECOMMENDED? </span>\
			<br><span class="size16"><span class="thick">' + furtherWork + '</span></span>'
	}
	
	// close out the pic and header
	k =	'</span>\
				</td>\
			</tr>\
			<tr >'
	
	// bodyText = '<p>Phase II investigations produced little evidence of prehistoric use by past inhabitants of the site...' or ''
	if ( bodyText != '' ){
		l =	'<td colspan="2"  align="justify">\
				<span class="bodytext"><span class="size14">' + bodyText + '</span></span>\
						<hr>\
					</td>\
				</tr>\
			</table>\
		</span>'
	}
	else{
		l =	'<td colspan="2"  align="justify"><hr></td>\
				</tr>\
			</table>\
		</span>'
	}
	

document.write( a + b + c + d + e + f + g + h + i + j + k + l )
}

function infoscramble(){
	 var a,b,c,d,e,f,g,h,i
	 
	 a='<a class="headerLink" href=\"mai'
	 b='info'
	 c='\">'
	 a+='lto:'
	 b+='@'
	 e='</a>'
	 f='Email us'
	 b+='prairiearchaeology.com'
	 g='<img src=\"'
	 h=''
	 i='\" alt="Contact us." border="0" >'
	
	 if (f) d=f
	 else if (h) d=g+h+i
	 else d=b
	
	 document.write(a+b+c+d+e)
}

function webmasterscramble(){
	 var a,b,c,d,e,f,g,h,i
	 a='<a href=\"mai'
	 b='webmaster'
	 c='\">'
	 a+='lto:'
	 b+='@'
	 e='</a>'
	 f=''
	 b+='prairiearchaeology.com'
	 g='<img src=\"'
	 h='img/footer.png" id="footerImage"  align="center" valign="bottom'
	 i='\" alt="Contact us." border="0" >'
	
	 if (f) d=f
	 else if (h) d=g+h+i
	 else d=b
	
	 document.write(a+b+c+d+e)
}


function staffscramble( msg, ename ){
	var a,b,c,d,e
	a='<a href=\"mai'
	b=ename
	c='\">'
	a+='lto:'
	b+='@'
	e='</a>'
	d=msg
	b+='prairiearchaeology.com'
		
	document.write(a+b+c+d+e)
}


function toggleMenu(currMenu) {
	if (document.getElementById) {
		thisMenu = document.getElementById(currMenu).style
		if (thisMenu.display == "block") {
			thisMenu.display = "none"
		}
		else {
			thisMenu.display = "block"
		}
		return false
	}
	else {
		return true
	}
}


function expandAllMenus(){
	if (document.getElementsByName) {
		x = document.getElementsByName("toggleMenu" );
		
		//alert("There are " + x.length + " menus.");
		
		for (var i=0; i<x.length; i++){
			
			x[i].style.display = "block"
		}
		
		return false
	}
	else{
		return true
	}
}


function contractAllMenus(){
	if (document.getElementsByName) {
		x = document.getElementsByName("toggleMenu" );
		
		//alert("There are " + x.length + " menus.");
		
		for (var i=0; i<x.length; i++){
			
			x[i].style.display = "none"
		}
		
		return false
	}
	else{
		return true
	}
}


function changeSlide( direction ){
	if ( document.images){
		
		if ( (direction == 1) || (direction == -1) ){
			thisPic = thisPic + direction;
			
			if ( thisPic > imgCt )
				thisPic = imgCt;
			
			if ( thisPic < 0 )
				thisPic = 0;
			
			thisText = thisText + direction;
			
			if ( thisText > txtCt )
				thisText = txtCt;
			
			if ( thisText < 0 )
				thisText = 0;
		}
		else{
			thisPic = direction;
			thisText = direction;
		}
		
		document.slidePicture.src = slidePixArray[thisPic];
		document.slideText.ta.value = slideTxtArray[thisText];
	}
}