function header()
{
	document.write("<h1>Cheknnudol (chik'en nood'l): 1. One who habitually consumes soup.</h1>");
	
}


function lefttabs(x)
{
	var ltab = [];
	ltab[0] = "<a href=\"./index.html\"><img src=\"./img/btn/home.png\"></a>";
	//ltab[1] = "<a href=\"./support.html\"><img src=\"./img/btn/support.png\"></a>";
	ltab[1] = "<a href=\"./portfolio.html\"><img src=\"./img/btn/portfolio.png\"></a>";

	lefttabcode = "<ul>";
	for(n=0; n<ltab.length; n++)
	{
		if(n == x)
		{
			lefttabcode += "<li class=\"here\">";
		}
		else lefttabcode+= "<li style=\"background-image:url(./img/b" +n+ ".png);\" onMouseover=\"this.style.backgroundImage='none';\" onMouseout=\"this.style.backgroundImage='url(./img/b" +n+ ".png)'\">";
		lefttabcode+= ltab[n]+ "</li>";
	}
	lefttabcode+= "</ul>";
	document.write(lefttabcode);
}


function footer()
{
	document.write("<div class=\"footer\">");
	document.write("<a href=\"techspecs.html\">Site Information</a>|||<a href=\"./contact.html\">Leave a Message</a></div>");
}


var state = 'begin';
var pfSections = [];
var pfTitles = [];
var pfTabs = [];
var index = 0;
function recognize(idOfSection,titleOfSection)
{
	//alert('recognizing...');
	pfSections[index] = idOfSection;
	pfTitles[index] = titleOfSection;
	if(index == 0)
		pfTabs[index] = '<td class="pfselected" id='+index+'><a href="javascript://" onclick="select(\''+idOfSection+'\');"><h3>'+titleOfSection+'</h3></a></td>';
	else
		pfTabs[index] = '<td class="pfunselected" id='+index+'><a href="javascript://" onclick="select(\''+idOfSection+'\');"><h3>'+titleOfSection+'</h3></a></td>';
	index++;
}
function writeTabs(container)
{
	//alert('writing...');
	var toWrite = "";
	var row = document.getElementById(container);
	//for each recognizable section
	for(n = 0; n < index; n++)
	{
		//alert("new cell");
		//place a new cell in the container
		var x = row.insertCell(pfTabs[n]);
		//alert(x + 'created');
		//set its class to unselected unless it is first
		if(n == 0)
			x.className = 'pfselected';
		else
			x.className = 'pfunselected';
		//alert('class name set to ' + x.className);
		//set its id to its index
		x.id = n;
		//alert('id set to ' + x.id);
		//set its contents
		x.innerHTML = '<a href="javascript://" onclick="select(\''+pfSections[n]+'\');"><h3>'+pfTitles[n]+'</h3></a>';
		//alert('filled with ' + x.innerHTML);
		//as backup, do this the old fashioned way
		toWrite += pfTabs[n];
	}
	
	if (document.all) { //IS IE 4 or 5 (or 6 beta)
	eval( "document.all." + container + ".innerHTML = toWrite");
	}
	if (document.layers) { //IS NETSCAPE 4 or below
	document.layers[container].innerHTML = toWrite;
	}
	if (document.getElementById && !document.all) {
	maxwell_smart = document.getElementById(container);
	maxwell_smart.innerHTML = toWrite;
	}
	//alert('write successful.');
}

function select(section)
{
	//alert('selecting...');
	var currentTab;
	for(n = 0; n < index; n++)
	{
		//retrieve current tab
		currentTab = document.getElementById(n);
		if(pfSections[n] == section)
		{
			currentTab.className = 'pfselected';
			show(section);
		}
		else
		{
			currentTab.className = 'pfunselected';
			hide(pfSections[n]);
		}
	}
}


function hide(layer_ref) {
	state = 'none';
	if (document.all) { //IS IE 4 or 5 (or 6 beta)
	eval( "document.all." + layer_ref + ".style.display = state");
	}
	if (document.layers) { //IS NETSCAPE 4 or below
	document.layers[layer_ref].display = state;
	}
	if (document.getElementById && !document.all) {
	maxwell_smart = document.getElementById(layer_ref);
	maxwell_smart.style.display = state;
	}
} 
function show(layer_ref)
{	
	state = 'block';
	if (document.all) { //IS IE 4 or 5 (or 6 beta)
	eval( "document.all." + layer_ref + ".style.display = state");
	}
	if (document.layers) { //IS NETSCAPE 4 or below
	document.layers[layer_ref].display = state;
	}
	if (document.getElementById && !document.all) {
	maxwell_smart = document.getElementById(layer_ref);
	maxwell_smart.style.display = state;
	}	
}
function toggle(tab) {
	var class_name = document.getElementById(tab).className;
	if (class_name == 'pfselected') {
		class_name = 'pfunselected';
	}
	else {
		class_name = 'pfselected';
	}
	if (document.all) { //IS IE 4 or 5 (or 6 beta)
	eval( "document.all." + tab + ".className = class_name");
	}
	if (document.layers) { //IS NETSCAPE 4 or below
	document.layers[tab].className = class_name;
	}
	if (document.getElementById && !document.all) {
	maxwell_smart = document.getElementById(tab);
	maxwell_smart.className = class_name;
	}
}
