var product_names = new Array(
	"Cocoa Nuts<span class='TM'>TM</span>", 
	"Bars", 
	"Cocoa Loco", 
	"Caramels");
var product_titles = new Array(
	"cocoanuts", 
	"bars", 
	"loco", 
	"caramels");
var product_pref = new Array(
	"cn-", 
	"bar-", 
	"loco-", 
	"car-");
var max_products = product_names.length;

var flavors = new Array(
		["azteque", "cafe", "epices", "extra noir", "framboise", "lait", "orange", "noir"], 
		["azteque", "epices", "cacahuete", "noisette", "cafe", "extra noir", "framboise", "orange"],
		["earl grey tea", "jasmine tea", "thai tea"]
	);

	var maincol="#ddd";
	var accentcol="#999";  // abc was good too.
	var bgcol= "#fff";
	var sidecol = "#fff";  // "#abc";
	var textcol = "#5B595A";
	var hilightcol = "#000";
	
	var tbg = "home";

var browserName=navigator.appName;
if (browserName=="Netscape")
{
}
else if (browserName=="Microsoft Internet Explorer")
{
}
else if (browserName=="Safari")
{
}
else if (browserName=="Firefox")
{
}


function writeSS(tcolor)
{

	switch (tcolor)
	{
		case 'framboise': 
		case 'weddings':
		case 'home':
			tbg = "framboise";
			bgcol= "#D21846";
			maincol = "#F2D9E3"; // "#D31145";
			accentcol = "#820E24"; // "#820024";
			sidecol= "#EFDFE6";
			hilightcol= "#820E24";
			break;
		case 'orange': 
		case 'about':
			tbg = "orange";
			bgcol = "#F28026";
			maincol = "#F4D07F";  //"#F48026"; 
			hilightcol = accentcol = "#E15C1E";  // "#E25C1F";
			sidecol = "#F5E0AC";
			break;
		case 'epices': 
		case 'retailers':
			tbg = "epices";
			bgcol= "#6DB23E";
			maincol = "#D9EEA3"; // "#6DB43F";
			accentcol = "#5C9731"; // "#5D9732";
			sidecol= "#E8F2BF";
			hilightcol = "#5C9731";
			break;
		case 'lait': 
		case 'news':
			tbg = "lait";
			bgcol= "#53A0C6";
			maincol = "#D6E3E3"; // "#55A1D5";
			hilightcol = accentcol = "#1B7CB3"; // "#007DC3";
			sidecol= "#F1F2F1";
			// hilight? "#D6DCE7";
			break;
		case 'cafe':
		case 'cocoanuts': 
		case 'gifts':
			tbg = "cafe";
			bgcol= "#7A1408";
			maincol = "#ED9B6C"; // "#964738"; "#7A1501"; 
			hilightcol = accentcol = "#5A1309"; // "#5B1300";
			sidecol= "#F2DEDC";
			break;
		case 'noir':
		case 'shop':
			tbg = "noir";
			bgcol= "#3D0900";
			maincol = "#A97744"; // "#78514C"; "#3D0900";
			hilightcol = accentcol = "#541800"; // "#541800";
			sidecol= "#F2E2D0";
			break;
		case 'extranoir':
		case 'events':
			tbg = "extranoir";
			bgcol= "#1C0009";
			maincol = "#A97744"; // "#4D383F"; "#1C0009";
			hilightcol = accentcol = "#3D0900"; // "#3D0900";
			sidecol= "#DBDAD8";
			break;
		case 'azteque':
		case 'wholesale': 
			tbg = "azteque";
			bgcol= "#BF2E1A";
			maincol = "#F65439"; // "#BF2E1A";
			hilightcol = accentcol = "#8A1E06"; // "#8A1E04";
			sidecol= "#F7E5CA";
			break;
//		case 'home':
//			maincol = "#333";
//			break;
		default:
			tbg = 'home';
 	}
	

document.write (
'<style>' + 
'body { ' + 
' margin:80px; ' + 
' background: url("' + tbg + '_bg2.jpg") ' + accentcol + '; ' + 
' color: #000; ' + 
' text-align:center; ' + 
' padding:0; ' + 
'	font-family: Verdana; Georgia; Futura; Arial;' +
' } ' + 
' ' + 
' ' +
'#outer { ' + 
' text-align:left; ' + 
' border:4px solid ' + accentcol + '; ' + 
' width:800px; ' + 
' margin:auto; ' + 
' } ' + 
' ' + 
'#header ' + 
' { ' + 
' 	background: ' + accentcol + '; ' + 
'	color: ' + maincol + '; ' + 
'	padding:0px; ' + 
'	font-family: Verdana; Georgia; Futura; Arial;' +
'	font-size:9pt; ' +
//'	border-bottom:1px solid black;' + 
'	text-align:center; ' + 
'	width:800px; ' +
'} ' + 
' ' + 
'#nav ' + 
'{ ' + 
'	vertical-align:middle; ' + 
'	text-align:middle; ' + 
'} ' + 
' ' + 
'#nav A:link, #nav A:visited ' + 
'{ ' + 
'	color: ' + maincol + '; ' + 
'	padding:3px 0 0 0; ' + 
'	margin:2px 0 0 0; ' + 
'	border:1px dashed ' + maincol + '; ' + 
'	width:120px; ' + 
'	height:20px; ' + 
'	display:block; ' + 
'	text-decoration:none; ' + 
'} ' + 
' ' + 
'#nav A:hover ' + 
'{ ' + 
'	color: ' + accentcol + '; ' + 
'	background:' + sidecol + '; ' + 
'	border:1px dashed black; ' + 
'	text-decoration:none; ' + 
'} ' + 
' ' + 
'#nav A:active ' + 
'{ ' + 
'	color: ' + accentcol + '; ' + 
'	padding:3px 0 0 0; ' + 
'	margin:2px 0 0 0; ' + 
'	border:1px dashed #c0c0c0; ' + 
'	width:120px; ' + 
'	height:20px; ' + 
'	display:block; ' + 
'	text-decoration:none; ' + 
'} ' + 
' ' + 
'A.nav-selected-item ' + 
'{ ' + 
'	background: ; ' + 
'	text-decoration:none; ' + 
'} ' + 
' ' + 
' ' + 
'#bar { ' + //not in use right now
' height:10px; ' + 
' background:#c0c0c0; ' + 
' color: #333333; ' + 
' border:solid #000000;	 ' + 
' border-width:1px 0 1px 0; ' + 
'	font-size:11px; ' + 
'	vertical-align:middle; ' + 
'} ' + 
' ' + 
'#bodyblock { ' + 
//'	border-left:1px  solid black;' + 
//'	border-right:1px  solid black;' + 
' position:relative; ' + 
' background: ' + sidecol + '; ' + 
' color: ' + maincol + '; ' + 
' width:800px; ' + 
' padding:0; ' + 
' } ' + 
' ' + 
' #bodyblock A ' + 
' { ' + 
' 	padding:0px; ' + 
' 	color: ' + maincol + '; ' + 
' } ' + 
' ' + 
'#r-col { ' + 
' float:right; ' + 
' width:165px; ' + 
' background:' + sidecol + '; ' + 
' height:550px; ' + 
' padding:0px; ' +
' position:relative; ' + 
' } ' + 
'  ' + 
' ' + 
'#cont { ' + 
'	position:relative; ' + 
' width:630px; ' + 
' height:550px; ' + 
' background: white; ' + 
' color: #333333; ' + 
' border:solid ' + accentcol + ';	 ' + 
' border-width:0 2px 0 0px; ' + 
' text-align:left; ' + 
'	font-family: Verdana; Georgia; Futura; Arial;' +
' float:left;' + 
' } ' + 
'  ' + 
'#ftr { ' + 
' height:15px; ' + 
' background:' + accentcol + '; ' + 
' color: #c0c0c0; ' + 
//' border:solid black; ' + 
//' border-width:1px 0 0 0; ' + 
' margin:0; ' + 
'	font-size:11px; ' + 
' } ' + 
'  ' + 
' ' + 
' ' + 
'#r-col-prods ' + 
'{ ' + 
'	position:absolute; ' + 
'	top:0; ' + 
'	left:0; ' + 
'	width:50%; ' + 
'	font-size:12px; ' + 
'	text-align:center; ' + 
'	vertical-align:middle; ' + 
'	text-decoration:none; ' + 
'} ' + 
' ' + 
'#r-col-prods A:link, #r-col-prods A:visited ' + 
'{ ' + 
'	color: ' + accentcol + '; ' + 
'	padding:0px 0 0 0; ' + 
'	margin:2px 0 2px 0; ' + 
'	border:1px solid ' + maincol + '; ' + 
'	width:100%; ' + 
'	height:10px; ' + 
'	display:block; ' + 
'	vertical-align:middle; ' + 
'	text-decoration:none; ' + 
'} ' + 
' ' + 
'#r-col-prods A:hover ' + 
'{ ' + 
'	background:' + maincol + '; ' + 
'	border:1px solid black; ' + 
'	text-decoration:none; ' + 
'	vertical-align:middle; ' + 
'} ' + 
' ' + 
'#r-col-prods A:active ' + 
'{ ' + 
'	color: white; ' + 
'	border:1px solid #c0c0c0; ' + 
'	text-decoration:none; ' + 
'	vertical-align:middle; ' + 
'} ' + 
' ' + 
'A.r-col-selected-item ' + 
'{ ' + 
'	background:' + maincol + '; ' + 
'	border:1px dotted; ' +
'	text-decoration:none; ' + 
'	vertical-align:middle; ' + 
'} ' + 
' ' + 
' ' + 
'#r-col-items ' + 
'{ ' + 
'	position:relative; ' + 
'	float:right; ' + 
'	top:0; ' + 
'	left:0; ' + 
'	margin-right:1px; ' + 
'	width:45%; ' + 
'	font-size:8pt; ' + 
'	text-align:center; ' + 
'	vertical-align:middle; ' + 
'	text-decoration:none; ' + 
'} ' + 
' ' + 
' ' + 
'#r-col-items A:link, #r-col-items A:visited ' + 
'{ ' + 
'	color: ' + accentcol + '; ' + 
'	padding:0px 0px 0px 0px; ' + 
'	margin:2px 0 2px 0; ' + 
'	border:1px solid ' + maincol + '; ' + 
'	width:100%; ' + 
'	height:12px; ' + 
'	display:block; ' + 
'	vertical-align:middle; ' + 
'	text-decoration:none; ' + 
'} ' + 
' ' + 
'#r-col-items A:hover ' + 
'{ ' + 
'	background:' + maincol + '; ' + 
'	border:1px solid black; ' + 
'	text-decoration:none; ' + 
'	vertical-align:middle; ' + 
'} ' + 
' ' + 
'#r-col-items A:active ' + 
'{ ' + 
'	color: white; ' + 
'	border:1px solid #c0c0c0; ' + 
'	vertical-align:middle; ' + 
'	text-decoration:none; ' + 
'} ' + 
' ' + 
'#r-col-content ' + 
'{ ' + 
'	width:100%; ' + 
'	position:absolute; ' + 
'	top:170px; ' + 
'	font-family: Verdana; Georgia; Futura; Arial;' +
'	font-size:8pt; ' +
'	font-weight:bolder; ' +
'	color: ' + hilightcol + '; ' + 
'	padding: 3px; ' + 
'} ' + 
' ' + 
'#r-col-content A' + 
'{ ' + 
'	text-decoration:; border:1px solid ' + hilightcol + ';' + 
'	background: ' + maincol + '; ' +
'	color: ' + accentcol + '; ' + 
'	text-decoration:none; ' + 
'} ' + 
' ' + 
'#r-col-content A:hover' + 
'{ ' + 
'	text-decoration:none; ' +
'	background: ' + accentcol + '; ' +
'	color: ' + maincol + '; ' + 
'} ' + 
' ' + 
'#product-name ' + 
'{ ' + 
'	position:absolute; ' + 
'	top:0px; ' + 
'	left:230px; ' +
'	font-size:25px; ' + 
'	text-align:center; ' +
'	font-family: Verdana; Georgia; Futura; Arial;' +
'	color: #000; ' + 
'	width:380px; ' +
'	height: 35px; ' +
'	z-index: 5; ' + 
'	text-align: center; ' + 
'	padding: 5px; ' + 
'} ' + 
' ' + 
'#cocoapercentage ' + 
'{ ' + 
'	position:relative; ' + 
'	width:64px; ' + 
'	height:50px; ' +
'	top:0px; ' + 
'	left:558px; ' + // 560px; ' + 
'	background: ' + accentcol + '; ' + 
'	color: ' + maincol + '; ' + 
'	font-size:26px; ' + 
'	text-align:center; ' + 
//'	border-left:2px solid ' + maincol + '; ' + 
'	padding: 2px; ' + 
'	visibility: hidden; ' + 
'} ' + 
'			 ' + 
'#product-pic ' + 
'{ ' + 
'	position:absolute; ' + 
'	top:25px; ' + 
'	left:25px; ' + 
'	width:297px; ' + 
'	height:446px; ' + 
'	background: white; ' +
	((tbg=='home')?'	filter:alpha(opacity=75); opacity:.75; ':'') + 
'} ' + 
'#product-horizpic ' + 
'{ ' + 
'	position:absolute; ' + 
'	top:225px; ' + 
'	left:25px; ' + 
'	width:450px; ' + 
'	height:300px; ' + 
'	background: white; ' +
	((tbg=='home')?'	filter:alpha(opacity=75); opacity:.75; ':'') + 
'} ' + 
'#product-description ' + 
'{ ' + 
'	position:absolute; ' + 
'	top:50px; ' + 
'	left:325px; ' + 
'	width:295px; ' + 
'	height:396px;' + 
'	font-size:16px; ' + 
'	background: white; ' +
	((tbg=='home')?'	filter:alpha(opacity=65); opacity:.65; ':'') + 
'}' +
'#product-horizdescription ' + 
'{ ' + 
'	position:absolute; ' + 
'	top:80px; ' + 
'	left:50px; ' + 
'	width:505px; ' + 
'	height:120px;' + 
'	font-size:16px; ' + 
'	background: white; ' +
	((tbg=='home')?'	filter:alpha(opacity=65); opacity:.65; ':'') + 
'}' +
'#product-horizprice ' + 
'{ ' + 
'	position:absolute; ' + 
'	top:225px; ' + 
'	left:500px; ' + 
'	width:50px; ' + 
'	height:200px;' + 
'	font-size:16px; ' + 
'	background: white; ' +
	((tbg=='home')?'	filter:alpha(opacity=65); opacity:.65; ':'') + 
'}' +

'#product-description A { ' +
'	color: #444; ' +
'}' +
'#nonproduct-description ' + 
'{ ' + 
'	position:absolute; ' + 
'	top:50px; ' + 
'	left:240px; ' + 
'	width:375px; ' + 
'	height:396px;' + 
'	font-size:16px; ' + 
'	background: white; ' +
	((tbg=='home')?'	filter:alpha(opacity=65); opacity:.65; ':'') + 
'}' +
'#nonproduct-description A { ' +
'	color: #444; ' +
'}' +
'.TM { ' + 
'	font-size:35%; ' + 
'	vertical-align:top; ' +
'}' +

'A.boxlink' + 
'{ ' + 
'	text-decoration:; border:1px solid ;' + 
'	background: ' + hilightcol + '; ' + 
'	color: ' + hilightcol + '; ' + 
'} ' + 
' ' + 
'A.boxlink:hover' + 
'{ ' + 
'	text-decoration:none; ' +
'	background: ' + maincol + '; ' +
'	color: ' + hilightcol + '; ' + 
'} ' + 

'</style>');

}


