function Question (qname,
type,
qstring,
response,
corrects,
explan,
ifcorrect,ifwrong,ifnull,
img)
{this.qname=qname;
this.type=type;
this.qstring=qstring;
this.response=response;
this.corrects=corrects;
this.explan=explan;
this.ifcorrect=ifcorrect;
this.ifwrong=ifwrong;
this.ifnull=ifnull;
this.img=img;
}

resp=new Array("Britain","Sweden","the United States","the Philippines","Russia","none of the above is true")
corr=new Array("0","0","0","0","0","1")
quest001 = new Question(
"Question 1",
0,
"With seven of the word's top 20 newspapers, this country leads the world in newspaper circulation.",
resp,
corr,
"",
1,
0,
0,
"");

resp=new Array("have been increasing on a yearly basis to match the increase in population","are at its lowest point since 1987","are increasing at a faster rate than any other country","are not possible to measure, because accurate records are not kept","two of the above are correct","none of the above is true")
corr=new Array("0","1","0","0","0","0")
quest002 = new Question(
"Question 2",
0,
"Newspaper subscriptions and sales in the United States",
resp,
corr,
"",
1,
0,
0,
"");

resp=new Array("radio","TV","the Internet","their hometown newspaper","newsmagazines")
corr=new Array("0","0","1","0","0")
quest003 = new Question(
"Question 3",
0,
"The primary souce of news for college students is",
resp,
corr,
"",
1,
0,
0,
"");

resp=new Array("person who sells newspapers to a wholesaler","person who bundles newspapers for delivery","newswriter who is paid for writing stories in their spare time","another name for a delivery boy (person)","person who buys up newspapers for a conglomerate")
corr=new Array("0","0","1","0","0")
quest004 = new Question(
"Question 4",
0,
"A newspaper <i>stringer</i> is a",
resp,
corr,
"",
1,
0,
0,
"");

resp=new Array("national advertising","local advertising","classified advertising","government subsidies")
corr=new Array("0","1","0","0")
quest005 = new Question(
"Question 5",
0,
"Most newspapers make most of their profit from",
resp,
corr,
"",
1,
0,
0,
"");

resp=new Array("Wall Street Journal","New York Times","USA Today","Washtington Post")
corr=new Array("0","0","1","0")
quest006 = new Question(
"Question 6",
0,
"The newspaper in the United States that claims to have more total daily readers than any other is the",
resp,
corr,
"",
1,
0,
0,
"");

resp=new Array("photographers generally associated with the tabloids","modern day newspaper barons","owners of media conglomerates","owners of pizza parlors","tabloid reporters")
corr=new Array("1","0","0","0","0")
quest007 = new Question(
"Question 7",
0,
"Paparazzi are",
resp,
corr,
"",
1,
0,
0,
"");

resp=new Array("Readers Digest","TV Guide","Modern Maturity","National Geographic","Time")
corr=new Array("0","0","1","0","0")
quest008 = new Question(
"Question 8",
0,
"The magazine with the largest U.S. circulation is",
resp,
corr,
"",
1,
0,
0,
"");

resp=new Array("magazines with internal specialization","trade publications","subscription based publications","all of the above are true","none of the above is true")
corr=new Array("0","1","0","0","0")
quest009 = new Question(
"Question 9",
0,
"Television Engineering, Millimeter, Government Video, and Videography are examples of",
resp,
corr,
"",
1,
0,
0,
"");

resp=new Array("Time","Issues and Answers","Saturday Evening Post","Colliers","Life")
corr=new Array("0","0","1","0","0")
quest010 = new Question(
"Question 10",
0,
"The first really successful magazine in the U.S. was first published in 1821. It was",
resp,
corr,
"",
1,
0,
0,
"");

resp=new Array("were commissioned by Theodore Roosevelt to do investigative journalism","were financed by John D. Rockefeller","uncovered government and corporate corruption","two of the above are true","all of the above are true","none of the above is true")
corr=new Array("0","0","1","0","0","0")
quest011 = new Question(
"Question 11",
0,
"The <i>muckrakers</i>",
resp,
corr,
"",
1,
0,
0,
"");

resp=new Array("sponsored publications","trade publications","magazines with internal speculation","muckraking publications","all of the above are true")
corr=new Array("1","0","0","0","0")
quest012 = new Question(
"Question 12",
0,
"The National Geographic, Modern Maturity, and American Legion are examples of",
resp,
corr,
"",
1,
0,
0,
"");

resp=new Array("Modern Maturity","National Geographic","the first newsmagazine","the first men's magazine","the first woman's magazine")
corr=new Array("0","0","1","0","0")
quest013 = new Question(
"Question 13",
0,
"In 1923, Henry Luce, who had just graduated from Yale, begged and borrowed $86,000 from friends and relatives to start",
resp,
corr,
"",
1,
0,
0,
"");

