/*
---------------------------------------------------------------------------------------------
	TAB BAR LINKS: This file includes the function that declares and displays the 
	tab links (home, policy, contact) as well as the "items in cart", cart image,
	"view cart" link, and "checkout" link.  Plus, as an added complimentary bonus,
	this file also includes the function that displays the tab bar border.

	What's the tab bar border, you ask?  It's the gray line just under the tab
	links.
---------------------------------------------------------------------------------------------
*/

/*
****************************************************
	begin function for tab bar links

		links include:
			- tabs (home, policy, contact)
			- checkout
			- view cart

		data includes:
			- items in cart
****************************************************
*/

	function tabBarLinks(whichPage) {
		var beginTabImageData = '<td width="78" height="32" valign="bottom" align="left">';
		var beginItemsData = '<td class="normTextGrayBold" width="306" height="35" valign="bottom" align="right">';
		var beginCartImageData = '<td width="29" height="35" valign="bottom" align="center">';		
		var beginCartData = '<td class="normTextGrayBold" width="72" height="35" valign="bottom" align="center">';
		var beginCheckoutData = '<td class="normTextGrayBold" width="68" height="35" valign="bottom" align="center">';

		var anchorCheckout = '<a href="https://futuretechtoday.net/Merchant2/merchant.mvc?Screen=LOGN&amp;Order=1&amp;Store_Code=FTT" class="checkout" onClick="deleteCookie(\'itemsInCart\', \'/\')">';
		var anchorCart = '<a href="http://futuretechtoday.net/Merchant2/merchant.mvc?Screen=BASK&amp;Store_Code=FTT" class="checkout">';
		var anchorViewCart = '<a href="http://futuretechtoday.net/Merchant2/merchant.mvc?Screen=BASK&amp;Store_Code=FTT" class="checkout">';
		var anchorHome = '<a href="http://futuretechtoday.net/index.htm">';
		var anchorPolicy = '<a href="http://futuretechtoday.net/policy.htm">';
		var anchorContact = '<a href="http://futuretechtoday.net/contact.htm">';

		var tabHomeOn = '<img src="http://futuretechtoday.net/images/tabHomeOn.gif" width="76" height="32" border="0" alt="Home">';
		var tabHomeOff = '<img src="http://futuretechtoday.net/images/tabHomeOff.gif" width="76" height="32" border="0" alt="Home">';
		var tabPolicyOn = '<img src="http://futuretechtoday.net/images/tabPolicyOn.gif" width="76" height="32" border="0" alt="Policy">';
		var tabPolicyOff = '<img src="http://futuretechtoday.net/images/tabPolicyOff.gif" width="76" height="32" border="0" alt="Policy">';
		var tabContactOn = '<img src="http://futuretechtoday.net/images/tabContactOn.gif" width="76" height="32" border="0" alt="Contact">';
		var tabContactOff = '<img src="http://futuretechtoday.net/images/tabContactOff.gif" width="76" height="32" border="0" alt="Contact">';

		var shoppingCart = '<img src="http://futuretechtoday.net/images/cart.gif" width="29" height="21" border="0">';

		// setup clearPixel spacer image
		var beginClearPixel = '<img src="images/clearpixel.gif" ';
		var endClearPixel = ' height="1" border="0">';

		document.write(beginData);
		document.write(beginClearPixel + 'width="10"' + endClearPixel);
		document.write(endImage);
		document.write(endData);

		if(whichPage == "home") {
			document.write(beginTabImageData);
			document.write(tabHomeOn);
			document.write(endImage);
			document.write(endData);

			document.write(beginTabImageData);
			document.write(anchorPolicy);
			document.write(tabPolicyOff);
			document.write(endImage);
			document.write(endAnchor);
			document.write(endData);

			document.write(beginTabImageData);
			document.write(anchorContact);
			document.write(tabContactOff);
			document.write(endImage);
			document.write(endAnchor);
			document.write(endData);
		}
		else if(whichPage == "policy") {
			document.write(beginTabImageData);
			document.write(anchorHome);
			document.write(tabHomeOff);
			document.write(endImage);
			document.write(endAnchor);
			document.write(endData);

			document.write(beginTabImageData);
			document.write(tabPolicyOn);
			document.write(endImage);
			document.write(endData);

			document.write(beginTabImageData);
			document.write(anchorContact);
			document.write(tabContactOff);
			document.write(endImage);
			document.write(endAnchor);
			document.write(endData);
		}
		else if(whichPage == "contact") {
			document.write(beginTabImageData);
			document.write(anchorHome);
			document.write(tabHomeOff);
			document.write(endImage);
			document.write(endAnchor);
			document.write(endData);

			document.write(beginTabImageData);
			document.write(anchorPolicy);
			document.write(tabPolicyOff);
			document.write(endImage);
			document.write(endAnchor);
			document.write(endData);

			document.write(beginTabImageData);
			document.write(tabContactOn);
			document.write(endImage);
			document.write(endData);
		}
		else if(whichPage == "none") {
			document.write(beginTabImageData);
			document.write(anchorHome);
			document.write(tabHomeOff);
			document.write(endImage);
			document.write(endAnchor);
			document.write(endData);

			document.write(beginTabImageData);
			document.write(anchorPolicy);
			document.write(tabPolicyOff);
			document.write(endImage);
			document.write(endAnchor);
			document.write(endData);

			document.write(beginTabImageData);
			document.write(anchorContact);
			document.write(tabContactOff);
			document.write(endImage);
			document.write(endAnchor);
			document.write(endData);
		}

		document.write(beginItemsData);
		document.write('Items in Cart: ');
		document.write(itemsInCart());
		document.write(endData);

		document.write(beginData);
		document.write(beginClearPixel + 'width="20"' + endClearPixel);
		document.write(endImage);
		document.write(endData);
		
		document.write(beginCartImageData);
		document.write(anchorCart);
		document.write(shoppingCart);
		document.write(endImage);
		document.write(anchorCart);
		document.write(endData);

		document.write(beginData);
		document.write(beginClearPixel + 'width="1"' + endClearPixel);
		document.write(endImage);
		document.write(endData);

		document.write(beginCartData);
		document.write(anchorViewCart);
		document.write('View Cart');
		document.write(endAnchor);
		document.write(endData);

		document.write(beginData);
		document.write(beginClearPixel + 'width="20"' + endClearPixel);
		document.write(endImage);
		document.write(endData);		

		document.write(beginCheckoutData);
		document.write(anchorCheckout);
		document.write('Checkout');
		document.write(endAnchor);
		document.write(endData);		
	}

