// JavaScript Document
//food objects
function Food(n,gf,r){
this.name = n;
this.gluten = gf;
this.price = 0;
this.recipe = ing[r];

}
//
//food types
var bread = new Array();
var tart = new Array();
var meals = new Array();
var hot = new Array();
var jam = new Array();
var ing = new Array();
//

//ingredients
 ing[0] = "Fruits, Root tubers, Whole Wheat Stone ground four(primary ingerdient), Oil, Cane Sugar, Vanilla & Spices";
 ing[1] = "Fresh fruits, Whole Wheat Stone ground four (primary ingerdient), Oil, Cane Sugar, Spices";
 ing[2] = "Okra, Sweet Potatoes, Local farm vegetables (primary ingerdient), Oil, Salt and Seasoning";
 ing[3] = "";
 ing[4] = "";
 ing[5] = "";
 ing[5] = "Fresh fruits, Root tubers and farm vegetables, Buck Wheat, and rice ground four, Oil, Cane Sugar, Vanilla & Spices";
 ing[6] = "Fresh fruits, Whole Wheat Stone ground four (primary ingerdient), Cane Sugar, Spices";
 ing[10] = "Fresh fruits, Root tubers and farm vegetables, Buck Wheat, and rice ground four, Oil, Cactus Agar, Vanilla & Spices";
 ing[7] = "";
 ing[8] = "";
 ing[9] = "Assorted vegetables, Whole Wheat Stone ground four (primary ingerdient), Oil, Spices";

//
//
//breads
bread.gumf = "Creole Soda breads are a tradition of central America, the Southern United States and the Caribbean, similar baking is also found in Southern Africa. Though they taste very much like cake they are breads and as such have around half the fat and sugar found in cake.";
bread[0] = new Food('15 unique fruit and seed loafs','yes',0);
bread[1] = new Food('7 fruit and savoury, gluten free breads','n',5);
bread[2] = new Food('5 fruit and savoury, Sugar and gluten free breads','n',10);

//
//tarts
tart.gumf = "Sweet and savoury tarts have a strong Cajun influence where the fruits and vegetables are marinated with jams and thick sauces and baked with the tart. This results in a rich and aromatic pastry";
tart[0] = new Food('Sweet Tarts','yes',1);
tart[1] = new Food('Field Mushroom Tart','yes',9);
tart[2] = new Food('Farm Vegetable Tart','yes',9);
//

//meals
meals.gumf = "Gumbo is from west African culture, but has become the regional dish of Louisiana. It is thickened with Okra, file powder or roux and thus can be made gluten free. Gumbo is traditionally served with rice and peas, but is equally good with potatoes, pasta, bread or salad";
meals[0] = new Food('Vegetable Gumbo','no',2);
meals[1] = new Food('Rice and Peas','no',3);
meals[1] = new Food('Rich Bean Salad','no',4);
//
//Hot Food
hot.gumf = "Fritters are based on Southern and Caribbean food law, and make up the staple flat bread diet in these regions. These are deeply ingrained into Amorite culture, where they are traditionally made with maize."
hot[0] = new Food('Vegetable Fritters','yes',6);
hot[1] = new Food('Banana Fritters','yes',6);
hot[2] = new Food('Apple Fritters','yes',6);
//
//Preserves
jam.gumf = "Chilli is one thing make the Americas such an exciting place for food. Though chilli is from America, it is now a primary ingredient in much of the worlds traditional cooking. Even so Creole hot sauces and relishes are arguably the original and the best.";
jam[0] = new Food('Chilli Relish','no',7);
jam[1] = new Food('Bajan Hot Chilli Sauce','no',8);
//

function Change_png(img,newimg,oldimg){
var oldpic = document.getElementById(img).src;
var newpic = oldpic.replace(oldimg, newimg);
document.getElementById(img).src = newpic;
}

