function Question (qname,
type,
qstring,
response,
comment,
corrects,
explan,
score,
ifcorrect,ifwrong,ifnull,
img)
{this.qname=qname;
this.type=type;
this.qstring=qstring;
this.response=response;
this.comment=comment;
this.corrects=corrects;
this.explan=explan;
this.score=score;
this.ifcorrect=ifcorrect;
this.ifwrong=ifwrong;
this.ifnull=ifnull;
this.img=img;
}

var zin=1,top=0, mycount=0, waitTime=900, qright=0, mycomment;
var global=new Array(3);
var recent, recent2, recdone=false, opera7, opera=CheckOpera56();
function cachewrite(s,idx){global[idx]+=s;}
function CheckOpera56()
{
var version;
if (navigator.userAgent.toLowerCase().indexOf('opera') == -1) return false;
version=parseInt(navigator.appVersion.toLowerCase());
if (version>6) {opera7=true; return false;}
if (version<5) return false;
return true;
}
resp=new Array("Cows","Forests","Tate &amp; Lyle","Associated British Foods")
corr=new Array("0","0","1","0")
comm=""
valu=""
quest001 = new Question(
"Question 1",
0,
"Who are biggest carbon dioxide emitters in UK food/farming?",
resp,
comm,
corr,
"<small>According to Trucost in Sunday Telegraph, Tate &amp; Lyle followed by Associated British Foods are biggest carbon dioxide emitters in FTSE 100</small>",
valu,
3,
0,
0,
"co2.jpg");

resp=new Array("Environmentally friendly","Animal friendly","Health","Taste")
corr=new Array("0","0","1","0")
comm=""
valu=""
quest002 = new Question(
"Question 2",
0,
"What is the reason most people give when asked why they eat organic food?",
resp,
comm,
corr,
"<small>MORI found in 1977 that among the reasons for buying organic food &quot;health&quot; was by far the most important, 46% of those buying organic food gave it as their primary concern... 40% claimed that organic food &quot;tastes better.&quot; This is despite the fact that the Food Standard Agency (FSA) consider that there is no evidence that organic food is healthier for people. In 2006, the <a target=\"_blank\" href=\"http://www.omsco.co.uk/index.cfm/organicmilk/Media.PressRelease/releaseid/53/title/top_scientists_urge_food_standards_agency_to_recognise_nutritional_difference_of_organic_milk\"><u>Organic Milk Producers</u></a>&#160; asked FSA in 2006 to recognise that organic milk is better for people. The <a target=\"_blank\" href=\"http://www.food.gov.uk/news/newsarchive/2006/sep/organicmilkresponse\"><u>FSA answer - No</u></a></small>",
valu,
3,
0,
0,
"organic.jpg");

resp=new Array("1-5 calories","5-10 calories","10-20 calories","&gt;50 calories")
corr=new Array("0","0","1","0")
comm=""
valu=""
quest003 = new Question(
"Question 3",
0,
"How many fuel calories does it take to make a calorie of beef?",
resp,
comm,
corr,
"<small>It takes about 10-30 calories for each calorie of beef. It is 500 for winter lettuce..</small>",
valu,
3,
0,
0,
"candle.jpg");

resp=new Array("UNICEF (United Nations Children's Fund)","ILO (International Labour organisation)","WHO (World Health Organisation)","UNEP (UN Environment Programme)")
corr=new Array("0","1","0","0")
comm=""
valu=""
quest004 = new Question(
"Question 4",
0,
"Who makes the Conventions that Ethical Codes are based on?",
resp,
comm,
corr,
"<small>The International Labour Organisation of the UN produces wodlwide <a target=\"_blank\" href=\"http://www.ilo.org/ilolex/english/convdisp1.htm\"><u>Conventions</u></a>&#160; covering child labour, freedom of association and health &amp; safety.</small>",
valu,
2,
0,
0,
"worker.jpg");

resp=new Array("True","False")
corr=new Array("0","1")
comm=""
valu=""
quest005 = new Question(
"Question 5",
0,
"There is a UK Sustainable Development Indicator for carbon in the soil",
resp,
comm,
corr,
"<small>False - unless you can find &quot;carbon in the soil&quot; among the 68 UK <a target=\"_blank\" href=\"http://www.sustainable-development.gov.uk/progress/national/index.htm\"><u>Sustainable Development Indicator</u></a><font color=\"#0000ff\">s.</font><br><font color=\"#008000\">Curious, as we think the answer lies in the soil...</font></small>",
valu,
3,
0,
0,
"section.jpg");