function writemainnav(titem)
{
	var navbar = new Array("About", "Shop", "News", "Corporate", "Retailers", "Weddings");
	
	document.write ('<tr valign="middle" align="center">');
	for (var j=0; j<(navbar.length/2); j++)
	{
		document.write ('<td><a href="' + navbar[j] + '.html"');
		if (navbar[j] == titem) document.write (' class="nav-selected-item"');
		document.write ('>' + navbar[j] + '</a></td>');
	}
	document.write ('</tr>');
	document.write ('<tr valign="middle" align="center">');
	for (var j=(navbar.length/2); j<navbar.length; j++)
	{
		document.write ('<td><a href="' + navbar[j] + '.html"');
		if (navbar[j] == titem) document.write (' class="nav-selected-item"');
		document.write ('>' + navbar[j] + '</a></td>');
	}
	document.write ('</tr>');

/* original HTML:
						<tr valign=middle>
							<td><a href="">about</a></td>
							<td><a href="">shop</a></td>
							<td><a href="">news</a></td>
							<td><a href="">gifts</a></td>
						</tr>
						<tr valign=middle>
							<td><a href="">retailers</a></td>
							<td><a href="">events</a></td>
							<td><a href="">wholesale</a></td>
							<td><a href="">weddings</a></td>
						</tr>
*/
}


