﻿aJuices = new Array();
aAllJuices = new Array();
iAantalKolommen = 4;
sIngredienten = "";
										
function Juices() 
{
	if (aJuices.length > 0) {
		aJuices = new Array();
		VanDeKaart();
		
		myKnop = document.getElementById("knopTaal");
		if (myKnop.value == "English") {
			sLanguage = "EN";
		} else {
			sLanguage = "NL";
		}			
		if (sLanguage == "NL") {
			mySapje = document.getElementById("saptekst");
			mySapje.innerHTML = "Sappen " ;
			myKnop = document.getElementById("knopTaal");
			myKnop.value = "English" ;
		} else {
			mySapje = document.getElementById("saptekst");
			mySapje.innerHTML = "Juices " ;
			myKnop = document.getElementById("knopTaal");
			myKnop.value = "Nederlands" ;
		}
	} else {
		sLanguage = "NL";
	}
	
	aJuice=new Array("MORNING GLORY", IIf(sLanguage=="NL","Meloen, mango, appel, sinaasappel", "Melon, mango, apple, orange"));
	aJuices.push(aJuice);
	
aJuice=new Array("VIRGIN MARY", IIf(sLanguage=="NL", "Passievrucht, appel, peer", "Passionfruit, apple, pear"));   
	aJuices.push(aJuice);              
aJuice=new Array("WHITE ANGEL", IIf(sLanguage=="NL", "Meloen, appel, peer, soya","Melon, apple, pear, soya"));
	aJuices.push(aJuice);              
aJuice=new Array("FLEUR D’AMOUR ", IIf(sLanguage=="NL", "Ananas, mango, banaan","Pineapple, mango, banana, orange"));
	aJuices.push(aJuice);              
aJuice=new Array("HOLLY MOLLY", IIf(sLanguage=="NL", "Kiwi, appel, peer, soya","Kiwi, apple, pear, soya"));
	aJuices.push(aJuice);              
aJuice=new Array("HULK", IIf(sLanguage=="NL", "Kiwi, banaan, sinaasappel, soya","Kiwi, banana, orange, soya"));
	aJuices.push(aJuice);              
aJuice=new Array("PINK LADY", IIf(sLanguage=="NL", "Aardbei, appel, peer","Strawberry, apple, pear"));
	aJuices.push(aJuice);              
aJuice=new Array("PINK PANTER", IIf(sLanguage=="NL", "Aardbei, banaan, appel, sinaasappel","Strawberry, banana, apple, orange"));
	aJuices.push(aJuice);              
aJuice=new Array("SUGAR BABY", IIf(sLanguage=="NL", "Meloen, aardbei, appel,peer","Melon, strawberry, apple, pear"));
	aJuices.push(aJuice);              
aJuice=new Array("Mr. COOL", IIf(sLanguage=="NL", "Sinaasappel, limoen, grapefruit, honing","Orange, lemon, grapefruit, honey"));
	aJuices.push(aJuice);              
aJuice=new Array("CREMA DE CACAO", IIf(sLanguage=="NL", "Meloen, papaya, mango, banaan, soya, cacao","Melon, papaya, mango,banana, soya, cacao"), "cremadecacao");
	aJuices.push(aJuice);              
aJuice=new Array("PINEAPPLE RUMBA", IIf(sLanguage=="NL", "Ananas, banaan, mango, grapefruit, sinaasappel","Pineapple, banana, mango, grapefruit, orange"));
	aJuices.push(aJuice);              
aJuice=new Array("MAORI DELIGHT ", IIf(sLanguage=="NL", "Kiwi, grapefruit, sinaasappel","Kiwi, grapefruit, orange"));
	aJuices.push(aJuice);              
aJuice=new Array("BREAKFAST", IIf(sLanguage=="NL", "Muesli, fruit, meloen dadels sinaasappel, yoghurt/soya","Muesli, fruit, melon, dates, orange, yoghurt/soya"));
	aJuices.push(aJuice);              
aJuice=new Array("BRAIN POWER", IIf(sLanguage=="NL", "Muesli,  pindakaas, ananas, fruit, soya","Muesli, peanutbutter, pineapple, fruit, soya"));
	aJuices.push(aJuice);              
aJuice=new Array("PINA COLADO", IIf(sLanguage=="NL", "Ananas, meloen, banaan, sinaasappel","Pineapple, melon, banana, orange"));
	aJuices.push(aJuice);              
aJuice=new Array("ALOHA", IIf(sLanguage=="NL", "Ananas, kiwi, limoen, grapefruit","Pineapple, kiwi, lemon, grapefruit"));
	aJuices.push(aJuice);              
aJuice=new Array("HAWAIIN PUNCH", IIf(sLanguage=="NL", "Passievrucht, ananas, appel, peer, grapefruit, limoen","Passionfruit, pineapple, apple, pear, grapefruit, limoen"));
	aJuices.push(aJuice);              
aJuice=new Array("TROPICAL MIX", IIf(sLanguage=="NL", "Ananas, meloen, mango, papaya, passievrucht, limoen, sinaasappel","Pineapple, melon, mango, papaya, passionfruit, lemon, orange"));
	aJuices.push(aJuice);              
aJuice=new Array("SOMBRERO", IIf(sLanguage=="NL", "Ananas, aardbei, appel, limoen, grapefruit, sinaasappel","Pineapple, strawberry, apple, lemon, grapefruit, orange"));
	aJuices.push(aJuice);              
aJuice=new Array("SUNSET", IIf(sLanguage=="NL", "Ananas, papaya, meloen, limoen, appel, peer","Pineapple, papaya, melon, lemon, apple, pear"));
	aJuices.push(aJuice);              
aJuice=new Array("BREEZER", IIf(sLanguage=="NL", "Mango, meloen, appel, peer","Mango, melon, apple, pear"));
	aJuices.push(aJuice);              
aJuice=new Array("MARTINIQUE", IIf(sLanguage=="NL", "Kiwi, banaan, peer, sinaasappel","Kiwi, banana, pear, orange"));
	aJuices.push(aJuice);              
aJuice=new Array("ORANGE SUNRISE", IIf(sLanguage=="NL", "Aardbei, banaan, ananas, sinaasappel","Strawberry, banana, pineapple, orange"));
	aJuices.push(aJuice);              
aJuice=new Array("RASTAFARI VIBES", IIf(sLanguage=="NL", "Ananas, mango, passievrucht, sinaasappel","Pineapple, mango, passionfruit, orange"));
	aJuices.push(aJuice);              
aJuice=new Array("APPASSIONATA", IIf(sLanguage=="NL", "Passievrucht, papaya, appel, peer, gember","Passionfruit, papaya, apple, pear, ginger"));
	aJuices.push(aJuice);              
aJuice=new Array("PARADISE", IIf(sLanguage=="NL", "Aardbei, appel, peer, limoen, sinaasappel","Strawberry, apple, pear, melon, orange"), "paradise");
	aJuices.push(aJuice);              
aJuice=new Array("RAINBOW", IIf(sLanguage=="NL", "Aardbei, passievrucht, appel, peer","Strawberry, passionfruit, apple, pear"));
	aJuices.push(aJuice);              
aJuice=new Array("MOONLIGHT", IIf(sLanguage=="NL", "Passievrucht, mango, kiwi, appel, sinaasappel","Passionfruit, mango, kiwi, apple, orange"));
	aJuices.push(aJuice);              
aJuice=new Array("BANANARAMA", IIf(sLanguage=="NL", "Banaan, sinaasappel","Banana, orange"));
	aJuices.push(aJuice);              
aJuice=new Array("CARIBEAN CRAZE", IIf(sLanguage=="NL", "Banaan, aardbei, grapefruit, orange","Banana, strawberry, grapefruit, orange"));
	aJuices.push(aJuice);              
aJuice=new Array("SWEET & SOUR", IIf(sLanguage=="NL", "Appel, limoen, grapefruit, honing","Apple, lemon, grapefruit, orange, honey"));
	aJuices.push(aJuice);              
aJuice=new Array("MAXIMA", IIf(sLanguage=="NL", "Druiven, appel, wortel","Grapes, apple, carrot"));
	aJuices.push(aJuice);              
aJuice=new Array("USAHA", IIf(sLanguage=="NL", "Grapefruit, sinaasappel","Grapefruit, orange"));
	aJuices.push(aJuice);              
aJuice=new Array("LIN’S SPECIAL", IIf(sLanguage=="NL", "?, ?, passievrucht, ?","?, passionfruit, ?, ?"), "linsspecial");
	aJuices.push(aJuice);              
aJuice=new Array("YELLOW MELLOW", IIf(sLanguage=="NL", "Mango, banaan, meloen, sinaasappel","Mango, banana, melon, orange"));
	aJuices.push(aJuice);              
aJuice=new Array("HONEYMOON", IIf(sLanguage=="NL", "Limoen, appel, honing, sinaasappel","Lemon, apple, honey, orange"));
	aJuices.push(aJuice);              
aJuice=new Array("LAURINA’S HEAVEN", IIf(sLanguage=="NL", "Druiven, appel, peer, wortel","Grapes, apple, pear, orange"));
	aJuices.push(aJuice);              
aJuice=new Array("FRESH UP", IIf(sLanguage=="NL", "Wortel, sinaasappel","Carrot, orange"));
	aJuices.push(aJuice);              
aJuice=new Array("VELVET", IIf(sLanguage=="NL", "Appel, wortel, gember","Apple, carrot, ginger"));
	aJuices.push(aJuice);              
aJuice=new Array("DYNAMITE", IIf(sLanguage=="NL", "Chilipeper, appel, wortel","Chilipepper, apple, carrot"), "dynamite");
	aJuices.push(aJuice);              
aJuice=new Array("TERMINATOR", IIf(sLanguage=="NL", "Chilipeper, knoflook, appel, wortel","Chilipepper, garlic, apple, carrot"));
	aJuices.push(aJuice);              
aJuice=new Array("AVOCADO DREAMS", IIf(sLanguage=="NL", "Avocado, appel, peer, wortel, soya","Avocado, apple, pear, carrot, soya"),"avocadodreams");
	aJuices.push(aJuice);              
aJuice=new Array("HANG OVER", IIf(sLanguage=="NL", "Groenten, grapefruit, gember","Vegetable, grapefruit, ginger"));
	aJuices.push(aJuice);              
aJuice=new Array("GREEN MAGIC", IIf(sLanguage=="NL", "Groene groenten","Green vegetables"));
	aJuices.push(aJuice);              
aJuice=new Array("ROYAL FLUSH", IIf(sLanguage=="NL", "Komkommer, biet, wortel","Cucumber, beetroot, carrot"));
	aJuices.push(aJuice);              
aJuice=new Array("FAST BOOSTER", IIf(sLanguage=="NL", "Tomaat, selderij, gember, wortel","Tomato, sellery, ginger, carrot"));
	aJuices.push(aJuice);              
aJuice=new Array("RED DEVIL", IIf(sLanguage=="NL", "Chilipeper, tomaat, selderij, wortel","Chilipepper, tomato, sellery, carrot"));
	aJuices.push(aJuice);              
aJuice=new Array("MAKE MY DAY", IIf(sLanguage=="NL", "Groenten mix","Vegetable mix "));
	aJuices.push(aJuice);              
aJuice=new Array("PERFECT DAY", IIf(sLanguage=="NL", "Groenten en fruit mix","Vegetables & fruit mix"));
	aJuices.push(aJuice);   
	if (sLanguage=="NL") {
		aJuice=new Array("Tarwegras", "Tarwegras gekweekt met liefde en passie");
		aJuices.push(aJuice);              
		aJuice=new Array("Verse kokosnoot",  "");
} else {
		aJuice=new Array("Wheatgrass", "Wheatgrass homegrown with love and passion");
		aJuices.push(aJuice);              
		aJuice=new Array("Fresh coconut",  "");
	}
	aJuices.push(aJuice);              
	aAllJuices = aJuices;
	sIngredienten = "";
	ToonMenukaart();
}										
													
              