resp=new Array("Top 100 French farmers","Top 1000 Hill farmers","Largest UK farm - Farmcare","Tate &amp; Lyle")
corr=new Array("0","0","0","1")
comm=""
valu=""
quest006 = new Question(
"Question 6",
0,
"Who received most from CAP subsidies between 2002-05?",
resp,
comm,
corr,
"<small>Tate and Lyle received most - &#163;350mil over three years - mainly as &quot;non farm&quot; payment. Check out who gets what at<font color=\"#0000ff\"><u> </u></font><a target=\"_blank\" href=\"http://www.farmsubsidy.org/\"><u>Farm Subsidy</u></a></small>",
valu,
3,
0,
0,
"beet.jpg");

resp=new Array("1.5 times","Twice","Three Times","Four Times")
corr=new Array("0","0","1","0")
comm=""
valu=""
quest007 = new Question(
"Question 7",
0,
"How much has the rate of obesity in UK changed in last 25 years?",
resp,
comm,
corr,
"<small>According to the <a target=\"_blank\" href=\"http://www.iotf.org/media/euobesity3.pdf\"><u>International Obesity Task Force Briefing Paper</u></a> obesity in UK rose from 6-7% in 1980 to 22-23% in 2003</small>",
valu,
3,
0,
0,
"weigh.jpg");

resp=""
corr="820"
comm=valu=""
quest008 = new Question(
"Question 8",
3,
"Write in how many million people go hungry in the world today?",
resp,
comm,
corr,
"<small>According to the <a target=\"_blank\" href=\"http://www.fao.org/newsroom/en/news/2006/1000433/index.html\"><u>UN Food &amp; Agriculture Organisation (FAO)</u></a> 820 million people go hungry. This 2006 figure is up on the 1996 figure - when the world committed itself to halve hunger by 2015, with numbers rising by 4 mill every year.</small>",
valu,
3,
0,
0,
"poordevils.jpg");

resp=new Array("5%","10%","25%","50%")
corr=new Array("0","0","1","0")
comm=""
valu=""
quest009 = new Question(
"Question 9",
0,
"What proportion of the UK's <a target=\"_blank\" href=\"http://www.sustainablefood.com/guide/env.html#Anchor-Footprin-25472\"><u>Ecological Footprint</u></a> is due to food production?",
resp,
comm,
corr,
"<small><p style=\"margin-left=3mm; margin-right=0mm; text-indent=-3mm; \">Using <a target=\"_blank\" href=\"http://www.york.ac.uk/inst/sei/IS/North_West.pdf\"><u>North West Calculations</u></a>, 25% of UK Ecological Footprint is due to food. </p><font face=\"Grotesque\">UK Footprint =&#160; 6.2 gha per resident, of which the highest single footprint component is food consumption in households with 1.4 gha/cap.</font></small>",
valu,
3,
0,
0,
"foot.gif");

resp=new Array("&#163;30 million","&#163;130 million","&#163;300","&#163;430 million")
corr=new Array("0","0","0","1")
comm=""
valu=""
quest010 = new Question(
"Question 10",
0,
"What are the costs to environmental and human health of pesticide use (UK)?",
resp,
comm,
corr,
"<small><p align=\"justify\"><font face=\"Arial\">DEFRA concludes (RPA, 2004) quoted in </font><a target=\"_blank\" href=\"http://www.food.gov.uk/consultations/ukwideconsults/2006/residueguide2\"><font face=\"Arial\"><u>FSA Pesticide Residue Minimisation Consultation</u></font></a><font face=\"Arial\">&#160;&quot;the impacts on ecosystems and human health of pesticide use in the UK is costed at&#160; &#163;300m, with the bulk of that figure accounted for by the environmental cost. The financial cost arising from policies to deal with the externalities (e.g., drinking water treatment) amounts to approximately &#163;130m per annum. Hence, the total external cost of pesticide use in the UK is in the range of<b> </b>&#163;430m per annum.</font></p></small>",
valu,
3,
0,
0,
"pesticde sprayer.jpg");

