
<!--

<!-- This script sets up the global java variables -->
<!-- Window onload command -->
<!-- Global hide of status bar text -->
<!-- Global Windows (Java script) error blocker -->
<!-- Drop down menus -->
<!-- This file to placed at the top of all HTML pages -->

var CartVersion = "Cart V2.5.8";

var VATValue = 0; // set the VAT value
var	QTYMaxDefault = "4"; // set default item max quantity in cart
var	CartMaxQuantity = 20; // set default cart max quantity
var Parts_Navigation_Menu = "";
var	Manuals_Price = "96.00";


var user1 = "service";
var user2 = "support";
var user3 = "feedback";
var user4 = "maillist";
var user5 = "sponsorship";
var site = "";
var Root_Of_Site = "";
var Root_Pos_Start = 0;
var Root_Pos_End = 0;
Root_Of_Site = window.location.href;
if (Root_Of_Site.indexOf("http") >= 0)
	{
	if (Root_Of_Site.indexOf("www.") >= 0)
		{
		Root_Pos_Start = Root_Of_Site.indexOf("www.") + 4;
		Root_Pos_End = Root_Of_Site.indexOf("/", Root_Pos_Start);
		site = Root_Of_Site.substring(Root_Pos_Start, Root_Pos_End);
		} else {
		window.location.href = "http://www.website-design-reviews.co.uk";
		}
	} else {
	site = "website-design-reviews.co.uk";
	}

var CartDuration = (1000*60*60);

var Thisurl = document.URL;
var RelativeLink = 0;
var CartLink = "";
document.cookie = 'BackToItemURLCookiePDC=' + escape(Thisurl) + "---" +";path=/";

var ButtonText = "  Add to Cart  "; // Text for button to add item to cart
var ButtonTextSOLD = "        SOLD      "; // Text for SOLD button
var ButtonTextSOLDOUT = "        Sold out        "; // Text for Sold out button
var ButtonComingSoon = "Coming soon"; // Text for coming soon button 
var ButtonTextRESERVED = "       Reserved       "; // Text for RESERVED button
var	Item = "";
var	PandP = "";
var QTYMax = "";
var menu = "";
var	Price = "";

var ItemDesc = "Description";
var ItemPrice = "Price";
var PandP = "packing";

var ItemShoppingCart = new Array();
var ItemShoppingCartDescription = new Array();
var ItemShoppingCartPandP = new Array();
var ItemShoppingCartPrice = new Array();
var ItemShoppingCartQuantity = new Array();
var ItemShoppingCartQTYMax = new Array();
var ItemShoppingCartTotal = new Array();
var	ItemShoppingCartDescriptionStart = new Array();
var	ItemShoppingCartDescriptionEnd = new Array();
var	ItemShoppingCartPandPStart = new Array();
var	ItemShoppingCartPandPEnd = new Array();
var	ItemShoppingCartPriceStart = new Array();
var	ItemShoppingCartPriceEnd = new Array();
var	ItemShoppingCartQuantityStart = new Array();
var	ItemShoppingCartQuantityEnd = new Array();
var	ItemShoppingCartQTYMaxStart = new Array();
var	ItemShoppingCartQTYMaxEnd = new Array();
var	ItemShoppingCartCookieStart = new Array();
var	ItemShoppingCartCookieEnd = new Array();
var	item_Quantity =  new Array();
var StringStart = 0;
var	ItemNumber = 0;
var ShoppingCartNumberItems = 0;
var ShoppingCartNumberItemsCookieStart = 0;
var ShoppingCartNumberItemsCookieEnd = 0;

var Site_Base_URL = "";

mystatus();

function Item_Sold_Out()
{
alert("This item is currently not available.  Please contact " + user1 + "@" + site + " for price and availability.");
}

function Item_Sold()
{
alert("This item has been sold recently.  If you wish to purchase a similar item please contact " + user1 + "@" + site + " for price and availability.");
}

function Item_Reserved()
{
alert("This item is currently reserved.  If you wish to purchase a similar item please contact " + user1 + "@" + site + " for price and availability.");
}

function Coming_Soon()
{
alert("This item will be available soon.  If you wish to pre-order this item please contact " + user1 + "@" + site + " to confirm price and availability.");
}