function ToonMenukaart()
{
	menuTabel = document.getElementById("menukaart");
	dAantalRijen = aJuices.length / iAantalKolommen;
	iAantalRijen = Math.floor(dAantalRijen);	
	for (var i = 0; i < iAantalRijen+1; i++) {
		laatsteCell = BouwMenu(menuTabel, i, iAantalRijen);
	}
}

function CheckIngredient() 
{
	aFilterJuices = new Array();
	myInputText = document.getElementById("ingredient");
	if (myInputText.value == "") {
		aFilterJuices = aAllJuices;
		sIngredienten = "";
	} else {
		aFilterJuices = new Array();
		for (var i = 0; i < aJuices.length; i++) 
		{
			if (aJuices[i][1].toLowerCase().indexOf(myInputText.value.toLowerCase()) > -1) {
				
				aFilterJuices.push(aJuices[i]);    
			}
		}
		sIngredienten += IIf(sIngredienten == "", " met " + myInputText.value, " en " + myInputText.value);
	}
	
	aJuices = aFilterJuices;
	VanDeKaart();
	ToonMenukaart();
	// laat nog even zien welke sappen we zien
	mySapje = document.getElementById("saptekst");
	
	mySapje.innerHTML = "Sappen " + sIngredienten;
}

function VanDeKaart()
{
	myTable = document.getElementById("menukaart");
	for (var i = myTable.rows.length; i > 0 ; i = myTable.rows.length) 
	{
   	myTable.deleteRow(i-1);
	}
}