resp=new Array("1 cup","10 cups","100 cups","1000 cups")
corr=new Array("0","0","0","1")
comm=""
valu=""
quest011 = new Question(
"Question 11",
0,
"How many cups of water does it take to make the beans for your cup of coffee?",
resp,
comm,
corr,
"<small>It takes a 1000 cups of water to grow the beans we consume in one cup..see <a target=\"_blank\" href=\"../guide/waterissue.html\"><u>Water</u></a>&#160; in SF Guide.</small>",
valu,
3,
0,
0,
"cuppa.jpg");

resp=new Array("Social","Political","Economic","Environmental")
corr=new Array("1","0","1","1")
comm=""
valu=""
quest012 = new Question(
"Question 12",
1,
"What elements does sustainable food balance? (Tick as many as you want)",
resp,
comm,
corr,
"<small>Sustainable food balances the social environmental and economic elements of production</small>",
valu,
1,
0,
0,
"apple.gif");

resp=new Array("Free","Fair","Ethical","Rough")
corr=new Array("0","1","0","0")
comm=""
valu=""
quest013 = new Question(
"Question 13",
0,
"Which trade provides producers with a living wage?",
resp,
comm,
corr,
"<small>Fairtrade. <a target=\"_blank\" href=\"../guide/Fairissue.html\"><u>More on Fairtade</u></a></small>",
valu,
2,
0,
0,
"Achieve.jpg");

resp=new Array("0.3 times","3.0 times","30 times","300X")
corr=new Array("0","0","0","1")
comm=""
valu=""
quest014 = new Question(
"Question 14",
0,
"How much more potent are nitrous gases, from fertilisers, than carbon dioxide as Greenhouse Gases (GHGs)?",
resp,
comm,
corr,
"<small>300X ! Nitrous oxide is a major contributor to climate change (4-6% in UK). More &quot;reactive&quot; nitrogen compounds now <i>falls</i> on farms than used to be <i>applied</i> in the 50's. <a target=\"_blank\" href=\"http://www.newscientist.com/data/images/archive/2535/25351501.jpg\"><u>More from New Scientist</u></a> <br></small>",
valu,
3,
0,
0,
"fertilising.jpg");

resp=new Array("True","False")
corr=new Array("0","1")
comm=""
valu=""
quest015 = new Question(
"Question 15",
0,
"<p><font face=\"Arial\">&quot;Local grown british tomatoes do less harm to the environment, than imported spanish tomatoes&quot; </font></p>",
resp,
comm,
corr,
"<small><p>Energy needed to heat the glass houses for growing tomatoes in Britain is significantly more than the energy used in transporting tomatoes from Spain, where no heating is used because of the warmer climate. <a target=\"_blank\" href=\"http://statistics.defra.gov.uk/esg/reports/foodmiles/final.pdf\"><u>DEFRA Food Miles Report (pdf p7)</u></a> </p></small>",
valu,
2,
0,
0,
"tomato2.jpg");

resp=new Array("65%","75%","85%","95%")
corr=new Array("0","0","0","1")
comm=""
valu=""
quest016 = new Question(
"Question 16",
0,
"What proportion of fruit sold in UK is imported?",
resp,
comm,
corr,
"<small>95 % of fruit imported - this is due mainly to bananas &amp; oranges, which can't be grown in UK. More apples are now being grown, including varieties like 'Braeburn' that now grow better due to warmer autumns..and talking of climate change - UK apricots are now on sale.<br>50% of vegetables are imported..We produce most of the Brassicas, Maincrop Potatoes, Onions, Carrots &amp; Parsnips we eat (but not legumes like beans/mange tout) -&#160; despite virtually no CAP subsidies...</small>",
valu,
3,
0,
0,
"apples.jpg");

resp=new Array("Cod","Mackerel","Prawns","Salmon (Farmed)")
corr=new Array("0","1","0","0")
comm=""
valu=""
quest017 = new Question(
"Question 17",
0,
"Which fish benefits &quot;both human and planetary health&quot;?",
resp,
comm,
corr,
"<small><a target=\"_blank\" href=\"http://www.sd-commission.org.uk/publications.php?id=289\"><u>Double Dividend</u></a> suggests replacing cod/haddock&#160; for oily fish such as mackerel and salmon through healthy school meals - thereby promoting good nutrition and sustainable consumption. (Sustainable Consumption Roundtable, 2005). <br>However, there are concerns that most salmon is farmed and fed with &quot;industrial&quot; fish meal that may deplete wild fish stocks. <br>And if prawns come from warm water (which most do) their farms destroy crucial mangrove swamps. <br><a target=\"_blank\" href=\"../guide/fishissue.html\"><u>More on fish issues</u></a><font color=\"#0000ff\"><u> </u></font></small>",
valu,
2,
0,
0,
"fishpile2.jpg");

