var LANGUAGE_EN='en';var LANGUAGE_DE='de';var LANGUAGE_ES='es';var LANGUAGE_FR='fr';var LANGUAGE_PL='pl';function NapiszDoNas(u,d){LoadPage('mai'+'lto'+':'+u+'@'+d+'.'+'pl')}function WordsLinesParser(){}WordsLinesParser.compareAnswers=function(correctAnswer,userAnswer,languageCode){correctAnswer=Htmlspecialchars_decode(correctAnswer);userAnswer=Htmlspecialchars_decode(userAnswer);correctAnswer=Trim(correctAnswer.toLowerCase().replace(/\-/g,' ').replace(/\,/g,'').replace(/\./g,'').replace(/\?/g,'').replace(/  /g,' '));userAnswer=Trim(userAnswer.toLowerCase().replace(/\-/g,' ').replace(/\,/g,'').replace(/\./g,'').replace(/\?/g,'').replace(/  /g,' '));var prefixes=null;var suffixes=null;if(languageCode==LANGUAGE_EN){prefixes=new Array('a ','an ','the ','to ');suffixes=new Array(' sb',' sth');if(!WordsLinesParser.checkPrefixesCompatibility(correctAnswer,userAnswer,prefixes)){return false}correctAnswer=WordsLinesParser.removePrefixes(correctAnswer,prefixes);userAnswer=WordsLinesParser.removePrefixes(userAnswer,prefixes);correctAnswer=WordsLinesParser.removeSuffixes(correctAnswer,suffixes);userAnswer=WordsLinesParser.removeSuffixes(userAnswer,suffixes);correctAnswer=correctAnswer.replace(/is not/,'isn\'t').replace(/are not/,'aren\'t').replace(/has not/,'hasn\'t').replace(/have not/,'haven\'t').replace(/was not/,'was\'t').replace(/were not/,'weren\'t').replace(/did not/,'didn\'t').replace(/had not/,'hadn\'t').replace(/will not/,'won\'t').replace(/would not/,'wouldn\'t').replace(/can not/,'can\'t').replace(/could not/,'couldn\'t').replace(/should not/,'shouldn\'t').replace(/need not/,'needn\'t');userAnswer=userAnswer.replace(/is not/,'isn\'t').replace(/are not/,'aren\'t').replace(/has not/,'hasn\'t').replace(/have not/,'haven\'t').replace(/was not/,'was\'t').replace(/were not/,'weren\'t').replace(/did not/,'didn\'t').replace(/had not/,'hadn\'t').replace(/will not/,'won\'t').replace(/would not/,'wouldn\'t').replace(/can not/,'can\'t').replace(/could not/,'couldn\'t').replace(/should not/,'shouldn\'t').replace(/need not/,'needn\'t');correctAnswer=correctAnswer.replace(/you aren\'t/,'you\'re not');userAnswer=userAnswer.replace(/you aren\'t/,'you\'re not');correctAnswer=correctAnswer.replace(/i am/,'i\'m').replace(/you are/,'you\'re').replace(/he is/,'he\'s').replace(/she is/,'she\'s').replace(/it is/,'it\'s').replace(/we are/,'we\'re').replace(/they are/,'they\'re');userAnswer=userAnswer.replace(/i am/,'i\'m').replace(/you are/,'you\'re').replace(/he is/,'he\'s').replace(/she is/,'she\'s').replace(/it is/,'it\'s').replace(/we are/,'we\'re').replace(/they are/,'they\'re');correctAnswer=correctAnswer.replace(/i will/,'i\'ll').replace(/you will/,'you\'ll').replace(/he will/,'he\'ll').replace(/she will/,'she\'ll').replace(/it will/,'it\'ll').replace(/we will/,'we\'ll').replace(/they will/,'they\'ll');userAnswer=userAnswer.replace(/i will/,'i\'ll').replace(/you will/,'you\'ll').replace(/he will/,'he\'ll').replace(/she will/,'she\'ll').replace(/it will/,'it\'ll').replace(/we will/,'we\'ll').replace(/they will/,'they\'ll');correctAnswer=correctAnswer.replace(/i had/,'i\'d').replace(/you had/,'you\'d').replace(/he had/,'he\'d').replace(/she had/,'she\'d').replace(/it had/,'it\'d').replace(/we had/,'we\'d').replace(/they had/,'they\'d');userAnswer=userAnswer.replace(/i had/,'i\'d').replace(/you had/,'you\'d').replace(/he had/,'he\'d').replace(/she had/,'she\'d').replace(/it had/,'it\'d').replace(/we had/,'we\'d').replace(/they had/,'they\'d');correctAnswer=correctAnswer.replace(/i have/,'i\'ve').replace(/you have/,'you\'ve').replace(/he has/,'he\'s').replace(/she has/,'she\'s').replace(/it has/,'it\'s').replace(/we have/,'we\'ve').replace(/they have/,'they\'ve');userAnswer=userAnswer.replace(/i have/,'i\'ve').replace(/you have/,'you\'ve').replace(/he has/,'he\'s').replace(/she has/,'she\'s').replace(/it has/,'it\'s').replace(/we have/,'we\'ve').replace(/they have/,'they\'ve');correctAnswer=correctAnswer.replace(/i would/,'i\'d').replace(/you would/,'you\'d').replace(/he would/,'he\'d').replace(/she would/,'she\'d').replace(/it would/,'it\'d').replace(/we would/,'we\'d').replace(/they would/,'they\'d');userAnswer=userAnswer.replace(/i would/,'i\'d').replace(/you would/,'you\'d').replace(/he would/,'he\'d').replace(/she would/,'she\'d').replace(/it would/,'it\'d').replace(/we would/,'we\'d').replace(/they would/,'they\'d');correctAnswer=correctAnswer.replace(/where is/,'where\'s').replace(/what is/,'what\'s').replace(/who is/,'who\'s').replace(/when is/,'when\'s').replace(/how is/,'how\'s').replace(/there is/,'there\'s').replace(/that is/,'that\'s').replace(/here is/,'here\'s');userAnswer=userAnswer.replace(/where is/,'where\'s').replace(/what is/,'what\'s').replace(/who is/,'who\'s').replace(/when is/,'when\'s').replace(/how is/,'how\'s').replace(/there is/,'there\'s').replace(/that is/,'that\'s').replace(/here is/,'here\'s');correctAnswer=correctAnswer.replace(/i\'m sorry/,'sorry');userAnswer=userAnswer.replace(/i\'m sorry/,'sorry');correctAnswer=correctAnswer.replace(/something/,'sth').replace(/somebody/,'sb').replace(/someone/,'sb');userAnswer=userAnswer.replace(/something/,'sth').replace(/somebody/,'sb').replace(/someone/,'sb')}else if(languageCode==LANGUAGE_DE){prefixes=new Array('ein ','eine ','der ','die ','das ');if(!WordsLinesParser.checkPrefixesCompatibility(correctAnswer,userAnswer,prefixes)){return false}correctAnswer=WordsLinesParser.removePrefixes(correctAnswer,prefixes);userAnswer=WordsLinesParser.removePrefixes(userAnswer,prefixes)}else if(languageCode==LANGUAGE_ES){prefixes=new Array('un ','una ','el ','la ');if(!WordsLinesParser.checkPrefixesCompatibility(correctAnswer,userAnswer,prefixes)){return false}correctAnswer=WordsLinesParser.removePrefixes(correctAnswer,prefixes);userAnswer=WordsLinesParser.removePrefixes(userAnswer,prefixes)}else if(languageCode==LANGUAGE_FR){prefixes=new Array('un ','une ','la ','le ','les ');if(!WordsLinesParser.checkPrefixesCompatibility(correctAnswer,userAnswer,prefixes)){return false}correctAnswer=WordsLinesParser.removePrefixes(correctAnswer,prefixes);userAnswer=WordsLinesParser.removePrefixes(userAnswer,prefixes)}correctAnswer=correctAnswer.replace(/é/,'e').replace(/ß/,'ss').replace(/ä/,'ae').replace(/ö/,'oe').replace(/ü/,'ue');userAnswer=userAnswer.replace(/é/,'e').replace(/ß/,'ss').replace(/ä/,'ae').replace(/ö/,'oe').replace(/ü/,'ue');return(correctAnswer==userAnswer)};WordsLinesParser.checkPrefixesCompatibility=function(correctAnswer,userAnswer,prefixes){for(var i in prefixes){if(correctAnswer.substr(0,prefixes[i].length)==prefixes[i]&&userAnswer.substr(0,prefixes[i].length)!=prefixes[i]){return false}}return true};WordsLinesParser.removePrefixes=function(text,prefixes){for(var i in prefixes){if(text.substr(0,prefixes[i].length)==prefixes[i]){text=Trim(text.substr(prefixes[i].length))}}return text};WordsLinesParser.removeSuffixes=function(text,suffixes){for(var i in suffixes){if(text.substr(text.length-suffixes[i].length)==suffixes[i]){text=Trim(text.substr(0,text.length-suffixes[i].length))}}return text};var showingSiteMenu=true;function ToggleSiteMenu(){if(showingSiteMenu){$('.top').hide();$('.foot').hide();$('#hiddensitelink').show().css('display','block');$('#pagetitle').css('visibility','hidden');$('#togglemenulink').html('Pokaż menu');$('#togglediv').css('marginTop','50px')}else{$('.top').show();$('.foot').show();$('#hiddensitelink').hide();$('#pagetitle').css('visibility','visible');$('#togglemenulink').html('Ukryj menu');$('#togglediv').css('marginTop','4px')}showingSiteMenu=!showingSiteMenu;return false}var displayedNumRepetitions=null;var displayedNumFiltereRepetitions=null;function DecreaseNumRepetitions(){if(displayedNumRepetitions!=null){if(currentTestId==0){NumRepetitionsChanged(Math.max(0,displayedNumRepetitions-1),Math.max(0,displayedNumFiltereRepetitions-1),currentTestId)}else{var parts=displayedNumRepetitions.split('|');parts[2]=Math.max(0,parseInt(parts[2])+1);var nb=parts.join('|');NumRepetitionsChanged(nb,nb,currentTestId)}}}function NumRepetitionsChanged(numRep,numFilteredRepetitions,currentTestId){if(currentTestId==undefined){currentTestId=0}displayedNumRepetitions=numRep;displayedNumFiltereRepetitions=numFilteredRepetitions;if(currentTestId==0){if(ElementExists('menunumrep')){SetInnerHTML('menunumrep',numRep)}if(ElementExists('uppernumrep')){SetInnerHTML('uppernumrep',numRep)}if(ElementExists('remainingreps')){if(numFilteredRepetitions==numRep){SetInnerHTML('remainingreps','Pozostałe powtórki:'+' <b>'+numRep+'</b>')}else{SetInnerHTML('remainingreps','Pozostałe powtórki:'+' <b>'+numFilteredRepetitions+'</b> ('+numRep+')')}}}else{if(ElementExists('remainingreps')){if(currentTestId!=0&&numRep=='0'){SetInnerHTML('remainingreps','')}else if(typeof numRep=='string'&&numRep.indexOf('|')>=0){var parts=numRep.split('|');var progress=parts[2]/parts[3];if(parts[1]==''){SetInnerHTML('remainingreps','Postęp:'+' <b>'+parts[2]+' '+'z'+' '+parts[3]+'</b> '+GenerateProgressBarHtml(progress))}else{SetInnerHTML('remainingreps','Test:'+' <a href="/powtorki/testy/viewtest.php?id='+parts[0]+'">'+parts[1]+'</a>, '+'postęp:'+' <b>'+parts[2]+' z '+parts[3]+'</b> '+GenerateProgressBarHtml(progress))}}}}}function GenerateProgressBarHtml(progress){if(isNaN(progress)||progress==undefined||progress<0)progress=0;if(progress>1)progress=1;var blueWidth=Math.round(30*progress);var progressBar='<img src="/images/progress/p'+blueWidth+'.gif" height="5" width="30" class="progress" />';if(blueWidth<30){progressBar+='<img src="/images/progress/p'+(blueWidth+1)+'.gif" width="0" height="0" style="display: none" alt="" />'}return progressBar}

