
var IE=false;if(navigator.userAgent.indexOf("MSIE")>=0)IE=true;if(navigator.appVersion.indexOf("MSIE 6.0")>=0){VERSION="6.0";};if(navigator.appVersion.indexOf("MSIE 6.5")>=0){VERSION="6.5";};if(navigator.appVersion.indexOf("MSIE 7.0")>=0){VERSION="7.0";};if(navigator.appVersion.indexOf("MSIE 8.0")>=0){VERSION="8.0";};var Editable=true;var notesTouched=false;var otherLoaded=false;var bF=null;function insertLoadingAjax(ox){var img=new Image();img.src="/library/extensions/glimages/ajax-loader.gif";img.style.height="5px";img.style.marginTop="3px";img.style.float="right";ox.parentNode.appendChild(img);return img;}
function removeLoadingAjax(ox){ox.parentNode.removeChild(ox);}
function onLoad(){xxx=getIFrameDocumentAll();if(xxx){xxx.contentEditable="true";xxx.designMode="On";http=getXMLHttpRequest();if(!http){alert('Error: problema con javascript, no se podrá guardar sus notas');}else{inp=xxx.parentNode.getElementsByTagName('INPUT')[0];executer=inp.parentNode;http.open("POST","/library/extensions/notes/index.php?action=load",true);http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");http.onreadystatechange=function()
{if(http.readyState==4)
{nts=http.responseXML.getElementsByTagName('usernotes');src="public.gif";if(nts.length>0){if((nts[0].getAttribute('public'))&&(nts[0].getAttribute('public')=="true")){src="publicsel.gif";$e.$(xxx.parentNode.parentNode.getAttribute('id')).notesPublic="true";}
btns=executer.parentNode.getElementsByTagName('IMG');for(var i=0;i<btns.length;i++){if(btns[i].src.indexOf('public')>=0){btns[i].src="/library/extensions/glimages/"+src;}}
nts=nts[0].firstChild;nts=(nts)?nts=nts.data:"<span>&nbsp;</span>";if(!IE){if(navigator.userAgent.indexOf('Firefox/2')>=0){nts+="<div class='ff2Warning'><img class='ff3logo'";nts+=" src='/library/extensions/glimages/ff3.gif' />";nts+="<img src='/library/extensions/glimages/close_on.gif'";nts+=" onclick='this.parentNode.parentNode.removeChild(this.parentNode);' /><br /><span class='frase'>You can look,<br /> but you can't touch!.</span><br />";nts+=" To be able to edit notes, <br />you will need Firefox Version 3 or newer.<br />"
nts+="<a href='http://www.firefox.com'>Please upgrade your browser!</a><br />";nts+="</div>";}}
if((qsParamValue('notes')==wgUserName)||(qsParamValue('notes')=="")){inp.value=wgUserName;}else{inp.value=qsParamValue('notes');}
xxx.innerHTML=nts;xxx.designMode="On";xxx.contentEditable=true;}}}
var data="wikiuser="+encodeURIComponent(wgUserName)+"&title="+encodeURIComponent(wgPageName);if(!((qsParamValue("notes")==wgUserName)||(qsParamValue("notes")==""))){data="wikiuser="+encodeURIComponent(qsParamValue('notes'))+"&title="+encodeURIComponent(wgPageName);}
http.send(data);}}
window.onbeforeunload=function(event){if(notesTouched)
event.returnValue="You have not saved your notes!"}}
addOnLoadHook("onLoad();");function getIFrameDocumentAll(){return document.getElementById('notesEditor');}
function getIFrameWinAll(){return document.getElementById('notesEditor');}
function getIFrameDocument(b){return document.getElementById('notesEditor');}
function retParent(ob,nmclass,nmclass2){var res;res=ob.parentNode;while((res.className)&&(res.className!=nmclass)&&(res.className!=nmclass2)){res=res.parentNode;}
return res;}
function notesToolClick(b){if(b.src.indexOf('bold.gif')>=0){if(navigator.userAgent.indexOf('Firefox/2')<0){makeBold(document);}}else
if(b.src.indexOf('italic.gif')>=0){if(navigator.userAgent.indexOf('Firefox/2')<0){makeItalic(document);}}else
if(b.src.indexOf('synctag.gif')>=0){if(navigator.userAgent.indexOf('Firefox/2')<0){makeSyncTag(getIFrameDocument(b),retParent(b,"mainW","mainWslides"));}}else
if(b.src.indexOf('newnotes.gif')>=0){if(navigator.userAgent.indexOf('Firefox/2')<0){getIFrameDocument(b).innerHTML="";notesTouched=true;}}else
if(b.src.indexOf('save.gif')>=0){if(navigator.userAgent.indexOf('Firefox/2')<0){saveNotes(b,getIFrameDocument(b),true);}}else
if(b.src.indexOf('public.gif')>=0){if(navigator.userAgent.indexOf('Firefox/2')<0){$e.$(b.parentNode.parentNode.parentNode.getAttribute('id')).notesPublic="true";b.src="/library/extensions/glimages/publicsel.gif";notesTouched=true;}}else
if(b.src.indexOf('publicsel.gif')>=0){if(navigator.userAgent.indexOf('Firefox/2')<0){$e.$(b.parentNode.parentNode.parentNode.getAttribute('id')).notesPublic="false";b.src="/library/extensions/glimages/public.gif";notesTouched=true;}}
return true;}
function makeBold(doku){doku.execCommand('bold',false,null);notesTouched=true;}
function makeItalic(doku){doku.execCommand('italic',false,null);notesTouched=true;}
function onEditLbl(lb){txt=lb.innerHTML;txt=txt.replace(/[^0-9:]/g,'');lb.innerHTML=txt;}
function makeSyncTag(doku,wn){try{time=secondsToTime(ply.$(wn.getAttribute('g_playerid')).currentTime);totalT=secondsToTime(ply.$(wn.getAttribute('g_playerid')).totalTime);edi=doku;txt="&nbsp;<span class='tmTag' g_playerid='"+wn.getAttribute('g_playerid')+"' g_start='"+time+"' g_stop='"+totalT+"' contentEditable='false' alt='["+time+","+totalT+"]' title='["+time+","+totalT+"]' onmouseover='resaltar(this);' onmouseout='backToNormal(this);' >";if(typeof(document.all)!="undefined"){edi.focus();sel=document.selection.createRange();txt=txt+"<img class='imgplay' src='/library/extensions/glimages/playtm.gif' onclick='goTo(this.parentNode);' /><img src='/library/extensions/glimages/pipenotas.gif' class='pipe' /><img src='/library/extensions/glimages/icpost.gif' onclick='showDLG(event,this);' class='editTM' wnd='"+wn.getAttribute('id')+"' alt='Adjust Time' title='Adjust Time' /></span>&nbsp;";sel.pasteHTML(txt);}else{sel=window.getSelection();txt+="<img src='/library/extensions/glimages/playtm.gif' class='imgplay' onclick='goTo(this.parentNode);' /><img src='/library/extensions/glimages/pipenotas.gif' class='pipe' /><img src='/library/extensions/glimages/icpost.gif' onclick='showDLG(event,this);' class='editTM'  wnd='"+wn.getAttribute('id')+"' alt='Adjust Time' title='Adjust Time'  /></span>&nbsp;";document.execCommand('insertHTML',false,txt);}
edi.focus();notesTouched=true;}catch(exc){}}
function clsDlgItext(){dlg=document.getElementById("tmDialog");edi=document.getElementById("notesEditor");dlg.style.display='none';edi.style.overflow='auto';edi.style.color='#000000';edi.contentEditable='true';}
function fcloseDLG(btn){btn.parentNode.parentNode.style.display='none';dlg=document.getElementById("tmDialog");cnt=btn.parentNode.parentNode.parentNode;edi=document.getElementById("notesEditor");edi.style.overflow='auto';edi.style.color='#000000';edi.contentEditable='true';start=stop="";inps=dlg.getElementsByTagName("INPUT");for(var i=0;i<inps.length;i++){switch(inps[i].className){case"dlgStart":start=inps[i].value;break;case"dlgStop":stop=inps[i].value;break;}}
if(typeof(dlg.spantag)!="undefined"){dlg.spantag.setAttribute("g_start",start);dlg.spantag.setAttribute("g_stop",stop);if(timeToSeconds(start)<3600)start=start.substring(3,start.length);if(timeToSeconds(stop)<3600)stop=stop.substring(3,stop.length);imgs=dlg.spantag.getElementsByTagName("IMG");for(i=0;i<imgs.length;i++){switch(imgs[i].className){case"editTM":{imgs[i].setAttribute("alt","Adjust Time");imgs[i].setAttribute("title","Adjust Time");}break;case"imgplay":{imgs[i].setAttribute("alt","["+start+","+stop+"]");imgs[i].setAttribute("title","["+start+","+stop+"]");}break;}}}}
function showDLG(e,ele){if(ele.className=='editTM'){start=ele.parentNode.getAttribute("g_start");stop=ele.parentNode.getAttribute("g_stop");dlg=document.getElementById("tmDialog");cnt=document.getElementById(ele.getAttribute("wnd"));cntW=document.getElementById(ele.getAttribute("wnd")+"content");edi=document.getElementById("notesEditor");dlg.style.display='block';inps=dlg.getElementsByTagName("INPUT");for(var i=0;i<inps.length;i++){switch(inps[i].className){case"dlgStart":inps[i].value=start;break;case"dlgStop":inps[i].value=stop;break;}}
mainDiv=doc.getElementById("MainDiv");scrollbody=document.documentElement.scrollTop+document.body.scrollTop;clickX=(e.screenX-mainDiv.offsetLeft-cnt.offsetLeft-doc.co.offsetWidth);clickY=(cntW.scrollTop+e.clientY+scrollbody-20-(cnt.offsetTop+edi.offsetHeight+mainDiv.offsetTop));if((clickX+dlg.offsetWidth+20)>cnt.offsetWidth){clickX-=dlg.offsetWidth;if(clickX<0)clickX=0;}
if((edi.offsetHeight+clickY+dlg.offsetHeight)>(cntW.scrollTop+cntW.offsetHeight)){clickY-=dlg.offsetHeight;}
dlg.style.left=clickX+"px";dlg.style.top=clickY+"px";edi.contentEditable='false';edi.style.color="#aaaaaa";edi.style.overflow="hidden";dlg.style.display='block';dlg.spantag=ele.parentNode;}}
function insertHTML(doku,txt,rep){if(!IE){if(rep)
doku.innerHTML=txt;else
document.execCommand('insertHTML',false,txt);}else{doku.focus();sel=document.selection.createRange();sel.pasteHTML(txt);}
return true;}
function saveNotes(bn,doku,AjxLd){flag=false;if(otherLoaded){if(confirm('Esto reemplazara sus notas!, Desea continuar?')){otherLoaded=false;}else{return false;}}
var img=null;var http2=null;if(AjxLd)img=insertLoadingAjax(bn);else http2=getXMLHttpRequest();btns=bn.parentNode.getElementsByTagName('IMG');publico=false;for(var i=0;i<btns.length;i++){if(btns[i].src.indexOf('publicsel.gif')>=0){publico=true;}}
if(AjxLd){$http=http;}else{$http=http2;}
$http.open("POST","/library/extensions/notes/index.php?action=save",true);$http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");$http.onreadystatechange=function()
{if($http.readyState==4)
{if(AjxLd)removeLoadingAjax(img);Xml=$http.responseXML;r=getNodeVal(Xml,'result');if(r=='OK'){r=getNodeVal(Xml,'usermsg');alert(r);notesTouched=false;}else{alert('We have troubles with communication.. try in a few seconds');}
bn.parentNode.getElementsByTagName('INPUT')[0].value=wgUserName;}}
texto=doku.innerHTML;var data="wikiuser="+encodeURIComponent(wgUserName)+"&title="+encodeURIComponent(wgPageName)+"&notesText="+encodeURIComponent(texto);$e.$(bn.parentNode.parentNode.parentNode.getAttribute('id')).notesBuffer=texto;if(publico)
{data=data+"&public=true";}else{data=data+"&public=false";}
$http.send(data);}
function inputKey(e,obj){key=(window.event)?event.keyCode:e.keyCode;if(obj.value.length>0){switch(key){case 13:{if(obj.getAttribute('opt')=="search")
setChosen(obj,1);else
setChosen(obj,0);}break;case 27:{showList(obj,false);obj.parentNode.childNodes[1].innerHTML="";}break;case 38:{moveSelected("up",obj);}break;case 40:{moveSelected("down",obj);}break;default:{if(key>65){var data="";if(obj.getAttribute('opt')!='search'){if(obj.value.toUpperCase()!="MY NOTES")
data="text="+encodeURIComponent(obj.value)+"&title="+encodeURIComponent(wgPageName);else data="text="+encodeURIComponent(wgUserName)+"&title="+encodeURIComponent(wgPageName);makeXMLHttpRequest(1,"/library/extensions/notes/index.php?action=suggest",data,function(){if(http.readyState==4)
{try{fillDropDown(obj,http.responseXML,0);obj.onblur=function(){showList(this,false);};}catch(e){}}});}else{data="text="+encodeURIComponent(obj.value);makeXMLHttpRequest(1,"/library/extensions/notes/index.php?action=suggest&op=search",data,function(){if(http.readyState==4)
{try{fillDropDown(obj,http.responseXML,1);obj.onblur=function(){showList(this,false);};}catch(e){}}});}}}break;}}}
function setChosen(obj,opt){inp=obj;var selected=null;if(obj.tagName=="DIV"){selected=obj;obj=obj.parentNode.parentNode.firstChild;}
showList(obj,false);if(!selected)selected=getTextSelect(obj);texto="";valor="";if(selected){obj.value=selected.getAttribute('text');texto=selected.getAttribute('text');valor=selected.getAttribute('value');}else{texto=inp.value;if(texto.toUpperCase()=="MY NOTES")texto=wgUserName;valor=texto;}
if(opt==0){var Ajx=insertLoadingAjax(obj.parentNode);var data="text="+encodeURIComponent(valor)+"&title="+encodeURIComponent(wgPageName);if((!otherLoaded)&&(notesTouched)){if(!confirm('This will destroy the changes, proceed?')){removeLoadingAjax(Ajx);return false;}}
if(valor!=wgUserName)otherLoaded=true;else otherLoaded=false;url="/library/extensions/notes/index.php?action=suggest&op=load";if(valor==wgUserName)url=url+"self";makeXMLHttpRequest(1,url,data,function(){if(http.readyState==4)
{Xml=http.responseXML;removeLoadingAjax(Ajx);r=getNodeVal(Xml,'contenido');if(r.length>0){doku=getIFrameDocument(obj.parentNode);doku.innerHTML="";insertHTML(doku,unescape(r),true);notesTouched=false;}}});}}
function showList(obj,op){if(obj.tagName=="INPUT")obj.parentNode.childNodes[1].style.display=(op)?"block":"none";else obj.parentNode.style.display=(op)?"block":"none";}
function getValueSelect(obj){drp=obj.parentNode.childNodes[1];return drp.getAttribute("value");}
function getTextSelect(obj){drp=obj.parentNode.childNodes[1].firstChild;while(drp){if((drp.getAttribute('selected'))&&(drp.getAttribute('selected')=="true")){return drp;}
try{drp=drp.nextSibling;}catch(e){drp=null;}}
return"";}
function moveSelected(op,obj){pg=obj.parentNode.childNodes[1].firstChild;if(pg){bfr=null;nxt=pg.nextSibling;flag=false;if(pg.nextSibling){while(nxt){if((pg.getAttribute('selected'))&&(pg.getAttribute('selected')=="true")){flag=true;switch(op){case"down":{pg.className="notesDropOp";pg.setAttribute("selected","false");nxt.className="notesDropOpSelected";nxt.setAttribute("selected","true");nxt.parentNode.setAttribute('value',nxt.getAttribute("value"));nxt=null;}break;case"up":{if(bfr){pg.className='notesDropOp';pg.setAttribute("selected","false");bfr.className="notesDropOpSelected"
bfr.setAttribute("selected","true");bfr.parentNode.setAttribute('value',bfr.getAttribute("value"));}
nxt=null;}break;}}else{bfr=pg;pg=pg.nextSibling;nxt=pg.nextSibling
if((!nxt)&&(pg.getAttribute("selected"))&&(pg.getAttribute("selected")=="true")&&(op=="up")){if(bfr){pg.className="notesDropOp";pg.setAttribute("selected","false");bfr.className="notesDropOpSelected";bfr.setAttribute("selected","true");bfr.parentNode.setAttribute('value',bfr.getAttribute("value"));}}}}}else{pg.className="notesDropOpSelected";pg.setAttribute("selected","true");pg.parentNode.setAttribute('value',pg.getAttribute("value"));}}}
function fillDropDown(obj,Xml,opt){list=obj.parentNode.childNodes[1];list.innerHTML="";r=Xml.getElementsByTagName('op');if(r.length>0)showList(obj,true);for(var i=0;i<r.length;i++){nd=createOption(r[i],opt);if(i==0){nd.setAttribute('selected',"true");nd.className="notesDropOpSelected";}
list.appendChild(nd);}}
function createOption(rop,opt){texto=rop.getAttribute('text');valor=rop.getAttribute('value');var res=document.createElement('DIV');res.onclick=function(){this.setAttribute("selected","true");setChosen(this,opt);showList(this,false);inpt.onblur=bF;};res.onmouseover=function(){this.className="notesDropOpSelected";inpt=this.parentNode.parentNode.firstChild;bF=inpt.onblur;inpt.onblur=null;this.onmouseout=function(){this.className="notesDropOp";inpt.onblur=bF;};this.onmouseup=function(){inpt.onblur=bF;};};res.setAttribute('value',valor);res.setAttribute('selected','false');res.setAttribute('text',texto);res.className="notesDropOp";res.innerHTML="<img src='/library/extensions/glimages/download.gif' /><span>"+texto+"</span>";return res;}
function resetRows(tbody){for(var i=0;i<tbody.childNodes.length;i++){row=tbody.childNodes[i];row.className=row.getAttribute('beforeclass');imgs=row.getElementsByTagName('IMG');for(var j=0;j<imgs.length;j++){if((imgs[j].getAttribute('beforesrc'))&&(imgs[j].src!=imgs[j].getAttribute('beforesrc'))&&(imgs[j].src!=imgs[j].getAttribute('beforesrc')))
{imgs[j].src=imgs[j].getAttribute('beforesrc');}}}}
function getNodeVal(xml,name){try{r=xml.getElementsByTagName(name);if(r.length>0)return r[0].firstChild.data;else return"";}catch(e){return"";}}
function showNotes(e,btn){dlg=doc.getElementById("gsmCN");dlg.style.display="block";corner=doc.getElementById("gsmCNcorner");cnt=btn;while((cnt!=null)&&(cnt.className)&&(cnt.className!="mainNotesDiv"))cnt=cnt.parentNode;mainDiv=doc.getElementById("MainDiv");scrollbody=document.documentElement.scrollTop+document.body.scrollTop;clickX=(e.screenX-mainDiv.offsetLeft-doc.co.offsetWidth-btn.offsetWidth);clickY=(e.clientY+scrollbody-doc.he.offsetHeight);clickY-=(IE)?35:25;clickX+=15;dlg.style.position="absolute";dlg.style.left=clickX+"px";dlg.style.top=clickY+"px";corner.style.position='absolute';corner.style.display='block';corner.style.top=(clickY+15)+"px";corner.style.left=(clickX-7)+"px";ndv=dlg.getElementsByTagName("DIV")[0];var ajx=new Image();ajx.src="/library/extensions/glimages/ajax-loader.gif";ndv.innerHTML="Loading ...";ajx.className='ajx';ndv.appendChild(ajx);var data="text="+encodeURIComponent(btn.getAttribute('usuario'))+"&title="+encodeURIComponent(btn.getAttribute('handle'));url="/library/extensions/notes/index.php?action=suggest&op=loadsearch";if(btn.getAttribute('usuario')==wgUserName){url+="self";}
makeXMLHttpRequest(1,url,data,function(){if(http.readyState==4)
{try{ajx.parentNode.removeChild(ajx);xml=http.responseXML;ndv.innerHTML=unescape(getNodeVal(xml,'contenido'));}catch(e){}}});}
function closeShowNotes(){doc.getElementById("gsmCN").style.display='none';doc.getElementById("gsmCNcorner").style.display='none';}
function getOffset(obj,tope){res=new ClassPoint();while(obj!=null){if(obj){if(typeof(obj.offsetTop)=="number")res.posy+=obj.offsetTop;if(typeof(obj.offsetLeft)=="number")res.posx+=obj.offsetLeft;obj=obj.parentNode;if((obj)&&((obj.id)||((obj.className)))){if((obj.id==tope)||(obj.className==tope)){obj=null;}}}}
return res;}
function hidePreviewNotes(btn){btn.parentNode.style.visibility="hidden";}
function changePublicNotes(btn){closeShowNotes();if(!http)http=getXMLHttpRequest();hdl=btn.getAttribute('handle');usr=btn.getAttribute('user');if(usr==wgUserName){pub=true;if(btn.src.indexOf('sel')>=0){pub=false;}
btn.src="/library/extensions/glimages/sharing.gif";var data;data="usr="+encodeURIComponent(wgUserName)+"&handle="+encodeURIComponent(hdl)+"&value="+encodeURIComponent(pub);makeXMLHttpRequest(1,"/library/extensions/notes/index.php?action=makepublic",data,function(){if(http.readyState==4)
{Xml=http.responseXML;r=getNodeVal(Xml,'result');if(r=='OK'){r=getNodeVal(Xml,'usermsg');if(pub)btn.src="/library/extensions/glimages/publicsel.gif";else btn.src="/library/extensions/glimages/public.gif";btn.setAttribute('beforesrc',btn.src);btn.style.width='';}else{btn.src=btn.getAttribute('beforesrc');btn.style.width='';alert('We have troubles with communication.. try in a few seconds');}}});}else{}}
function deleteNotes(btn){closeShowNotes();if(!http)http=getXMLHttpRequest();hdl=btn.getAttribute('handle');usr=btn.getAttribute('user');if(usr==wgUserName){btn.src="/library/extensions/glimages/ajax-loader.gif";btn.style.width='9px';var data;data="usr="+encodeURIComponent(wgUserName)+"&handle="+encodeURIComponent(hdl);makeXMLHttpRequest(1,"/library/extensions/notes/index.php?action=delete",data,function(){if(http.readyState==4)
{Xml=http.responseXML;r=getNodeVal(Xml,'result');if(r=='OK'){r=getNodeVal(Xml,'usermsg');row=btn.parentNode.parentNode;row.parentNode.removeChild(row);}else{btn.src=btn.getAttribute('beforesrc');btn.style.width='';alert('We have troubles with communication.. try in a few seconds');}}});}else{}}
function wrapSort(im){rw=im.parentNode.parentNode;rw=rw.getElementsByTagName('IMG');for(var i=0;i<rw.length;i++){if(rw[i].parentNode.innerHTML!=im.parentNode.innerHTML)
rw[i].src="/library/skins/common/images/sort_none.gif";}
nxI=im.nextSibling;while(nxI.tagName!='A')nxI=nxI.nextSibling;nxA=nxI;inThis=false;rw=im.parentNode.parentNode;while((!inThis)&&(rw)){if((rw.className)&&(rw.className=='selected')){inThis=true;}
rw=rw.nextSibling;}
if(inThis){resetRows(im.parentNode.parentNode.parentNode);document.getElementById('notesPreview').style.visibility="hidden";}
nxA.onclick();nxI=nxI.getElementsByTagName('IMG')[0];im.src=nxI.src;}
function showTbl(bn){o=bn.parentNode.parentNode;while(o.tagName!='TABLE')o=o.nextSibling;if(bn.getAttribute('opt')=='hide'){o.style.display='none';bn.setAttribute('opt','show');bn.innerHTML="[show]";}else{o.style.display='block';bn.setAttribute('opt','hide');bn.innerHTML='[hide]';}}
function notesSyncVideo(b){ply.$(b.parentNode.getAttribute('g_playerid')).goTo(b.parentNode.getElementsByTagName('SPAN')[0].innerHTML);if(b.parentNode.getElementsByTagName('SPAN')[1]){globalStop=timeToSeconds(b.parentNode.getElementsByTagName('SPAN')[1].innerHTML);}}
function notesIncrement(b){tmlbl=null;if(b.getAttribute('opt')=='end')
tmlbl=b.parentNode.getElementsByTagName('SPAN')[1];else
tmlbl=b.parentNode.getElementsByTagName('SPAN')[0];time=timeToSeconds(tmlbl.innerHTML);if(b.className=='forward'){time=time+1;}else{time=time-1;if(time<0)time=0;}
tmlbl.innerHTML=secondsToTime(time);}
function extend(im){sp=im.parentNode;nsp=document.createElement('SPAN');nsp.innerHTML='00:00';nsp.onblur=function(){onEditLbl(this);};nsp.contentEditable='true';nsp.designMode='on';nimg1=document.createElement('IMG');nimg1.src=sp.getElementsByTagName('IMG')[1].src;nimg1.className='backward';nimg1.onclick=function(){notesIncrement(this);}
nimg1.setAttribute('opt','end');nimg2=document.createElement('IMG');nimg2.src=sp.getElementsByTagName('IMG')[2].src;nimg2.className='forward';nimg2.onclick=function(){notesIncrement(this);}
nimg2.setAttribute('opt','end');sp.appendChild(nsp);sp.appendChild(nimg1);sp.appendChild(nimg2);im.parentNode.removeChild(im);}
function notesShowStats(b){tb=timeToSeconds(b.nextSibling.innerHTML);if(b.parentNode.getElementsByTagName('SPAN')[1]){te=timeToSeconds(b.parentNode.getElementsByTagName('SPAN')[1].innerHTML);}else{te=ply.$(b.parentNode.getAttribute('g_playerid')).totalTime;}
if(te>tb){ply.$(b.parentNode.getAttribute('g_playerid')).showActive(tb,te);}else{ply.$(b.parentNode.getAttribute('g_playerid')).showActive(tb,tb+1);}
b.onmouseout=function(){ply.$(this.parentNode.getAttribute('g_playerid')).hideActive();};}