resp=new Array("Local and Seasonal","Cheap and Cheerful","Organic/Fairtrade","<a target=\"_blank\" href=\"http://www.sustainablefood.com/assurance.html\"><u>Assured</u></a>&#160; Fresh")
corr=new Array("1","0","1","0")
comm=""
valu=""
quest018 = new Question(
"Question 18",
1,
"Which two pairs of words promote food that is healthier for people and the planet?",
resp,
comm,
corr,
"<small>We know this is going to cause a debate..<br />Fresh &amp; Assured is the majority of food in supermarkets - produced to Assured (=UK) standards and usually fresh - but neither of these do much for health/environment. <br />Organic is good for soil and Fairtrade healthy for producers (2 point), <br>Local - especially seasonal, is good both for environment&#160; and good for local commiunity - and if it encourages you to you eat more vegs it wont be far wrong.&#160; The<font color=\"#0000ff\"><u>&#160; </u></font><a target=\"_blank\" href=\"http://www.wen.org.uk/local_food/Reports/foodmiles.pdf\"><u>Women's Environmental Network Food &amp; Transport Report</u></a> came to similar conclusions (quoted in interesting&#160;&#160;<font color=\"#0000ff\"><u> </u></font><a target=\"_blank\" href=\"http://www.lincoln.ac.nz/story_images/2328_RR285_s6508.pdf\"><u>challenge from New Zealand re &quot;Food Miles&quot;</u></a>)</small>",
valu,
2,
2,
0,
"bfl1.jpg");

resp=new Array("Textile Manufacture","Agriculture","Furniiture","Electronics")
corr=new Array("0","1","0","0")
comm=""
valu=""
quest019 = new Question(
"Question 19",
0,
"Where does most child labour occur?",
resp,
comm,
corr,
"<small>70% of all child labour takes place in agriculture. This is subject of a new global target in a 2007,&#160; supported by <a target=\"_blank\" href=\"http://www.iufdocuments.org/cgi-bin/dbman/db.cgi?db=default&uid=default&ID=3840&view_records=1&ww=1&en=1\"><u>International Union of Foodworkers (IUF)</u></a>.</small>",
valu,
3,
0,
0,
"child2.jpg");

resp=new Array("Tesco","Marks &amp; Spencer","Sainsbury's","Waitrose")
corr=new Array("0","0","0","1")
comm=""
valu=""
quest020 = new Question(
"Question 20",
0,
"Which is the &quot;greenest&quot; supermarket?",
resp,
comm,
corr,
"<small>According to&#160; <a target=\"_blank\" href=\"http://www.ncc.org.uk/responsibleconsumption/index.htm\"><u>National Consumer Council</u></a> Waitrose gained top marks - a &quot;B&quot;</small>",
valu,
3,
0,
0,
"Supermarket.JPG");

questions = new Array (
quest001,quest002,quest003,quest004,quest005,quest006,quest007,quest008,quest009,quest010,quest011,quest012,quest013,quest014,quest015,quest016,quest017,quest018,quest019,quest020)