/*
**************************************************
	end function for tab bar links
**************************************************
*/


/*
****************************************************
	begin function for tab bar border
****************************************************
*/

	function tabBarBorder(whichPage) {
		var beginTabUnderscore = '<img src="http://futuretechtoday.net/images/tabOnUnderscore.gif" width="76" height="3" border="0">';

		var beginGrayPixel = '<img src="http://futuretechtoday.net/images/darkgraypixel.gif" ';
		var endGrayPixel = ' height="3" border="0">'; 

		if(whichPage == "home") {
			document.write(beginDataLeft);
			document.write(beginGrayPixel + 'width="10"' + endGrayPixel);
			document.write(endImage);
			document.write(endData);
			document.write(beginDataLeft);
			document.write(beginTabUnderscore);
			document.write(endImage);
			document.write(endData);
			document.write(beginDataLeft);
			document.write(beginGrayPixel + 'width="674"' + endGrayPixel);
			document.write(endImage);
			document.write(endData);
		}
		else if(whichPage == "policy") {
			document.write(beginDataLeft);
			document.write(beginGrayPixel + 'width="88"' + endGrayPixel);
			document.write(endImage);
			document.write(endData);
			document.write(beginDataLeft);
			document.write(beginTabUnderscore);
			document.write(endImage);
			document.write(endData);
			document.write(beginDataLeft);
			document.write(beginGrayPixel + 'width="596"' + endGrayPixel);
			document.write(endImage);
			document.write(endData);
		}
		else if(whichPage == "contact") {
			document.write(beginDataLeft);
			document.write(beginGrayPixel + 'width="166"' + endGrayPixel);
			document.write(endImage);
			document.write(endData);
			document.write(beginDataLeft);
			document.write(beginTabUnderscore);
			document.write(endImage);
			document.write(endData);
			document.write(beginDataLeft);
			document.write(beginGrayPixel + 'width="518"' + endGrayPixel);
			document.write(endImage);
			document.write(endData);
		}
		else if(whichPage == "none") {
			document.write(beginDataLeft);
			document.write(beginGrayPixel + 'width="166"' + endGrayPixel);
			document.write(endImage);
			document.write(endData);
			document.write(beginDataLeft);
			document.write(beginGrayPixel + 'width="76"' + endGrayPixel);
			document.write(endImage);
			document.write(endData);
			document.write(beginDataLeft);
			document.write(beginGrayPixel + 'width="518"' + endGrayPixel);
			document.write(endImage);
			document.write(endData);
		}
	}

/*
**************************************************
	end function for tab bar border
**************************************************
*/