function BouwMenu(menuTabel, iDezeRij, iAantalRijen)
{
	if (iDezeRij == iAantalRijen) 
	{
		// we zijn bezig met de rest
		iRest = aJuices.length % iAantalKolommen;
		if (iAantalRijen == 0) {
			iStartHier = 0;
			iAantalRijen = 1;
		} else {
			iStartHier = iAantalKolommen - iRest;
		}
	} else {
		iStartHier = 0;
	}
	row = menuTabel.insertRow(menuTabel.rows.length);
	for (var i = iStartHier; i < iAantalKolommen ; i++) 
	{
		iCel = iDezeRij + (i * iAantalRijen);
		if (iCel < aJuices.length) {
			// de naam van de sap staat in het eerste element
			sText='<table style="color: #FAFB02;" width="100%" cellspacing="0" cellpadding="0"><tr><td>';
			sText+=aJuices[iCel][0]+"<BR>";
			// de naam van de ingredienten staat in het tweede element
			sText+='<span class="kleiner">'+aJuices[iCel][1]+'</span></td><td>'
			if (aJuices[iCel].length == 3) {
				sText+='&nbsp;&nbsp;&nbsp;<img class="handje" src="./Fotoos/'+aJuices[iCel][2]+'.gif" onClick="Taste('+iCel+')"><BR>'
			} else {
				sText+="<BR>";
			}
			sText+="</td></tr></table>";
			// nu de cel invullen
			myCell = row.insertCell(row.cells.length);
			myCell.innerHTML =sText;
		
			myCell.style.borderStyle = "solid";
			myCell.style.borderWidth = 1;
			myCell.style.borderColor = "#33E02A";
			myCell.style.paddingBottom = "10px";
			myCell.style.verticalAlign = "top";
			myCell.style.width = "200px";
		}
	}

  return myCell;
}

