function makeArray(len) {
    for (var i = 0; i < len; i++) this[i] = null;
this.length = len;
}


function gwneudcwestiwn(cwestiwn, atebcywir) {
var args = gwneudcwestiwn.arguments;
this.cwestiwn = cwestiwn;
this.atebcywir = atebcywir;
this.atebion = null;
this.maengywir = maengywir;
this.dewision = new makeArray(args.length - 2);
   for (var i = 0; i < args.length - 2; i++) { 
   this.dewision[i] = args[i + 2];
   }
}


function maengywir() {
if (this.atebcywir == this.atebion) return true;
else return false;
}

function cywiroprofiad(dangosAtebionCywir) {
var rheicywir = 0;
dangosAtebionCywir = '';
    for (var i = 0; i < profiad.length; i++) {
    if (profiad[
i].maengywir()) rheicywir++;
    }
var pwyntiau = Math.round((rheicywir / profiad.length) * 100);
dangosAtebionCywir += '<font size=+2 color=red>Score: <STRONG>' + pwyntiau + '</STRONG> %</font><br>';
    if (rheicywir < profiad.length) { 
    dangosAtebionCywir += osanghywir;
        for (var i = 0; i < profiad.length; i++) {
            if (!profiad[i].maengywir()) {
            dangosAtebionCywir += '<tr><td valign=top left>'+(i + 1) + '.<td valign=top left> ' +
            profiad[i].dewision[profiad[i].atebcywir];
            }
        }
    }
    else dangosAtebionCywir += osperffaith;
parent.main.document.clear();
parent.main.document.open();
parent.main.document.writeln ('<html>');
parent.main.document.writeln ('<body bgcolor=#FFFFFF 		text=#BA050A><b>');
parent.main.document.writeln (dangosAtebionCywir);
parent.main.document.writeln ('</b></font></table><hr color = blue></body></html>');
parent.main.document.close();

}


var osperffaith = "<P>Well done, you made no mistakes at all.<br> You are probably at a higher level, so do only the difficult, intermediate to higher-intermediate quizzes."; 

var osanghywir = "Here is a list of all your incorrect answers indicating<ul><li>their number in the quiz<li>the <i>grammatical element</i> tested <li>a list of quizzes that can help you.</ul><center><hr color = blue><center>Clicking on the links will open a new window. Do the quizzes then close the new window to return to this page.</center><hr color = blue><table cellpadding=5>";