function doQuestion(quest)
{
var numdo;
var numord=eval(quest+1);
var i=-1, ii, type, myname, gadget;
type=questions[quest].type;
numdo=type>=3?1:questions[quest].response.length;


document.writeln ("<a name=\""+questions[quest].qname+"\"></a>")
document.write("\n")
document.write("  <tr>\n")
document.write("    <td>\n")
document.write("      <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n")
document.write("      <tr height=5>\n")
document.write("        <td colSpan=5></td>\n")
document.write("      </tr>\n")
document.write("      <tr>\n")
document.write("        <td width=\"5%\" rowspan=\"4\"></td>\n")
document.write("        <td width=\"9%\" rowspan=\"4\" background=\"s_topnumber.gif\" valign=\"top\" align=\"center\" >\n")
document.write("          <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n")
document.write("          <tr height=\"5\">\n")
document.write("            <td></td>\n")
document.write("          </tr>\n")
document.write("          <tr>\n")
document.write("            <td valign=\"top\" align=\"center\">\n")
document.write("              <font face=\"Verdana\" size=\"6\" color=\"#00399C\">")
document.write(numord)
document.write("</font>\n")
document.write("            </td>\n")
document.write("          </tr>\n")
document.write("          </table>\n")
document.write("        </td>\n")
document.write("        <td width=\"1%\" rowspan=\"4\">&nbsp;</td>\n")
document.write("        <td width=\"80%\" class=\"question\" valign=\"top\">\n")
document.write("         ")
if (questions[quest].img!="") {
document.write("\n")
document.write("         <img border=\"0\" hspace=\"10\" vspace=\"0\" align=\"left\" src=\"")
document.write(questions[quest].img)
document.write("\">\n")
document.write("         ")
}
document.write("\n")
document.write("          ")
document.writeln(questions[quest].qstring)
document.write("\n")
document.write("        </td>\n")
document.write("        <td width=\"5%\"></td>\n")
document.write("      </tr>\n")
document.write("      <tr height=1>\n")
document.write("        <td width=\"80%\" bgcolor=\"#00399C\" background=\"s_dots.gif\"></td>\n")
document.write("        <td width=\"5%\"></td>\n")
document.write("      </tr>\n")
document.write("      <tr height=10>\n")
document.write("        <td width=\"80%\"></td>\n")
document.write("        <td width=\"5%\"></td>\n")
document.write("      </tr>\n")
document.write("      <tr>\n")
document.write("        <td width=\"80%\" class=\"answer\">\n")
document.write("          ")
for (i=0; i<numdo; i++) {
myname=questions[quest].qname;
gadget="radio";
if (type>=3) gadget="text";
else if (type==1) {
myname+="_"+(i<9?"0":"")+(i+1);
gadget="checkbox";}
document.write("\n")
document.write("          ")
document.write(type==7?"<textarea name=\""+myname+"\" rows=5 cols=30 class=\"input\">":" <input type="+gadget+" name=\""+myname);
if (type<3) document.write("\" value=\""+i+"\">\n")
else document.write(type==7?"</textarea>":"\" class=\"input\" value=\"\">\n")
if (type<3) document.write(questions[quest].response[i]);
document.write("<br>\n")
document.write("          ")
}
document.write("\n")
document.write("        </td>\n")
document.write("        <td width=\"5%\"></td>\n")
document.write("      </tr>\n")
document.write("      <tr height=5>\n")
document.write("        <td colSpan=5></td>\n")
document.write("      </tr>\n")
document.write("      </table>\n")
document.write("    </td>\n")
document.write("  </tr>\n")
document.write("  <tr height=10>\n")
document.write("    <td>&nbsp;</td>\n")
document.write("  </tr>\n")
document.write("  ")
}
function doTest() {
var count, i, newq;
questions.sort(myrandom);
newq=questions.slice(0,10);questions=newq;
for (i=0; i<questions.length; i++) {
questions[i].qname="Question "+(i+1);}
count=questions.length;
for (i=0; i<count; i++) doQuestion(i);
}
function fill(s,l){
s=s+""
for (y=1;y<=l;y++)
if (s.length>=l) break; else s="0"+s;
return s
}
function CheckQName(wapf,ii,i,multi,selection){
var len;
if (!multi) return(wapf.elements[ii].name==questions[i].qname);
len=questions[i].qname.length;
if (wapf.elements[ii].name.substring(0,len)!=questions[i].qname) return false;
if (wapf.elements[ii].name.substring(len,len+1)!="_") return false;
if (eval(wapf.elements[ii].name.substring(len+1,len+3))==(selection+1)) return true;
return false;
}
function errore(uno,due,tre)
{
if (!errori) global[1]="<H3>You have made the following errors</H3>";
++errori;
cachewrite("<p><b>"+uno+"</b><br>"+due+"<br>"+mycomment+tre+"</p>",2);
mycomment="";
}
function testIE5plus(){
var pos=navigator.appVersion.lastIndexOf('MSIE ');
if (pos != -1) {
pos+=5;
if (eval(navigator.appVersion.charAt(pos))>4)
return true;}
return false;}
function correct(wapf)
{
var i, ii, t, re, tmp, selection, multi, multipage=0, type, isnull, iswrong, iscorrect, evaluation=0, total=0, udat;
errori=waitTime=0;
udat=new Array();
for (i=0, ii=0; i<wapf.elements.length; i++)
{tmp=wapf.elements[i];
if (tmp.name.substring(0,13)=="Quiz.UserData"){
t=tmp.name.substring(14,tmp.name.length);
re=new RegExp("_", "g");
t=t.replace(re," ");
udat[ii++]=t+": <i>"+tmp.value+"</i><br>";
if (opera) tmp.value="";}}
global[0]=global[2]="";
global[1]="<h3>Congratulations, you haven't made any errors</h3>";
cachewrite("<html><head><title>Results</title><BASE target='_blank'></head><body bgcolor='#FFFFFF'><font face='Verdana, Arial'><table border=0 cellpadding=0 cellspacing=0 width='100%' bgcolor='#C0C0C0'><tr><td width='100%'><font face='Verdana, Arial' size=5 color='#FFFFFF'><b>&nbsp;Results</b></font></td></tr></table>",0)
now= new Date()
cachewrite("<small><p>"+fill((now.getMonth()+1),2)+"/"+fill(now.getDate(),2)+"/"+now.getYear()+"&nbsp;&nbsp;"+fill(now.getHours(),2)+":"+fill(now.getMinutes(),2)+"</p>",0)
cachewrite("<b>Sustainable Food Quiz</b><br><br>\n",0);
if (udat.length>0) {
cachewrite("<b>Information</b><br>\n",0);
for (i=0; i<udat.length; i++) cachewrite(udat[i],0);}
if (opera7 && multipage) {
for (i=0; i<questions.length; i++) {
id=document.getElementById("q"+(i+1));
id2=document.getElementById("q"+(i+1)+"a");
id.style.display=id2.style.display="block";}
document.getElementById('wq_final').style.display='block';
}

for (i=0; i<questions.length; i++) {
if (opera && multipage) {
id=document.getElementById("q"+(i+1));
id2=document.getElementById("q"+(i+1)+"a");
id.style.visibility=id2.style.visibility="visible";}
type=questions[i].type;
if (type==1) multi=1;
else multi=0;
isnull=true;
iscorrect=false;iswrong=false;
selection=0;
evaluation=0;
mycomment="";
for (ii=0; ii<wapf.elements.length; ii++) {
if (CheckQName(wapf,ii,i,multi,selection)) {
if (type>=3 && wapf.elements[ii].value!="") {
isnull=false;
if (wapf.elements[ii].value.toLowerCase()==questions[i].corrects.toLowerCase()) iscorrect=true;
else iswrong=true;
++selection;}
else if (wapf.elements[ii].checked) {
if (questions[i].score!="") evaluation+=questions[i].score[selection];
if (isnull) isnull=false;
if (questions[i].corrects[selection]=="1") iscorrect=(iswrong==false)?true:false;
else {
iswrong=true;
if (multi && questions[i].corrects!='') errore(questions[i].qname,"The checkbox  <i>"+questions[i].response[selection]+"</i>  shouldn't have been selected.",questions[i].explan)
}
if (questions[i].comment!="" && questions[i].comment[selection]!="")
mycomment+=((iscorrect || questions[i].corrects=='')?"<b>"+questions[i].qname+"</b><br>":"")+"<small>"+questions[i].comment[selection]+"</small><br>";
} else {
if (questions[i].corrects[selection]=="1") {
iswrong=true;
if (multi && questions[i].corrects!='') errore(questions[i].qname,"The checkbox  <i>"+questions[i].response[selection]+"</i>  should have been selected.",questions[i].explan);
}}
++selection;
}}
if (multi==false && (isnull || iswrong)) {
var okresp="", z;
if (type>=3) okresp=questions[i].corrects;
else {
for (z=0; z<questions[i].corrects.length; z++) {
if (questions[i].corrects[z]==1) {
okresp=questions[i].response[z];
break;
}}}
if (okresp!="") errore(questions[i].qname,"The right answer was <i>"+okresp+".</i>",questions[i].explan);
}
if (mycomment!="") cachewrite(mycomment,2);
if (questions[i].corrects!="") ++qright;
if (isnull) evaluation+=questions[i].ifnull;
else if (iswrong) evaluation+=questions[i].ifwrong;
else if (iscorrect) evaluation+=questions[i].ifcorrect;
total+=evaluation;}
if (qright==0) global[1]="<br>";
if (errori) cachewrite("<br><b>You have made "+errori+" "+(errori==1?"error":"errors")+".</b>",2);
cachewrite("<br><b>Total score: "+total+".</b><br>",2);

cachewrite("<br><b>Evaluation:</b><br>"+GetEval(total)+"<br>",2);
cachewrite("</small><hr noshade><center><form>",2)
printest=(((navigator.appName=="Netscape") && (navigator.appVersion.charAt(0)>="4")) || (testIE5plus() == true))? "print()": "alert('This button can be used with Netscape Navigator 4 or Microsoft Internet Explorer 5 only. If you want to print with other browsers, please select the Print command in the File menu.')"
cachewrite("<input type='button' value='Print...' onClick='"+printest+"'>&nbsp;&nbsp;&nbsp;&nbsp;",2)
cachewrite("<input type='button' value='Close' onClick='window.close()'></form></center>",2)
cachewrite(aknw,2)
winr=window.open('','wapres', 'titlebar=1,location=0,directories=0,menubar=1,toolbar=0,scrollbars=1,resizable=1,status=1')
for (i=0; i<3; i++) winr.document.write(global[i]);winr.document.close()
if ((opera || opera7) && multipage) {
document.forms[0].elements[0].value='Print...';
document.forms[0].elements[1].value='Close';
for (i=0; i<questions.length; i++) {
id=document.getElementById("q"+(i+1));
id2=document.getElementById("q"+(i+1)+"a");
opera?id.style.visibility=id2.style.visibility="hidden":id.style.display=id2.style.display="none";}}
}
aknw="<br><p align='center'><small><small>Created and managed with <a title='Click here to visit WebQuiz site' href='http://www.smartlite.it/go.asp?OLDLP' target = '_blank'>SmartLite WebQuiz</a></small></small></p>"
function myrandom(a,b)
{
var rc;
do {rc=Math.floor(Math.random()*3)-1;} while (rc==2);
return(rc);
}
function GetEval(total)
{
var minval, maxval, valstr, top, i;
minval=new Array(0,11,21);
maxval=new Array(10,20,30);
valstr=new Array("Oh Dear! <br>You could do with having another go at the quiz - just refresh and <a target=\"_blank\" href=\"susfood.htm\"><u>get another bunch of questions</u></a>","Decent score. <br>You obviously have an interest in the issues. <br>You may like to follow some up with<br> <a target=\"_blank\" href=\"../search.html\"><u>SF search engine</u></a> <br>or <a target=\"_blank\" href=\"http://www.sustainablefood.com/trialversion.swf\"><u>Sustainable Food Awareness Programme</u></a>&#160; to find out more.","Excellent. Print this out to show your friends.<br>These were not easy questions. You clearly think about the issues, and now you may want to see how to put the ideas into practice at work with <a target=\"_blank\" href=\"../guide\"><u>Sustainable Food Guide</u></a>","non disponibile.");
top=minval.length;
for (i=0;i<top;i++) if (total>=minval[i] && total<=maxval[i]) break;
return(valstr[i]);}
function update_time(t) {
self.status=t;}
function stms(s){
if (Math.abs(tmMx)>=3600){
h=Math.floor(s/3600);m=Math.floor((s%3600)/60);s=((s%3600)%60);return fill(h,2)+':'+fill(m,2)+':'+fill(s,2);
}else{m=Math.floor(s/60);s=s%60;return fill(m,2)+':'+fill(s,2);}}
function shtm(t){
tmVl=t+1;update_time(stms(Math.abs(t)))
if (waitTime==0) return;
tmId = setTimeout('shtm(tmVl)',1000)
if (t==((tmMx>0)? tmMx : 0)){
clearTimeout(tmId)
alert('Time is over, correcting questionnaire now.')

correct(document.WapForm)}}
function checkTime(){
tmMx=-waitTime;
if (tmMx!=0){
alert('Time to complete your questionnaire is: '+stms(Math.abs(tmMx))+'\n\nPlease check time count.');
shtm((tmMx>0) ? 0 : tmMx)}}
