// JavaScript Document

// Random Image Strip

var intRnd;
var arrImages = new Array(8);

for (var fImg=0; fImg<=3; fImg++) {
	for (;;) {
	   	intRnd = Math.floor(Math.random() * arrImages.length);
		if (!arrImages[intRnd]==1) {break;}
	}
	arrImages[intRnd]=1;
	document.getElementById("footer100"+String(fImg)).src = "images/footer_100_"+String(intRnd)+".jpg";
}

var arrImages = new Array(6);
for (var fImg=0; fImg<=2; fImg++) {
	for (;;) {
	   	intRnd = Math.floor(Math.random() * arrImages.length);
		if (!arrImages[intRnd]==1) {break;}
	}
	arrImages[intRnd]=1;
	document.getElementById("footer150"+String(fImg)).src = "images/footer_150_"+String(intRnd)+".jpg";
}

// Cursor Position

var curPosX,curPosY;

document.onmousemove=getCursorPos;

// Tool Tip Text

var objTTT;
var arrTTT = new Array();
var TTTCancel;

objTTT=document.getElementById("ttt").style;
objTTT.visibility="visible";
objTTT.display="none";

arrTTT[1]='T and J Grocery:    Tomato Products, Mushrooms, Vegetables, Truffles, Fish and Specialist Grocer.';
arrTTT[2]='Oils &amp; Vinegars:    Olive Oils, Flavoured Oils, Fats &amp; Oils, Vinegarette, Wine &amp; Flavoured Vinegars, Balsamic Vinegars and Cooking Alcohol.';
arrTTT[3]='Condiments &amp; Sauces:    Tracklements, Mustards, Dressings, Capers and Pickles.';
arrTTT[4]='Stock &amp; Gravy:    Essential Cuisine and Savoury Sauces (Macphie).';
arrTTT[5]='Herbs &amp; Spices:    Ground Spices, Whole Spices, Dried Herbs and Saffron.';
arrTTT[6]='Seasonings &amp; Garlic:    Pepper, Salt and Garlic.';
arrTTT[7]='Pulses, Grains, Rice, Seeds &amp; Nuts:    Dried Pulses, Tinned Pulses, Grains, Seeds, Rice, Nuts and Nut Products.';
arrTTT[8]='Sapori D\'Italia:    Olives, Pesto, Vegetables and Seafood Range.';
arrTTT[9]='Tuk Tuk Foods:    Dipping Sauces, Curry Pastes, Curry Sauces, Salad Dressings, Rice, Noodles and Vegetable Crackers.';
arrTTT[10]='International:    International Sauces &amp; Flavours, Noodles and International Grocery.';
arrTTT[11]='Flour &amp; Tartlet Cases:    Bread Flour, Soft Flour, Specialist Flours, Yeast and Tartlet Cases.';
arrTTT[12]='Patisserie, Baking &amp; Biscuits:    Baking &amp; Patissierie, Food Colourings, Flavourings, Cheese Biscuits and Sweet Biscuits.';
arrTTT[13]='Sugars, Syrups &amp; Sweet Sauces:    Sugars (Tate &amp; Lyle), Syrups and Sweet Sauces (Macphie).';
arrTTT[14]='Chocolate:    Chocolate Cups, After Dinner Delights and Chocolate (Callebaut).';
arrTTT[15]='Fruit, Jams &amp; Honey:    Jam &amp; Honey, Fruit Puree, Frozen Fruit Purees, Fruit Coulis, Premium Fruits, Dried Fruit, Tinned Fruit (in syrup) and Fruit Juice.';
arrTTT[16]='Special Brew &amp; Room Service:    Beverages, Twinings Teabags, Rooms, Twinings Enveloped Teabags and Sugar &amp; Biscuits.';
arrTTT[17]='Restaurant Bar &amp; Breakfast:    Breakfast Cereals, Confectionery, Bar and Crisps &amp; Snacks.';
arrTTT[18]='Non Consumables:    Acetate, Skewers, Paper, Gloves, Jars, Bottles, Etc...';
arrTTT[19]='Mediterranean:    Premium Flavoured Pasta, Pasta, Mediterranean Products, Olives with Stones, Pitted Olives and Stuffed Olives.';
arrTTT[20]='Spice Up Your Life!:    Take Spices and Herbs beyond seasoning. How spices interact, not only with the food, but also within the human body.';

// Info Popup

var objInfo;
var arrInfo = new Array();

objInfo=document.getElementById("info").style;
objInfo.visibility="visible";
objInfo.display="none";
document.onmouseup=killInfo;

// Cursor Position (functions)

function getCursorPos(e){
	if (!e) {
		curPosX=event.x+document.body.scrollLeft;
		curPosY=event.y+document.body.scrollTop;
	} else {
		curPosX=e.pageX;
		curPosY=e.pageY;
	}
}

// Tool Tip Text (functions)

function showTTT(intTTT){
	TTTCancel=0
	var content="<table class=\"ttt\" cellspacing=\"0\" cellpadding=\"0\"><td>"+arrTTT[intTTT]+"</td></table>";
	document.getElementById("ttt").innerHTML=content;
	setTimeout('if(TTTCancel==0){objTTT.display=\'\'}',750);
}

function moveTTT(){
	if (!curPosX){getCursorPos()}
	objTTT.left=curPosX+(-2);
	objTTT.top=curPosY+19;
}

function killTTT(){
	TTTCancel=1;
	objTTT.display="none";
}

// Info Popup (functions)

function showInfo(intInfo){
	var content="<table class=\"info\"><td>"+arrInfo[intInfo]+"</td></table>";
	document.getElementById("info").innerHTML=content;
	objInfo.display='';
	objInfo.left=curPosX+(-10);
	objInfo.top=curPosY+10;
}

function killInfo(){
	objInfo.display="none";
}