function ignoreSpaces(string) {
	var temp = "";
	string = '' + string;
	splitstring = string.split(" ");
	for(i = 0; i < splitstring.length; i++)
	temp += splitstring[i];
	return temp;
}

function writeprodlist(tcat, titem)
{
	for (var k=0; k<max_products; k++)
		if (product_titles[k] == tcat) break;

	for (var j=0; j<flavors[k].length; j++)
	{
		document.write ('<a href="' + product_pref[k] + ignoreSpaces(flavors[k][j]) + '.html"');
		if (flavors[k][j] == titem) document.write (' class="r-col-selected-item"');
		document.write ('>' + flavors[k][j] + '</a>');
	}

/* original HTML:
			<div id="r-col-items">
				<a href="cn-azteque.html">azteque</a>
				<a href="cn-cafe.html">cafe</a>
				<a href="cn-epices.html">epices</a>
				<a href="cn-extranoir.html">extra noir</a>
				<a href="cn-framboise.html">framboise</a>
				<a href="cn-lait.html">lait</a>
				<a href="cn-orange.html" class="r-col-selected-item">orange</a>
				<a href="cn-noir.html">noir</a>
			</div>
*/
}

function writeheader(tpage)
{
	document.write('<table border="0" cellpadding="0" cellspacing="0" style="padding-right:5px;">');
	document.write('<tr valign="middle">');
	document.write('<td width="300" align="center"><a href="index.html" title="Go to main page."><img align="middle" src="cdlogo_' + String(accentcol).substring(7,1) + '.gif" alt="" border="0" style="padding:5px 0 5px 0" /></a>');
	document.write('</td>');
	document.write('<td>');
	document.write('<table border="0" id="nav" >');
	writemainnav(tpage);
	document.write('</table>');
	document.write('</td>');
	document.write('</tr>');
	document.write('</table>');

/* original HTML:
		<table border="0" cellpadding="0" cellspacing="0" style="padding-right:5px;">
			<tr valign="middle">
				<td width="300" align=middle><a href="index.html" title="Go to main page."><img 
					align=middle src="cocoadesigns_black.gif" alt="" border="0" style="padding:5px 0 5px 0" /></a>
				</td>
		 		<td>
					<table border="0" id="nav" >
						<script>
							writemainnav("about");
						</script>
					</table>
				</td>
			</tr>
		</table>
*/
}


function writeprods(tprod)
{
//	document.write ('Buy now!<br />');
	for (var j=0; j<max_products; j++)
	{
		document.write ('<a href="' + product_titles[j] + '-main.html"');
		if (product_titles[j] == tprod) document.write (' class="r-col-selected-item"');
		document.write ('>' + product_names[j] + '</a>');
	}
//	document.write ('<br /><a href=sale.html>On sale!</a>');
//	document.write ('<a href=giftcard.html>Add Gift Card</a>');
	document.write ('<br /><a href=http://order.store.yahoo.com/cgi-bin/wg-order?yhst-66483293720792>View Cart</a>');

/* original HTML:
				<a href="cocoanuts-main.html" class="r-col-selected-item">cocoa nuts</a>
				<a href="cookies-main.html">choco cookies</a>
				<a href="spreadables-main.html">cocoa nut spreadables</a>
				<a href="caramels-main.html">cocoa caramels</a>
				<a href="bars-main.html">cocoa nut bars</a>
*/
}