function mlist(n,src){
	var listing = '<table width="440" height="155" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFEFBD">';
	var stuff = new Array();
stuff[0] = bread;
stuff[1] = tart;
stuff[2] = meals;
stuff[3] = hot;
stuff[4] = jam;
var l1 = '<tr><td width="126" valign="top"><span class="style2">';
var l2 = '</span></td><td width="223" rowspan="2" align="left" valign="top"><span class="style2">Ingredients:<br>';
var l3 = '</span></td></tr><tr><td valign="top"><span class="style2">Gluten?: ';
var l4 = '</span></td></tr>';
	listing +='<tr> <td height="86" colspan="2" valign="top"><span class="style3">'+stuff[n].gumf+'</span></td> </tr>'

for (var o = 0; o < stuff[n].length; o++)    {
	listing += l1+stuff[n][o].name+l2+stuff[n][o].recipe+l3+stuff[n][o].gluten+l4;
	}
listing +='</table>';
document.getElementById(src).innerHTML = listing;
}


function Market(n,loco,wd,img,linc){
this.name = n;
this.loco = loco;
this.day = wd;
this.img = img;
this.linc = linc;
this.info = "";

}
//
//market array types
var shop = new Array();

//
//Markets
shop[0] = new Market("The Stoke Newington Farmers' Market ","William Patten School, Stoke Newington Church Street, London, N16","Every Saturday, (except for Christmas and New Year) from 10am till 2.30pm.","template/growing.jpg","http://www.growingcommunities.org/farmers-market/index.htm");
shop[5] = new Market("Wimbledon Park Farmers' Market","Wimbledon Park First School, Havana Road, SW19","Every first and third Saturday, (except for Christmas and New Year) from 9am till 1.00pm.","http://www.bbc.co.uk/london/content/images/2008/03/04/eat_470x300.jpg","http://www.lfm.org.uk/wimb.asp");
shop[2] = new Market("Islington Farmers' Market","William Tyndale School (behind the Town Hall), Upper Street, Islington. N1","Every first and third Sunday, (except for Christmas and New Year) from 10am till 2.00pm.","http://www.londonelicious.com/dining/images/2008/09/28/islington_sunflowers.jpg","http://www.lfm.org.uk/isling.asp");
shop[4] = new Market("Walthamstow Farmers' Market","Town Square by Selbourne Walk Shopping Centre, off the High Street, Walthamstow E17","Every Sunday, (except for Christmas and New Year) from 10am till 2.00pm.","http://www.britevents.com/img/event_pictures/75968.jpg","http://www.lfm.org.uk/walthamstow.asp");
shop[3] = new Market("Wanstead's Essex Farmers' Market","Wanstead High Street","Every forth Sunday, (except for Christmas and New Year) from 10am till 2.00pm.","http://www.bbc.co.uk/london/content/images/2008/03/04/eat_470x300.jpg","http://www.essexfarmersmarkets.co.uk/markets/event/53-wanstead-farmers-market");
shop[1] = new Market("Brixton's Farmers' Market","Brixton Station Road","Every Sunday (except for Christmas and New Year) from 10am till 2pm.","template/lbread.jpg","http://www.lfm.org.uk/brixton.asp");

function mlist2(n,src){
	var listing = '<table border="2" width="100"cellpadding="0" cellspacing="0" bordercolor="#FFEFBD">';

var l1 = '<tr>   <td  valign="top" class="style3" width="200">';
var l2 = '</td> <td rowspan="2" valign="top" ><div align="center"><img src="';
var l3 = '" width="150"></div></td>  </tr>  <tr> <td valign="top" class="style2" width="200">';
var l4 = '</td></tr>';


	listing += l1+shop[n].name+l2+shop[n].img+l3+shop[n].loco+'<br>'+shop[n].day+'<br>Web Site: <a href="'+shop[n].linc+'" target="_blank">'+shop[n].linc+'</a><br>'+l4;

listing +='</table>';
document.getElementById(src).innerHTML = listing;
}


 
function test(t){

	document.getElementById(t).innerHTML =ing[0];
}
function setCookie(cname,value){
document.cookie=cname+"="+value;
}
function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
}