function GoToCart()
{
if (Thisurl.search("http") >= 0)
	{
	window.location.href = "/BuyNow/ShoppingCart.htm";//absolute link (live website only)
	}
else
	{
	for (i=0;i<Thisurl.length; i++) // loop through this URL string
		{
		if (Thisurl.charAt(i) == "\\")
			{
			RelativeLink = RelativeLink + 1;
			}
		}
	RelativeLink = RelativeLink - 2;
	for (i=0;i<RelativeLink; i++) // loop to create correct link 
		{
		CartLink = CartLink + "../"
		}
	window.location.href = CartLink + "BuyNow/ShoppingCart.htm";//relative link (testing only)
	}
}

//Add to Cart
function AddToCart()
{

//alert("There is a fault.  The Shopping Cart required the use of Cookies to function.  Please enable Cookies in your Browser (refer to help in Shopping Cart) or contact " + user1 + "@" + site + " to purchase this item.")

var CookieTestWrite = "false";
var	CookieTestCookieStart = 0;
var	CookieTestCookieEnd = 0;
var	ItemExists = "false";
var itemAdded = 0;
var CartCookie = "";
var	CartCookieStart = 0;
var	CartCookieEnd = 0;

Item = Item.replace("_" , " ");//remove any underscore characters from item Description as this is a control character in the cookie
Item = Item.replace("---" , " ");//remove any 3 dash characters from item Description as this is a control character in the cookie
Item = Item.replace("***" , " ");//remove any 3 star characters from item Description as this is a control character in the cookie

document.cookie = "CookieTest=" + escape("true") +";path=/";
CookieTestCookieStart = document.cookie.indexOf("CookieTest=");
CookieTestCookieEnd = document.cookie.indexOf(";", CookieTestCookieStart + 0);
if (CookieTestCookieEnd == -1) // Carry out a test for Cookies enabled
	{
	CookieTestCookieEnd = document.cookie.length;
	}
CookieTestWrite = document.cookie.substring(CookieTestCookieStart + 11, CookieTestCookieEnd);
if (CookieTestCookieStart == -1)
	{
	CookieTestWrite =  "false";
	}
if (CookieTestWrite != "true")
	{
	alert("The Shopping Cart required the use of Cookies to function.  Please enable Cookies in your Browser (refer to help in Shopping Cart) or contact " + user1 + "@" + site + " to purchase this item.")
	} else {
	var oldDate = new Date();
	oldDate.setTime(oldDate.getTime() - (1000*60*60*24*30));
	document.cookie = "CookieTest=" + ";expires=" + oldDate.toGMTString() + ";path=/";
	document.cookie = 'BackToItemURLCookiePDC=' + escape(Thisurl) + "---" +";path=/";
	ExtractShoppingCartNumberItems()
	
//Extract CartCookie
	CartCookieStart = document.cookie.indexOf("CartCookiePDC=");
	CartCookieEnd = document.cookie.indexOf("***", CartCookieStart + 0);
	if (CartCookieEnd == -1)
		{
		CartCookieEnd = document.cookie.length;
		}
	CartCookie = unescape(document.cookie.substring(CartCookieStart + 14, CartCookieEnd));
	if (CartCookieStart == -1)
		{
		CartCookie = "";
		}
	ItemShoppingCart = CartCookie.split("---");
	CartCookie = "";
	if (QTYMax == "") {QTYMax = QTYMaxDefault};
	for (i=0;i<ItemShoppingCart.length; i++)
		{
// extract the data for the items in the cart from the Cookie
		ItemShoppingCartDescriptionStart[i] = 0;
		ItemShoppingCartDescriptionEnd[i] = ItemShoppingCart[i].indexOf("_", 1);
		ItemShoppingCartDescription[i] = ItemShoppingCart[i].substring(ItemShoppingCartDescriptionStart[i], ItemShoppingCartDescriptionEnd[i]);	
		
		ItemShoppingCartPandPStart[i] = ItemShoppingCartDescriptionEnd[i] + 1;
		ItemShoppingCartPandPEnd[i] = ItemShoppingCart[i].indexOf("_", ItemShoppingCartPandPStart[i]);
		ItemShoppingCartPandP[i] = ItemShoppingCart[i].substring(ItemShoppingCartPandPStart[i], ItemShoppingCartPandPEnd[i]);

		ItemShoppingCartPriceStart[i] = ItemShoppingCartPandPEnd[i] + 1;
		ItemShoppingCartPriceEnd[i] = ItemShoppingCart[i].indexOf("_", ItemShoppingCartPriceStart[i]);
		ItemShoppingCartPrice[i] = ItemShoppingCart[i].substring(ItemShoppingCartPriceStart[i], ItemShoppingCartPriceEnd[i]);
		
		ItemShoppingCartQuantityStart[i] = ItemShoppingCartPriceEnd[i] + 1;
		ItemShoppingCartQuantityEnd[i] = ItemShoppingCart[i].indexOf("_", ItemShoppingCartQuantityStart[i]);
		ItemShoppingCartQuantity[i] = ItemShoppingCart[i].substring(ItemShoppingCartQuantityStart[i], ItemShoppingCartQuantityEnd[i]);

		ItemShoppingCartQTYMaxStart[i] = ItemShoppingCartQuantityEnd[i] + 1;
		ItemShoppingCartQTYMaxEnd[i] = ItemShoppingCart[i].length;
		ItemShoppingCartQTYMax[i] = ItemShoppingCart[i].substring(ItemShoppingCartQTYMaxStart[i], ItemShoppingCartQTYMaxEnd[i]);

		if (Item == ItemShoppingCartDescription[i]) // update quantity of item already in cart
			{
			ItemExists = "true";
			if (parseInt(ItemShoppingCartQuantity[i]) < parseInt(ItemShoppingCartQTYMax[i]))
				{
				ItemShoppingCartQuantity[i] = (parseInt(ItemShoppingCartQuantity[i]) + 1);
				} else {
				alert("The maximum quantity of this item has been placed in your shopping cart.  Unable to add another of this item to the shopping cart.  To purchase a larger quantity of this item please contact " + user1 + "@" + site);
				}
			if (QTYMax == 0)
				{
				ItemShoppingCartQuantity[i] = 0;
				alert("This item is currently out of stock.  To purchase this item please contact " + user1 + "@" + site);
				}
			}	
		
		if (ItemShoppingCartDescription[i] !="") // update cart with the new quantity
			{
			CartCookie = CartCookie + ItemShoppingCartDescription[i] + "_" + ItemShoppingCartPandP[i] + "_" + ItemShoppingCartPrice[i] + "_" + ItemShoppingCartQuantity[i] + "_" + ItemShoppingCartQTYMax[i] + "---";
			}
		}// end of for loop
		
//create and write Cookie
		for (i=0;i<ItemShoppingCart.length; i++) // add new item to cart
			{
			if (ItemExists != "true")
				{
				if (ShoppingCartNumberItems < 20)
					{
					if (itemAdded == 0)	
						{
						itemAdded = 1;
						if (QTYMax == 0)
							{
							alert("This item is currently out of stock.  To purchase this item please contact " + user1 + "@" + site);
							} else {
							CartCookie = CartCookie + Item + "_" + PandP + "_" + Price + "_1_" + QTYMax + "---";
							}
						}
					}
				}
			}// end of for loop
		}	
	CartCookie = CartCookie + "***";
	var newDate = new Date();
	newDate.setTime(newDate.getTime() + CartDuration);
	document.cookie = "CartCookiePDC=" + escape(CartCookie) + ";expires=" + newDate.toGMTString() + ";path=/"; // write cart cookie
	if (ShoppingCartNumberItems > 19)
		{
		alert("The Shopping Cart is full.  Please proceed to the checkout.");
		}
	
//Add to Cart Cookie Counter
var VisitCartCounterLink = "";
var VisitCartCounter = "Counter/CountToCart.php?js=1";
ObtainRootURL();//get the base site URL
VisitCartCounterLink = Site_Base_URL + VisitCartCounter;

var VisitCartCookieWrite = "false";
var	VisitCartCookieStart = 0;
var	VisitCartCookieEnd = 0;
var VisitCartCookieNewDate = new Date();
VisitCartCookieNewDate.setTime(VisitCartCookieNewDate.getTime() + (1000*60*60*24));//Visit cookie to expire in 24 hours

VisitCartCookieStart = document.cookie.indexOf("CookieVisitCart=");
VisitCartCookieEnd = document.cookie.indexOf(";", VisitCartCookieStart + 0);
if (VisitCartCookieEnd == -1) // Carry out a test for visit Cookies present
	{
	VisitCartCookieEnd = document.cookie.length;
	}
VisitCartCookieWrite = document.cookie.substring(VisitCartCookieStart + 16, VisitCartCookieEnd);

if (VisitCartCookieStart == -1)
	{
	VisitCartCookieWrite =  "false";
	}
if (VisitCartCookieWrite != "true")
	{
	document.write('<tr><td align="center"><script type="text/JavaScript" src="' + VisitCartCounterLink + '"></script></td></tr>');//increment visit counter
	}
document.cookie = "CookieVisitCart=" + escape("true") + ";expires=" + VisitCartCookieNewDate.toGMTString() + ";path=/";//write visit cookie

	GoToCart()
}