function JaysStory() 
{
		myKnop = document.getElementById("knopTaal");
		if (myKnop.innerHTML == "English") {
			sLanguage = "EN";
		} else {
			sLanguage = "NL";
		}			
	if (sLanguage == "NL") {
		sTekst = "Jay Garrido (1957) geboren in Aruba, rechtstreekse afstammeling van de Arawak-indianen.<BR><BR>";
		sTekst += "Zodra hij op 21 jarige leeftijd zijn paspoort in handen kreeg vloog hij naar Nederland.";
		sTekst += "Toen de saaie baantjes niet meer te doen waren voor zijn wilde natuur, raakte hij op het pad van drank, drugs en criminaliteit.";
		sTekst += "Dat pad liep hij voor meer dan 20 jaar.<BR><BR>";

		sTekst += "Op het dieptepunt van zijn leven, 130 kilo en zwaar verslaafd, kreeg Jay een visioen. Zijn overleden oma bezocht hem, nam hem mee naar haar wereld, en toonde hem een witte veer. Het voelde dat die belangrijk voor hem was.";
		sTekst += "In de daaropvolgende dagen ging hij op zoek naar die witte veer. Na 3 dagen onafgebroken zoeken vond hij, bijna doorgedraaid, de witte veer. Hij was afkomstig van een grote witte haan. Toen hij oog in oog kwam te staan met die haan, was dat als een spiegel die hem zijn onmetelijke, innerlijke kracht liet zien. Vanaf dat moment transformeerde zijn leven.<BR><BR>";

		sTekst += "Na afkicken en reinigen met sappen, besloot hij dat de sappen zijn levenswerk zouden worden, en in 2000 opende hij met de deuren van Jay's Juices ook zijn groene hart.";
		sTekst += "Sindsdien zijn vele mensen op onnavolgbare wijze geïnspireerd door deze excentrieke indiaan.";
		myKnop.innerHTML = "English";

	} else {
		sTekst = "Jay Garrido (1957) born in Aruba, lineal descendant of the Indian tribe the Arawak<BR><BR>";

		sTekst += "As soon as he got his passport, he flew to the Netherlands.";
		sTekst += "His wild nature made the boring jobs impossible for him, and soon he got involved in drugs, alcohol and crime.";
		sTekst += "He walked that path for more than 20 years.<BR><BR>";

		sTekst += "At his lowest ebb, 130 kilo and totally hooked,  Jay received a vision. His deceased grandmother appeared, brought him to her world and showed him a white feather. In the days that followed he went looking for that white feather. After three days non-stop searching, almost crazy, he found it. It came from a big white rooster. Standing eye to eye with the rooster, he saw as in a mirror his infinite inner power. From that moment on his life transformed.<BR><BR>";

		sTekst += "After kicking the habit and detoxing with juices, he decided to make the juices his lifework. In the year 2000 he opened with the doors of Jay’s Juices also his green hart.";
		sTekst += "Since then many people has been inspired on an inimitable way by this eccentric Indian.";
		myKnop.innerHTML = "Nederlands";

	}
	sVerhaalPlek = document.getElementById("verhaalplek");
	sVerhaalPlek.innerHTML = sTekst ;

}

