var quotes=[];
var logFrameDoc;
var logresultElt;
var logTimer=null;
function startLogFromFrame(frameid,resid){
if(logTimer)
return;
var iframe=document.getElementById(frameid);
logFrameDoc=iframe.contentDocument || iframe.contentWindow.document;
logresultElt=document.getElementById(resid);
doLog();
}
function stopLogFromFrame(frameid,resid){
clearTimeout(logTimer);
logTimer=null;
}
function doLog(){
var latin=logFrameDoc.getElementById("L").innerHTML;
var norsk=logFrameDoc.getElementById("N").innerHTML;
var T=latin+" : "+norsk;
// Random acces and we dont want duplicates
if(quotes.indexOf(T)==-1){
quotes.push(T);
logresultElt.innerHTML=quotes.join("<br/>");
}
logTimer=setTimeout(doLog,1000);
}
function clearLog(){
if(logresultElt)
logresultElt.innerHTML="",
quotes=[];
}