//Block Javascript errors
function blockError(){return true;}
window.onerror = blockError;

//disable status bar
function mystatus()
{
window.status = 'Business Website Services';
return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover=mystatus;
document.onmouseout=mystatus;

	 
function InitMenu()
{
	
<!-- The script below hides the loading message -->
if (document.getElementById)
	{  // DOM3 = IE5, NS6
	document.getElementById('hidepage').style.visibility = 'hidden';
	}
else
	{
	if (document.layers)
		{  // Netscape 4
		document.hidepage.visibility = 'hidden';
		}
	else
		{  // IE 4
		document.all.hidepage.style.visibility = 'hidden';
		}
	}
}

<!-- The script below runs the drop down menus -->

var timeOn = null;
var numMenus = 8;
var MenuDesired = 1;
var MenuOffDelay = 1500;
document.onmouseover = DelayHideMenus;
document.onclick = hideAllMenus;
window.onerror = null;

function HideMenusNow()
{
MenuDesired = 0;
hideAllMenus();
}

function DelayHideMenus()
{
MenuDesired = 0;
timeOn = setTimeout("hideAllMenus()", MenuOffDelay);
}

function menuOver(itemName)
{
clearTimeout(timeOn);
MenuDesired = 1;
}

function menuOut(itemName)
{
if(document.layers)
	{
	MenuDesired = 0;
	hideAllMenus();
	}
}

function getStyleObject(objectId)
{
    // cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getStyleObject


function changeObjectVisibility(objectId, newVisibility)
{
// get a reference to the cross-browser style object and make sure the object exists
var styleObject = getStyleObject(objectId);
if(styleObject)
	{
	styleObject.visibility = newVisibility;
	return true;
    } else {
	//we couldn't find the object, so we can't change its visibility
	return false;
    }
} // changeObjectVisibility


function showMenu(menuNumber, eventObj, labelID)
{
MenuDesired = 0;
hideAllMenus();
MenuDesired = 1;
if(document.layers)
	{
	menuTop = y + 10; // LAYER TOP POSITION
	eval('document.layers["menu'+menuNumber+'"].top="'+menuTop+'"');
	eval('document.layers["menu'+menuNumber+'"].left="'+x+'"');
	}
eventObj.cancelBubble = true;
var menuId = 'menu' + menuNumber;
if(changeObjectVisibility(menuId, 'visible'))
	{
	return true;
    } else {
	return false;
    }
}


function hideAllMenus()
{
if (MenuDesired == 0)
	{
	MenuDesired = 1;
	for(counter = 1; counter <= numMenus; counter++)
		{
		changeObjectVisibility('menu' + counter, 'hidden');
		}
	}
}


function moveObject(objectId, newXCoordinate, newYCoordinate)
{
// get a reference to the cross-browser style object and make sure the object exists
var styleObject = getStyleObject(objectId);
if(styleObject)
	{
	styleObject.left = newXCoordinate;
	styleObject.top = newYCoordinate;
	return true;
    } else {
	// we couldn't find the object, so we can't very well move it
	return false;
    }
} // moveObject

// ***********************
// hacks and workarounds *
// ***********************

// initialize hacks whenever the page loads
window.onload = initializeHacks;

// setup an event handler to hide popups for generic clicks on the document
function initializeHacks()
{
    // this ugly little hack resizes a blank div to make sure you can click
    // anywhere in the window for Mac MSIE 5
    if ((navigator.appVersion.indexOf('MSIE 5') != -1) 
	&& (navigator.platform.indexOf('Mac') != -1)
	&& getStyleObject('blankDiv'))
		{
		window.onresize = explorerMacResizeFix;
    	}
    resizeBlankDiv();
    // this next function creates a placeholder object for older browsers
    createFakeEventObj();
}


function createFakeEventObj()
{
// create a fake event object for older browsers to avoid errors in function call
// when we need to pass the event object to functions
if (!window.event)
	{
	window.event = false;
    }
} // createFakeEventObj


function resizeBlankDiv()
{
// resize blank placeholder div so IE 5 on mac will get all clicks in window
if ((navigator.appVersion.indexOf('MSIE 5') != -1) && (navigator.platform.indexOf('Mac') != -1)	&& getStyleObject('blankDiv'))
	{
	getStyleObject('blankDiv').width = document.body.clientWidth - 20;
	getStyleObject('blankDiv').height = document.body.clientHeight - 20;
    }
}


function explorerMacResizeFix()
{
location.reload(false);
}

function mClk(src)
{ 
if(event.srcElement.tagName=='TD')
		src.children.tags('A')[0].click();
}


function ExtractShoppingCartNumberItems()
{
// extract the value of the number of items in the cart from the Cookie

var ShoppingCartNumberItemsCookieStart = 0;
var ShoppingCartNumberItemsCookieEnd = 0;
ShoppingCartNumberItemsCookieStart = document.cookie.indexOf("ShoppingCartNumberItems=");
ShoppingCartNumberItemsCookieEnd = document.cookie.indexOf(";", ShoppingCartNumberItemsCookieStart + 0);
if (ShoppingCartNumberItemsCookieEnd == -1)
	{
	ShoppingCartNumberItemsCookieEnd = document.cookie.length;
	}
ShoppingCartNumberItems = document.cookie.substring(ShoppingCartNumberItemsCookieStart + 24, ShoppingCartNumberItemsCookieEnd);
if (ShoppingCartNumberItemsCookieStart == -1)
	{
	ShoppingCartNumberItems = "0";
	}
ShoppingCartNumberItems = (parseInt(ShoppingCartNumberItems));
}


function Email_Page_Button()
// email this page - puts button on page centrally
{
document.write('<FORM><div align="center">');
document.write('<INPUT class="select" TYPE="button" VALUE="E-mail this page to a friend" onClick="Create_Page_Email()">');
document.write('</div></FORM>');
}


function Create_Page_Email()
// email this page
{
window.location = "mailto:"+"?subject=This may interest you" + "&body=" + "I thought this may be of interest to you.  " + document.title + "  " + window.location;
}

// Tooltip functions

function showtip(Current,Position,ToolTipText)
//Show the tool tip
{
if (document.all||document.getElementById)
	{
	Current.title = ToolTipText;
	}
else if (document.layers)
	{
	document.tooltip.document.write('<layer bgColor="white" style="border:1px solid black;font-size:12px;">' + ToolTipText + '</layer>');
	document.tooltip.document.close();
	document.tooltip.left = Position.pageX + 5;
	document.tooltip.top = Position.pageY + 5;
	document.tooltip.visibility = "show";
	}
}

function HideToolTip()
// hide the tool tip
{
	if (document.layers)
	{
	document.tooltip.visibility = "hidden";
	}
}

function ObtainRootURL()
// creates a string for the root URL
{
if (Thisurl.indexOf("http") >= 0)
	{
	var Root_Pos = Thisurl.indexOf("www." + site);
	Root_Pos = Root_Pos + 33;
	Site_Base_URL = Thisurl.substring(0, Root_Pos);
	} else {
	var Root_Pos = Thisurl.indexOf("website");
	Root_Pos = Root_Pos + 7;
	Site_Base_URL = Thisurl.substring(0, Root_Pos);
	Site_Base_URL = Site_Base_URL.replace(/%20/g, " ");// removes %20 to allow local operation
	Site_Base_URL = Site_Base_URL + "/";
	}
}

// -->