function IIf(i,j,k) {

if (i) {
  xToReturn = j 
} else {
	xToReturn = k
}
return xToReturn 		
}
 		
function handleErr(msg,url,l)
{
txt="There was an error on this page.\n\n"
txt+="Error: " + msg + "\n"
txt+="URL: " + url + "\n"
txt+="Line: " + l + "\n\n"
txt+="Click OK to continue.\n\n"
alert(txt)
return true
}

function Taste(i)
{  
	
	tdTitle = document.getElementById("juicetitle");
  tdTitle.innerHTML = aJuices[i][0];
	tdIngredient = document.getElementById("juiceingredient");
  tdIngredient.innerHTML = aJuices[i][1]+'<BR><BR>';
	tdImg = document.getElementById("juiceimg");
  tdImg.innerHTML = '<img src="./Fotoos/'+aJuices[i][2]+'.jpg" border=0>'+'<BR><BR>';
	tdText = document.getElementById("juicetext");
  tdText.innerHTML = JuiceText(aJuices[i][2]);

	divTasting = document.getElementById("tasting");
	divTasting.style.visibility = "visible";
	taalKnop = document.getElementById("knopTaal");
	taalKnop.style.visibility = "hidden";
}

function sluiten()
{
	divTasting = document.getElementById("tasting");
	divTasting.style.visibility = "hidden";
	taalKnop = document.getElementById("knopTaal");
	taalKnop.style.visibility = "visible";

}

function JuiceText(sJuice)
{
	myKnop = document.getElementById("knopTaal");
	if (myKnop.value == "English") {
		sLanguage = "NL";
	} else {
		sLanguage = "EN";
	}			
	switch (sJuice) {
		case "cremadecacao":
			return CremaDeCacao(sLanguage);
		  break;
		case "paradise":
			return Paradise(sLanguage);
		  break;
		case "dynamite":
			return Dynamite(sLanguage);
		  break;
		case "avocadodreams":
			return AvocadoDreams(sLanguage);
		  break;
		case "linsspecial":
			return LinsSpecial(sLanguage);
		  break;
		default:
	}
}