resp=new Array("women's magazines","newsmagazines","internal specialization magazines","men's magazines","how-to magazines")
corr=new Array("1","0","0","0","0")
quest014 = new Question(
"Question 14",
0,
"The most financially successful magazines in the U.S. are",
resp,
corr,
"",
1,
0,
0,
"");

resp=new Array("they feature reviews of products written by the manufacturers involved","they often simply rewrite the claims of their advertisers in their stories","they often get their money illegally","they are not members of AMAA","two of the above are true","all of the above are true")
corr=new Array("0","0","0","0","1","0")
quest015 = new Question(
"Question 15",
0,
"Many trade magazines have a spotty reputation because",
resp,
corr,
"",
1,
0,
0,
"");

resp=new Array("subscriptions","newsstand purchases","advertising","government subsidies")
corr=new Array("0","0","1","0")
quest016 = new Question(
"Question 16",
0,
"With typical magazines most revenue comes from",
resp,
corr,
"",
1,
0,
0,
"");

resp=new Array("on-line magazines","women's magazines","tabloid publications","foreign language magazines")
corr=new Array("1","0","0","0")
quest017 = new Question(
"Question 17",
0,
"Slate, Hotwired, and Salon are examples of",
resp,
corr,
"",
1,
0,
0,
"");

resp=new Array("trade publications","early Colonial magazines","on-line magazines","ultra-conservative magazines","none of the above is true")
corr=new Array("0","0","1","0","0")
quest018 = new Question(
"Question 18",
0,
"<i>Zines </i>are",
resp,
corr,
"",
1,
0,
0,
"");

questions = new Array (
quest001,quest002,quest003,quest004,quest005,quest006,quest007,quest008,quest009,quest010,quest011,quest012,quest013,quest014,quest015,quest016,quest017,quest018)

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(" <input type="+gadget+" name=\""+myname);
if (type<3) document.write("\" value=\""+i+"\">\n")
else document.write("\" 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;

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)
{
if (!errori) winr.document.write("<H3>You have made the following errors:</H3>");
++errori;
winr.document.write("<p><b>"+uno+"</b><br>This answer is not correct.</p>");
}
function correct(wapf)
{
var i, ii, t, re, tmp, selection, multi, type, isnull, iswrong, iscorrect, evaluation=0, total=0, udat;
errori=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>";}}
winr=window.open('','wapres', 'titlebar=1,location=0,directories=0,menubar=1,toolbar=0,scrollbars=1,resizable=1,status=1')
winr.document.write("<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>")
now= new Date()
winr.document.write("<small><p>"+fill((now.getMonth()+1),2)+"/"+fill(now.getDate(),2)+"/"+now.getYear()+"&nbsp;&nbsp;"+fill(now.getHours(),2)+":"+fill(now.getMinutes(),2)+"</p>")
if (udat.length>0) {
winr.document.write("<b>Information</b><br>\n");
for (i=0; i<udat.length; i++) winr.document.write(udat[i]);}

for (i=0; i<questions.length; i++) {
type=questions[i].type;
if (type==1) multi=1;
else multi=0;
isnull=true;
iscorrect=false;iswrong=false;
selection=0;
evaluation=0;
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 (isnull) isnull=false;
if (questions[i].corrects[selection]=="1") iscorrect=(iswrong==false)?true:false;
else {
iswrong=true;
if (multi) errore(questions[i].qname);
}} else {
if (questions[i].corrects[selection]=="1") {
iswrong=true;
if (multi) errore(questions[i].qname);
}}
++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;
}}}
errore(questions[i].qname);
}
if (isnull) evaluation+=questions[i].ifnull;
else if (iswrong) evaluation+=questions[i].ifwrong;
else if (iscorrect) evaluation+=questions[i].ifcorrect;
total+=evaluation;}
if (errori) {var voc=(errori==1)?"":"s";winr.document.write("<br><b>You have made "+errori+" error"+voc+".</b>");}
else winr.document.write("<h3>Congratulations, you haven't made any errors</h3>")
{var voc=(total==1)?"":"s";winr.document.write("<br><b>Total score: "+total+" point"+voc+".</b><br>");}

winr.document.write("</small><hr noshade><center><form>")
printest=(((navigator.appName=='Netscape') && (navigator.appVersion.charAt(0)>='4')) || (navigator.appVersion.lastIndexOf('MSIE 5') !=-1))? '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.")'
winr.document.write("<input type='button' value='Print...' onClick='"+printest+"'>&nbsp;&nbsp;&nbsp;&nbsp;")
winr.document.write("<input type='button' value='Close' onClick='window.close()'></form></center>")
winr.document.write(aknw)
winr.document.close()
if (navigator.appVersion.lastIndexOf('MSIE 3') == -1) nomsie3=true
else nomsie3=false
if (nomsie3) winr.focus()
}
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>"