function CremaDeCacao(sLanguage)
{
	sTekst="";
		sTekst="I was looking for something to still my hunger.  Something that ";
		sTekst+="would fill the gnawing emptyness in the center of my body. ";
		sTekst+="The crema de cacao seemed to be the answer. It´s thick richness ";
		sTekst+="promissed fulfilment. <BR><BR>";
	
		sTekst+="It´s modest taste preceeded it´s  modest effect. I seemed to ";
		sTekst+="be invited to disappointment. I hesitated at the threshold and ";
		sTekst+="looked inside. <BR><BR>";
	
		sTekst+="What I had experienced as emptyness, had become lightness. ";
		sTekst+="The lightness touched the world and brightened the colours. ";
		sTekst+="Crema de cacao had understood my hunger at a level I ";
		sTekst+="had not seen it myself. ";
	return sTekst;
}
function LinsSpecial(sLanguage)
{
	sTekst="";
		sTekst="I don´t know the ingredients for this drink. They are ";
		sTekst+="secret. The only thing I recognize immediately is the vigorously ";
		sTekst+="sparkling passion.<BR><BR>";
	
		sTekst+="This carefully guarded secret invites you to go out, visiting places you´ve ";
		sTekst+="never seen, willing to see them in a way you never knew. ";
		sTekst+="<BR><BR>";
	
		sTekst+="It´s an invitation, to believe in moments of true vision. To ";
		sTekst+="believe that your visions come true.<BR><BR>  ";
		sTekst+="It´s an invitation to make love to the world. ";

	return sTekst;
}

function Paradise(sLanguage)
{
	sTekst="";
		sTekst="The first time I visited Jay's Juice Bar, I boldly chose ";
		sTekst+="“Paradise” from the menu. I took a sip, not at all expecting ";
		sTekst+="what would follow. The first thing I noticed was that this ";
		sTekst+="taste wanted to linger on my  tongue for a while.  <BR><BR>";
	
		sTekst+="It wasn't hasty. <BR><BR> ";
	
		sTekst+="And while lingering it told me about my first desires, ";
		sTekst+="the first promises I made to the world and myself.  ";
		sTekst+="Tears rolled down my cheeks, regaining my purest love and ";
		sTekst+="the memory of my desire to feed the world with it. And myself. ";
		
	return sTekst;
}

function Dynamite(sLanguage)
{
	sTekst="";
		sTekst="No long stories to tell about dynamite. Dynamite is for ";
		sTekst+="immediate action. All visions you´ve had, all support you´ve been ";
		sTekst+="gathering: they will be compressed into this moment of action.<BR><BR> ";
	
		sTekst+="Hesitation becomes firmness, longing becomes receiving: the waiting is done.<BR><BR> ";
	
		sTekst+="No questions asked. Your way is lying open before you.	 ";
	
	return sTekst;
}

function AvocadoDreams(sLanguage)
{
	sTekst="";
		sTekst="Sometimes you hurt someone. By accident. The togetherness  ";
		sTekst+="seduced you.  You look at the one you love and you ";
		sTekst+="see the pain.  There is no taking it back. Everything you did and ";
		sTekst+="said is lying naked before you. The earth is shaking and you don't  ";
		sTekst+="know whether you can trust it to keep on turning.<BR><BR>  ";
		
		sTekst+="These are the moments for avocado dreams. The taste is so smooth ";
		sTekst+="and subtle that everything falls still. It causes the stillness of ";
		sTekst+="your senses and soothes every fear.  ";

	return sTekst;
}

function ToonFilmpje(sFilmpje)
{
	myCell = document.getElementById("filmpje");
	myCell.style.visibility='visible';
	sText="<div id='sluitknop' align='right'><IMG src='./sluiten.gif' onclick='WegFilmpje();'></div>";
	sText +="<div id='filmraam' align='center'>";
  sText += '<EMBED SRC="'+sFilmpje+'" width="291" HEIGHT="238" ALIGN="middle" border="0"><BR>';
  sText += '<span class="aankondiging">Bestemming Nederland 7-6-2008 (dubbelklik filmpje voor volledig scherm)</span></div>';
  myCell.innerHTML = sText;
}
function WegFilmpje()
{
	myCell = document.getElementById("filmpje");
	myCell.innerHTML = '';
	myCell.style.visibility='hidden';
}
