<!DOCTYPE html>
<html>
<title>Clicking on YouTube Embedded Iframe - RJM Programming - June, 2016 - via Google YouTube API https://developers.google.com/youtube/iframe_api_reference</title>
<link href='//www.rjmprogramming.com.au/PHP/emboss_h1.css' rel='stylesheet' type='text/css'>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=0.1, maximum-scale=8, user-scalable=yes" >
<script type='text/javascript'>
var stduration=0, sdivcbi='';
var hgrip='', lasthgriprec='', hgans='', hgcnt=0, lasthgrip='';
var startagain=false, psuf='', mletter='m', uletter='U', numericals='', numericalssamecount=0, prevretry='', lastokn=0, thatisit=false, inplaying=false;
var ouraidis='', ouriframeidis='';
if (window.parent) {
 ouraidis=parent.location.search.split('theaid=')[1] ? parent.location.search.split('theaid=')[1].split('&')[0] : '';
 ouriframeidis=parent.location.search.split('theiframeid=')[1] ? parent.location.search.split('theiframeid=')[1].split('&')[0] : '';
 if (('#' + parent.location.hash).indexOf('#inp') != -1) {
        startagain=true;
        parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-loop', 'y');
        parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).style.fontSize='7px';
   //ttt.title=('found');
 }
 if (ouraidis != '' && ouriframeidis != '' && ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^\#$/g,'') == '') {
    location.hash='#inp' + ouraidis + '_' + ouriframeidis;
   //ttt.title=('Found');
    if (('' + parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).getAttribute('data-loop')).replace(/^undefined/g,'').replace(/^null/g,'') != '') {
   //ttt.title=('FounD');
        startagain=true;
    } else if (parent.parent.document.getElementById(location.hash.replace(/\#/g,''))) {
   //ttt.title=('FoUND');
        parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).style.fontSize='7px';
        if (('' + parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).rows) == "4") {
          parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).rows="5";
        }
    }
 }
}
var fauxpas_w=null, fauxmore='', fauxdef='', fauxdefcnt=0, lastfauxdef='';
var parentdocumentURL='';
if (window.parent) {
  parentdocumentURL=parent.document.URL;
}
var ttt=document;   //sometimes we will use parent.parent.document.title to write to rather than top.document.title
if (window.top) {
ttt=top.document;
if (('' + ttt.title).indexOf('External Javascript ') == 0 || ('' + ttt.URL).replace('/wordpress', '/ITblog').toLowerCase().indexOf('/itblog') != -1) {
  ttt=parent.parent.document;
}
}
var etg=false, pwo=null;
var parentvidtitlespassed=[];
var endcnt=-1;
var onestodourl='';
var onespause=20;
var onestodoprefix=location.search.split('andthen=')[1] ? ('&andthen=' + decodeURIComponent(location.search.split('andthen=')[1].split('&')[0])).substring(0,9) : '';
var onestodosuffix=location.search.split('andthen=')[1] ? decodeURIComponent(location.search.split('andthen=')[1].split('&')[0]) : '';
var prevonestodosuffix=onestodosuffix;
var iframegridmode=false;
var urlis='';
var dostumps=true;
var atnextend=false;
var vwidth=640;
var vheight=390; 
var hone=1, lookedat=false;
var vidarr;
var one=0;
var nextvidi=-1;
var cntpause=0;
var onepause=0;
var tobechecked=null;
var thistext='';
var nexttext='2';
var nextvid='';
var prevvid='';
var nexturl='';
var prevurl='';
var of=' 1 of 1 ';
var cnt=0;
var toggle=1, thispt='0';
var secscnt=location.search.split('start=')[1] ? location.search.split('start=')[1].split('&')[0] : 0;
var oursecscnt=secscnt;  // for Karaoke purposes ... September, 2016
var suffix="#t=00m00s";
var presuffix="";
var wo=null;
var yturl='';
var playtime=4000;
var delay=1300;
var vlen=0;
var eventtarget=null;
var duration=-1;
var previd="7o9wvYXR3n0";
var vid="7o9wvYXR3n0";
var play_list_id='';
var hm=2;
var anymore='';
var yes_esp=false;
var oknow=true;
var gtn="Go to next on the list";
var pgtn="Go to previous on the list";
var kpi=-9;
var player;
var lastlfmcs='';
var lastvolume=-1;
var maxvolume=-1;
var ipbit='';
var wpp=null, wpwp=null;
var comeval='', oktoivid=true, vidarrv=[], vidstarts=[], viddurs=[], viddos=[], ivid=0, firstdelay=-1, ismobileplaylistplay=false, firststdone=false, lastshuffle=-1, firstshuffle=false;
var midpre='';
if (('' + location.search + ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'')).indexOf('WEBVTT%20FILE%0A%0A') != -1) {
  midpre='WEBVTT%20FILE%0A%0A';
}
var prefx='', stimes=[], etimes=[], stimesf=[], etimesf=[], alttimesubtitles=[], altsubtimesubtitles=[], timesubtitles=[], subtimesubtitles=[], cursubi=-1, xhr=null, cursecselapsed=-1.0, enforcedtimeis=-1.0, isnotplaying=true, createdlh='';
if (window.parent.parent) {
  if (parent.parent.document.getElementById('srt') && parent.parent.document.getElementById('diaudiov') && parent.parent.document.getElementById('diaudio')) { wpp=window.parent.parent; }
  if (parent.parent.document.getElementById('srt') && !parent.parent.document.getElementById('diaudiov') && parent.parent.document.getElementById('diaudio')) { wpwp=window.parent.parent; }
  if (parent.parent.document.getElementById('youtubeid') && parent.parent.document.getElementById('srt') && (('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^\#/g,'') == '' || ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').indexOf('#srt=WEBVTT') != -1)) {
    if (parent.parent.document.getElementById('youtubeid').value != '') {
//alert('45 ' + parent.parent.document.getElementById('srt').value);
    if (parent.parent.document.getElementById('srt').value.indexOf('WEBVTT') == 0 && parent.parent.document.getElementById('srt').value.indexOf('1~') != -1) {
    //location.hash='#srt=1' + encodeURIComponent('' + String.fromCharCode(10) + parent.document.getElementById('srt').value.split('1~')[1].replace(/\~/g, String.fromCharCode(10)));
//alert(parent.parent.document.getElementById('srt').value);
    prefx='=1' + encodeURIComponent('' + String.fromCharCode(10) + parent.parent.document.getElementById('srt').value.split('1~')[1].replace(/\~/g, String.fromCharCode(10)) + String.fromCharCode(10)) + '&';
//alert(decodeURIComponent(prefx));
    } //else {
    //location.hash='#srt=' + encodeURIComponent(parent.document.getElementById('srt').value.replace(/\~/g, String.fromCharCode(10)));
    //}
    }
  }
}
var gsrt=( ('' + prefx + location.search + ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'')).indexOf('=' + midpre + '1' + encodeURIComponent(String.fromCharCode(10))) != -1 ? processsrt(midpre + '1' + encodeURIComponent(String.fromCharCode(10)) + ('' + prefx + location.search + ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'')).split('=' + midpre + '1' + encodeURIComponent(String.fromCharCode(10))[1].split(encodeURIComponent(String.fromCharCode(10)) + '&')[0].split(encodeURIComponent(String.fromCharCode(10)) + '#')[0])  ).replace(/\+/g, ' ') : (('' + prefx + location.search + ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'')).toLowerCase().replace(encodeURIComponent('.') + 'vtt',encodeURIComponent('.') + 'srt').indexOf(encodeURIComponent('.') + 'srt') != -1 ? processsrt(('' + prefx + location.search + ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'')).replace(encodeURIComponent('.') + 'SRT','SRT' + encodeURIComponent('.') + 'srt').replace(encodeURIComponent('.') + 'vtt','vtt' + encodeURIComponent('.') + 'srt').replace(encodeURIComponent('.') + 'VTT','VTT' + encodeURIComponent('.') + 'srt').split(encodeURIComponent('.') + 'srt')[0].split(encodeURIComponent(String.fromCharCode(10)) + '&')[0].split(encodeURIComponent(String.fromCharCode(10)) + '#')[0]) : ''));
var ggsandc='Subtitle and caption';
if (gsrt == '' && window.parent) {
 if (parent.document.URL.indexOf('/karaoke_') != -1) {
  var parentdocumentURL=parent.document.URL.replace('#WEBVTT', '#srt=WEBVTT');
 //alert('HeRe ' + midpre + ' ' + parent.document.URL.slice(-350));
  //var xzz=prompt(parent.document.URL,parent.document.URL);
  gsrt=( ('' + parentdocumentURL.replace(/^undefined/g,'').replace(/^null/g,'')).indexOf('=' + midpre + '1' + encodeURIComponent(String.fromCharCode(10))) != -1 ? processsrt(midpre + '1' + encodeURIComponent(String.fromCharCode(10)) + ('' + parentdocumentURL.replace(/^undefined/g,'').replace(/^null/g,'')).split('=' + midpre + '1' + encodeURIComponent(String.fromCharCode(10))[1].split(encodeURIComponent(String.fromCharCode(10)) + '&')[0].split(encodeURIComponent(String.fromCharCode(10)) + '#')[0])  ).replace(/\+/g, ' ') : (('' + parentdocumentURL.replace(/^undefined/g,'').replace(/^null/g,'')).toLowerCase().replace(encodeURIComponent('.') + 'vtt',encodeURIComponent('.') + 'srt').indexOf(encodeURIComponent('.') + 'srt') != -1 ? processsrt(('' + parentdocumentURL.replace(/^undefined/g,'').replace(/^null/g,'')).replace(encodeURIComponent('.') + 'SRT','SRT' + encodeURIComponent('.') + 'srt').replace(encodeURIComponent('.') + 'vtt','vtt' + encodeURIComponent('.') + 'srt').replace(encodeURIComponent('.') + 'VTT','VTT' + encodeURIComponent('.') + 'srt').split(encodeURIComponent('.') + 'srt')[0].split(encodeURIComponent(String.fromCharCode(10)) + '&')[0].split(encodeURIComponent(String.fromCharCode(10)) + '#')[0]) : ''));
 }
}
 function whichone(intone) {
   var ioff=0;
   //if (intone.indexOf('  ,  ') != -1) {
   //  alert(cursubi);
   //}
   if (intone.indexOf('  ,  ') == -1) {
      return intone;
   } else if (eval('' + intone.split('  ,  ').length) <= Math.max(0,eval(-1 + cursubi))) {
      while (intone.split('  ,  ')[eval(-1 + ioff + intone.split('  ,  ').length)].trim() == '') {
        ioff--;
      }
      return intone.split('  ,  ')[eval(-1 + ioff + intone.split('  ,  ').length)];
   } else {
      while (intone.split('  ,  ')[eval(ioff + Math.max(0,eval(-1 + cursubi)))].trim() == '') {
        ioff--;
      }
      return intone.split('  ,  ')[eval(ioff + Math.max(0,eval(-1 + cursubi)))];
   }
   return intone;
 }
 function whichaltone(intone) {
   var ioff=0;
   if (intone.indexOf('  ,  ') == -1) {
      return intone;
   } else if (eval('' + intone.split('  ,  ').length) <= Math.max(0,eval(-1 + cursubi))) {
      while (intone.split('  ,  ')[eval(-1 + ioff + intone.split('  ,  ').length)].trim() == '') {
        ioff--;
      }
      return intone.split('  ,  ')[eval(-1 + ioff + intone.split('  ,  ').length)];
   } else {
      while (intone.split('  ,  ')[eval(ioff + Math.max(0,eval(-1 + cursubi)))].trim() == '') {
        ioff--;
      }
      return intone.split('  ,  ')[eval(ioff + Math.max(0,eval(-1 + cursubi)))];
   }
   return intone;
 }
 function endgame() {
   if (hgrip != '') {
                      var washgrip=hgrip;
                      hgrip='';
                      hgans='';
                      if (window.opener) {
                      if (window.opener.document.URL.indexOf('/karaoke_') != -1) {
                      
                      if (window.opener.window.opener) {
                      if (window.opener.document.URL.indexOf('/karaoke_') != -1 && ('' + window.opener.document.URL + '~').indexOf('srt=~') != -1) {
                      if (window.opener.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                        fauxpas_w=window.opener.window.opener; //alert('yes FounD');
                      } else if (window.opener.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=window.opener.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      
                        location.hash='#srt=' + encodeURIComponent(washgrip);
                        if (window.opener.document.URL.indexOf('youtubeid=') == -1) {
                        window.opener.location.href=window.opener.document.URL.split('#')[0].replace('srt=','').replace('?','?youtubeid=' + vid + '&') + '#srt=' + encodeURIComponent(washgrip);
                        hgrip='';
                        } else {
                        window.opener.location.href=window.opener.document.URL.split('#')[0].replace('srt=','').replace('?','?rand=' + Math.floor(Math.random() * 3456) + '&') + '#srt=' + encodeURIComponent(washgrip);
                        hgrip='';
                        }
                      } 
                      }                      
                      if (window.parent) {
                      if (parent.document.URL.indexOf('/karaoke_') != -1 && ('' + parent.document.URL + '~').indexOf('srt=~') != -1) {
                      if (parent.window.opener) {
                      if (parent.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                        fauxpas_w=parent.window.opener; //alert('found');
                      } else if (parent.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=parent.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      
                      if (parent.document.URL.indexOf('/karaoke_') != -1) {
                      //alert(1);
                        location.hash='#srt=' + encodeURIComponent(washgrip);
                        parent.location.href=parent.document.URL.split('#')[0].replace('srt=','').replace('?','?rand=' + Math.floor(Math.random() * 3456) + '&') + '#srt=' + encodeURIComponent(washgrip);
                        hgrip='';
                      } else if (parent.document.URL.indexOf('/stop_start') != -1) {
                      //alert(2);
                        var rhs=parent.document.URL.split('?')[0].split('#')[0].replace('srt=','').replace('.html','.html?vid=' + vid + ('&playtime=' + stduration).replace('&playtime=undefined','&playtime=' + duration)) + '#srt=' + encodeURIComponent(washgrip);
                        hgrip='';
                        parent.location.href=rhs;
                        location.href=rhs;
                      }
                      } else {
                      //alert(3);
                        location.hash='#srt=' + encodeURIComponent(washgrip);
                        hgrip='';
                      }
   }
 }
 
 function nextfauxdef() {
  if (fauxpas_w) {
    if ((eval(fauxdefcnt % 2) == 1 || lastfauxdef != '') || fauxdefcnt == 0) {
      lastfauxdef='';
      return ' ';
    }
    lastfauxdef=fauxdef;
    return fauxdef;
  }
  return '';
 }
 function getlh() {
  return ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'');
 }
 
 function maybedet(inid) {
   if (document.getElementById('detdiv' + inid)) {
     return 'detdiv' + inid;
   } else if (document.getElementById(inid)) {
     if (document.getElementById(inid).innerHTML == '') {
      if (window.parent) {
      if (window.parent.parent) {
      //alert('3:' + parent.parent.document.URL);
      if (parent.parent.document.URL.indexOf('/video_commentary.htm')) {
        ggsandc='Commentary note';
      } else if (parent.parent.document.URL.indexOf('/song_lyric_faux_pas.htm') == -1) {
         if (parent.parent.document.getElementById('conceptsubject')) {
           ggsandc=parent.parent.document.getElementById('conceptsubject').value;
         }
      }
      } else {
      ggsandc=ggsandc;
      }
      } else {
      ggsandc=ggsandc;
      }
      document.getElementById(inid).innerHTML='<details id="det' + inid + '" open><summary id="sum' + inid + '">' + ggsandc + ' ...</summary><div id="detdiv' + inid + '"></div></details>';
      return 'detdiv' + inid;
     }
   }
   return inid;
 }
 function writeoutsubtitle() {
  var newsubi=-1, ithings=0;
  //console.log('cAll ' + enforcedtimeis + ' ' + cursecselapsed);
  if (enforcedtimeis >= 0.0) {
     cursecselapsed=enforcedtimeis;
  }
  if (cursecselapsed >= 0.0 && cursubi >= 0 && eval('' + etimes.length) > 0 && eval('' + stimes.length) > 0 && eval('' + timesubtitles.length) > 0) {
    if (enforcedtimeis < 0.0) {
     cursecselapsed+=0.1;
    }
    //console.log('' + cursecselapsed);
    if (eval(cursecselapsed) >= eval(stimes[cursubi]) && eval(cursecselapsed) <= eval(etimes[cursubi])) {
    if (document.getElementById('subtitlegoeshere').innerHTML == '' && eval('' + timesubtitles.length) > cursubi) {
      console.log('found for ' + cursubi);
      document.getElementById(maybedet('subtitlegoeshere')).innerHTML=whichone(timesubtitles[cursubi]);
      if (('' + document.getElementById('subtitlegoeshere').title) == ('' + document.getElementById('subtitlegoeshere').title).trim()) {
        document.getElementById('subtitlegoeshere').title+='     ';
      }
      if (window.parent) {
        if (parent.document.getElementById('preareyousinging')) {
          if (('' + parent.document.getElementById('preareyousinging').title) == '') {
            parent.document.getElementById('preareyousinging').title='Captions and subtitles ';
            if (wpwp) {
            //alert(8);
            parent.document.getElementById(parent.maybedet('preareyousinging')).onmousedown=function(event) { parent.parent.ouralert(parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).title,parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).innerText,parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).innerHTML,null); };
            parent.document.getElementById(parent.maybedet('preareyousinging')).ontouchdown=function(event) { parent.parent.ouralert(parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).title,parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).innerText,parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).innerHTML,null); };
            } else if (!wpp) {
            //alert(1);
            parent.document.getElementById(parent.maybedet('preareyousinging')).onmousedown=function(event) { alert(parent.document.getElementById(('' + event.target.id).replace('detdiv','').replace('det','')).title); };
            parent.document.getElementById(parent.maybedet('preareyousinging')).ontouchdown=function(event) { alert(parent.document.getElementById(('' + event.target.id).replace('detdiv','').replace('det','')).title); };
            } else {
            //alert(11);
            parent.document.getElementById(parent.maybedet('preareyousinging')).onmousedown=function(event) { parent.ouralert(parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).title,parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).innerText,parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).innerHTML,null); };
            parent.document.getElementById(parent.maybedet('preareyousinging')).ontouchdown=function(event) { parent.ouralert(parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).title,parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).innerText,parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).innerHTML,null); };
            }
          }
          parent.document.getElementById('preareyousinging').style.backgroundColor='orange';
          parent.document.getElementById(parent.maybedetstart('preareyousinging', whichaltone(alttimesubtitles[cursubi]))).innerHTML=whichone(timesubtitles[cursubi]);
          parent.document.getElementById('preareyousinging').title=parent.document.getElementById('preareyousinging').title.replace(parent.document.getElementById('preareyousinging').title.split('aptions')[0], 'Last (now usefully SubRip editable clickable) caption for ' + stimesf[cursubi] + ' to ' + etimesf[cursubi] + ' is ' + String.fromCharCode(10) + timesubtitles[cursubi] + String.fromCharCode(10) + ' ... ' + String.fromCharCode(10) + 'C');
          document.getElementById('subtitlegoeshere').title=document.getElementById('subtitlegoeshere').title.replace(document.getElementById('subtitlegoeshere').title.split('aptions')[0], 'Last (now usefully SubRip editable clickable) caption for ' + stimesf[cursubi] + ' to ' + etimesf[cursubi] + ' is ' + String.fromCharCode(10) + timesubtitles[cursubi] + String.fromCharCode(10) + ' ... ' + String.fromCharCode(10) + 'C');
        } else if (parent.document.getElementById('subtitlegoeshere')) {
          if (('' + parent.document.getElementById('subtitlegoeshere').title) == ('' + parent.document.getElementById('subtitlegoeshere').title).trim()) {
            parent.document.getElementById('subtitlegoeshere').title+='     ';
          }
          parent.document.getElementById(parent.maybedetstart('subtitlegoeshere', whichaltone(alttimesubtitles[cursubi]))).innerHTML=whichone(timesubtitles[cursubi]);
          parent.document.getElementById('subtitlegoeshere').title=parent.document.getElementById('subtitlegoeshere').title.replace(parent.document.getElementById('subtitlegoeshere').title.split('aptions')[0], 'Last (now usefully SubRip editable clickable) caption for ' + stimesf[cursubi] + ' to ' + etimesf[cursubi] + ' is ' + String.fromCharCode(10) + timesubtitles[cursubi] + String.fromCharCode(10) + ' ... ' + String.fromCharCode(10) + 'C');
          document.getElementById('subtitlegoeshere').title=document.getElementById('subtitlegoeshere').title.replace(document.getElementById('subtitlegoeshere').title.split('aptions')[0], 'Last (now usefully SubRip editable clickable) caption for ' + stimesf[cursubi] + ' to ' + etimesf[cursubi] + ' is ' + String.fromCharCode(10) + timesubtitles[cursubi] + String.fromCharCode(10) + ' ... ' + String.fromCharCode(10) + 'C');
        }
      } else {
          document.getElementById('subtitlegoeshere').title=document.getElementById('subtitlegoeshere').title.replace(document.getElementById('subtitlegoeshere').title.split('aptions')[0], 'Last (now usefully SubRip editable clickable) caption for ' + stimesf[cursubi] + ' to ' + etimesf[cursubi] + ' is ' + String.fromCharCode(10) + timesubtitles[cursubi] + String.fromCharCode(10) + ' ... ' + String.fromCharCode(10) + 'C');
      }
    }
    } else {
    for (ithings=0; ithings<stimes.length; ithings++) {
      if (eval(cursecselapsed) >= eval(stimes[ithings]) && eval(cursecselapsed) <= eval(etimes[ithings])) {
        newsubi=ithings;
        //alert('yes ' + ithings);
      }
    }
    if (eval(newsubi) < 0) {
        document.getElementById('subtitlegoeshere').innerHTML=document.getElementById('subtitlegoeshere').title.replace(document.getElementById('subtitlegoeshere').title.trim(), '').replace(/\ /g,' ');
        if (window.parent) {
        if (parent.document.getElementById('preareyousinging')) {
          parent.document.getElementById(parent.maybedet('preareyousinging')).innerHTML=parent.document.getElementById('preareyousinging').title.replace(parent.document.getElementById('preareyousinging').title.trim(), '').replace(/\ /g,' ');
        } else if (parent.document.getElementById('subtitlegoeshere')) {
          parent.document.getElementById(parent.maybedet('subtitlegoeshere')).innerHTML=parent.document.getElementById('subtitlegoeshere').title.replace(parent.document.getElementById('subtitlegoeshere').title.trim(), '').replace(/\ /g,' ');
        }
        }
    }
    if (eval(newsubi) >= 0 && eval(cursubi) >= 0 && eval(newsubi) != eval(cursubi)) {
    //alert('' + timesubtitles.length + ' needs to be bigger than ' + newsubi);
    if (eval('' + timesubtitles.length) > eval(newsubi)) {
      cursubi=newsubi;
      console.log('Found for ' + cursubi);
      if (('' + timesubtitles[cursubi]).replace(/^undefined$/g,'').replace('WEBVTT FILE', '') != '') {
      document.getElementById('subtitlegoeshere').innerHTML=('' + timesubtitles[cursubi]).replace(/^undefined$/g,'');
      if (window.parent) {
        if (parent.document.getElementById('preareyousinging')) {
          if (('' + parent.document.getElementById('preareyousinging').title) == '') {
            parent.document.getElementById('preareyousinging').title='Captions and subtitles ';
            if (wpwp) {
            //alert(88);
            parent.document.getElementById(parent.maybedet('preareyousinging')).onmousedown=function(event) { parent.parent.ouralert(parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).title,parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).innerText,parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).innerHTML,null); };
            parent.document.getElementById(parent.maybedet('preareyousinging')).ontouchdown=function(event) { parent.parent.ouralert(parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).title,parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).innerText,parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).innerHTML,null); };
            } else if (!wpp) {
            //alert(111);
            parent.document.getElementById(parent.maybedet('preareyousinging')).onmousedown=function(event) { alert(parent.document.getElementById(('' + event.target.id).replace('detdiv','').replace('det','')).title); };
            parent.document.getElementById(parent.maybedet('preareyousinging')).ontouchdown=function(event) { alert(parent.document.getElementById(('' + event.target.id).replace('detdiv','').replace('det','')).title); };
            } else {
            //alert(1111);
            parent.document.getElementById(parent.maybedet('preareyousinging')).onmousedown=function(event) { parent.ouralert(parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).title,parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).innerText,parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).innerHTML,null); };
            parent.document.getElementById(parent.maybedet('preareyousinging')).ontouchdown=function(event) { parent.ouralert(parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).title,parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).innerText,parent.document.getElementById(('' + event.target.id).replace('detJUNKdiv','').replace('det','')).innerHTML,null); };
            }
          }
          parent.document.getElementById('preareyousinging').style.backgroundColor='orange';
          parent.document.getElementById(parent.maybedetstart('preareyousinging', whichaltone(alttimesubtitles[cursubi]))).innerHTML=whichone(timesubtitles[cursubi]);
          parent.document.getElementById('preareyousinging').title=parent.document.getElementById('preareyousinging').title.replace(parent.document.getElementById('preareyousinging').title.split('aptions')[0], 'Last (now usefully SubRip editable clickable) caption for ' + stimesf[cursubi] + ' to ' + etimesf[cursubi] + ' is ' + String.fromCharCode(10) + timesubtitles[cursubi] + String.fromCharCode(10) + ' ... ' + String.fromCharCode(10) + 'C');
          document.getElementById('subtitlegoeshere').title=document.getElementById('subtitlegoeshere').title.replace(document.getElementById('subtitlegoeshere').title.split('aptions')[0], 'Last (now usefully SubRip editable clickable) caption for ' + stimesf[cursubi] + ' to ' + etimesf[cursubi] + ' is ' + String.fromCharCode(10) + timesubtitles[cursubi] + String.fromCharCode(10) + ' ... ' + String.fromCharCode(10) + 'C');
        } else if (parent.document.getElementById('subtitlegoeshere')) {
          if (('' + parent.document.getElementById('subtitlegoeshere').title) == ('' + parent.document.getElementById('subtitlegoeshere').title).trim()) {
            parent.document.getElementById('subtitlegoeshere').title+='     ';
          }
          parent.document.getElementById(parent.maybedetstart('subtitlegoeshere', whichaltone(alttimesubtitles[cursubi]))).innerHTML=whichone(timesubtitles[cursubi]);
          parent.document.getElementById('subtitlegoeshere').title=parent.document.getElementById('subtitlegoeshere').title.replace(parent.document.getElementById('subtitlegoeshere').title.split('aptions')[0], 'Last (now usefully SubRip editable clickable) caption for ' + stimesf[cursubi] + ' to ' + etimesf[cursubi] + ' is ' + String.fromCharCode(10) + timesubtitles[cursubi] + String.fromCharCode(10) + ' ... ' + String.fromCharCode(10) + 'C');
          document.getElementById('subtitlegoeshere').title=document.getElementById('subtitlegoeshere').title.replace(document.getElementById('subtitlegoeshere').title.split('aptions')[0], 'Last (now usefully SubRip editable clickable) caption for ' + stimesf[cursubi] + ' to ' + etimesf[cursubi] + ' is ' + String.fromCharCode(10) + timesubtitles[cursubi] + String.fromCharCode(10) + ' ... ' + String.fromCharCode(10) + 'C');
        }
      } else {
          document.getElementById('subtitlegoeshere').title=document.getElementById('subtitlegoeshere').title.replace(document.getElementById('subtitlegoeshere').title.split('aptions')[0], 'Last (now usefully SubRip editable clickable) caption for ' + stimesf[cursubi] + ' to ' + etimesf[cursubi] + ' is ' + String.fromCharCode(10) + timesubtitles[cursubi] + String.fromCharCode(10) + ' ... ' + String.fromCharCode(10) + 'C');
      }
      }
    }
    } else if (eval(newsubi) >= 0 && eval(cursubi) >= 0 && document.getElementById('subtitlegoeshere').innerHTML == '') {
      console.log('Found For ' + cursubi);
      if (('' + timesubtitles[cursubi]).replace(/^undefined$/g,'').replace('WEBVTT FILE', '') != '') {
      document.getElementById('subtitlegoeshere').innerHTML=('' + timesubtitles[cursubi]).replace(/^undefined$/g,'');
      if (window.parent) {
        if (parent.document.getElementById('preareyousinging')) {
          parent.document.getElementById(parent.maybedet('preareyousinging')).style.backgroundColor='orange';
          parent.document.getElementById(parent.maybedetstart('preareyousinging', whichaltone(alttimesubtitles[cursubi]))).innerHTML=whichone(timesubtitles[cursubi]);
          parent.document.getElementById('preareyousinging').title=parent.document.getElementById('preareyousinging').title.replace(parent.document.getElementById('preareyousinging').title.split('aptions')[0], 'Last (now usefully SubRip editable clickable) caption for ' + stimesf[cursubi] + ' to ' + etimesf[cursubi] + ' is ' + timesubtitles[cursubi] + String.fromCharCode(10) + ' ... ' + String.fromCharCode(10) + 'C');
          document.getElementById('subtitlegoeshere').title=document.getElementById('subtitlegoeshere').title.replace(document.getElementById('subtitlegoeshere').title.split('aptions')[0], 'Last (now usefully SubRip editable clickable) caption for ' + stimesf[cursubi] + ' to ' + etimesf[cursubi] + ' is ' + timesubtitles[cursubi] + String.fromCharCode(10) + ' ... ' + String.fromCharCode(10) + 'C');
        } else if (parent.document.getElementById('subtitlegoeshere')) {
          parent.document.getElementById(parent.maybedetstart('subtitlegoeshere',whichaltone(alttimesubtitles[cursubi]))).innerHTML=whichone(timesubtitles[cursubi]);
          parent.document.getElementById('subtitlegoeshere').title=parent.document.getElementById('subtitlegoeshere').title.replace(parent.document.getElementById('subtitlegoeshere').title.split('aptions')[0], 'Last (now usefully SubRip editable clickable) caption for ' + stimesf[cursubi] + ' to ' + etimesf[cursubi] + ' is ' + timesubtitles[cursubi] + String.fromCharCode(10) + ' ... ' + String.fromCharCode(10) + 'C');
          document.getElementById('subtitlegoeshere').title=document.getElementById('subtitlegoeshere').title.replace(document.getElementById('subtitlegoeshere').title.split('aptions')[0], 'Last (now usefully SubRip editable clickable) caption for ' + stimesf[cursubi] + ' to ' + etimesf[cursubi] + ' is ' + timesubtitles[cursubi] + String.fromCharCode(10) + ' ... ' + String.fromCharCode(10) + 'C');
        }
      } else {
          document.getElementById('subtitlegoeshere').title=document.getElementById('subtitlegoeshere').title.replace(document.getElementById('subtitlegoeshere').title.split('aptions')[0], 'Last (now usefully SubRip editable clickable) caption for ' + stimesf[cursubi] + ' to ' + etimesf[cursubi] + ' is ' + timesubtitles[cursubi] + String.fromCharCode(10) + ' ... ' + String.fromCharCode(10) + 'C');
      }
      }
    }   
    }
  }
  if (!isnotplaying) { enforcedtimeis=-1.0;  }
 }
 function convertSrtToText(srt) { // thanks to https://medium.com/@backlinkss.info/convert-srt-to-text-regex-javascript-9660964ee3f0
  // Use a expressão regular para remover os números de linha e as marcas de tempo
  return srt.replace(/^\d+\n([\d:,.]+ --> [\d:,.]+\n)/gm, '');
 }
 
 function fromsecs(outsecs) {
   var fromthistimestamp=''; // 21.681 becomes 00:00:02.681
   var hrs=Math.floor(eval(outsecs / 3600.0));
   var mns=Math.floor(eval(eval(outsecs - hrs * 3600.0) / 60.0));
   var scs=Math.floor(eval(eval(outsecs - hrs * 3600.0 - mns * 60.0) / 1.0));
   var msc=('' + ('' + (eval(eval(outsecs - hrs * 3600.0 - mns * 60.0 - scs) / 1.0)) + '.').split('.')[1] + '000').substring(0,3);
   fromthistimestamp=('0' + ('' + hrs)).slice(-2) + ':' + ('0' + ('' + mns)).slice(-2) + ':' + ('0' + ('' + scs)).slice(-2) + ',' + msc; 
   //alert('' + outsecs + ' becomes ' + fromthistimestamp);
   return ('' + fromthistimestamp).replace(/00\:\00\:00\,000/g, '00:00:00,001').replace(/00\:\00\:00\.000/g, '00:00:00.001');
 }
 
 function tosecs(fromthistimestamp) {
   //alert('fromthistimestamp=' + fromthistimestamp);
   var outsecs=0.0, cola=[], cfactor=1.0, icf=0;
   if (fromthistimestamp.replace('.',',').indexOf(',') != -1) {
     outsecs+=eval(eval('' + fromthistimestamp.replace('.',',').split(',')[1]) / Math.pow(10.0, eval('' + fromthistimestamp.replace('.',',').split(',')[1].length)));
     fromthistimestamp=fromthistimestamp.replace('.',',').split(',')[0];
   }
   cola=fromthistimestamp.split(':');
   for (icf=eval(-1 + cola.length); icf>=0; icf--) {
     if (('' + cola[icf]).replace(/0/g,'') != '') {
     outsecs+=eval(eval(('' + cola[icf]).replace(/^0/g,'')) * cfactor);
     }
   //if (fromthistimestamp.indexOf(':01:') != -1) {
   //alert('cola[icf]=' + cola[icf] + ' cfactor=' + cfactor + ' outsecs=' + outsecs + ' via ' + fromthistimestamp);
   //}
     cfactor*=60.0;
   }
   return outsecs;
 }
 
 function stateChanged() {
  if (xhr.readyState == 4) {
   if (xhr.status == 200) {
    if (xhr.response.indexOf(String.fromCharCode(10)) != -1) {
     gsrt=xhr.response;
     stimes=[];
     etimes=[];
     timesubtitles=[];
     processsrt('');
    }
   }
  }
 }   
    
 function processsrt(instis) {
  var it=0, interimsrt=[];
  if (instis != '') { 
  //alert('instis=' + instis);
    gsrt=decodeURIComponent(decodeURIComponent(instis).replace(/\ \+/g,' %2b').replace(/\+/g,' ')); 
    if (gsrt != '' && gsrt.indexOf(String.fromCharCode(10)) == -1 && gsrt.indexOf('=') != -1) {
      gsrt=gsrt.split('=')[eval(-1 + gsrt.split('=').length)] + '.srt';
    }
    if (gsrt.toLowerCase().trim() != gsrt.toLowerCase().trim().replace(/\.srt$/g,'').replace(/VTT\.srt$/g, '.VTT').replace(/vtt\.srt$/g, '.vtt')) {
     xhr = new XMLHttpRequest();
     xhr.onreadystatechange=stateChanged;
     createdlh='#srt=' + encodeURIComponent(gsrt.replace(/SRT\.srt$/g, '.SRT'));
     xhr.open('get',gsrt.replace(/SRT\.srt$/g, '.SRT').replace(/VTT\.srt$/g, '.VTT').replace(/vtt\.srt$/g, '.vtt'),true);
     xhr.send(null);
    gsrt='';
    return decodeURIComponent(instis).replace(/SRT\.srt$/g, '.SRT').replace(/VTT\.srt$/g, '.VTT').replace(/vtt\.srt$/g, '.vtt'); 
    }
    //gsrt='';
    //return decodeURIComponent(instis).replace(/SRT\.srt$/g, '.SRT').replace(/VTT\.srt$/g, '.VTT').replace(/vtt\.srt$/g, '.vtt'); 
  }
  if (gsrt != '') {
  //alert('gsrt=' + gsrt);
    if (gsrt.indexOf('=WEBVTT FILE') != -1) {
      gsrt='WEBVTT FILE' + gsrt.split('=WEBVTT FILE')[eval(-1 + gsrt.split('=WEBVTT FILE').length)];
    } else if (gsrt.indexOf('WEBVTT FILE') != -1) {
      gsrt='WEBVTT FILE' + gsrt.split('WEBVTT FILE')[eval(-1 + gsrt.split('WEBVTT FILE').length)];
    }
    if (gsrt.indexOf('1' + String.fromCharCode(10) + '0') > 0) {
      gsrt='1' + String.fromCharCode(10) + '0' + gsrt.substring(gsrt.indexOf('1' + String.fromCharCode(10) + ' 0'));
    } else if (gsrt.indexOf('1' + String.fromCharCode(10)) > 0) {
      gsrt='1' + String.fromCharCode(10) + gsrt.substring(gsrt.indexOf('1' + String.fromCharCode(10) + ' '));
    }
    //alert('GSRT=' + gsrt.replace(String.fromCharCode(10) + String.fromCharCode(10),String.fromCharCode(10)).replace(String.fromCharCode(10) + String.fromCharCode(10),String.fromCharCode(10)).replace(String.fromCharCode(10) + String.fromCharCode(10),String.fromCharCode(10)).replace(String.fromCharCode(10) + String.fromCharCode(10),String.fromCharCode(10)).replace(String.fromCharCode(10) + String.fromCharCode(10),String.fromCharCode(10)).replace(String.fromCharCode(10) + String.fromCharCode(10),String.fromCharCode(10)).replace(String.fromCharCode(10) + String.fromCharCode(10),String.fromCharCode(10)).replace(String.fromCharCode(10) + String.fromCharCode(10),String.fromCharCode(10)).replace(String.fromCharCode(10) + String.fromCharCode(10),String.fromCharCode(10)));
    gsrt=gsrt.replace(/\~/g, String.fromCharCode(10));
    stimes=[];
    etimes=[];
    stimesf=[];
    etimesf=[];
    alttimesubtitles=[];
    interimsrt=gsrt.split(' --> ');
    timesubtitles=convertSrtToText(gsrt).split(String.fromCharCode(10) + String.fromCharCode(10));
    for (it=0; it<timesubtitles.length; it++) {
    alttimesubtitles.push('');
    }
    var what='';
    for (it=1; it<timesubtitles.length; it++) {
      if (timesubtitles[it].trim().slice(-1) == '}' && timesubtitles[it].trim().indexOf('{') > 0) {
        alttimesubtitles[it]=timesubtitles[it].trim().split('{')[1].split('}')[0].split('": "')[eval(-1 + timesubtitles[it].trim().split('{')[1].split('}')[0].split('": "').length)].split('"')[0].replace(/\+/g,'%20').replace(/\%2b/g,'+'); 
        timesubtitles[it]=timesubtitles[it].split('{')[0];
      }
      what+=' ' + timesubtitles[it];
      while (what.indexOf(String.fromCharCode(10)) != -1) {
        what=what.replace(String.fromCharCode(10), ' ');
      }
      //window.open('HTTP://localhost:8888/macos_say_record.php?andsoonclose=y&docronwork=say%20' + encodeURIComponent(what), 'sayif', 'top=50,left=50,width=500,height=500');
      //what='';
    }
    //alert(what);
    console.log(timesubtitles);
    // 1\n00:00:10,500 --> 00:00:13,000\nhuh\n\n2\n00:00:13,000 --> 00:00:23,000\nhuhagain
    stimes.push(0.0);
    etimes.push(0.0);
    stimesf.push('00:00:00.000');
    etimesf.push('00:00:00.000');
    for (it=1; it<interimsrt.length; it++) {
      stimesf.push(('' + (interimsrt[eval(-1 + it)].split(String.fromCharCode(10))[eval(-1 + interimsrt[eval(-1 + it)].split(String.fromCharCode(10)).length)])).replace(',','.'));
      etimesf.push(('' + (interimsrt[eval(0 + it)].split(String.fromCharCode(10))[0])).replace(',','.'));
      stimes.push(tosecs(interimsrt[eval(-1 + it)].split(String.fromCharCode(10))[eval(-1 + interimsrt[eval(-1 + it)].split(String.fromCharCode(10)).length)]));
      etimes.push(tosecs(interimsrt[eval(0 + it)].split(String.fromCharCode(10))[0]));
    }
    //alert('' + stimes.length + '/' + etimes.length + '/' + timesubtitles.length);
    //console.warn(stimes);
    //console.warn(etimes);
    //console.warn(timesubtitles);
    
    if (!document.getElementById('mysubrip')) {
    if (eval('' + etimes.length) > 0) {
      cursubi=0;
      //alert('yes');
      setInterval(writeoutsubtitle, 100);
    }
    }
  }
  if (!document.getElementById('mysubrip')) {
  if (createdlh == '') {
     createdlh='#srt=' + encodeURIComponent(decodeURIComponent(instis).replace(/\+/g,' '));
  }
  }
  //alert('' + stimes.length + '/' + etimes.length + '/' + timesubtitles.length);
  //console.log(stimes);
  //console.log(etimes);
  //console.log(timesubtitles);
  return decodeURIComponent(instis);
 }
  
  function checkip(iois) {
       if (iois.src.indexOf('signature_signature.php') != -1) {
       var aconto = (iois.contentWindow || iois.contentDocument);
       if (aconto != null) {
       if (aconto.document) { aconto = aconto.document; }
       if (aconto.body.innerHTML.indexOf('<p>') == 0) {
         ipbit=aconto.body.innerHTML.split('<p>')[1].split('<')[0];
       }
       }
       } 
  }
function sendoff() {
   if (urlis != '') {
     //alert(urlis);
     document.getElementById('fgrid').submit();
     //location.href=urlis;
     //urlis='';
   }
}
function iframemode(inoup) {
    // ?total=9&tag=div&period=4000&from=%3ciframe src%3d%22hb11.jpg%22%3e%3c/iframe%3e&to=%3ciframe src%3d%22bb11.jpg%22%3e%3c/iframe%3e
    urlis='';
    var suff='?', total=0;
    retval=inoup;
    vidarr=inoup.split(',');
    for (var jk=0; jk<9; jk+=1) { //2) {
      if (jk < vidarr.length) {
        total++;
      } else {
        total++;
        document.getElementById('p' + eval(eval(jk + 1) / 1)).value='?total=9&tag=div&period=4' + eval(eval(jk + 1) / 1) + '00&from=&to=';
      }
    }
    for (var ik=0; ik<9; ik+=1) { //2) {
      if (ik < vidarr.length) {
        //if (urlis == '') urlis='http://www.rjmprogramming.com.au/HTMLCSS/reveal_div.php';
        if (urlis == '') urlis='//www.rjmprogramming.com.au/HTMLCSS/reveal_div.php';
        if (eval(10 + ik) < vidarr.length) {
          document.getElementById('p' + eval(eval(ik + 1) / 1)).value='?total=' + total + '&tag=div&period=4' + eval(eval(ik + 1) / 1) + '00&from=' + vidarr[ik] + '&to=' + vidarr[eval(10 + ik)];
          urlis+=suff + 'p' +  + eval(eval(ik + 1) / 1) + '=' + encodeURIComponent('?total=' + total + '&tag=div&period=4' + eval(eval(ik + 1) / 1) + '00&from=' + vidarr[ik] + '&to=' + vidarr[eval(10 + ik)]);
          suff='&';
          retval=retval.replace(vidarr[ik] + ',' + vidarr[eval(1 + ik)], '');
        } else {
          document.getElementById('p' + eval(eval(ik + 1) / 1)).value='?total=' + total + '&tag=div&period=4' + eval(eval(ik + 1) / 1) + '00&from=' + vidarr[ik] + '&to=' + vidarr[ik];
          urlis+=suff + 'p' +  + eval(eval(ik + 1) / 1) + '=' + encodeURIComponent('?total=' + total + '&tag=div&period=4' + eval(eval(ik + 1) / 1) + '00&from=' + vidarr[ik] + '&to=' + vidarr[ik]);
          suff='&';
          retval=retval.replace(vidarr[ik], '');
        }
        if (retval != '') {
          if (retval.substring(0,1) == ',') {
            retval=retval.replace(',','');
          }
        }
      }
    }
    if (retval != inoup) {
      if (retval == '') {
         setTimeout(sendoff,500);
         //document.getElementById('fgrid').submit();
      } else {
         setTimeout(sendoff,500);
         document.getElementById('fgrid').target='_blank';
         //document.getElementById('fgrid').submit();
      }
    } else {
      urlis='';
    }
    return retval;   
}
function force_next() {
  if (nexturl == '') {
  if (prevurl.indexOf('this=') != -1) {
    pgtn="Go to previous Video on the list";
    if (("" + prevvid).length > ('cGdz3GNhEQ4').length) pgtn="Go to previous Playlist on the list";
    return "<br><a target='_self' href='" + prevurl + "' title='Go to previous'>" + pgtn + "</a>";
  }
    return "<br><a target='_self' href='" + drhuh(document.referrer) + "' title='Go to previous'>Go to previous</a>";
  }
  gtn="Go to next Video on the list";
  if (("" + nextvid).length > ('cGdz3GNhEQ4').length) gtn="Go to next Playlist on the list";
  if (prevurl.indexOf('this=') != -1) {
    pgtn="Go to previous Video on the list";
    if (("" + prevvid).length > ('cGdz3GNhEQ4').length) pgtn="Go to previous Playlist on the list";
    return "<br><a target='_self' href='" + prevurl + "' title='Go to previous'>" + pgtn + "</a>" + "<br><a target='_self' href='" + nexturl + "' title='Go to next'>" + gtn + "</a>";
  }
  if (document.referrer.indexOf('this=') != -1) {
    return "<br><a target='_self' href='" + drhuh(document.referrer) + "' title='Go to previous'>Go to previous</a>" + "<br><a target='_self' href='" + nexturl + "' title='Go to next'>" + gtn + "</a>";
  }
  return "<br><a target='_self' href='" + nexturl + "' title='Go to next'>" + gtn + "</a>";
}
function etc_quality() {
  return "<br>Quality <select id=iqty onchange=' event.target.setPlaybackQuality(this.value);  '><option value='highres'>highres</option><option value='hd1080'>hd1080</option><option value='hd720'>hd720</option><option value='large'>large</option><option value='medium' selected>medium</option><option value='small'>small</option><option value='unknown'>unknown</option></select>" + force_next();
}
function etc_playbackrate() {
  return "<br>Playback Rate <select id=ipbr onchange=' event.target.setPlaybackRate(this.value);  '><option value='0.25'>x 0.25</option><option value='0.5'>x 0.5</option><option value='1.5'>x 1.5</option><option value='1' selected>x 1</option><option value='2'>x 2</option></select>" + etc_quality();
}
function etc_volume() {
  return "<br>Volume <input id=ivol onchange=' event.target.setVolume(this.value);  ' type=number min=0 max=100 step=1 value=0></input>" + etc_playbackrate();
}
function postprompt(inp) {
  if (inp == null) return "";
  if (inp.indexOf('+') != -1) iframegridmode=true;
  var oup=inp;
  while (oup.indexOf('+') != -1) {
    oup=oup.replace('+','');
  }
  while (oup.indexOf(' ') != -1) {
    oup=oup.replace(' ','');
  }
  if (oup.indexOf(';') != -1) {
    var ous=oup.split(';');
    oup=ous[eval(-1 + ous.length)];
    if (ous[0].indexOf(',') != -1) {
      var ouss=ous[0].split(',');
      vwidth=eval(ouss[0].replace('[','').replace(']',''));
      vheight=eval(ouss[1].replace('[','').replace(']',''));
      if (vwidth != 640 || vheight != 390) hone=0;
    } else {
      vwidth=eval(ous[0].replace('[','').replace(']',''));
      if (ous.length >= 3) vheight=eval(ous[1].replace('[','').replace(']',''));
      if (vwidth != 640 || vheight != 390) hone=0;
    }
  }
  if (iframegridmode) {
    oup=iframemode(oup);
  }
  return oup;
}
function offerform() {
   offerdform(hm);
}
function offerdform(howmany) {
   var iid="id=i2 onblur=\"document.getElementById('vid').value=this.value;\"";
   alert(createdlh);
   var odivc="<form id='oform' target='_self' action='./stop_start_youtube.html" + createdlh + "' method='GET'><input type='hidden' value='2' name='this'></input><input type='hidden' value='-1' name='playtime'></input><input type='hidden' value='" + vidarr[0] + "' id='vid' name='vid'></input><input id='bsubmit' type='submit' value='Play' style='display:none;'></input><br>Current Video Playing 1 of " + howmany + " <input type='text' readonly value='" + vid + "' name='next'></input> ... and then ...";
   for (var ij=2; ij<=howmany; ij++) {
     odivc+="<br>Video to Play Later " + ij + " of " + howmany + " <input " + iid + " type='text' value='" + vidarr[eval(-1 + ij)] + "' name='next" + ij + "'></input>";
     iid='';
   }
   odivc+="</form>";
   document.getElementById('dform').innerHTML = odivc;
   tobechecked=document.getElementById('i2');
}
function updatesc() {
    cnt+=one;
    cntpause+=onepause;
    if (toggle == 0) secscnt+=one;
    var ours="00" + eval(secscnt % 60);
    var ourm="00" + eval((secscnt - ours) / 60);
    suffix="#t=" + ourm.substring(eval(ourm.length - 2)) + "m" + ours.substring(eval(ours.length - 2)) + "s";
    if (presuffix != "") presuffix=suffix;
    if (eval(eval(cnt) - eval(cntpause)) >= duration && eval(duration) > 0) { // && eval(playtime) < 0) {
      if (tobechecked != null) {
          if (tobechecked.value != '') {
            document.getElementById('oform').submit();
          }
      } else if (nexturl != '') {
          if (urlis == '') location.href=nexturl;
      } else {
          secscnt=cnt;
          stopVideo();
      }
    }
}
function dolaterthis() {
  if (onestodourl != '') {
     parent.location.href=onestodourl;
     onestodourl='';
  }
}
function dothislater(afterhowlong, nexturlisthistime) {
  onestodourl=nexturlisthistime;
  setTimeout(dolaterthis, Math.floor(eval(1000 * eval(onespause + eval('' + afterhowlong)))));   
}
function drhuh(indr) {
  var outdr=indr;
  if (onestodosuffix != '') {
    var drhbits=outdr.split('&andthen=')[0].split('#')[0];
    if (prevonestodosuffix != onestodosuffix) {
        return drhbits[0] + '&andthen=' + prevonestodosuffix;
    } else {
        var nexties=onestodosuffix.split(';');
        var nextdetails=nexties[1].split(',');
        if (onestodosuffix.replace(nexties[0] + ";" + nextdetails[0],"") == '') return outdr;
        return drhbits[0] + '&andthen=' + onestodosuffix.replace(nexties[0] + ";" + nextdetails[0],"");
    }
  } 
  return outdr;
}
function fauxit(insecs) { 
  if (fauxpas_w) {
                         //alert(1987);
                           if (fauxpas_w.document.getElementById('fauxpasstartsecs' + fauxpas_w.document.getElementById('tbtheone').value)) {
                         //alert(1887);
                            if (fauxpas_w.document.getElementById('fauxpasstartsecs' + fauxpas_w.document.getElementById('tbtheone').value).value == '') {
                         //alert(1787);
                              fauxpas_w.document.getElementById('fauxpasstartsecs' + fauxpas_w.document.getElementById('tbtheone').value).value='' + insecs;
                            } else {
                              var sofararr=fauxpas_w.document.getElementById('fauxpasstartsecs' + fauxpas_w.document.getElementById('tbtheone').value).value.split(',');
                              var farsoarr=fauxpas_w.document.getElementById('fauxpasendsecs' + fauxpas_w.document.getElementById('tbtheone').value).value.split(',');
                              if (eval('' + sofararr.length) > eval('' + farsoarr.length) || fauxpas_w.document.getElementById('fauxpasendsecs' + fauxpas_w.document.getElementById('tbtheone').value).value == '') {
                                 if (fauxpas_w.document.getElementById('fauxpasendsecs' + fauxpas_w.document.getElementById('tbtheone').value).value == '') {
                                   fauxpas_w.document.getElementById('fauxpasendsecs' + fauxpas_w.document.getElementById('tbtheone').value).value='' + insecs;
                                 } else {
                                   fauxpas_w.document.getElementById('fauxpasendsecs' + fauxpas_w.document.getElementById('tbtheone').value).value+=',' + insecs;
                                 }
                              } else {
                                 fauxpas_w.document.getElementById('fauxpasstartsecs' + fauxpas_w.document.getElementById('tbtheone').value).value+=',' + insecs;
                              }
                            }
                           }
  } 
  return insecs;
}
function vslfd(inida) {
   if (inida.trim() != '') {
   //alert('0:' + fauxpas_w.document.getElementById('fauxpasstartsecs' + fauxpas_w.document.getElementById('tbtheone').value).value);
   var sofararr=fauxpas_w.document.getElementById('fauxpasstartsecs' + fauxpas_w.document.getElementById('tbtheone').value).value.split(',');
   var arrsofar=fauxpas_w.document.getElementById('fauxpas' + fauxpas_w.document.getElementById('tbtheone').value).value.split('  ,  ');
   if (fauxpas_w.document.getElementById('fauxpas' + fauxpas_w.document.getElementById('tbtheone').value).value != '') {
   //alert('1:' + fauxpas_w.document.getElementById('fauxpas' + fauxpas_w.document.getElementById('tbtheone').value).value);
   if (inida.split('#')[0] != fauxpas_w.document.getElementById('fauxpas' + fauxpas_w.document.getElementById('tbtheone').value).value.split('  ,  ')[eval(-1 + fauxpas_w.document.getElementById('fauxpas' + fauxpas_w.document.getElementById('tbtheone').value).value.split('  ,  ').length)].split('#')[0]) {
   //alert('2:' + eval('' + arrsofar.length) + ' < ' + eval('' + sofararr.length) + ' ?');
      lastfauxdef=inida;
      if (eval('' + arrsofar.length) == eval('' + sofararr.length) && fauxpas_w.document.getElementById('fauxpas' + fauxpas_w.document.getElementById('tbtheone').value).value != '') {
      fauxpas_w.document.getElementById('fauxpas' + fauxpas_w.document.getElementById('tbtheone').value).value+='  ,  ';
      if (inida.indexOf('#') != -1) {
        fauxpas_w.document.getElementById('fauxpasreally' + fauxpas_w.document.getElementById('tbtheone').value).value+='  ,  ';
      }
      }
      while (eval('' + arrsofar.length) < eval('' + sofararr.length)) {
        fauxpas_w.document.getElementById('fauxpas' + fauxpas_w.document.getElementById('tbtheone').value).value+='  ,  ';
        fauxpas_w.document.getElementById('fauxpasreally' + fauxpas_w.document.getElementById('tbtheone').value).value+='  ,  ';
        arrsofar=fauxpas_w.document.getElementById('fauxpas' + fauxpas_w.document.getElementById('tbtheone').value).value.split('  ,  ');
      }
      fauxpas_w.document.getElementById('fauxpas' + fauxpas_w.document.getElementById('tbtheone').value).value+=inida.split('#')[0];
      if (inida.indexOf('#') != -1) {
        fauxpas_w.document.getElementById('fauxpasreally' + fauxpas_w.document.getElementById('tbtheone').value).value+=inida.split('#')[1];
      }
   }
   } else {
   //alert('2:' + fauxpas_w.document.getElementById('fauxpasstartsecs' + fauxpas_w.document.getElementById('tbtheone').value).value);
      fauxpas_w.document.getElementById('fauxpas' + fauxpas_w.document.getElementById('tbtheone').value).value+=inida.split('#')[0];
      if (inida.indexOf('#') != -1) {
        fauxpas_w.document.getElementById('fauxpasreally' + fauxpas_w.document.getElementById('tbtheone').value).value+=inida.split('#')[1];
      }
   }
   }
   //alert(inida);
   return inida;
}
function lfmcs() {
      var thisvolume=-1, sofarmaxvol=0;
      if (ttt.title == lastlfmcs && ttt.title.indexOf(' mute control') != -1) {
           try {
            thisvolume=eval('' + event.target.getVolume()); 
            if (lastvolume == 0) { lastvolume=-1;  }
           } catch(thyu) {
            thisvolume=-1;
           }
           if (thisvolume > 0 && ttt.title.indexOf(' mute control') != -1) {
             if (ttt.title.indexOf('maxvol:') == -1) {
               ttt.title=ttt.title.replace(' mute control', ' maxvol:' + thisvolume + ' mute control');
               lastlfmcs=ttt.title;
             } else {
               sofarmaxvol=eval(ttt.title.split('maxvol:')[1].split(' mute control')[0]);
               if (sofarmaxvol < thisvolume) {
                 ttt.title=ttt.title.replace('maxvol:' + ttt.title.split('maxvol:')[1].split(' mute control')[0], 'maxvol:' + thisvolume);
                 lastlfmcs=ttt.title;
               }
             }
           }
      } else if (ttt.title != lastlfmcs) {
         lastlfmcs=ttt.title;
         if (lastvolume <= 0) {
           try {
            lastvolume=eval('' + event.target.getVolume()); 
            if (lastvolume == 0) { lastvolume=-1;  }
           } catch(thyu) {
            lastvolume=-1;
           }
           if (lastvolume > 0 && ttt.title.indexOf(' mute control') != -1) {
             if (ttt.title.indexOf('maxvol:') == -1) {
               ttt.title=ttt.title.replace(' mute control', ' maxvol:' + lastvolume + ' mute control');
               lastlfmcs=ttt.title;
             } else {
               sofarmaxvol=eval(ttt.title.split('maxvol:')[1].split(' mute control')[0]);
               if (sofarmaxvol < lastvolume) {
                 ttt.title=ttt.title.replace('maxvol:' + ttt.title.split('maxvol:')[1].split(' mute control')[0], 'maxvol:' + lastvolume);
                 lastlfmcs=ttt.title;
               }
             }
           }
         }
         if (ttt.title.indexOf('maxvol:') != -1) {
            maxvolume=eval(ttt.title.split('maxvol:')[1].split(' mute control')[0]);
         }
         if (lastlfmcs.indexOf('volume:') != -1) {
            if (lastlfmcs.split('volume:')[1].toLowerCase().trim().replace(/^0\%/g,'mute').replace(/^100\%/g,'unmute').indexOf('unmute') == 0) {
             if (lastvolume > 0) {
           try {
             if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
             if (confirm('Okay to unmute ' + (parent.parent.getlasttitleclicked() != '' ? parent.parent.getlasttitleclicked() : parent.document.getElementById('myh1').innerHTML) + ' ?')) {
             if (parent.document.getElementById('myh1').innerHTML.indexOf('Karaoke via ') == 0) {
             event.target.playVideo();
             }
             event.target.setVolume(lastvolume);
             //if (eval('' + lastvolume) == 0) { alert('OoPS'); }
             if (parent.document.getElementById('myh1').innerHTML.indexOf('Karaoke via ') != 0) {
             event.target.playVideo();
             }
             } else {
             setTimeout(function(){ top.donothingmute(); }, 30000);
             }
             } else {
              event.target.setVolume(lastvolume);
             }
           } catch(thyu) {
           }
             }
            } else if (lastlfmcs.split('volume:')[1].toLowerCase().trim().replace(/^0\%/g,'mute').replace(/^100\%/g,'unmute').indexOf('mute') == 0) {
             setTimeout(function(){
             if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
             if (confirm('Okay to mute ' + (parent.parent.getlasttitleclicked() != '' ? parent.parent.getlasttitleclicked() : parent.document.getElementById('myh1').innerHTML) + ' ?')) {
             if (parent.document.getElementById('myh1').innerHTML.indexOf('Karaoke via ') == 0) {
             event.target.playVideo();
             }
             event.target.setVolume(0);
             if (parent.document.getElementById('myh1').innerHTML.indexOf('Karaoke via ') != 0) {
             event.target.playVideo();
             }
             } else {
             setTimeout(function(){ top.donothingmute(); }, 30000);
             }
             } else {
             event.target.setVolume(0);
             }
             }, 200);
            } else if (('' + lastlfmcs.split('volume:')[1].toLowerCase().replace(/^\ /g,'').replace(/^\ /g,'').replace(/^\ /g,'').replace(/^1/g,'0').replace(/^2/g,'0').replace(/^3/g,'0').replace(/^4/g,'0').replace(/^5/g,'0').replace(/^6/g,'0').replace(/^7/g,'0').replace(/^8/g,'0').replace(/^9/g,'0')).indexOf('%') != -1) {
             if (('' + lastlfmcs.split('volume:')[1].toLowerCase().replace(/^\ /g,'').replace(/^\ /g,'').replace(/^\ /g,'').split(' ')[0].split(',')[0].split(';')[0].split('|')[0]) > 0) {
               if (maxvolume > 0) {
               lastvolume=eval(eval(eval('' + lastlfmcs.split('volume:')[1].toLowerCase().replace(/^\ /g,'').replace(/^\ /g,'').replace(/^\ /g,'').split(' ')[0].split(',')[0].split(';')[0].split('|')[0].split('%')[0]) / 100.0) * eval('' + maxvolume));
               if (maxvolume < lastvolume) {
                 ttt.title=ttt.title.replace('maxvol:' + ttt.title.split('maxvol:')[1].split(' mute control')[0], 'maxvol:' + lastvolume);
                 lastlfmcs=ttt.title;
                 maxvolume=lastvolume;
               }
           try {
             if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
             if (confirm('Okay to try unmute ' + (parent.parent.getlasttitleclicked() != '' ? parent.parent.getlasttitleclicked() : parent.document.getElementById('myh1').innerHTML) + ' ?')) {
             if (parent.document.getElementById('myh1').innerHTML.indexOf('Karaoke via ') == 0) {
             event.target.playVideo();
             }
             event.target.setVolume(lastvolume);
             if (parent.document.getElementById('myh1').innerHTML.indexOf('Karaoke via ') != 0) {
             event.target.playVideo();
             }
             } else {
             setTimeout(function(){ top.donothingmute(); }, 30000);
             }
             } else {
              event.target.setVolume(lastvolume);
             }
           } catch(thyu) {
           }
               }
             } else if (eval('' + lastlfmcs.split('volume:')[1].toLowerCase().replace(/^\ /g,'').replace(/^\ /g,'').replace(/^\ /g,'').split(' ')[0].split(',')[0].split(';')[0].split('|')[0].split('%')[0]) > 0) {
               lastvolume=eval('' + lastlfmcs.split('volume:')[1].toLowerCase().replace(/^\ /g,'').replace(/^\ /g,'').replace(/^\ /g,'').split(' ')[0].split(',')[0].split(';')[0].split('|')[0].split('%')[0]);
               if (maxvolume < lastvolume) {
                 ttt.title=ttt.title.replace('maxvol:' + ttt.title.split('maxvol:')[1].split(' mute control')[0], 'maxvol:' + lastvolume);
                 lastlfmcs=ttt.title;
                 maxvolume=lastvolume;
               }
           try {
             if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
             if (confirm('Okay if we try unmute ' + (parent.parent.getlasttitleclicked() != '' ? parent.parent.getlasttitleclicked() : parent.document.getElementById('myh1').innerHTML) + ' ?')) {
             if (parent.document.getElementById('myh1').innerHTML.indexOf('Karaoke via ') == 0) {
             event.target.playVideo();
             }
             event.target.setVolume(lastvolume);
             if (parent.document.getElementById('myh1').innerHTML.indexOf('Karaoke via ') != 0) {
             event.target.playVideo();
             }
             } else {
             setTimeout(function(){ top.donothingmute(); }, 30000);
             }
             } else {
              event.target.setVolume(lastvolume);
             }
           } catch(thyu) {
           }
             }
            }
         }
      } 
}
function followup() {
      var lb='', ilb=2, prevtext=' ', theon='on', thispdu='';
                   var hgx='';
                   if (window.parent) {
                    //alert(parent.document.URL);
                    if ((parent.document.URL + '~').indexOf('srt=~') != -1 || (parent.document.URL + '~').indexOf('srt' + encodeURIComponent('=') + '~') != -1) {
                      hgx='srt=';
                    }
                   }
                   if (window.top && hgx == '') {
                    //alert(parent.document.URL);
                    if ((top.document.URL + '~').indexOf('srt=~') != -1 || (top.document.URL + '~').indexOf('srt' + encodeURIComponent('=') + '~') != -1) {
                      hgx='srt=';
                    }
                   }
                   if (document.URL.slice(-4) == 'srt=' || hgx == 'srt=' || ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/srt\=$/g, '') != ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'') && ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^#/g,'') != '') {
                     if (document.getElementById('subripcommentary')) {
                      if (document.getElementById('subripcommentary').innerHTML == '') {
                        document.getElementById('subripcommentary').innerHTML='Awaiting pause for SubRip subtitles <div id=divcbi style=display:inline-block;><iframe class="spag" scrolling="no"  data-accept="text/*" id="cbi" frameborder="0" style="display:inline-block;width:173px;height:218px;margin-top:-200px;" src="/HTMLCSS/client_browsing.htm?typeJUNKhastobe=text&straightJUNKtext=y&wordJUNKing=Allimages%20images%2E%20"></iframe></div><br><textarea onblur="hgrip=massage(this.value,hgrip);" id=mysubrip></textarea>';
                        if (sdivcbi == '') { sdivcbi=document.getElementById('divcbi').innerHTML; }
                        setInterval(subripize, 1000);
                      }
                     }
                   }
      
      if (window.parent) {
         thispdu=parent.document.URL.replace(/^undefined/g,'').replace(/^null/g,'');
         if (thispdu.indexOf('#') == -1 && thispdu.indexOf('stop_start_youtube.htm') != -1) {
           thispdu+=parent.getlh();
         }
         midpre='';
         if (('' + thispdu).indexOf('WEBVTT%20FILE%0A%0A') != -1) {
           midpre='WEBVTT%20FILE%0A%0A';
         }
         gsrt=( ('' + thispdu).indexOf('=' + midpre + '1' + encodeURIComponent(String.fromCharCode(10))) != -1 ? processsrt(midpre + '1' + encodeURIComponent(String.fromCharCode(10)) + ('' + thispdu).split('=' + midpre + '1' + encodeURIComponent(String.fromCharCode(10))[1].split(encodeURIComponent(String.fromCharCode(10)) + '&')[0].split(encodeURIComponent(String.fromCharCode(10)) + '#')[0])  ).replace(/\+/g, ' ') : (('' + thispdu).toLowerCase().replace(encodeURIComponent('.') + 'vtt',encodeURIComponent('.') + 'srt').indexOf(encodeURIComponent('.') + 'srt') != -1 ? processsrt(('' + thispdu).replace(encodeURIComponent('.') + 'SRT','SRT' + encodeURIComponent('.') + 'srt').replace(encodeURIComponent('.') + 'vtt','vtt' + encodeURIComponent('.') + 'srt').replace(encodeURIComponent('.') + 'VTT','VTT' + encodeURIComponent('.') + 'srt').split(encodeURIComponent('.') + 'srt')[0].split(encodeURIComponent(String.fromCharCode(10)) + '&')[0].split(encodeURIComponent(String.fromCharCode(10)) + '#')[0]) : ''));
         delay=13;  // new idea
         if (typeof (window.parent.yesesp) == 'function') {
           yes_esp=window.parent.yesesp();
         } else if (parent.parent.document.URL) {
           if (('' + parent.parent.document.URL).indexOf('/esp_ornot_esp.') != -1) {
             yes_esp=true;
           }
         }
      }
  
  setTimeout(function(){
     if (!document.getElementById('srcif')) {
       if (window.parent) {
          if (typeof(parent.checkip) == 'function') {
            ipbit=parent.checkip(null);
          }
       }
     }
  }, 5000);
      if (ttt.title.indexOf(' mute control') != -1) {
        setInterval(lfmcs, 2000);
      }
      if (ttt.title.replace(' !important ;', ' !important;').indexOf(' ; ') != -1) {
        if (ttt.title.indexOf('!important') == -1) {
        alert("toP.document.title=" + ttt.title);
        }
      } else if (onestodoprefix != "") {   // multiple dropdown selections
        console.log('11: onestodoprefix=' + onestodoprefix + ' onestodosuffix=' + onestodosuffix);
        //var nexties=["",""], nextdetails=["",""];
        //if (onestodosuffix.indexOf(';') != -1) {
        //try {
        var nexties=onestodosuffix.split(';');
        var nextdetails=nexties[1].split(',');
        //} catch(hjgfjh) {
        //nexties=["",""];
        //nextdetails=["",""];
        //}
        //}
        onestodosuffix=onestodosuffix.replace(nexties[0] + ";" + nextdetails[0] + ",","");
        if (onestodosuffix == "") onestodoprefix="";
        prevonestodosuffix=onestodosuffix;
        theon='on';
        if (window.parent) {
          if (parent.document.URL.indexOf('c0=on') == -1) { theon='off&ezj=1'; }
        }
        dothislater(nexties[0], document.referrer.split('?')[0].split('#')[0] + "?youtubeid=" + nextdetails[0] + "&youtube_duration=" + nextdetails[1] + "&email=&email=&emoji=on&c0=" + theon + "&i0=0&j0=" + nextdetails[1] + "&i1=&j1=&i2=&j2=&i3=&j3=&i4=&j4=&i5=&j5=&i6=&j6=&i7=&j7=&i8=&j8=&i9=&j9=&i10=&j10=&i11=&j11=&i12=&j12=&i13=&j13=&i14=&j14=&i15=&j15=&i16=&j16=&i17=&j17=&i18=&j18=&i19=&j19=&i20=&j20=&i21=&j21=&i22=&j22=&i23=&j23=&i24=&j24=&i25=&j25=&i26=&j26=&i27=&j27=&i28=&j28=&i29=&j29=" + onestodoprefix + encodeURIComponent(onestodosuffix));
      }
          if (kpi == -9) {
          //alert(99);
        if (document.URL.indexOf('start=') != -1 && document.URL.indexOf('playtime=') != -1) {
          //alert(990);
        //parent.document.getElementById('myh1').innerHTML='zxkpi' + document.URL;
        if (document.URL.indexOf('start=0') == -1 || document.URL.indexOf('playtime=0') == -1) {
          //alert(9900);
            kpi=-8;
            kpi=0; //event.target.getCurrentTime();
            setTimeout(keepParentInformed,1000);
            }
            }
          }
      thistext=location.search.split('this=')[1] ? location.search.split('this=')[1].split('&')[0] : '';
      if (thistext != '') {
        of = ' ' + thistext + ' of ';
        nexttext=eval(1 + eval(thistext));
        if (nexttext >= 2) prevtext=eval(-1 + eval(thistext));
        if (("" + prevtext) == "1") prevtext="";
      } else if (document.URL.indexOf('next2=') != -1) {
        of = ' 1 of ';
        nexttext=2;
      }
      nextvid=location.search.split('next' + nexttext + '=')[1] ? location.search.split('next' + nexttext + '=')[1].split('&')[0] : '';
      if (nextvid != '') {
        //alert(nextvid + " " + 'vid=' + vid + " NEWvid=" + nextvid + " " + document.URL);
        nexturl=document.URL.replace('this=' + thistext + '&', 'this=' + nexttext + '&').replace('vid=' + vid + play_list_id, 'vid=' + nextvid);
        //alert(nexturl);
      }
      if (prevtext != ' ') {
        prevvid=location.search.split('next' + prevtext + '=')[1] ? location.search.split('next' + prevtext + '=')[1].split('&')[0] : '';
        if (prevvid != '') {
         prevurl=document.URL.replace('this=' + thistext + '&', 'this=' + prevtext + '&').replace('vid=' + vid + play_list_id, 'vid=' + prevvid);
       }
      }
      //alert(nexttext + '=nexttext nextvid=' + nextvid + ' nexturl=' + nexturl);
      if (document.URL.indexOf('next2=') != -1) {
        while (document.URL.indexOf('next' + ilb + '=') != -1) {
          ilb++;
        }
        lb=eval(ilb - 1);
        of+=lb + ' ';
      }
}
function analyzemaybe(playing, paused, isdone) {
        if (document.URL.indexOf('start=') != -1 && document.URL.indexOf('playtime=') != -1) {
        if (document.URL.indexOf('start=0') == -1 || document.URL.indexOf('playtime=0') == -1) {
        if (paused != 0) {
          var urp=parent.document.getElementById('updatethisplease');
          if (urp) {
          if (urp.value != '') {
          var urpvalue=urp.value;
          parent.document.getElementById(urpvalue).value=eval(event.target.getCurrentTime()).toFixed(3);
          if (wpwp) { if (88 == 89 || wpwp.document.getElementById('curct').innerHTML == '') {
            alert('6:' + '' + eval(event.target.getCurrentTime()).toFixed(3));
            wpwp.document.getElementById('curct').innerHTML='' + eval(event.target.getCurrentTime()).toFixed(3);
          } }
          if (urpvalue.indexOf('i') == 0) {
           urpvalue=urpvalue.replace('i','j');
           parent.document.getElementById('updatethisplease').value=urpvalue;
          } else {
           urpvalue=urpvalue.replace('j','');
           urpvalue=eval(1 + eval(urpvalue));
           urpvalue='i' + urpvalue;
           if (parent.document.getElementById(urpvalue).value == "") {
             parent.document.getElementById(urpvalue.replace('i','c')).checked=true;
           }
           parent.document.getElementById('updatethisplease').value=urpvalue;
          }
          //alert(urpvalue);
          }
          }
        }
		}
		}
}
function yeswell() {
   
   var ismedia=checkforaudio(true);
   if (ismedia) { 
     //alert('IVID=' + ivid + ' and vid=' + vid + ' and endcnt=' + endcnt + ' and urL=' + document.URL);
     return '';  
   }
   if (eval('' + endcnt) == 1) {
                   endcnt=5;
                   var sufx='';
                   var capitalloop=top.document.getElementById('listeleven').getAttribute('data-title');
                   if ((capitalloop + 'a').substring(0,1) == 'X') {
                     sufx='^' + top.document.getElementById('listeleven').innerHTML.split('^')[0].replace('  ','').replace(' ','').trim();
                   }
                   if (top.document.getElementById('listeleven').innerHTML.indexOf('^') != -1) {
                   window.top.focus();
                   sufx='';
                   //alert('pre 1');
                   top.document.getElementById('listeleven').innerHTML=top.document.getElementById('listeleven').innerHTML.replace(top.document.getElementById('listeleven').innerHTML.split('^')[0] + '^','') + sufx; //.replace(top.document.getElementById('listeleven').innerHTML.split('^')[0],'');
                   //alert('1:' + top.document.getElementById('listeleven').innerHTML);
                   //ttt.title+=' ' + top.document.getElementById('listeleven').innerHTML.toUpperCase() + ' ';
                   //if (sufx != '') { alert(top.document.getElementById('listeleven').innerHTML); }
                   //ttt.title+=' 4'; 
                   } else {
                   window.top.focus();
                   //alert('pre 2');
                   var capitalloopx=top.document.getElementById('listeleven').getAttribute('data-title');
                   sufx=top.document.getElementById('listeleven').title; //sufx.replace('^','');
                   top.document.getElementById('listeleven').innerHTML=top.document.getElementById('listeleven').innerHTML.replace(top.document.getElementById('listeleven').innerHTML.split('^')[0] + '','') + sufx; //.replace(top.document.getElementById('listeleven').innerHTML.split('^')[0],'');
                   //alert('2:' + top.document.getElementById('listeleven').innerHTML);
                   //ttt.title+=' ' + top.document.getElementById('listeleven').innerHTML.toLowerCase() + ' ';
                   if ((capitalloopx + 'a').substring(0,1) == 'X') {
                   if (top.document.emojirestart) {
                     top.document.emojirestart();
                   } else {
                   var topifs=top.document.getElementsByTagName('iframe');
                   for (var itop=0; itop<topifs.length; itop++) {
                     if (itop != -1) { topifs[itop].src=topifs[itop].src.split('&rnd=')[0] + '&rnd=' + itop + '' + Math.floor(Math.random() * 1234567); }
                   }
                   //ttt.title+=' 1'; 
                   top.document.getElementById('myh1').style.marginLeft='1px';
                   //ttt.title+='2'; 
                   window.top.scrollTo(0,0);
                   //ttt.title+='3'; 
                   }
                   }
                   }
    }
}
 
 function consolelog(inm) {
   if (window.top) {
   //alert(1);
     if (top.document.getElementById('postlist') && top.document.URL.indexOf('debug=') != -1) {
   //alert(101);
       top.document.getElementById('postlist').style.display='block'; 
       top.document.getElementById('postlist').innerHTML+='<br>' + inm;
     } else if (('' + typeof window.top.consolelog) == 'function' && top.document.URL.indexOf('debug=') != -1) {
   //alert(201);
       window.top.consolelog(inm);
     } else {
   //alert('11 ' + typeof window.top.consolelog);
       console.log(inm);
     }
   } else {
   //alert(111);
     console.log(inm);
   }
 }
</script>
</head>
  <body onload=' followup(); setInterval(updatesc,1000);' style='background-color: transparent;'>
  <form id='fgrid' method='POST' target='_self' action='//www.rjmprogramming.com.au/HTMLCSS/reveal_div.php'>
  <input style='display:none' type='submit' value='Show in Grid' id='bgrid'></input>
  <input type='hidden' value='' id='p1' name='p1'></input>
  <input type='hidden' value='' id='p2' name='p2'></input>
  <input type='hidden' value='' id='p3' name='p3'></input>
  <input type='hidden' value='' id='p4' name='p4'></input>
  <input type='hidden' value='' id='p5' name='p5'></input>
  <input type='hidden' value='' id='p6' name='p6'></input>
  <input type='hidden' value='' id='p7' name='p7'></input>
  <input type='hidden' value='' id='p8' name='p8'></input>
  <input type='hidden' value='' id='p9' name='p9'></input>
  </form>
    <!-- 1. The <iframe> (and video player) will replace this <div> tag. -->
    <div id="player"></div>
    <script>
      // 2. This code loads the IFrame Player API code asynchronously.
      var tag = document.createElement('script');
      tag.src = "https://www.youtube.com/iframe_api";
      var firstScriptTag = document.getElementsByTagName('script')[0];
      firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
      vwidth=location.search.split('width=')[1] ? eval(location.search.split('width=')[1].split('&')[0]) : vwidth;
      vheight=location.search.split('height=')[1] ? eval(location.search.split('height=')[1].split('&')[0]) : vheight;
      // 3. This function creates an <iframe> (and YouTube player)
      //    after the API code downloads.
      //var player;
      if (document.URL.indexOf('vid=') != -1) {
      vid=location.search.split('vid=')[1] ? location.search.split('vid=')[1].split('&')[0] : postprompt(prompt('Please enter YouTube video id or playlist id (or a comma separated list of these, that can include a + to have up to 18 of them occur in a parent iframe grid), and optionally prefix by [640;][390;] which is [width;][height;]', previd));
      if (vid.trim() != '') {
if (window.parent) {
                      if (top.document.URL.indexOf('/stop_start_') != -1 && ('' + top.document.URL + '~').indexOf('srt=~') != -1) {
                      //alert(5642);
                      if (top.window.opener.window.opener) {
                      //alert('5643 ' + top.window.opener.window.opener.document.URL);
                      if (top.window.opener.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                      //alert(5644);
                        fauxpas_w=top.window.opener.window.opener; //alert('fOund');
                      //alert(fauxpas_w.document.getElementById('tbtheone').value);
                      //alert(fauxpas_w.gettheone());
                      } else if (top.window.opener.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=top.window.opener.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      //alert(564);
                      if (parent.document.URL.indexOf('/karaoke_') != -1 && ('' + parent.document.URL + '~').indexOf('srt=~') != -1) {
                      //alert(5642);
                      if (parent.window.opener.window.opener) {
                      //alert(5643);
                      if (parent.window.opener.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                      //alert(5644);
                        fauxpas_w=parent.window.opener.window.opener; //alert('fOund');
                      } else if (parent.window.opener.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=parent.window.opener.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      
                      if (fauxpas_w) {
                        if (fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value)) {
                         //alert(887);
                            if (fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value).value == '') {
                         //alert(787);
                              fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value).value='' + vid;
                              if (fauxpas_w.document.URL.indexOf('/video_commentary.htm') != -1) {
                              fauxmore='  If you separate string by # we will consider this as Commentary or Note#Lead In';
                              } else {
                              fauxmore='  If you separate string by # we will consider this as Faux Pas#Actual.';
                              }
                            }
                        }
                      }
}
      if (('' + window.sessionStorage.getItem('loop_' + vid.split(',')[0])).replace(/^undefined/g,'').replace(/^null/g,'').trim() != '') {
         startagain=true;
         if (('' + window.sessionStorage.getItem('loop_' + vid.split(',')[0])).replace(/^undefined/g,'').replace(/^null/g,'').trim().toLowerCase() != 'y') {
            lastokn=eval(    ('' + window.sessionStorage.getItem('loop_' + vid.split(',')[0])).replace(/^undefined/g,'').replace(/^null/g,'').trim()      );
         }
         if (1 == 1 || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
         if (parent.parent.document.getElementById(location.hash.replace(/\#/g,''))) {
              setInterval(retry, 5000);
         }
         }
      }
      }
        vidarr=vid.split(',');
      var splaytime="";
      if (vid.indexOf(',') != -1) {
        vid=vidarr[0];
if (window.parent) {
                      if (top.document.URL.indexOf('/stop_start_') != -1 && ('' + top.document.URL + '~').indexOf('srt=~') != -1) {
                      //alert(5642);
                      if (top.window.opener.window.opener) {
                      //alert('5643 ' + top.window.opener.window.opener.document.URL);
                      if (top.window.opener.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                      //alert(5644);
                        fauxpas_w=top.window.opener.window.opener; //alert('fOund');
                      //alert(fauxpas_w.document.getElementById('tbtheone').value);
                      //alert(fauxpas_w.gettheone());
                      } else if (top.window.opener.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=top.window.opener.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      //alert(564);
                      if (parent.document.URL.indexOf('/karaoke_') != -1 && ('' + parent.document.URL + '~').indexOf('srt=~') != -1) {
                      //alert(5642);
                      if (parent.window.opener.window.opener) {
                      //alert(5643);
                      if (parent.window.opener.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                      //alert(5644);
                        fauxpas_w=parent.window.opener.window.opener; //alert('fOund');
                      } else if (parent.window.opener.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=parent.window.opener.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      
                      if (fauxpas_w) {
                        if (fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value)) {
                         //alert(887);
                            if (fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value).value == '') {
                         //alert(787);
                              fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value).value='' + vid;
                              if (fauxpas_w.document.URL.indexOf('/video_commentary.htm') != -1) {
                              fauxmore='  If you separate string by # we will consider this as Commentary or Note#Lead In';
                              } else {
                              fauxmore='  If you separate string by # we will consider this as Faux Pas#Actual.';
                              }
                            }
                        }
                      }
}
        splaytime=eval(-vidarr.length);
      } else if (urlis != '' && document.URL.indexOf('playtime=') == -1) {
        //location.href='./stop_start_youtube.html?vid=' + vid + '&playtime=-1000';
        splaytime="-1";
        oknow=false;
        setTimeout(sendoff,2000);
      } else if (vid.length > ('cGdz3GNhEQ4').length && document.URL.indexOf('playtime=') == -1) {
        if (urlis == '') location.href='./stop_start_youtube.html?vid=' + vid + '&playtime=-1000' + ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^\#$/g,'') + ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^\#$/g,'');
        splaytime="-1";
        oknow=false;
      } else if (document.URL.indexOf('start=') != -1) {
        splaytime=location.search.split('playtime=')[1] ? eval(1000.0 * eval(location.search.split('playtime=')[1].split('&')[0])) : prompt('Please enter YouTube video ' + vid + ' playtime snippets in seconds (-1 to play whole video in one session, -2 (or -n) to play whole video and perhaps more (n in total) to follow in one session).  Append # and a SubRip subtitles/captions *.srt or *.vtt filename to read and process such captioning.  Append #srt= to prompt for the creation of a SubRip subtitle or caption file data.', playtime / 1000);
        if (splaytime == null) { splaytime=''; }
        if (('' + splaytime + '~').indexOf('#srt=~') != -1) {
          location.hash='#srt=';
          splaytime=splaytime.split('#')[0];
        } else if (('' + splaytime).indexOf('#') != -1) {
          location.hash='#captionis=' + encodeURIComponent(splaytime.split('#')[1]);
          splaytime=splaytime.split('#')[0];
        }
      } else {
        splaytime=location.search.split('playtime=')[1] ? location.search.split('playtime=')[1].split('&')[0] : prompt('Please enter YouTube video ' + vid + ' playtime snippets in seconds (-1 to play whole video in one session, -2 (or -n) to play whole video and perhaps more (n in total) to follow in one session).  Append # and a SubRip subtitles/captions *.srt or *.vtt filename to read and process such captioning.  Append #srt= to prompt for the creation of a SubRip subtitle or caption file data.', playtime / 1000);
        if (splaytime == null) { splaytime=''; }
        if (('' + splaytime + '~').indexOf('#srt=~') != -1) {
          location.hash='#srt=';
          splaytime=splaytime.split('#')[0];
        } else if (('' + splaytime).indexOf('#') != -1) {
          location.hash='#captionis=' + encodeURIComponent(splaytime.split('#')[1]);
          splaytime=splaytime.split('#')[0];
        }
      }
      if (document.URL.indexOf('playtime=') != -1) {
      playtime=eval(eval("" + splaytime) * 1);
      } else if (("" + splaytime) != "-1" && ("" + splaytime).indexOf("-") == 0) {
      playtime=eval(-1 * 1000);
      hm=eval(("" + splaytime).replace('-',''))
      of=' 1 of up to ' + hm + ' ';
      if (oknow) setTimeout(offerform,2000);
      } else {
      playtime=eval(eval("" + splaytime) * 1000);
      }
      } else {
      vid=location.search.split('vid=')[1] ? location.search.split('vid=')[1].split('&')[0] : postprompt(prompt('Please enter YouTube video id or playlist id (or a comma separated list of these, that can include a + to have up to 18 of them occur in a parent iframe grid), and optionally prefix by [640;][390;] which is [width;][height;]', previd));
      if (vid.trim() != '') {
if (window.parent) {
                      if (top.document.URL.indexOf('/stop_start_') != -1 && ('' + top.document.URL + '~').indexOf('srt=~') != -1) {
                      //alert(5642);
                      if (top.window.opener.window.opener) {
                      //alert('5643 ' + top.window.opener.window.opener.document.URL);
                      if (top.window.opener.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                      //alert(5644);
                        fauxpas_w=top.window.opener.window.opener; //alert('fOund');
                      //alert(fauxpas_w.document.getElementById('tbtheone').value);
                      //alert(fauxpas_w.gettheone());
                      } else if (top.window.opener.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=top.window.opener.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      //alert(564);
                      if (parent.document.URL.indexOf('/karaoke_') != -1 && ('' + parent.document.URL + '~').indexOf('srt=~') != -1) {
                      //alert(5642);
                      if (parent.window.opener.window.opener) {
                      //alert(5643);
                      if (parent.window.opener.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                      //alert(5644);
                        fauxpas_w=parent.window.opener.window.opener; //alert('fOund');
                      } else if (parent.window.opener.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=parent.window.opener.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      
                      if (fauxpas_w) {
                        if (fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value)) {
                         //alert(887);
                            if (fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value).value == '') {
                         //alert(787);
                              fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value).value='' + vid;
                              if (fauxpas_w.document.URL.indexOf('/video_commentary.htm') != -1) {
                              fauxmore='  If you separate string by # we will consider this as Commentary or Note#Lead In';
                              } else {
                              fauxmore='  If you separate string by # we will consider this as Faux Pas#Actual.';
                              }
                            }
                        }
                      }
}
      if (('' + window.sessionStorage.getItem('loop_' + vid.split(',')[0])).replace(/^undefined/g,'').replace(/^null/g,'').trim() != '') {
         startagain=true;
         if (('' + window.sessionStorage.getItem('loop_' + vid.split(',')[0])).replace(/^undefined/g,'').replace(/^null/g,'').trim().toLowerCase() != 'y') {
            lastokn=eval(    ('' + window.sessionStorage.getItem('loop_' + vid.split(',')[0])).replace(/^undefined/g,'').replace(/^null/g,'').trim()      );
         }
         if (1 == 1 || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
         if (parent.parent.document.getElementById(location.hash.replace(/\#/g,''))) {
              setInterval(retry, 5000);
         }
         }
      }
      }
        vidarr=vid.split(',');
      var ssplaytime="";
      if (vid.indexOf(',') != -1) {
        vid=vidarr[0];
if (window.parent) {
                      if (top.document.URL.indexOf('/stop_start_') != -1 && ('' + top.document.URL + '~').indexOf('srt=~') != -1) {
                      //alert(5642);
                      if (top.window.opener.window.opener) {
                      //alert('5643 ' + top.window.opener.window.opener.document.URL);
                      if (top.window.opener.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                      //alert(5644);
                        fauxpas_w=top.window.opener.window.opener; //alert('fOund');
                      //alert(fauxpas_w.document.getElementById('tbtheone').value);
                      //alert(fauxpas_w.gettheone());
                      } else if (top.window.opener.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=top.window.opener.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      //alert(564);
                      if (parent.document.URL.indexOf('/karaoke_') != -1 && ('' + parent.document.URL + '~').indexOf('srt=~') != -1) {
                      //alert(5642);
                      if (parent.window.opener.window.opener) {
                      //alert(5643);
                      if (parent.window.opener.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                      //alert(5644);
                        fauxpas_w=parent.window.opener.window.opener; //alert('fOund');
                      } else if (parent.window.opener.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=parent.window.opener.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      
                      if (fauxpas_w) {
                        if (fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value)) {
                         //alert(887);
                            if (fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value).value == '') {
                         //alert(787);
                              fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value).value='' + vid;
                              if (fauxpas_w.document.URL.indexOf('/video_commentary.htm') != -1) {
                              fauxmore='  If you separate string by # we will consider this as Commentary or Note#Lead In';
                              } else {
                              fauxmore='  If you separate string by # we will consider this as Faux Pas#Actual.';
                              }
                            }
                        }
                      }
}
        ssplaytime=eval(-vidarr.length);
      } else if (urlis != '' && document.URL.indexOf('playtime=') == -1) {
        //location.href='./stop_start_youtube.html?vid=' + vid + '&playtime=-1000';
        ssplaytime="-1";
        oknow=false;
        setTimeout(sendoff,2000);
      } else if (vid.length > ('cGdz3GNhEQ4').length && document.URL.indexOf('playtime=') == -1) {
        if (urlis == '') location.href='./stop_start_youtube.html?vid=' + vid + '&playtime=-1000' + ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^\#$/g,'');
        ssplaytime="-1";
        oknow=false;
      } else {
        ssplaytime=location.search.split('playtime=')[1] ? location.search.split('playtime=')[1].split('&')[0] : prompt('Please enter YouTube video ' + vid + ' playtime snippets in seconds (-1 to play whole video in one session, -2 (or -n) to play whole video and perhaps more (n in total) to follow in one session).  Append # and a SubRip subtitles/captions *.srt or *.vtt filename to read and process such captioning.  Append #srt= to prompt for the creation of a SubRip subtitle or caption file data.', playtime / 1000);
        if (ssplaytime == null) { ssplaytime=''; }
        if (('' + ssplaytime + '~').indexOf('#srt=~') != -1) {
          location.hash='#srt=';
          ssplaytime=ssplaytime.split('#')[0];
        } else if (ssplaytime.indexOf('#') != -1) {
          location.hash='#captionis=' + encodeURIComponent(ssplaytime.split('#')[1]);
          ssplaytime=ssplaytime.split('#')[0];
        }
      }
      if (document.URL.indexOf('playtime=') != -1) {
      playtime=eval(eval("" + ssplaytime) * 1);
      } else if (("" + ssplaytime) != "-1" && ("" + ssplaytime).indexOf("-") == 0) {
      playtime=eval(-1 * 1000);
      hm=eval(("" + ssplaytime).replace('-',''))
      if (hm > hone) {
        anymore='&this=&width=' + vwidth + '&height=' + vheight + '&next=' + vid;
        for (var iu=2; iu<=hm; iu++) {
          anymore+='&next' + iu + '=' + vidarr[eval(-1 + iu)];
        }
      }
      of=' 1 of up to ' + hm + ' ';
      //alert(vid + " " + ssplaytime + " " + ("" + ssplaytime).indexOf("-") + " " + hm);
      if (oknow) setTimeout(offerform,2000);
      } else if (hone == 0) {
      anymore='&this=&width=' + vwidth + '&height=' + vheight + '&next=' + vid;
      playtime=eval(eval("" + ssplaytime) * 1000);
      } else {
      playtime=eval(eval("" + ssplaytime) * 1000);
      }
      if (urlis == '' && ((vid != previd && vid.indexOf(',') == -1) || vwidth != 640 || vheight != 390)) location.href='./stop_start_youtube.html?vid=' + vid + '&playtime=' + playtime + anymore + ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^\#$/g,'');
      }
      
      function onYouTubeIframeAPIReady() {
        if (vid.length > ('cGdz3GNhEQ4').length) {  
        play_list_id=vid;
        vid='';                          
        player = new YT.Player('player', {
          width: vwidth,
          height: vheight,   
          playerVars: 
          {
            listType: 'playlist',
            list:  play_list_id,
            index: 0
          },
          events: {
            'onReady': onPlayerReady,
            'onStateChange': onPlayerStateChange
          }
        });
        //event.target.playVideoAt(0);
        } else {
        console.log('' + ('' + new Date()) + ' ViD=' + vid + ' ivid=' + ivid + ' referrer=' + document.referrer + ' uRl=' + document.URL);
        var ismedia=false;
        ismedia=checkforaudio(false);
        if (!ismedia) {
        player = new YT.Player('player', {
          height: vheight,   
          width: vwidth,
          videoId: vid,
          events: {
            'onReady': onPlayerReady,
            'onStateChange': onPlayerStateChange
          }
        });
        console.log('Parent is ' + parent.document.URL);
        dovidarrv();
        }
        }
 
  
      if (document.URL.indexOf('negpos=') != -1) {
         setTimeout(function(){  
           if (3 == 5) { 
             document.body.width='200px'; 
             document.body.style.overflowX='visible';  
             document.getElementsByTagName('iframe')[0].style.zIndex='999'; 
             document.getElementsByTagName('iframe')[0].style.overflowX='visible'; 
           }  
           document.getElementsByTagName('iframe')[0].style.position='absolute'; 
           //document.body.style.zIndex='-999';   
           //document.getElementsByTagName('iframe')[0].style.zIndex='-999';  
           //parent.document.getElementById('ifhost').style.zIndex='-999'; 
           parent.document.getElementById('ifhost').style.marginLeft='-200px'; 
           document.body.onmousemove=function(event){ parent.omd(event); };
           document.body.onmouseover=function(event){ parent.omd(event); };
           document.body.onmouseout=function(event){ parent.omd(event); };
           document.body.ontouchmove=function(event){ parent.otd(event); };
           document.getElementsByTagName('iframe')[0].onmousemove=function(event){ parent.omd(event); };
           document.getElementsByTagName('iframe')[0].onmouseover=function(event){ parent.omd(event); };
           document.getElementsByTagName('iframe')[0].onmouseout=function(event){ parent.omd(event); };
           document.getElementsByTagName('iframe')[0].ontouchmove=function(event){ parent.otd(event); };
         }, 5000);
      }
      }
      
      function butellipsis(owhat) {
        var theval='', tv=0;
        if (owhat.indexOf('image/svg') != -1) { return owhat.replace(/\+/g,' ').replace('image/svg xml','image/svg+xml');   }
        if ((7 == 7 || owhat.indexOf('data:') != -1)) { // && encodeURIComponent(owhat).toLowerCase().indexOf('%e2%80%a6') != -1) {
          //alert(owhat);
          //alert(parent.document.getElementById('urlbig').value);
          if (('' + parent.document.getElementById('spareurlbig').value).indexOf('data:') != -1) {
          theval='data:' + parent.document.getElementById('spareurlbig').value.split('data:')[1];
          for (tv=1; tv<=10; tv++) {
            if (parent.document.getElementById('spareurlbig' + eval(tv % 10))) {
              if (parent.document.getElementById('spareurlbig' + eval(tv % 10)).value == theval) {
                 parent.document.getElementById('spareurlbig' + eval(tv % 10)).value='';
                 if (parent.document.getElementById('spareurlbig' + eval(eval(1 + tv) % 10))) {
                   parent.document.getElementById('spareurlbig').value=parent.document.getElementById('spareurlbig' + eval(eval(1 + tv) % 10)).value;
                   return theval;
                 }
              }
            }
          }
          return theval;
          }
          return 'data:' + parent.document.getElementById('urlbig').value.split('data:')[1];
        } else if (owhat.indexOf('data:') != -1) {
          return 'data:' + owhat.split('data:')[1];
        }
        return owhat;
      }
      
      function checkforaudio(atend) {
        var etype='audio';
        var newa=null, newv=null;
        var ismedia=false;
        var jvid=-1, numreldata=0, thisnumreldata=0, lhd='', lhds=[];
        var jv=0;
        thispt='0';
        if (document.URL.indexOf('&playtime=') != -1) {
          thispt=('' + decodeURIComponent(document.URL.split('&playtime=')[1].split('&')[0].split('#')[0]));
          //alert(thispt + ' ' + duration);
          while (parent.document.getElementById('j' + jv)) {
             if (parent.document.getElementById('j' + jv).value == thispt) {
              if (jvid == -1) {
               if (parent.document.getElementById('i' + jv).value.indexOf('data') == 0) {
               jvid=jv;
               thisnumreldata=numreldata;
               }
              } else {
               //alert('OoPs');
               jvid=-2;
              }
             }
             if (parent.document.URL.indexOf(encodeURIComponent('i' + jv + '=data')) != -1 && (parent.document.URL.indexOf(encodeURIComponent('i' + jv + '=data&')) == -1 && parent.document.URL.indexOf(encodeURIComponent('i' + jv + '=data#')) == -1)) {
              numreldata++;
             } else if (parent.document.URL.indexOf('i' + jv + '=data') != -1 && (parent.document.URL.indexOf('i' + jv + '=data&') == -1 && parent.document.URL.indexOf('i' + jv + '=data#') == -1)) {
              numreldata++;
             }
             jv++;
          }
          if (jvid >= 0) {
          //alert('Yes ' + atend + ' ' + jvid + ' thispt=' + thispt);
             if ((parent.document.URL.indexOf('i' + jvid + '=data') != -1 || parent.document.URL.indexOf(encodeURIComponent('i' + jvid + '=data')) != -1)) {
             //alert('audio ');
      if (parent.document.URL.indexOf('c' + jvid + '=on') != -1 || parent.document.URL.indexOf(encodeURIComponent('c' + jvid + '=on')) != -1) {
             //alert('auDio ');
            
      if (parent.document.URL.indexOf(encodeURIComponent('c' + jvid + '=on')) != -1) {
        if (parent.document.URL.split(encodeURIComponent('i' + jvid + '='))[1].split(encodeURIComponent('&'))[0].split(encodeURIComponent('#'))[0].indexOf('video') != -1) {
          etype='video';
        } else if (parent.document.URL.split(encodeURIComponent('i' + jvid + '='))[1].split(encodeURIComponent('&'))[0].split(encodeURIComponent('#'))[0].indexOf('image') != -1) {
          etype='img';
        }
      } else if (parent.document.URL.indexOf('c' + jvid + '=on') != -1) {
        if (parent.document.URL.split('i' + jvid + '=')[1].split('&')[0].split('#')[0].indexOf('video') != -1) {
          etype='video';
        } else if (parent.document.URL.split('i' + jvid + '=')[1].split('&')[0].split('#')[0].indexOf('image') != -1) {
          etype='img';
        }
      } else if (parent.document.URL.indexOf(encodeURIComponent('c' + jvid + '=on')) != -1) {
        if (parent.document.URL.split(encodeURIComponent('i' + jvid + '='))[1].split(encodeURIComponent('&'))[0].split(encodeURIComponent('#'))[0].indexOf('video') != -1) {
          etype='video';
        } else if (parent.document.URL.split(encodeURIComponent('i' + jvid + '='))[1].split(encodeURIComponent('&'))[0].split(encodeURIComponent('#'))[0].indexOf('image') != -1) {
          etype='img';
        }
      } else if (parent.document.URL.indexOf(encodeURIComponent('c' + jvid + '=on')) != -1) {
        if (parent.document.URL.split(encodeURIComponent('i' + jvid + '='))[1].split(encodeURIComponent('&'))[0].split(encodeURIComponent('#'))[0].indexOf('image') != -1) {
          etype='img';
        }
      } else if (parent.document.URL.indexOf('c' + jvid + '=on') != -1) {
        if (parent.document.URL.split('i' + jvid + '=')[1].split('&')[0].split('#')[0].indexOf('image') != -1) {
          etype='img';
        }
      } else if (parent.document.URL.indexOf(encodeURIComponent('c' + jvid + '=on')) != -1) {
        if (parent.document.URL.split(encodeURIComponent('i' + jvid + '='))[1].split(encodeURIComponent('&'))[0].split(encodeURIComponent('#'))[0].indexOf('image') != -1) {
          etype='img';
        }
      }
      newa=document.createElement(etype);
      if (etype == 'img') {
      newa.onload=function(event){
        etg=event.target;
        if (parent.document.URL.indexOf(encodeURIComponent('c' + eval(1 + jvid) + '=on')) != -1 || parent.document.URL.indexOf(('c' + eval(1 + jvid) + '=on')) != -1) {
        setTimeout(function(){   setTimeout(function(){ if (parent.getnim()) {  parent.setnim(false); } parent.queuenext();  }, eval(eval('' + thispt) * 1000));  }, 300);
        } else {
        if (parent.document.getElementById('loopchk')) {
        if (parent.document.getElementById('loopchk').checked) {
        setTimeout(function(){   setTimeout(function(){ if (parent.getnim()) {  parent.setnim(false); } parent.queuenext();  }, eval(eval('' + thispt) * 1000));  }, 300);
        } else {
        setTimeout(function(){  setTimeout(function(){ if (parent.getnim()) {  parent.setnim(false); }  }, eval(eval('' + thispt) * 1000));  }, 300);
        }
        } else {
        setTimeout(function(){  setTimeout(function(){ if (parent.getnim()) {  parent.setnim(false); }  }, eval(eval('' + thispt) * 1000));  }, 300);
        }
        }
      };
      } else {
      newa.onloadedmetadata=function(event){
        etg=event.target;
        if (parent.document.URL.indexOf(encodeURIComponent('c' + eval(1 + jvid) + '=on')) != -1 || parent.document.URL.indexOf(('c' + eval(1 + jvid) + '=on')) != -1) {
        setTimeout(function(){ etg.play();  setTimeout(function(){ if (parent.getnim()) {  parent.setnim(false); } parent.queuenext();  }, eval(eval('' + thispt) * 1000));  }, 300);
        } else {
        if (parent.document.getElementById('loopchk')) {
        if (parent.document.getElementById('loopchk').checked) {
        setTimeout(function(){ etg.play();  setTimeout(function(){ if (parent.getnim()) {  parent.setnim(false); } parent.queuenext();  }, eval(eval('' + thispt) * 1000));  }, 300);
        } else {
        setTimeout(function(){ etg.play();  setTimeout(function(){ if (parent.getnim()) {  parent.setnim(false); }  }, eval(eval('' + thispt) * 1000));  }, 300);
        }
        } else {
        setTimeout(function(){ etg.play();  setTimeout(function(){ if (parent.getnim()) {  parent.setnim(false); }  }, eval(eval('' + thispt) * 1000));  }, 300);
        }
        }
        //alert('played');
      };
      }
      //newa.onload=function(event){
      //  etg=event.target;
      //  setTimeout(function(){ etg.play(); alert(564); }, 900);
      //};
      //if (parent.document.URL.indexOf('#') != -1) {
      //   alert(parent.document.URL.indexOf(encodeURIComponent('i' + jvid + '=data')));
      //   alert(parent.document.URL.indexOf(encodeURIComponent('i' + jvid + '=data&')));
      //   alert(parent.document.URL.indexOf(encodeURIComponent('i' + jvid + '=data#')));
      //}
      
      if (parent.document.URL.indexOf('#') != -1 && parent.document.URL.indexOf(encodeURIComponent('i' + jvid + '=data')) != -1 && (parent.document.URL.indexOf(encodeURIComponent('i' + jvid + '=data&')) == -1 && parent.document.URL.indexOf(encodeURIComponent('i' + jvid + '=data#') == -1))) {
      lhd=decodeURIComponent(decodeURIComponent(parent.document.URL.split('#')[1])).replace(/\ /g,'+');
      lhds=lhd.split('data:');
      //alert('lhds.length=' + lhds.length + ' and thisnumreldata=' + thisnumreldata);
      if (eval('' + lhds.length) >= eval(1 + eval('' + thisnumreldata))) {
             //alert('AuDiO ' + atend + ' data:' + lhds[eval(1 + eval('' + thisnumreldata))].replace(/\ /g,'+').split('&')[0].split('#')[0]);
             ismedia=true;
      //alert('1a:' + lhds[eval(1 + eval('' + thisnumreldata))].replace(/\ /g,'+').split('&')[0].split('#')[0]);
      //alert('1b:' + lhds[eval(1 + eval('' + thisnumreldata))].replace(/\ /g,'+').split('&')[0].split('#')[0].slice(-20));
        newa.src=butellipsis('data:' + lhds[eval(1 + eval('' + thisnumreldata))].replace(/\ /g,'+').split('&')[0].split('#')[0]);
        parent.document.getElementById('i' + jvid).value=newa.src;
        duration=eval('' + thispt);
        //if (('' + top.document.URL).indexOf('/select_palette.') != -1) {
        //  alert('987:' + duration);
        //}
        if (parent.document.getElementById('preareyousinging')) {
          parent.document.getElementById('preareyousinging').innerHTML+='<br><' + etype.replace('video', 'video autoplay ') + ' type=' + etype.replace('img','image') + '/' + newa.src.split('/')[1].split(';')[0].split(',')[0].split('+')[0] + ' src="' + newa.src + ('" controls></' + etype).replace('" controls></img','"></img') + '><br>';
          //pwo=parent.window.open('','_blank','top=50,left=50,width=600,height=600');
          //pwo.document.write('<html><body>' + '<br><' + etype.replace('video', 'video autoplay ') + ' type=' + etype + '/' + newa.src.split('/')[1].split(';')[0].split(',')[0] + ' src="' + newa.src + '" controls></' + etype + '><br>' + '</body></html>');
        }
      }
      } else if (parent.document.URL.indexOf('#') != -1 && parent.document.URL.indexOf('i' + jvid + '=data') != -1 && (parent.document.URL.indexOf('i' + jvid + '=data&') == -1 && parent.document.URL.indexOf('i' + jvid + '=data#') == -1)) {
      //alert(11);
      lhd=decodeURIComponent(parent.document.URL.split('#')[1]).replace(/\ /g,'+');
      lhds=lhd.split('data:');
      //alert('lHds.length=' + lhds.length + ' and thisnumreldata=' + thisnumreldata);
      if (eval('' + lhds.length) >= eval(1 + eval('' + thisnumreldata))) {
             //alert('AudiO ' + 'data:' + lhds[eval(1 + eval('' + thisnumreldata))].replace(/\ /g,'+').split('&')[0].split('#')[0]);
             ismedia=true;
        newa.src=butellipsis('data:' + lhds[eval(1 + eval('' + thisnumreldata))].replace(/\ /g,'+').split('&')[0].split('#')[0]);
        parent.document.getElementById('i' + jvid).value=newa.src;
        duration=eval('' + thispt);
        //if (('' + top.document.URL).indexOf('/select_palette.') != -1) {
        //  alert('1987:' + duration);
        //}
        if (parent.document.getElementById('preareyousinging')) {
          parent.document.getElementById('preareyousinging').innerHTML+='<br><' + etype.replace('video', 'video autoplay ') + ' type=' + etype.replace('img','image') + '/' + newa.src.split('/')[1].split(';')[0].split(',')[0].split('+')[0] + ' src="' + newa.src + ('" controls></' + etype).replace('" controls></img','"></img') + '><br>';
          //pwo=parent.window.open('','_blank','top=50,left=50,width=600,height=600');
          //pwo.document.write('<html><body>' + '<br><' + etype.replace('video', 'video autoplay ') + ' type=' + etype + '/' + newa.src.split('/')[1].split(';')[0].split(',')[0] + ' src="' + newa.src + '" controls></' + etype + '><br>' + '</body></html>');
        }
      }
      } else if (decodeURIComponent(parent.document.URL.split('i' + jvid + '=')[1].split('&')[0].split('#')[0]).replace(/\ /g,'+') != 'data') {
      //alert(111);
             //alert('Audio ' + decodeURIComponent(parent.document.URL.split('i' + jvid + '=')[1].split('&')[0].split('#')[0]).replace(/\ /g,'+'));
             ismedia=true;
        newa.src=butellipsis(decodeURIComponent(parent.document.URL.split('i' + jvid + '=')[1].split('&')[0].split('#')[0]).replace(/\ /g,'+'));
        parent.document.getElementById('i' + jvid).value=newa.src;
        duration=eval('' + thispt);
        //if (('' + top.document.URL).indexOf('/select_palette.') != -1) {
        //  alert('2987:' + duration);
        //}
        if (parent.document.getElementById('preareyousinging')) {
          parent.document.getElementById('preareyousinging').innerHTML+='<br><' + etype.replace('video', 'video autoplay ') + ' type=' + etype.replace('img','image') + '/' + newa.src.split('/')[1].split(';')[0].split(',')[0].split('+')[0] + ' src="' + newa.src + ('" controls></' + etype).replace('" controls></img','"></img') + '><br>';
          //pwo=parent.window.open('','_blank','top=50,left=50,width=600,height=600');
          //pwo.document.write('<html><body>' + '<br><' + etype.replace('video', 'video autoplay ') + ' type=' + etype + '/' + newa.src.split('/')[1].split(';')[0].split(',')[0] + ' src="' + newa.src + '" controls></' + etype + '><br>' + '</body></html>');
        }
      }
      }
             }
          }
        }
        
        return ismedia;
      }
      
      function dovidarrv() {
        if (parent.document.URL.indexOf('#http') != -1 && (!lookedat || eval('' + vidarrv.length) == 0)) {
        //alert('yes1');
          lookedat=true;
          if (parent.document.URL.toLowerCase().indexOf('&unknowndur=y') != -1 || parent.document.URL.split('#')[0].split('//')[1].split('&unknowndur=')[0] == decodeURIComponent(parent.document.URL.split('#')[1]).split('&unknowndur=')[0].split('&loop')[0].split('&name')[0].split('//')[1]) {
        //alert('yes2');
             if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) || parent.document.URL.toLowerCase().indexOf('&unknowndur=y') != -1) {
         //alert('yes3');
              comeval=parent.getcomingurl();
              if (comeval == '' && parent.document.URL.toLowerCase().indexOf('&unknowndur=y') != -1) {
                comeval=parent.document.URL;
              }
               if (comeval != '') {
         //alert('yes4');
               //alert(1);
                 parent.unsetieo();
               //alert(11);
                 firstdelay=eval(eval(parent.document.URL.split('&j0=')[1].split('&')[0].split('#')[0]) - eval(parent.document.URL.split('&i0=')[1].split(';')[0].split('&')[0].split('#')[0]));
               //alert(firstdelay);
                 ivid=0;
                 ismobileplaylistplay=true;
                 //  vidarr=[], vidstarts=[], viddurs=[], viddos=[]
                 //setTimeout(function(){
                 for (var iipp=0; iipp<=29; iipp++) {
                    if (parent.document.URL.indexOf('youtubeid=') != -1 && iipp == 0) {
                      vidarrv.push(parent.document.URL.split('youtubeid=')[1].split('&')[0].split('#')[0]);
                      console.log(vidarrv);
                      vidstarts.push(parent.neweval(parent.document.URL.split('&i' + iipp + '=')[1].split('&')[0].split('#')[0]));
                      if (parent.document.URL.indexOf('&c' + iipp + '=on') != -1) { 
                        viddos.push(true);
                      } else if (parent.document.URL.indexOf('&c' + iipp + '=off') != -1) { 
                        viddos.push(false);
                      } else {
                        viddos.push(false);
                      }
                      viddurs.push(parent.document.URL.split('&j' + iipp + '=')[1].split('&')[0].split('#')[0]);
                      if (1 == 4) {
                      event.target.cueVideoById(
                           vidarrv[eval(-1 + vidarrv.length)], 
                           eval('' + vidstarts[eval(-1 + vidstarts.length)]),
                           eval(eval('' + viddurs[eval(-1 + viddurs.length)]) - eval('' + vidstarts[eval(-1 + vidstarts.length)])),
                           "medium");
                      }
                      if (parent.document.URL.indexOf('&unknowndur=') != -1 && document.URL.indexOf('&playtime=0') == -1) {
                      setTimeout(function(){ if (document.URL.indexOf('&playtime=0') == -1) { nextvidi=1; } }, 5000);
                      }
                    } else if (parent.document.URL.indexOf('&i' + iipp + '=') != -1 && parent.document.URL.indexOf('&i' + iipp + '=&') == -1 && parent.document.URL.indexOf('&i' + iipp + '=#') == -1) { 
                       //if (parent.document.URL.indexOf('&unknowndur=') != -1) {
                       //   alert('huh9=');
                       //}
                      if (parent.document.URL.indexOf('&unknowndur=') != -1) {
                      ivid=0;   // was 0
                      setTimeout(function(){ if (document.URL.indexOf('&playtime=0') == -1) { nextvidi=1; } }, 5000);
                      } else {
                      ivid=1;
                      }
                      vidstarts.push(parent.neweval(parent.document.URL.split('&i' + iipp + '=')[1].split('&')[0].split('#')[0]));
                      //alert(vidstarts[eval(-1 + vidstarts.length)]);
                      vidarrv.push(parent.newereval(parent.document.URL.split('&i' + iipp + '=')[1].split('&')[0].split('#')[0]));
                      console.log(vidarrv);
                      if (parent.document.URL.indexOf('&c' + iipp + '=on') != -1) { 
                        viddos.push(true);
                      } else if (parent.document.URL.indexOf('&c' + iipp + '=off') != -1) { 
                        viddos.push(false);
                      } else {
                        viddos.push(false);
                      }
                      viddurs.push(parent.document.URL.split('&j' + iipp + '=')[1].split('&')[0].split('#')[0]);
   //alert(viddurs[eval(-1 + viddurs.length)]);
                      if (viddos[eval(-1 + viddos.length)] && viddurs[eval(-1 + viddurs.length)].replace(/^0/g,'') != '') {
   //alert('event.target.cueVideoById(' + vidarrv[eval(-1 + vidarrv.length)] + ',' + eval('' + vidstarts[eval(-1 + vidstarts.length)]) + ',' + eval(eval('' + viddurs[eval(-1 + viddurs.length)]) - eval('' + vidstarts[eval(-1 + vidstarts.length)])) + ');');
                        if (1 == 4) {
                        try {
                        event.target.cueVideoById(
                           vidarrv[eval(-1 + vidarrv.length)], 
                           eval('' + vidstarts[eval(-1 + vidstarts.length)]),
                           eval(eval('' + viddurs[eval(-1 + viddurs.length)]) - eval('' + vidstarts[eval(-1 + vidstarts.length)])),
                           "medium");
                        } catch(errsd) { alert(errsd.message);  }
                        }
   //alert('event.target.cueVideoById(' + vidarrv[eval(-1 + vidarrv.length)] + ',' + eval('' + vidstarts[eval(-1 + vidstarts.length)]) + ',' + eval(eval('' + viddurs[eval(-1 + viddurs.length)]) - eval('' + vidstarts[eval(-1 + vidstarts.length)])) + ');');
                      }
                      
                    }
                 }
                 //alert('vidarrv.length=' + vidarrv.length);
                 //alert('found! looping ' + parent.getlooping());
                 setInterval(lookforparentcues, 100);
                 //}, 4000);
               }         
             }
          }
        }
              }
              
      function halfway(givid,gvid,gviddurs,gtitle) {
        var iivid=givid, ggvid=gvid, retval='', bmaybe=true, gggvid=gvid;
        var kkk=0;
        while (parent.document.getElementById('i' + kkk)) {
          if (parent.document.getElementById('c' + kkk).checked) {
            if (kkk == 0) { parent.document.getElementById('xx0').style.backgroundColor='lightgreen'; }
            if (bettervalue(kkk,parent.document.getElementById('i' + kkk).value).indexOf(gvid) != -1) {
              if (kkk == 0 && ('' + parent.document.getElementById('i' + eval(0 + kkk)).title).indexOf(' tap/click ') == -1) {
              setTimeout(function(){
              //alert('0:' + parent.document.getElementById('myh1').innerHTML);
              parent.document.getElementById('i0').title=placeholderis(0, '' + parent.document.getElementById('myh1').innerHTML.replace(/\&\;/g,'&') + ' ... double tap/click to jump to this');
              }, 4000);
              }
              if (kkk > 1 && parent.document.getElementById('c1')) {
                if (parent.document.getElementById('c1').checked && parent.document.getElementById('i1').value.replace(',','|').replace('!','|').replace('@','|').replace('#','|').indexOf('|') != -1) {
                  if (parent.document.getElementById('j1').value.indexOf('2222') == -1 && (parent.document.getElementById('j1').value + '0').substring(0,1) != '0') {
                  if (parent.document.getElementById('i1').title.indexOf(' tap/click ') != -1) {
                if (window.parent && 1 == 1) {
                if (parent.window.opener) {
                  if (typeof parent.window.opener.setvurl == 'function') {
                    parent.window.opener.setvurl(parent.document.getElementById('i1').value.substring(2).slice(-11), parent.document.getElementById('i1').title.split(' ...')[0], parent.document.getElementById('j1').value);
                  }
                }
                }
                  }
                  }
                }
              }
              iivid=kkk;
              setTimeout(function(){
              //parent.document.getElementById('youtubeid').value='' + gvid;
              //parent.document.getElementById('youtube_duration').value='' + gviddurs;
              parent.document.getElementById('i' + eval(-1 + iivid)).placeholder='' + gtitle;
              parent.document.getElementById('j' + eval(-1 + iivid)).value=gviddurs;
              parent.document.getElementById('i' + eval(-1 + iivid)).title=placeholderis(eval(-1 + iivid), '' + gtitle.replace(/\&\;/g,'&') + ' ... double tap/click to jump to this');
              parent.document.getElementById('i' + eval(-1 + iivid)).setAttribute('data-index', '' + eval(-1 + iivid));
              parent.document.getElementById('i' + eval(-1 + iivid)).setAttribute('data-title', '' + gtitle);
              parent.document.getElementById('i' + eval(-1 + iivid)).ondblclick=function(event){ parent.setforcemix(event.target.getAttribute('data-index')); parent.mixitup(parentdocumentURL,true);  ttt.title=event.target.getAttribute('data-title');  };
              if (parent.document.getElementById('xx' + eval(-1 + iivid))) {
                parent.document.getElementById('xx' + eval(-1 + iivid)).style.backgroundColor='lightgreen';
              }
              try {
                var xds='' + player.getDuration();
                stduration=eval(xds);
                if (xds != 'undefined') {
                parent.document.getElementById('j' + eval(-1 + iivid)).value='' + xds;
                viddurs[eval(-1 + iivid)]='' + xds;
                parent.document.getElementById('youtube_duration').value='' + xds;
                //alert(xds);
                if (parent.document.getElementById('youtubeid').value == gvid) {
                  parent.document.getElementById('youtube_duration').value='' + xds;
                }
                parentdocumentURL=parentdocumentURL.replace('&j' + eval(-1 + iivid) + '=22221', '&j' + eval(-1 + iivid) + '=' + xds).replace(encodeURIComponent('&j' + eval(-1 + iivid) + '=22221'), encodeURIComponent('&j' + eval(-1 + iivid) + '=' + xds));
                if (window.parent && 1 == 1) {
                if (parent.window.opener) {
                  if (typeof parent.window.opener.setvurl == 'function') {
                    parent.window.opener.setvurl(gvid, gtitle, xds);
                  }
                }
                }
                }
              } catch(ghtr) {  }
              }, 5000);
            } else if (kkk == 0 && bettervalue(kkk,parent.document.getElementById('i' + eval(0 + kkk)).value).replace(',','|').replace('!','|').replace('@','|').replace('#','|').indexOf('|') != -1) {
              ggvid=parent.document.URL.split('youtubeid=')[1].split('&')[0];              
              if (('' + parent.document.getElementById('i' + eval(0 + kkk)).title).indexOf(' tap/click ') == -1) {
              setTimeout(function(){
              //alert('0:' + parent.document.getElementById('myh1').innerHTML);
              parent.document.getElementById('i0').title='' + parent.document.getElementById('myh1').innerHTML.replace(/\&\;/g,'&') + ' ... double tap/click to jump to this';
              }, 4000);
              parent.document.getElementById('i' + eval(0 + kkk)).setAttribute('data-index', '0');
              //parent.document.getElementById('i' + eval(0 + kkk)).setAttribute('data-title', '' + gtitle);
              if (parent.document.URL.indexOf('#http') != -1) {
              if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
              parent.document.getElementById('i' + eval(0 + kkk)).ondblclick=function(event){   parent.location.href=parentdocumentURL;   };
              } else {
              parent.document.getElementById('i' + eval(0 + kkk)).ondblclick=function(event){  if (parent.window.opener.document.getElementById('awowowo')) {   parent.window.opener.document.getElementById('awowowo').click(); parent.location.href=parent.document.URL.split('?')[0].split('#')[0]; } else { parentdocumentURL='' + document.URL.split(':')[0] + ':' + decodeURIComponent(parent.document.URL.split('#http')[1]).replace(/^s\:/g,'').replace(/^\:/g,'').split('&loop')[0] + '#http' + parent.document.URL.split('#http')[1];  parent.location.href=parentdocumentURL; }     };
              }
              } else {
              parent.document.getElementById('i' + eval(0 + kkk)).ondblclick=function(event){  if (parent.window.opener.document.getElementById('awowowo')) { parent.window.opener.document.getElementById('awowowo').click(); parent.location.href=parent.document.URL.split('?')[0].split('#')[0]; } else {  parent.location.href=parentdocumentURL; }  };
              }
              }
              
              if (window.parent && 1 == 1) {
                if (parent.window.opener) {
                  if (typeof parent.window.opener.setvurl == 'function') {
                    parent.window.opener.setvurl(ggvid, parent.document.getElementById('myh1').innerHTML, parent.document.getElementById('youtube_duration').value);
                  }
                }
              }
              
              var kkkk=kkk;
              kkkk++;
              while (parent.document.getElementById('i' + eval(0 + kkkk))) {
              if (('' + parent.document.getElementById('i' + eval(0 + kkkk)).title).indexOf(' tap/click ') == -1 && bettervalue(kkkk,parent.document.getElementById('i' + eval(0 + kkkk)).value).replace(',','|').replace('!','|').replace('@','|').replace('#','|').indexOf('|') != -1) {
              gggvid=bettervalue(kkkk,parent.document.getElementById('i' + eval(0 + kkkk)).value).substring(2).slice(-11);
              if (window.parent) {
              if (parent.window.opener) {
                  if (typeof parent.window.opener.getvresults == 'function') {
                    retval=('' + parent.window.opener.getvresults(gggvid)).replace('||','');
                    if (retval.trim().indexOf('|') != -1) {
                      parent.document.getElementById('j' + eval(0 + kkkk)).value='' + retval.trim().split('|')[0];
                      parent.document.getElementById('i' + eval(0 + kkkk)).title=placeholderis(eval(0 + kkkk),'' + retval.split(retval.split('|')[0] + '|' + retval.split('|')[1] + '|')[1].replace(/\&\;/g,'&') + ' ... double tap/click to jump to this');
                      parent.document.getElementById('i' + eval(0 + kkkk)).setAttribute('data-index', '' + eval(0 + kkkk));
                      parent.document.getElementById('i' + eval(0 + kkkk)).setAttribute('data-title', '' + retval.split(retval.split('|')[0] + '|' + retval.split('|')[1] + '|')[1]);
                      parent.document.getElementById('i' + eval(0 + kkkk)).ondblclick=function(event){ parent.setforcemix(event.target.getAttribute('data-index')); parent.mixitup(parentdocumentURL,true);  ttt.title=event.target.getAttribute('data-title');  };
                    }
                  }
              }
              }
              }
              kkkk++;
              }
              
              
            } else if (bettervalue(kkk,parent.document.getElementById('i' + eval(0 + kkk)).value).replace(',','|').replace('!','|').replace('@','|').replace('#','|').indexOf('|') != -1) {
              ggvid=bettervalue(kkk,parent.document.getElementById('i' + eval(0 + kkk)).value).substring(2).slice(-11);
              bmaybe=true;
              if (('' + parent.document.getElementById('i' + eval(0 + kkk)).title).indexOf(' tap/click ') == -1) {
              if (window.parent) {
              if (parent.window.opener) {
                  if (typeof parent.window.opener.getvresults == 'function') {
                    retval=('' + parent.window.opener.getvresults(ggvid)).replace('||','');
                    if (retval.trim().indexOf('|') != -1) {
                      parent.document.getElementById('j' + eval(0 + kkk)).value='' + retval.trim().split('|')[0];
                      parent.document.getElementById('i' + eval(0 + kkk)).title=placeholderis(eval(0 + kkk),'' + retval.split(retval.split('|')[0] + '|' + retval.split('|')[1] + '|')[1].replace(/\&\;/g,'&') + ' ... double tap/click to jump to this');
                      parent.document.getElementById('i' + eval(0 + kkk)).setAttribute('data-index', '' + eval(0 + kkk));
                      parent.document.getElementById('i' + eval(0 + kkk)).setAttribute('data-title', '' + retval.split(retval.split('|')[0] + '|' + retval.split('|')[1] + '|')[1]);
                      parent.document.getElementById('i' + eval(0 + kkk)).ondblclick=function(event){ parent.setforcemix(event.target.getAttribute('data-index')); parent.mixitup(parentdocumentURL,true);  ttt.title=event.target.getAttribute('data-title');  };
                      bmaybe=false;
                    }
                  }
              }
              }
              if (bmaybe) {
              parent.document.getElementById('i' + eval(0 + kkk)).title=placeholderis(eval(0 + kkk), 'YouTube video ' + ggvid + ' ... double click/tap to jump to this');
              parent.document.getElementById('i' + eval(0 + kkk)).setAttribute('data-index', '' + eval(0 + kkk));
              //parent.document.getElementById('i' + eval(0 + kkk)).setAttribute('data-title', '' + gtitle);
              parent.document.getElementById('i' + eval(0 + kkk)).ondblclick=function(event){ parent.setforcemix(event.target.getAttribute('data-index')); parent.mixitup(parentdocumentURL,true);   };
              }
              }
            }
          }
          kkk++;
        }
        if (eval('' + vidarrv.length) > 0) {
          if (parent.document.getElementById('i' + eval(-1 + vidarrv.length))) {
            if (parent.document.getElementById('i' + eval(-1 + vidarrv.length)).outerHTML.indexOf(' data-value') != -1) {
               if (parent.document.getElementById('i' + eval(-1 + vidarrv.length)).outerHTML.indexOf(' data-done') == -1) {
                 parent.document.getElementById('i' + eval(-1 + vidarrv.length)).setAttribute('data-done', 'y');
                 setInterval(togglevalue, 8000);
               }
            }
          }
        }
        return gtitle;
      }
      
      function togglevalue() {
        for (var iig=0; iig<vidarrv.length; iig++) {
          if (parent.document.getElementById('i' + eval(-1 + vidarrv.length)).value == '') {
            if (iig == 0 && ('' + parent.document.getElementById('i' + iig).getAttribute('data-value')).replace(/^null/g,'').replace(/^undefined/g,'') == '') {
              parent.document.getElementById('i' + iig).setAttribute('data-value', '0');
              parent.document.getElementById('i0').placeholder=parent.document.getElementById('i0').title;
            }
            parent.document.getElementById('i' + iig).value=parent.document.getElementById('i' + iig).getAttribute('data-value');
          } else {
            parent.document.getElementById('i' + iig).value='';
          }
        }
      }
      
      function bettervalue(isuffix, valuemaps) {
         var altvmaps='';
         if (valuemaps == '' && parent.document.getElementById('i' + isuffix)) {
           altvmaps=('' + parent.document.getElementById('i' + isuffix).getAttribute('data-value')).replace(/^undefined/g,'').replace(/^null/g,'');
           if (altvmaps != '') {  return altvmaps; }
         }
         return valuemaps;
      }
      
      function placeholderis(isuffix, titlemaps) {
         if (parent.document.getElementById('i' + isuffix)) {
           parent.document.getElementById('i' + isuffix).placeholder=titlemaps;
         }
         if (parent.document.getElementById('i' + isuffix).outerHTML.indexOf(' data-value') == -1) {
           //if (parent.document.getElementById('i' + eval(-1 + vidarrv.length)).outerHTML.indexOf(' data-done') != -1) {
           //  alert('whY with ' + '' + bettervalue(isuffix,parent.document.getElementById('i' + isuffix).value));
           //}
           parent.document.getElementById('i' + isuffix).setAttribute('data-value', '' + bettervalue(isuffix,parent.document.getElementById('i' + isuffix).value));
         } else if (('' + parent.document.getElementById('i' + isuffix).getAttribute('data-value')) != ('' + parent.document.getElementById('i' + isuffix).value)) {
           //if (parent.document.getElementById('i' + eval(-1 + vidarrv.length)).outerHTML.indexOf(' data-done') != -1) {
           //  alert('why with ' + '' + bettervalue(isuffix,parent.document.getElementById('i' + isuffix).value));
           //}
           var bv=bettervalue(isuffix,parent.document.getElementById('i' + isuffix).value);
           parent.document.getElementById('i' + isuffix).removeAttribute('data-value');
           parent.document.getElementById('i' + isuffix).setAttribute('data-value', '' + bv);
         }
         if (isuffix > 0) {
           if (parent.document.getElementById('i0').outerHTML.indexOf(' data-value') == -1) {
             if (parent.document.getElementById('i0').title.indexOf('click') != -1 && parent.document.getElementById('i0').title.indexOf('tap') != -1) {
                placeholderis(0, parent.document.getElementById('i0').title);
             }
           }
         }
         return titlemaps;
      }
      
      function preparentlook() {
        return '';
        firstdelay=-1;
        if (ivid < eval('' + vidarrv.length)) {
        //alert('0:' + ivid);
           if (oktoivid) {
           while (!parent.document.getElementById('c' + ivid).checked) {
                       //if (parent.document.URL.indexOf('&unknowndur=') != -1) {
                       //   alert('huh1=');
                       //}
             ivid++;
             if (ivid >= eval('' + vidarrv.length)) {
              if (!parent.document.getElementById('loopchk')) {
               ivid=-1;
              } else if (parent.document.getElementById('loopchk').checked) {
               ivid=0;
              } else {
               ivid=-1;
              }
             }
           }
           }
        //alert('00:' + ivid);
           if (ivid >= 0) {
        //alert('000:' + ivid + ' ' + vidarrv[ivid]);
            event.target.cueVideoById(vidarrv[ivid], eval('' + vidstarts[ivid]), eval(eval('' + viddurs[ivid]) - eval('' + vidstarts[ivid])), "medium");
            if (firstdelay < 0) {
              firststdone=false;
              firstdelay=eval(eval('' + viddurs[eval(eval(1 + ivid) % viddurs.length)]) - eval('' + vidstarts[eval(eval(1 + ivid) % vidstarts.length)]));
            }
            event.target.playVideo();
           }
                       //if (parent.document.URL.indexOf('&unknowndur=') != -1) {
                       //   alert('huh2=');
                       //}
           ivid++;
           if (ivid >= eval('' + vidarrv.length)) {
               ivid=0;
           }
           if (ivid < eval('' + vidarrv.length)) {
        //alert(eval(1000 *  eval(eval('' + viddurs[ivid]) - eval('' + vidstarts[ivid]))));
              if ('sadnews' == 'sadnews') {
              if (firstdelay < 0) {
              firststdone=false;
              firstdelay=eval(eval('' + viddurs[ivid]) - eval('' + vidstarts[ivid]));
              }
              } else {
              setTimeout(preparentlook, eval(1000 *  eval(eval('' + viddurs[ivid]) - eval('' + vidstarts[ivid]))));
              }
           }
        }
      }
      
      function dowpwo() {
                if (window.parent && 1 == 1) {
                if (parent.window.opener) {
                  if (typeof parent.window.opener.setvurl == 'function') {
                    parent.window.opener.setvurl(parent.document.getElementById('youtubeid').value, parent.document.getElementById('myh1').innerHTML, parent.document.getElementById('youtube_duration').value);
                  }
                }
                }
      }
      
      function lookforparentcues() {
        return '';
        var thisorder=parent.getcue();
        if (thisorder != '') {
          parent.setcue('');
          if (thisorder == 'startagain') {
            for (var iipp=0; iipp<vidarrv.length; iipp++) {
              if (ipp == 0) {
                event.target.cueVideoById(vidarr[ipp], eval('' + vidstarts[0]), eval(eval('' + viddurs[ipp]) - eval('' + vidstarts[ipp])), "medium");
              } else {
                event.target.cueVideoById(vidarr[ipp], eval('' + vidstarts[ipp]), eval(eval('' + viddurs[ipp]) - eval('' + vidstarts[ipp])), "medium");
              }
            }
          }
          event.target.playVideo();
        }
      }
      // 4. The API will call this function when the video player is ready.
      function onPlayerReady(event) {
           var oktoplay=true;
           //if (('' + top.document.URL).indexOf('/select_palette.') != -1) {
           //  alert('apr');
           //}
           if (document.URL.indexOf('start=0') != -1 && document.URL.indexOf('playtime=0') != -1) {
           if (parent.document.getElementById('youtube_duration')) {
           if (parent.document.getElementById('youtube_duration').value != "") {
           if (parent.document.getElementById('myh1')) {
           //if (('' + top.document.URL).indexOf('/select_palette.') != -1) {
           //  alert('apr not ok');
           //}
            parent.document.getElementById('myh1').innerHTML=halfway(ivid,vid,parent.document.getElementById('youtube_duration').value,event.target.getVideoData().title);
            oktoplay=false;
           }
           }
           }
           }
        if (oktoplay) {
         event.target.playVideo();
        toggle=eval(1 - toggle);
           if (window.parent) {
            if (parent.document.getElementById('youtube_duration')) {
           if (parent.document.getElementById('youtube_duration').value.indexOf("22222.") == 0) { // || ('' + top.document.URL).indexOf('/select_palette.') != -1) {  // new loosening
             if (('' + parent.document.getElementById('youtube_duration').title) == '') {
             parent.document.getElementById('youtube_duration').title=vid;
             parent.document.getElementById('youtube_duration').setAttribute('data-vid', '' + vid);
             if (document.URL.indexOf('but=y') == -1) {
             event.target.mute();
             mletter='M';
             uletter='u';
             } else {
             event.target.unMute();
             mletter='m';
             uletter='U';
             }
             //setTimeout(function(){ event.target.unMute();  }, 2000);
             parent.document.getElementById('youtube_duration').value="22222.0100";
             //event.target.stopVideo();
             //alert('245 ' + parent.document.getElementById('youtube_duration').title + '?');
             } else {
             event.target.unMute();
             }
             }
             }
           }
        if (play_list_id != '' && play_list_id.length > ('cGdz3GNhEQ4').length && document.URL.indexOf('playtime=') != -1) {
          //window.open('./stop_start_youtube.html','_blank');
          //location.href=event.target.getVideoUrl();
          var yturlis=event.target.getVideoUrl();
          if (document.URL.indexOf('nowo=') == -1 && urlis == '') window.open(yturlis,'_blank','top=50,left=650,width=700,height=800');
        }
        }
      }
      // 5. The API calls this function when the player's state changes.
      //    The function indicates that when playing a video (state=1),
      //    the player should play for six seconds and then stop.
      var done = false;
      function onPlayerStateChange(event) {
        var sgoes=0, previvid=0;
        one=0;
        onepause=0;
        if (window.top) {
         if (top.document.getElementById('listeleven') && eval('' + vid.trim().length) == 11 || ismobileplaylistplay) {
           if (top.document.getElementById('listeleven').innerHTML != '' || ismobileplaylistplay) {
             if (top.document.getElementById('listeleven').innerHTML.indexOf(vid + '##') != -1 || ismobileplaylistplay) {
               if (top.document.getElementById('listeleven').innerHTML.indexOf(vid + '##') < 11 || ismobileplaylistplay) {
                 if (event.data == YT.PlayerState.PLAYING) {
          if (wpwp) { if (88 == 88 || wpwp.document.getElementById('curct').innerHTML == '') {
            //alert('269:' + '' + eval(event.target.getCurrentTime()).toFixed(3));
            wpwp.document.getElementById('curct').innerHTML='' + eval(event.target.getCurrentTime()).toFixed(3);
          } }
                   isnotplaying=false;
                   if (wpp) {
                     if (wpp.document.getElementById('diaudiov')) {
                       if (wpp.document.getElementById('diaudiov').outerHTML.indexOf(' class="') != -1) {
                         wpp.document.getElementById('diaudio').innerHTML=wpp.document.getElementById('diaudiov').outerHTML.replace(' class="loop autoplay"', '').replace('hidden;','visible;display:inline-block;');
                         wpp.document.getElementById('diaudio').style.display='inline-block';
                       }
                     }
                   }
                   if (enforcedtimeis < 0.0) { enforcedtimeis=0.0;  }
                   var okt=true;
                   previvid=ivid;
                   if (ismobileplaylistplay) {
                     if (firstdelay < 0) {
                        firstdelay=eval(eval(parent.document.URL.split('&j0=')[1].split('&')[0].split('#')[0]) - eval(parent.document.URL.split('&i0=')[1].split(';')[0].split('&')[0].split('#')[0]));
                     }
                     if (!firststdone) { 
              if (('' + parent.document.getElementById('i0').title).indexOf(' tap/click ') == -1) {
              setTimeout(function(){
              parent.document.getElementById('i0').title=placeholderis(0, '' + parent.document.getElementById('myh1').innerHTML.replace(/\&\;/g,'&') + ' ... double tap/click to jump to this');
              parent.document.title='' + parent.document.getElementById('myh1').innerHTML.replace(/\&\;/g,'&');
              }, 4000);
              }
                       //if (parent.document.URL.indexOf('&unknowndur=') != -1) {
                       //   alert('firstdelay=' + firstdelay);
                       //}
                       firststdone=true; 
                       setTimeout(preparentlook, eval(1000 * firstdelay)); 
        if (parent.document.getElementById('shufflechk') && !firstshuffle) {
          if (parent.document.getElementById('shufflechk').checked) {
        console.log('1:' + lastshuffle + ' ' + vidarrv.length);
        console.log(11);
            dovidarrv();
            if (oktoivid) {
            firstshuffle=true;
            ivid=eval(Math.floor(Math.random() * 198675643) % Math.max(1,eval('' + vidarrv.length)));
        console.log('ivid=' + ivid);
            sgoes=0;
            while (!parent.document.getElementById('c' + ivid).checked || ivid == lastshuffle) {
              ivid=eval(Math.floor(Math.random() * 198675643) % Math.max(1,eval('' + vidarrv.length)));
        console.log('IVID=' + ivid);
              sgoes++;
              if (sgoes > 100) { lastshuffle=-1;  }
            }
            lastshuffle=ivid;
            }
        console.log('lastshuffle=' + lastshuffle);
          }
        }
        console.log('034:' + ' nextvidi=' + nextvidi);
        if (nextvidi >= 0) { ivid=nextvidi; nextvidi=-2;  } //else { alert('oops=' + nextvidi);  }
        console.log('IviD=' + ivid);
        console.log('134:' + lastshuffle + ' previvid=' + previvid + ' nextvidi=' + nextvidi);
                    if (ivid != 0 || lastshuffle == 0) {
                    if (lastshuffle == 0 && ivid == 0) {
                    if (previvid == 0) {
                    if (parent.document.getElementById('j0').value.indexOf('2222') != 0 && ismobileplaylistplay) {
                        if (parent.window.opener.document.getElementById('awowowo')) {   
                          atnextend=true; //parent.window.opener.document.getElementById('awowowo').click(); 
                        } 
                    }
                    }
                    parent.document.getElementById('xx0').style.backgroundColor='lightgreen';
                    vid=vidarrv[ivid];
            secscnt='' + eval('' + vidstarts[ivid]);
            enforcedtimeis=eval('' + vidstarts[ivid]);
            vidarr=vid.split(',');      
            playtime=eval(eval('' + viddurs[ivid]) - eval('' + vidstarts[ivid]));
            if (previvid != 0 && oktoivid) {
            event.target.loadVideoById(vidarrv[ivid], eval('' + vidstarts[ivid]), eval(eval('' + viddurs[ivid]) - eval('' + vidstarts[ivid])));
            } else if (atnextend) {
            //alert('66:' + vidarrv[ivid] + ' vs ' + vidarrv[8]);
            event.target.loadVideoById(vidarrv[eval(-1 + vidarrv.length)], eval('' + vidstarts[eval(-1 + vidarrv.length)]), eval(eval('' + viddurs[eval(-1 + vidarrv.length)]) - eval('' + vidstarts[eval(-1 + vidarrv.length)])));
            setTimeout(function(){ placeholderis(eval(-1 + vidarrv.length), parent.document.getElementById('myh1').innerHTML + ' ... double tap/click to jump to this'); parent.document.getElementById('xx' + eval(-1 + vidarrv.length)).style.backgroundColor='lightgreen'; }, 3000);
            }
            oktoivid=false;
            if (atnextend) {
            setTimeout(function(){ oktoivid=true; }, 7900);
            parent.document.getElementById('youtubeid').value=vidarrv[eval(-1 + vidarrv.length)];
            parent.document.getElementById('youtube_duration').value='' + viddurs[eval(-1 + vidarrv.length)];
            //alert('6:' + vid + ' of ' + vidarrv.length);
            } else {
            if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
            setTimeout(function(){ oktoivid=true; }, 29900);
            } else {
            setTimeout(function(){ oktoivid=true; }, 8900); // was 1900
            }
            parent.document.getElementById('youtubeid').value=vid;
            parent.document.getElementById('youtube_duration').value='' + viddurs[ivid];
            }
            setTimeout(function(){ if (atnextend) {  parent.document.getElementById('youtube_duration').value='' + player.getDuration(); parent.document.getElementById('j' + eval(-1 + vidarrv.length)).value=parent.document.getElementById('youtube_duration').value;  parent.document.getElementById('i' + eval(-1 + vidarrv.length)).title='' + parent.document.getElementById('myh1').innerHTML.replace(/\&\;/g,'&') + ' ... double tap/click to jump to this';  dowpwo();  } else { parent.document.getElementById('myh1').innerHTML=halfway(ivid,vid,viddurs[ivid],event.target.getVideoData().title); ttt.title=event.target.getVideoData().title; } }, 6000);
                    } else {
                    //setTimeout(function(){
            vid=vidarrv[ivid];
            secscnt='' + eval('' + vidstarts[ivid]);
            enforcedtimeis=eval('' + vidstarts[ivid]);
            vidarr=vid.split(',');      
            playtime=eval(eval('' + viddurs[ivid]) - eval('' + vidstarts[ivid]));
            if (oktoivid) {
            event.target.loadVideoById(vidarrv[ivid], eval('' + vidstarts[ivid]), eval(eval('' + viddurs[ivid]) - eval('' + vidstarts[ivid])));
            }
            oktoivid=false;
            setTimeout(function(){ oktoivid=true; }, 8900);  // was 1900
            //if (atnextend) {
              //alert('7:' + vid);
            //}
      //      parent.document.getElementById('youtubeid').value=vid;
      //      parent.document.getElementById('youtube_duration').value='' + viddurs[ivid];
            setTimeout(function(){ parent.document.getElementById('myh1').innerHTML=halfway(ivid,vid,viddurs[ivid],event.target.getVideoData().title); ttt.title=event.target.getVideoData().title; }, 2000);
                     //}, 3000);
                     }
                     }
                     }
                   }
                   if (eval('' + endcnt) <= 0) { endcnt=1; }
                   consolelog('playing event.data=' + event.data + ' was=' + top.document.getElementById('listeleven').innerHTML);
                   //if (top.document.getElementById('listeleven').innerHTML.indexOf(vid + '##') == 0) {
                     top.document.getElementById('listeleven').innerHTML=' ' + top.document.getElementById('listeleven').innerHTML.replace(' ',' ').trim();
                   consolelog('Playing event.data=' + event.data + ' is=' + top.document.getElementById('listeleven').innerHTML);
                   //} else if (top.document.getElementById('listeleven').innerHTML.indexOf(vid + '##') == 2) {
                   //  top.document.getElementById('listeleven').innerHTML=' ' + top.document.getElementById('listeleven').innerHTML.trim();
                   //}
                   if (lastshuffle < 0) { lastshuffle=ivid; }
                 } else if (event.data == YT.PlayerState.PAUSED) {
           if (wpwp) { if (8 == 8 || wpwp.document.getElementById('curct').innerHTML == '') {
            wpwp.document.getElementById('curct').title='';
            //alert('169:' + ' ' + eval(event.target.getCurrentTime()).toFixed(3) + ' to ' + wpwp.document.getElementById('curct').innerHTML);
          } }
                    isnotplaying=true;
                    //alert('Why');
                    consolelog('paused event.data=' + event.data + ' was=' + top.document.getElementById('listeleven').innerHTML);
                  endcnt=2;
                   //alert('paused event.data=' + event.data);
                   //if (top.document.getElementById('listeleven').innerHTML.indexOf(vid + '##') == 0) {
                     top.document.getElementById('listeleven').innerHTML='  ' + top.document.getElementById('listeleven').innerHTML.replace(' ',' ').trim();
                    consolelog('Paused event.data=' + event.data + ' is=' + top.document.getElementById('listeleven').innerHTML);
                   //} else if (top.document.getElementById('listeleven').innerHTML.indexOf(vid + '##') == 1) {
                   //  top.document.getElementById('listeleven').innerHTML='  ' + top.document.getElementById('listeleven').innerHTML.trim();
                   //}
                   //alert(document.URL);
                   var hgx='';
                   if (window.parent) {
                    //alert(parent.document.URL);
                    if ((parent.document.URL + '~').indexOf('srt=~') != -1 || (parent.document.URL + '~').indexOf('srt' + encodeURIComponent('=') + '~') != -1) {
                      hgx='srt=';
                    }
                   }
                   if (window.top && hgx == '') {
                    //alert(parent.document.URL);
                    if ((top.document.URL + '~').indexOf('srt=~') != -1 || (top.document.URL + '~').indexOf('srt' + encodeURIComponent('=') + '~') != -1) {
                      hgx='srt=';
                    }
                   }
                   if (document.URL.slice(-4) == 'srt=' || hgx == 'srt=' || ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/srt\=$/g, '') != ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'') && ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^#/g,'') != '') {
                     if (document.getElementById('subripcommentary')) {
                      if (document.getElementById('subripcommentary').innerHTML == '') {
                        document.getElementById('subripcommentary').innerHTML='Awaiting pause for SubRip subtitles <div id=divcbi style=display:inline-block;><iframe class="spag" scrolling="no" data-accept="text/*" id="cbi" frameborder="0" style="display:inline-block;width:173px;height:218px;margin-top:-200px;" src="/HTMLCSS/client_browsing.htm?typeJUNKhastobe=text&straightJUNKtext=y&wordJUNKing=Allimages%20images%2E%20"></iframe></div><br><textarea onblur="hgrip=massage(this.value,hgrip);" id=mysubrip></textarea>';
                        if (sdivcbi == '') { sdivcbi=document.getElementById('divcbi').innerHTML; }
                        setInterval(subripize, 1000);
                      }
                     }
                     hgans='';
                     var xsecscnt=fauxit(eval(event.target.getCurrentTime()).toFixed(3));
          if (wpwp) { if (88 == 89 || wpwp.document.getElementById('curct').innerHTML == '') {
            alert('66:' + '' + eval(event.target.getCurrentTime()).toFixed(3));
            wpwp.document.getElementById('curct').innerHTML='' + eval(event.target.getCurrentTime()).toFixed(3);
          } }
                     // hgrip='', lasthgriprec='';
                     if (hgrip == '') {
                       if (window.opener) {
                      
                      //alert(4);
                      if (window.opener.window.opener) {
                      //alert(5);
                      if (window.opener.document.URL.indexOf('/karaoke_') != -1 && ('' + window.opener.document.URL + '~').indexOf('srt=~') != -1) {
                      //alert(51);
                      if (window.opener.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                      //alert(52);
                        fauxpas_w=window.opener.window.opener; //alert('yEs FounD');
                      } else if (window.opener.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=window.opener.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      
                           if (window.opener.document.getElementById('stduration')) {
                             window.opener.document.getElementById('stduration').innerHTML='' + fromsecs(stduration) + '#' + vid;
                           }
                       }
                       if (window.top) {
                       //alert('Top');
                         if (top.document.getElementById('stduration')) {
                           top.document.getElementById('stduration').innerHTML='' + fromsecs(stduration) + '#' + vid;
                         } else if (window.parent) {
                       //alert('ParenT');
                           if (parent.document.getElementById('stduration')) {
                             parent.document.getElementById('stduration').innerHTML='' + fromsecs(stduration) + '#' + vid;
                           }
                         }
                       } else if (window.parent) {
                       //alert('Parent');
                      if (window.parent) {
                      if (parent.document.URL.indexOf('/karaoke_') != -1 && ('' + parent.document.URL + '~').indexOf('srt=~') != -1) {
                      if (parent.window.opener) {
                      if (parent.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                        fauxpas_w=parent.window.opener; //alert('Found');
                      } else if (parent.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=parent.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      }
                           if (parent.document.getElementById('stduration')) {
                             parent.document.getElementById('stduration').innerHTML='' + fromsecs(stduration) + '#' + vid;
                           }
                       }
                       document.getElementById('subtitlegoeshere').title='Captions and subtitles';
                       hgans=prompt('Enter optional from ' + fromsecs(0.0) + ' to now caption (and if used, delimited by ~~~~) to ' + fromsecs(xsecscnt) + ' and a caption for from this point until your next pause ... where ~~ represents a line feed.  Idea can be to enter all captions (delimited by ~~~~) now and do several pause(s) to time them.' + fauxmore, nextfauxdef());
                       if (hgans == null) { 
                         hgans='';  
                       }
                       if (hgans.trim() != '') {
                         fauxdef=hgans;
                       } else {
                         fauxdefcnt++;
                       }
                       if (hgans.indexOf('~~~~') != -1) {
                         if (fauxpas_w) {
                         if (fauxpas_w.document.getElementById('fauxpasstartsecs' + fauxpas_w.document.getElementById('tbtheone').value)) {
                           if (fauxpas_w.document.getElementById('fauxpasstartsecs' + fauxpas_w.document.getElementById('tbtheone').value).value != '') {
                             fauxpas_w.document.getElementById('fauxpasendsecs' + fauxpas_w.document.getElementById('tbtheone').value).value=fauxpas_w.document.getElementById('fauxpasstartsecs' + fauxpas_w.document.getElementById('tbtheone').value).value;
                             fauxpas_w.document.getElementById('fauxpasstartsecs' + fauxpas_w.document.getElementById('tbtheone').value).value='0.001,' + fauxpas_w.document.getElementById('fauxpasendsecs' + fauxpas_w.document.getElementById('tbtheone').value).value;
                           }
                         }
                         }
                         fauxdef=vslfd(hgans.split('~~~~')[0]);
                         //alert(fauxdef);
                         fauxdef=vslfd(hgans.split('~~~~')[1]);
                         //alert(fauxdef);
                         fauxdefcnt+=2;
                         if (fauxpas_w) {
                         //alert(987);
                           if (fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value)) {
                         //alert(887);
                            if (fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value).value == '') {
                         //alert(787);
                              fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value).value='' + vid;
                            }
                           }
                         } 
                         hgrip='WEBVTT FILE' + String.fromCharCode(10) + String.fromCharCode(10) + '1' + String.fromCharCode(10) + fromsecs(0.0) + ' --> ' + fromsecs(xsecscnt) + String.fromCharCode(10) + hgans.split('~~~~')[0].replace(/\~\~/g, String.fromCharCode(10)) + String.fromCharCode(10) + String.fromCharCode(10) + '2' + String.fromCharCode(10) + fromsecs(xsecscnt) + ' --> youllneverfindthis' + String.fromCharCode(10) + hgans.split('~~~~')[1].replace(/\~\~/g, String.fromCharCode(10));
 //alert('10:' + hgrip);
                         if (eval('' + hgans.split('~~~~').length) > 2) {
                         hgcnt=3;
                         document.getElementById('subtitlegoeshere').title='Captions and subtitles ... "<strong>' + hgans.split('~~~~')[2].replace(/\~\~/g, String.fromCharCode(10)) + '</strong>" should <strong>start</strong> where you next pause.';
                         for (var jjarrhg=2; jjarrhg<hgans.split('~~~~').length; jjarrhg++) {
                           fauxdefcnt++;
                           hgrip+='' + String.fromCharCode(10) + String.fromCharCode(10) + hgcnt + String.fromCharCode(10) + 'youllneverfindthis' + ' --> youllneverfindthis' + String.fromCharCode(10) + hgans.split('~~~~')[jjarrhg].replace(/\~\~/g, String.fromCharCode(10));
                           hgcnt++;
                         }
                         } else {
                         hgcnt=3;
                         document.getElementById('subtitlegoeshere').title='Captions and subtitles ... "<strong>' + hgans.split('~~~~')[1].replace(/\~\~/g, String.fromCharCode(10)) + '</strong>" should <strong>end</strong> where you next pause or get video to finish.';
                         }
                       } else if (hgans != '') {
                         //fauxdef=vslfd(hgans);
                         fauxdef=vslfd(hgans); 
                         fauxdefcnt++;
                         if (fauxpas_w) {
                         //alert(1987);
                           if (fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value)) {
                         //alert(1887);
                            if (fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value).value == '') {
                         //alert(1787);
                              fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value).value='' + vid;
                            }
                           }
                         } 
                         hgrip='WEBVTT FILE' + String.fromCharCode(10) + String.fromCharCode(10) + '1' + String.fromCharCode(10) + fromsecs(xsecscnt) + ' --> youllneverfindthis' + String.fromCharCode(10) + hgans.split('~~~~')[0].replace(/\~\~/g, String.fromCharCode(10));
 //alert('11:' + hgrip);
                         document.getElementById('subtitlegoeshere').title='Captions and subtitles ... "<strong>' + hgans.split('~~~~')[0].replace(/\~\~/g, String.fromCharCode(10)) + '</strong>" should <strong>end</strong> where you next pause or get video to finish.';
                         hgcnt=2;
                       }
                     } else {
                       if (eval('' + hgrip.split('youllneverfindthis').length) > 2) {
                       hgrip=hgrip.replace('youllneverfindthis', '' + fromsecs(xsecscnt));
                       hgrip=hgrip.replace('youllneverfindthis', '' + fromsecs(xsecscnt));
                       document.getElementById('subtitlegoeshere').title='Captions and subtitles ... "<strong>' + hgrip.split('youllneverfindthis' + String.fromCharCode(10))[1].split('~~~~')[0].replace(/\~\~/g, String.fromCharCode(10)) + '</strong>" should <strong>end</strong> where you next pause or get video to finish.';
                       } else {
                       hgans=prompt('Enter caption for period from ' + fromsecs(xsecscnt) + ' until your next pause ... where ~~ represents a line feed.  As required more than the one caption (delimited by ~~~~) can be entered here then do several pause(s) to time them.  Entering nothing and clicking OK finishes up.' + fauxmore, nextfauxdef());
                       if (hgans == null) { 
                         hgans='';  
                         fauxdefcnt++;
                       } else if (hgans == '') {
                         fauxdefcnt++;
                         hgrip=hgrip.replace('youllneverfindthis', '' + fromsecs(xsecscnt));
                         if (eval('' + hgrip.split('youllneverfindthis').length) == 1) { //   Entering nothing and clicking OK finishes up.
                           endgame();
                         }
                       }
                       if (hgans != '') {
                         //fauxdef=vslfd(hgans);
                         fauxdef=vslfd(hgans); 
                         fauxdefcnt++;
                         hgrip=hgrip.replace('youllneverfindthis', '' + fromsecs(xsecscnt));
 //alert('12:' + hgrip);
                         hgrip+='' + String.fromCharCode(10) + String.fromCharCode(10) + hgcnt +  String.fromCharCode(10) + fromsecs(xsecscnt) + ' --> youllneverfindthis' + String.fromCharCode(10) + hgans.split('~~~~')[0].replace(/\~\~/g, String.fromCharCode(10));
 //alert('13:' + hgrip);
                         hgcnt++;
                         if (eval('' + hgans.split('~~~~').length) >= 2) {
                         for (var jjjarrhg=1; jjjarrhg<hgans.split('~~~~').length; jjjarrhg++) {
                           fauxdefcnt++;
                           hgrip+='' + String.fromCharCode(10) + String.fromCharCode(10) + hgcnt + String.fromCharCode(10) + 'youllneverfindthis' + ' --> youllneverfindthis' + String.fromCharCode(10) + hgans.split('~~~~')[jjjarrhg].replace(/\~\~/g, String.fromCharCode(10));
                           hgcnt++;
                         }
                         } else {
                         document.getElementById('subtitlegoeshere').title='Captions and subtitles ... "<strong>' + hgans.split('~~~~')[0].replace(/\~\~/g, String.fromCharCode(10)) + '</strong>" should <strong>end</strong> where you next pause or get video to finish.';
                         } 
                       }
                       }
                     }
                   }
                 } else if (event.data == YT.PlayerState.ENDED) {
                    if (hgans.trim() != '' && hgrip != '') {  
                      hgrip=hgrip.replace('youllneverfindthis', '' + fromsecs(eval(event.target.getCurrentTime()))); 
          if (wpwp) { if (88 == 89 || wpwp.document.getElementById('curct').innerHTML == '') {
            //alert('666:' + '' + eval(event.target.getCurrentTime()).toFixed(3));
            wpwp.document.getElementById('curct').innerHTML='' + eval(event.target.getCurrentTime()).toFixed(3);
          } }
                      hgans='';
                      if (window.opener) {
                      
                      if (window.opener.window.opener) {
                      if (window.opener.document.URL.indexOf('/karaoke_') != -1 && ('' + window.opener.document.URL + '~').indexOf('srt=~') != -1) {
                      if (window.opener.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                        fauxpas_w=window.opener.window.opener; //alert('yes FoUnD');
                      } else if (window.opener.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=window.opener.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      
                      if (window.opener.document.URL.indexOf('/karaoke_') != -1) {
                        location.hash='#srt=' + encodeURIComponent(hgrip);
                        if (window.opener.document.URL.indexOf('youtubeid=') == -1) {
                        window.opener.location.href=window.opener.document.URL.split('#')[0].replace('srt=','').replace('?','?youtubeid=' + vid + '&') + '#srt=' + encodeURIComponent(hgrip);
                        hgrip='';
                        } else {
                        window.opener.location.href=window.opener.document.URL.split('#')[0].replace('srt=','').replace('?','?rand=' + Math.floor(Math.random() * 3456) + '&') + '#srt=' + encodeURIComponent(hgrip);
                        hgrip='';
                        }
                      } 
                      }                      
                      if (window.parent) {
                      if (parent.document.URL.indexOf('/karaoke_') != -1 && ('' + parent.document.URL + '~').indexOf('srt=~') != -1) {
                      if (parent.window.opener) {
                      if (parent.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                        fauxpas_w=parent.window.opener; //alert('founD');
                      } else if (parent.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=parent.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      
                      if (parent.document.URL.indexOf('/karaoke_') != -1) {
                        location.hash='#srt=' + encodeURIComponent(hgrip);
                        parent.location.href=parent.document.URL.split('#')[0].replace('srt=','').replace('?','?rand=' + Math.floor(Math.random() * 3456) + '&') + '#srt=' + encodeURIComponent(hgrip);
                        hgrip='';
                      } else if (parent.document.URL.indexOf('/stop_start') != -1) {
                        parent.location.href=parent.document.URL.split('?')[0].split('#')[0].replace('srt=','').replace('.html','.html?vid=' + vid + ('&playtime=' + stduration).replace('&playtime=undefined','&playtime=' + duration)) + '#srt=' + encodeURIComponent(hgrip);
                        hgrip='';
                      }
                      } else {
                        location.hash='#srt=' + encodeURIComponent(hgrip);
                        hgrip='';
                      }
                    }
                    isnotplaying=true;
                   //alert('prehere');
                   //alert('ivid=' + ivid + ' vid=' + vid);
                   if (atnextend) {
               if (parent.window.opener.document.getElementById('awowowo')) {   
              if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
                 ivid=0; //parent.document.getElementById('i' + eval(0 + kkk)).ondblclick=function(event){   parent.location.href=parentdocumentURL;   };
                 lastshuffle=0;
                 oktoivid=false;
                 okt=false;
                 for (var opi=1; opi<vidarrv.length; opi++) {
                    if (parent.document.getElementById('xx' + opi)) {
                      parent.document.getElementById('xx' + opi).style.background='pink';
                    }
                 }
                 setTimeout(function(){ oktoivid=true; }, 7900);
              } else {
                 parent.window.opener.document.getElementById('awowowo').click(); 
                 parent.location.href=parent.document.URL.split('?')[0].split('#')[0];
              }
               } 
                   }
                   oktoivid=okt;
                   if (ismobileplaylistplay) {
                   //alert('here');
        firstdelay=-1;
        if (parent.document.getElementById('shufflechk')) {
          if (parent.document.getElementById('shufflechk').checked) {
            if (nextvidi >= 0) {  nextvidi=-3; }
            if (oktoivid) {
            firstshuffle=true;
            //for (var iuy=0; iuy<20; iuy++) {
            ivid=eval(Math.floor(Math.random() * 198675643) % Math.max(1,eval('' + vidarrv.length)));
        console.log('lastshuffle=' + lastshuffle + ' and pre0:' + ivid);
            //}
            sgoes=0;
            while (!parent.document.getElementById('c' + ivid).checked || ivid == lastshuffle) {
        console.log('was no good ' + ivid);
              ivid=eval(Math.floor(Math.random() * 198675643) % Math.max(1,eval('' + vidarrv.length)));
              sgoes++;
              if (sgoes > 100) { lastshuffle=-1;  }
            }
            lastshuffle=ivid;
            }
          }
        }
        if (ivid < eval('' + vidarrv.length)) {
        console.log('0:' + ivid);
           if (oktoivid) {
           while (!parent.document.getElementById('c' + ivid).checked) {
                       //if (parent.document.URL.indexOf('&unknowndur=') != -1) {
                       //   alert('huh3=');
                       //}
             ivid++;
             if (ivid >= eval('' + vidarrv.length)) {
              if (!parent.document.getElementById('loopchk')) {
               ivid=-1;
              } else if (parent.document.getElementById('loopchk').checked) {
               ivid=0;
               if (parent.window.opener.document.getElementById('awowowo') && !navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {   
                 parent.window.opener.document.getElementById('awowowo').click(); 
               } 
              } else {
               ivid=-1;
              }
             }
           }
           }
        console.log('00:' + ivid);
           if (ivid >= 0) {
        console.log('000:' + ivid + ' ' + vidarrv[ivid]);
            if (1 == 1) {
            ivid=ivid;
            } else {
            event.target.cueVideoById(vidarrv[ivid], eval('' + vidstarts[ivid]), eval(eval('' + viddurs[ivid]) - eval('' + vidstarts[ivid])), "medium");
            }
            if (firstdelay < 0) {
              firststdone=false;
              firstdelay=eval(eval('' + viddurs[eval(eval(1 + ivid) % viddurs.length)]) - eval('' + vidstarts[eval(eval(1 + ivid) % vidstarts.length)]));
            }
            if (1 == 1) {
            if (parent.document.URL.indexOf('&unknowndur=') != -1) {
              //alert('ivId=' + ivid);
              if (ivid == 0 && okt) { ivid++; } else if (ivid == 0 && !okt) { atnextend=false;   }
              if (nextvidi >= 0) {  ivid=nextvidi; console.log('ivid now =' + ivid);  nextvidi=-4;  console.log(vidarrv); console.log(vidstarts); console.log(viddurs); }
            }
            vid=vidarrv[ivid];
            secscnt='' + eval('' + vidstarts[ivid]);
            enforcedtimeis=eval('' + vidstarts[ivid]);
            if (('' + vid).indexOf(',') != -1) { vidarr=vid.split(','); }      
            playtime=eval(eval('' + viddurs[ivid]) - eval('' + vidstarts[ivid]));
            oktoivid=false;
            setTimeout(function(){ oktoivid=true; }, 5000);
            event.target.loadVideoById(vidarrv[ivid], eval('' + vidstarts[ivid]), eval(eval('' + viddurs[ivid]) - eval('' + vidstarts[ivid])));
            //if (atnextend) {
            //  alert('8:' + vid + ' ivid=' + ivid + ' ' + event.target.getDuration());
            //}
            parent.document.getElementById('youtubeid').value=vid;
            parent.document.getElementById('youtube_duration').value='' + viddurs[ivid];
            setTimeout(function(){ parent.document.getElementById('myh1').innerHTML=halfway(ivid,vid,viddurs[ivid],event.target.getVideoData().title); ttt.title=event.target.getVideoData().title; }, 2000);
            } else {
            event.target.playVideo();
            }
           }
                       if (parent.document.URL.indexOf('&unknowndur=') != -1) {
                          //alert('huh4=' + ivid + ' ' + vidarrv.length);
                                      if (eval('' + vidarrv.length) <= 1) { dovidarrv(); }
                          //ttt.title=('huh44=' + ivid + ' ' + vidarrv.length);
                       }
           ivid++;
           if (ivid >= eval('' + vidarrv.length)) {
               ivid=0;
                          //ttt.title=('why');
           }
           if (ivid < eval('' + vidarrv.length)) {
        console.log(eval(1000 *  eval(eval('' + viddurs[ivid]) - eval('' + vidstarts[ivid]))));
              if ('sadnews' == 'sadnews') {
              if (firstdelay < 0) {
              firststdone=false;
              firstdelay=eval(eval('' + viddurs[ivid]) - eval('' + vidstarts[ivid]));
              }
              } else {
              setTimeout(preparentlook, eval(1000 *  eval(eval('' + viddurs[ivid]) - eval('' + vidstarts[ivid]))));
              }
           }
        }
                   
                   
                   }
                 
                    consolelog('ended event.data=' + event.data + ' was=' + top.document.getElementById('listeleven').innerHTML);
                   if (eval('' + endcnt) < 5) {
                   //alert('ended event.data=' + event.data);
                   endcnt=3;
                   var sufx='';
                   var capitalloop=top.document.getElementById('listeleven').getAttribute('data-title');
                   if ((capitalloop + 'a').substring(0,1) == 'X') {
                     sufx='^' + top.document.getElementById('listeleven').innerHTML.split('^')[0].replace('  ','').replace(' ','').trim();
                   }
                   if (top.document.getElementById('listeleven').innerHTML.indexOf('^') != -1) {
                   window.top.focus();
                   sufx='';
                   //alert('pre 1');
                   top.document.getElementById('listeleven').innerHTML=top.document.getElementById('listeleven').innerHTML.replace(top.document.getElementById('listeleven').innerHTML.split('^')[0] + '^','') + sufx; //.replace(top.document.getElementById('listeleven').innerHTML.split('^')[0],'');
                   //alert('1:' + top.document.getElementById('listeleven').innerHTML);
                   //ttt.title+=' ' + top.document.getElementById('listeleven').innerHTML.toUpperCase() + ' ';
                   //if (sufx != '') { alert(top.document.getElementById('listeleven').innerHTML); }
                   //ttt.title+=' 4'; 
                   } else {
                   window.top.focus();
                   //alert('pre 2');
                   var capitalloopx=top.document.getElementById('listeleven').getAttribute('data-title');
                   sufx=top.document.getElementById('listeleven').title; //sufx.replace('^','');
                   top.document.getElementById('listeleven').innerHTML=top.document.getElementById('listeleven').innerHTML.replace(top.document.getElementById('listeleven').innerHTML.split('^')[0] + '','') + sufx; //.replace(top.document.getElementById('listeleven').innerHTML.split('^')[0],'');
                   //alert('2:' + top.document.getElementById('listeleven').innerHTML);
                   //ttt.title+=' ' + top.document.getElementById('listeleven').innerHTML.toLowerCase() + ' ';
                   if ((capitalloopx + 'a').substring(0,1) == 'X') {
                   if (top.document.emojirestart) {
                     top.document.emojirestart();
                   } else {
                   var topifs=top.document.getElementsByTagName('iframe');
                   for (var itop=0; itop<topifs.length; itop++) {
                     if (itop != -1) { topifs[itop].src=topifs[itop].src.split('&rnd=')[0] + '&rnd=' + itop + '' + Math.floor(Math.random() * 1234567); }
                   }
                   //ttt.title+=' 1'; 
                   top.document.getElementById('myh1').style.marginLeft='1px';
                   //ttt.title+='2'; 
                   window.top.scrollTo(0,0);
                   //ttt.title+='3'; 
                   }
                   }
                   }
                    consolelog('Ended event.data=' + event.data + ' is=' + top.document.getElementById('listeleven').innerHTML);
                  }
                 //} else {
                   //alert('event.data=' + event.data);
                 }
               }
             }
           }
          }
        }
        if (event.data == YT.PlayerState.PLAYING) {
                   isnotplaying=false;
           if (wpwp) { if (8 == 8 || wpwp.document.getElementById('curct').innerHTML == '') {
            wpwp.document.getElementById('curct').innerHTML='' + eval(event.target.getCurrentTime()).toFixed(3);
            wpwp.document.getElementById('curct').title=wpwp.document.getElementById('curct').innerHTML;
            //alert('169:' + ' ' + eval(event.target.getCurrentTime()).toFixed(3) + ' to ' + wpwp.document.getElementById('curct').innerHTML);
          } }
                  if (wpp) {
                     if (wpp.document.getElementById('diaudiov')) {
                       if (wpp.document.getElementById('diaudiov').outerHTML.indexOf(' class="') != -1) {
                         wpp.document.getElementById('diaudio').innerHTML=wpp.document.getElementById('diaudiov').outerHTML.replace(' class="loop autostart"', '').replace('hidden;','visible;display:inline-block;');
                         wpp.document.getElementById('diaudio').style.display='inline-block';
                       }
                     }
                   }
                   if (enforcedtimeis < 0.0) { enforcedtimeis=0.0; }
                   if (ismobileplaylistplay) {
                     if (firstdelay < 0) {
                        firstdelay=eval(eval(parent.document.URL.split('&j0=')[1].split('&')[0].split('#')[0]) - eval(parent.document.URL.split('&i0=')[1].split(';')[0].split('&')[0].split('#')[0]));
                     }
                     if (!firststdone) {   firststdone=true; setTimeout(preparentlook, eval(1000 * firstdelay)); }
                   }
        }
        if (event.data == YT.PlayerState.PLAYING) {  one=1; isnotplaying=false;  }
                   if (event.data == YT.PlayerState.ENDED) {
                    if (hgans.trim() != '' && hgrip != '') {  
                      hgrip=hgrip.replace('youllneverfindthis', '' + fromsecs(eval(event.target.getCurrentTime()))); 
          if (wpwp) { if (88 == 89 || wpwp.document.getElementById('curct').innerHTML == '') {
            //alert('64:' + '' + eval(event.target.getCurrentTime()).toFixed(3));
            wpwp.document.getElementById('curct').innerHTML='' + eval(event.target.getCurrentTime()).toFixed(3);
          } }
                      hgans='';
                      if (window.opener) {
                      if (window.opener.document.URL.indexOf('/karaoke_') != -1) {
                      
                      if (window.opener.window.opener) {
                      if (window.opener.document.URL.indexOf('/karaoke_') != -1 && ('' + window.opener.document.URL + '~').indexOf('srt=~') != -1) {
                      if (window.opener.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                        fauxpas_w=window.opener.window.opener; //alert('yes founD');
                      } else if (window.opener.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=window.opener.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      
                        location.hash='#srt=' + encodeURIComponent(hgrip);
                        if (window.opener.document.URL.indexOf('youtubeid=') == -1) {
                        window.opener.location.href=window.opener.document.URL.split('#')[0].replace('srt=','').replace('?','?youtubeid=' + vid + '&') + '#srt=' + encodeURIComponent(hgrip);
                        hgrip='';
                        } else {
                        window.opener.location.href=window.opener.document.URL.split('#')[0].replace('srt=','').replace('?','?rand=' + Math.floor(Math.random() * 3456) + '&') + '#srt=' + encodeURIComponent(hgrip);
                        hgrip='';
                        }
                      } 
                      }                      
                      if (window.parent) {
                      if (parent.document.URL.indexOf('/karaoke_') != -1 && ('' + parent.document.URL + '~').indexOf('srt=~') != -1) {
                      if (parent.window.opener) {
                      if (parent.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                        fauxpas_w=parent.window.opener; //alert('foUnd');
                      } else if (parent.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=parent.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      
                      if (parent.document.URL.indexOf('/karaoke_') != -1) {
                        location.hash='#srt=' + encodeURIComponent(hgrip);
                        parent.location.href=parent.document.URL.split('#')[0].replace('srt=','').replace('?','?rand=' + Math.floor(Math.random() * 3456) + '&') + '#srt=' + encodeURIComponent(hgrip);
                        hgrip='';
                      } else if (parent.document.URL.indexOf('/stop_start') != -1) {
                        parent.location.href=parent.document.URL.split('?')[0].split('#')[0].replace('srt=','').replace('.html','.html?vid=' + vid + ('&playtime=' + stduration).replace('&playtime=undefined','&playtime=' + duration)) + '#srt=' + encodeURIComponent(hgrip);
                        hgrip='';
                      }
                      } else {
                        location.hash='#srt=' + encodeURIComponent(hgrip);
                        hgrip='';
                      }
                    }
                   }
                   if (event.data == YT.PlayerState.PAUSED) { 
           if (wpwp) { if (88 == 88 || wpwp.document.getElementById('curct').innerHTML == '') {
            //alert('61:' + '' + eval(event.target.getCurrentTime()).toFixed(3));
            wpwp.document.getElementById('curct').title='';
          } }
                  onepause=1; 
                   isnotplaying=true; 
                   //alert(document.URL);
                   var zhgx='';
                   if (window.parent) {
                     //alert('2:' + parent.document.URL);
                   if ((parent.document.URL + '~').indexOf('srt=~') != -1 || (parent.document.URL + '~').indexOf('srt' + encodeURIComponent('=') + '~') != -1) {
                      zhgx='srt=';
                     //alert('22:' + parent.document.URL);
                    }
                   }
                   if (window.top && zhgx == '') {
                     //alert('2:' + parent.document.URL);
                   if ((top.document.URL + '~').indexOf('srt=~') != -1 || (top.document.URL + '~').indexOf('srt' + encodeURIComponent('=') + '~') != -1) {
                      zhgx='srt=';
                     //alert('22:' + parent.document.URL);
                    }
                   }
                   if (document.URL.slice(-4) == 'srt=' || zhgx == 'srt=' || ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/srt\=$/g, '') != ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'') && ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^#/g,'') != '') {
                   //alert('2:' + document.URL);
                     if (document.getElementById('subripcommentary')) {
                      if (document.getElementById('subripcommentary').innerHTML == '') {
                        document.getElementById('subripcommentary').innerHTML='Awaiting pause for SubRip subtitles <div id=divcbi style=display:inline-block;><iframe class="spag" scrolling="no" data-accept="text/*" id="cbi" frameborder="0" style="display:inline-block;width:173px;height:218px;margin-top:-200px;" src="/HTMLCSS/client_browsing.htm?typeJUNKhastobe=text&straightJUNKtext=y&wordJUNKing=Allimages%20images%2E%20"></iframe></div><br><textarea onblur="hgrip=massage(this.value,hgrip);" id=mysubrip></textarea>';
                        if (sdivcbi == '') { sdivcbi=document.getElementById('divcbi').innerHTML; }
                        setInterval(subripize, 1000);
                      }
                     }
                     hgans='';
                     // hgrip='', lasthgriprec='';
                     var zsecscnt=fauxit(eval(event.target.getCurrentTime()).toFixed(3));
          if (wpwp) { if (88 == 89 || wpwp.document.getElementById('curct').innerHTML == '') {
            alert('61:' + '' + eval(event.target.getCurrentTime()).toFixed(3));
            wpwp.document.getElementById('curct').innerHTML='' + eval(event.target.getCurrentTime()).toFixed(3);
          } }
                     if (hgrip == '') {
                       if (window.opener) {
                      
                      if (window.opener.window.opener) {
                      if (window.opener.document.URL.indexOf('/karaoke_') != -1 && ('' + window.opener.document.URL + '~').indexOf('srt=~') != -1) {
                      if (window.opener.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                        fauxpas_w=window.opener.window.opener; //alert('yes FouND');   // here it is
                      } else if (window.opener.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=window.opener.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      
                           if (window.opener.document.getElementById('stduration')) {
                             window.opener.document.getElementById('stduration').innerHTML='' + fromsecs(stduration) + '#' + vid;
                           }
                       }
                       if (window.top) {
                       //alert('top');
                         if (top.document.getElementById('stduration')) {
                           top.document.getElementById('stduration').innerHTML='' + fromsecs(stduration) + '#' + vid;
                         } else if (window.parent) {
                       //alert('paReNt');
                           if (parent.document.getElementById('stduration')) {
                             parent.document.getElementById('stduration').innerHTML='' + fromsecs(stduration) + '#' + vid;
                           }
                           //alert('981 ' + top.document.URL);
                      if (top.document.URL.indexOf('/stop_start_') != -1 && ('' + top.document.URL + '~').indexOf('srt=~') != -1) {
                      //alert(5642);
                      if (top.window.opener.window.opener) {
                      //alert('5643 ' + top.window.opener.window.opener.document.URL);
                      if (top.window.opener.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                      //alert(5644);
                        fauxpas_w=top.window.opener.window.opener; //alert('fOund');
                      //alert(fauxpas_w.document.getElementById('tbtheone').value);
                      //alert(fauxpas_w.gettheone());
                      } else if (top.window.opener.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=top.window.opener.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                         }
                       } else if (window.parent) {
                       //alert('paRent');
                      if (window.parent) {
                      //alert(564);
                      if (parent.document.URL.indexOf('/karaoke_') != -1 && ('' + parent.document.URL + '~').indexOf('srt=~') != -1) {
                      //alert(5642);
                      if (parent.window.opener.window.opener) {
                      //alert(5643);
                      if (parent.window.opener.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                      //alert(5644);
                        fauxpas_w=parent.window.opener.window.opener; //alert('fOund');
                      } else if (parent.window.opener.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=parent.window.opener.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      }
                      
                           if (parent.document.getElementById('stduration')) {
                             parent.document.getElementById('stduration').innerHTML='' + fromsecs(stduration) + '#' + vid;
                           }
                       }
                    //alert('3:' + document.URL);
                       //hgans=prompt('Enter optional from ' + fromsecs(0.0) + ' to now caption (and if used, delimited by ~~~~) to ' + fromsecs(zsecscnt) + ' and a caption for from this point until your next pause ... where ~~ represents a line feed.', '');
                       document.getElementById('subtitlegoeshere').title='Captions and subtitles';
                       hgans=prompt('Enter optional from ' + fromsecs(0.0) + ' to now caption (and if used, delimited by ~~~~) to ' + fromsecs(zsecscnt) + ' and a caption for from this point until your next pause ... where ~~ represents a line feed.  Idea can be to enter all captions (delimited by ~~~~) now and do several pause(s) to time them.' + fauxmore, nextfauxdef());
                       if (hgans == null) { hgans='';  }
                       var arrhg=hgans.split('~~~~');
                       if (hgans.indexOf('~~~~') != -1) {
                         //fauxdef=vslfd(hgans.split('~~~~')[0]);
                         //fauxdef=vslfd(hgans.split('~~~~')[1]);
                         fauxdef=vslfd(hgans.split('~~~~')[0]); 
                         fauxdef=vslfd(hgans.split('~~~~')[1]); 
                         if (fauxpas_w) {
                         if (fauxpas_w.document.getElementById('fauxpasstartsecs' + fauxpas_w.document.getElementById('tbtheone').value)) {
                           if (fauxpas_w.document.getElementById('fauxpasstartsecs' + fauxpas_w.document.getElementById('tbtheone').value).value != '') {
                             fauxpas_w.document.getElementById('fauxpasendsecs' + fauxpas_w.document.getElementById('tbtheone').value).value=fauxpas_w.document.getElementById('fauxpasstartsecs' + fauxpas_w.document.getElementById('tbtheone').value).value;
                             fauxpas_w.document.getElementById('fauxpasstartsecs' + fauxpas_w.document.getElementById('tbtheone').value).value='0.001,' + fauxpas_w.document.getElementById('fauxpasendsecs' + fauxpas_w.document.getElementById('tbtheone').value).value;
                           }
                         }
                         }
                         fauxdefcnt+=2;
                         if (fauxpas_w) {
                         //alert(987);
                           if (fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value)) {
                         //alert(887);
                            if (fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value).value == '') {
                         //alert(787);
                              fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value).value='' + vid;
                            }
                           }
                         } 
                         hgrip='WEBVTT FILE' + String.fromCharCode(10) + String.fromCharCode(10) + '1' + String.fromCharCode(10) + fromsecs(0.0) + ' --> ' + fromsecs(zsecscnt) + String.fromCharCode(10) + hgans.split('~~~~')[0].replace(/\~\~/g, String.fromCharCode(10)) + String.fromCharCode(10) + String.fromCharCode(10) + '2' + String.fromCharCode(10) + fromsecs(zsecscnt) + ' --> youllneverfindthis' + String.fromCharCode(10) + hgans.split('~~~~')[1].replace(/\~\~/g, String.fromCharCode(10));
 //alert('20:' + hgrip);
                         if (eval('' + arrhg.length) > 2) {
                         hgcnt=3;
                         document.getElementById('subtitlegoeshere').title='Captions and subtitles ... "<strong>' + hgans.split('~~~~')[2].replace(/\~\~/g, String.fromCharCode(10)) + '</strong>" should <strong>start</strong> where you next pause.';
                         for (var jarrhg=2; jarrhg<arrhg.length; jarrhg++) {
                           hgrip+='' + String.fromCharCode(10) + String.fromCharCode(10) + hgcnt + String.fromCharCode(10) + 'youllneverfindthis' + ' --> youllneverfindthis' + String.fromCharCode(10) + hgans.split('~~~~')[jarrhg].replace(/\~\~/g, String.fromCharCode(10));
                           hgcnt++;
                         }
                         } else {
                         hgcnt=3;
                         document.getElementById('subtitlegoeshere').title='Captions and subtitles ... "<strong>' + hgans.split('~~~~')[1].replace(/\~\~/g, String.fromCharCode(10)) + '</strong>" should <strong>end</strong> where you next pause or get video to finish.';
                         }
                       } else if (hgans != '') {
                         fauxdefcnt++;
                         //fauxdef=vslfd(hgans);
                         fauxdef=vslfd(hgans);
                         if (fauxpas_w) {
                         //alert(987);
                           if (fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value)) {
                         //alert(887);
                            if (fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value).value == '') {
                         //alert(787);
                              fauxpas_w.document.getElementById('youtubeid' + fauxpas_w.document.getElementById('tbtheone').value).value='' + vid;
                            }
                           }
                         } 
                         hgrip='WEBVTT FILE' + String.fromCharCode(10) + String.fromCharCode(10) + '1' + String.fromCharCode(10) + fromsecs(zsecscnt) + ' --> youllneverfindthis' + String.fromCharCode(10) + hgans.split('~~~~')[0].replace(/\~\~/g, String.fromCharCode(10));
// alert('21:' + hgrip);
                         document.getElementById('subtitlegoeshere').title='Captions and subtitles ... "<strong>' + hgans.split('~~~~')[0].replace(/\~\~/g, String.fromCharCode(10)) + '</strong>" should <strong>end</strong> where you next pause or get video to finish.';
                         hgcnt=2;
                       } else {
                         fauxdefcnt++;
                       }
                     } else {
                   //alert('4:' + document.URL);
                       if (eval('' + hgrip.split('youllneverfindthis').length) > 2) {
                       hgrip=hgrip.replace('youllneverfindthis', '' + fromsecs(zsecscnt));
                       hgrip=hgrip.replace('youllneverfindthis', '' + fromsecs(zsecscnt));
                       document.getElementById('subtitlegoeshere').title='Captions and subtitles ... "<strong>' + hgrip.split('youllneverfindthis' + String.fromCharCode(10))[1].split('~~~~')[0].replace(/\~\~/g, String.fromCharCode(10)) + '</strong>" should <strong>end</strong> where you next pause or get video to finish.';
                       } else {
                       hgans=prompt('Enter caption for period from ' + fromsecs(zsecscnt) + ' until your next pause ... where ~~ represents a line feed.  As required more than the one caption (delimited by ~~~~) can be entered here then do several pause(s) to time them.  Entering nothing and clicking OK finishes up.' + fauxmore, nextfauxdef());
                       if (hgans == null) { 
                         hgans='';  
                       } else if (hgans == '') {
                         hgrip=hgrip.replace('youllneverfindthis', '' + fromsecs(zsecscnt));
                         if (eval('' + hgrip.split('youllneverfindthis').length) == 1) { //   Entering nothing and clicking OK finishes up.
                           endgame();
                         }
                       }
                       if (hgans != '') {
                         fauxdef=vslfd(hgans); 
                         hgrip=hgrip.replace('youllneverfindthis', '' + fromsecs(zsecscnt));
  //alert('22:' + hgrip);
                         hgrip+='' + String.fromCharCode(10) + String.fromCharCode(10) + hgcnt + String.fromCharCode(10) + fromsecs(zsecscnt) + ' --> youllneverfindthis' + String.fromCharCode(10) + hgans.split('~~~~')[0].replace(/\~\~/g, String.fromCharCode(10));
  //alert('23:' + hgrip);
                         hgcnt++;
                         if (eval('' + hgans.split('~~~~').length) >= 2) {
                         for (var jjjjarrhg=1; jjjjarrhg<hgans.split('~~~~').length; jjjjarrhg++) {
                           hgrip+='' + String.fromCharCode(10) + String.fromCharCode(10) + hgcnt + String.fromCharCode(10) + 'youllneverfindthis' + ' --> youllneverfindthis' + String.fromCharCode(10) + hgans.split('~~~~')[jjjjarrhg].replace(/\~\~/g, String.fromCharCode(10));
                           hgcnt++;
                         }
                         } else {
                         document.getElementById('subtitlegoeshere').title='Captions and subtitles ... "<strong>' + hgans.split('~~~~')[0].replace(/\~\~/g, String.fromCharCode(10)) + '</strong>" should <strong>end</strong> where you next pause or get video to finish.';
                         } 
                       }
                       }
                     }
                   }
        }
        analyzemaybe(one, onepause, done);
        if (event.data == YT.PlayerState.PLAYING && !done) {
          if (wpwp) { if (88 == 88 || wpwp.document.getElementById('curct').innerHTML == '') {
            //alert('269:' + '' + eval(event.target.getCurrentTime()).toFixed(3));
            wpwp.document.getElementById('curct').innerHTML='' + eval(event.target.getCurrentTime()).toFixed(3);
          } }
                   if (wpp) {
                     if (wpp.document.getElementById('diaudiov')) {
                       if (wpp.document.getElementById('diaudiov').outerHTML.indexOf(' class="') != -1) {
                         wpp.document.getElementById('diaudio').innerHTML=wpp.document.getElementById('diaudiov').outerHTML.replace(' class="loop autostart"', '').replace('hidden;','visible;display:inline-block;');
                         wpp.document.getElementById('diaudio').style.display='inline-block';
                       }
                     }
                   }
          isnotplaying=false;
          duration=event.target.getDuration();
          stduration=eval('' + duration);
        //if (('' + top.document.URL).indexOf('/select_palette.') != -1) {
        //  alert('4987:' + duration);
        //}
          if (parent.document.getElementById('youtube_duration') && ('' + duration) != 'undefined') {
            if (parent.document.getElementById('youtube_duration').value.indexOf('22221') == 0) {
              parent.document.getElementById('youtube_duration').value='' + duration;
              if (parent.document.getElementById('j0')) {
                if (parent.document.getElementById('j0').value == '22221') {
                  parent.document.getElementById('j0').value='' + duration;
                if (window.parent) {
                if (parent.window.opener) {
                  if (typeof parent.window.opener.setvurl == 'function') {
                   setTimeout(function(){
                    parent.window.opener.setvurl(parent.document.getElementById('youtubeid').value, parent.document.getElementById('myh1').innerHTML, parent.document.getElementById('youtube_duration').value);
                   }, 2000);
                  }
                }
                }
                }
              }
            }
          }
          if (('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/\#/g,'') != '' && ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/\#/g,'').indexOf('captionis=') == -1) {
            if (('' + parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).getAttribute('data-mute')).replace(/^undefined/g,'').replace(/^null/g,'') != '') {
              event.target.mute();
            }
            if (parent.parent.document.getElementById(location.hash.replace(/\#/g,''))) {
              parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).style.fontSize='7px';
              enforcedtimeis=secscnt;
              parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder='' + secscnt + '/' + duration + ' ... ' + 'P=pause/play S=stop M=mute U=unmute L=loop Y=YouTube G=Google W=Wikipedia ';
    if (('' + top.document.URL).indexOf('/select_palette.') != -1) {
      if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).outerHTML.indexOf('<textarea ') != -1) {
        if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).outerHTML.split('<textarea ')[1].split('</')[0].indexOf('display:none') != -1) {
          if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).outerHTML.split('<textarea ')[1].split('</')[0].indexOf(' id="') != -1) {
            parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).style.display='inline-block';
          }
        //} else if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).outerHTML.split('<textarea ')[1].split('</')[0].indexOf('inline-block') == -1) {
        //  alert(parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).outerHTML);
        }
      }
    }
              parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-duration', '' + duration);
              if (lastokn > 0) {
                    parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='' + lastokn;
              }
              if (!inplaying) { inplaying=true; setTimeout(playingvideo, 1000); }
              if (('' + parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).getAttribute('data-loop')).replace(/^undefined/g,'').replace(/^null/g,'') != '') {
                  startagain=true;
                  parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-loop', '');
              }
          psuf='';
          if (startagain) {
             psuf=' ' + String.fromCodePoint(10004);
          }
            }
          }
          endcnt=0;
          setTimeout(yeswell, eval(eval(10 + eval('' + duration)) * 1000));
          console.log('0:' + (new Date()) + ' duration=' + duration);
          if (document.URL.indexOf('start=') != -1 && document.URL.indexOf('playtime=') != -1) parent.document.getElementById('myh1').innerHTML=halfway(ivid,vid,duration,event.target.getVideoData().title);
          if (document.URL.indexOf('start=0') != -1 && document.URL.indexOf('playtime=0') != -1) {
          //alert(duration);
          oursecscnt=-1;
          setTimeout(stopVideo, 10);
          console.log('00:' + (new Date()) + ' duration=' + duration);
          if (parent.document.getElementById('youtube_duration').value.indexOf("22222.") != 0) {
          parent.document.getElementById('youtube_duration').value='' + duration;
          }
          if (window.top) {
            if (top.document.getElementById('list_eleven')) {
             top.document.getElementById('list_eleven').title='' + duration;
             //try {
             //top.document.getElementById('list_eleven').title+='|' + event.target.getVideoData().title;
             //} catch(errt) { 
             //top.document.getElementById('list_eleven').title='' + duration;
             //}
            }
          }
          //parent.document.getElementById('myh1').innerHTML=event.target.getVideoData().title;
          if (kpi == -9) {
          //alert(99);
        if (document.URL.indexOf('start=') != -1 && document.URL.indexOf('playtime=') != -1) {
          //alert(990);
        if (document.URL.indexOf('start=0') == -1 || document.URL.indexOf('playtime=0') == -1) {
          //alert(9900);
            kpi=-8;
            kpi=event.target.getCurrentTime();
          if (wpwp) { if (88 == 89 || wpwp.document.getElementById('curct').innerHTML == '') {
            alert('67:' + '' + eval(event.target.getCurrentTime()).toFixed(3));
            wpwp.document.getElementById('curct').innerHTML='' + eval(event.target.getCurrentTime()).toFixed(3);
          } }
            if (('' + kpi) == 'undefined') {
                      alert('iViD=' + ivid + ' vid=' + vid + ' url=' + document.URL);
            }
            keepParentInformed();
            }
            }
          }
          //stopVideo();
          return;
          } else {
          if (playtime < 0) { playtime=duration * 1000; }
          enforcedtimeis=eval(playtime / 1000); 
          isnotplaying=false;
          document.title='Playing YouTube ' + vid + of + ' for ' + playtime / 1000 + ' seconds ... is ' + duration + ' seconds altogether.'; 
          if (yes_esp) {
            if (parent.parent.document.getElementById('progress_' + vid)) {
              parent.parent.document.getElementById('progress_' + vid).style.visibility='visible';  
              parent.parent.document.getElementById('progress_' + vid).max='' + duration;  
              parent.parent.document.getElementById('progress_' + vid).value='0';  
              parent.parent.document.getElementById('progress_' + vid).title='At 0 of ' + duration + ' seconds of ' + parent.getElementById('myh1').innerHTML; 
            } else {
            //parent.parent.document.getElementsByTagName('h4')[0].style.visibility='visible';
            parent.parent.document.getElementsByTagName('h4')[0].title=document.title;
            //parent.parent.document.getElementsByTagName('h4')[0].innerHTML=document.title;
            }
          }
          enforcedtimeis=eval(playtime / 1000); 
          isnotplaying=false;
          document.getElementById('ptitle').innerHTML='Playing YouTube ' + vid + of + ' for ' + playtime / 1000 + ' seconds ... is ' + duration + ' seconds altogether.' + etc_volume(); 
          document.getElementById('ivol').value=event.target.getVolume(); 
          document.getElementById('ipbr').value=event.target.getPlaybackRate(); 
          document.getElementById('iqty').value=event.target.getPlaybackQuality();
          setTimeout(stopVideo, playtime + delay);
          done = true;
          eventtarget=event.target;
          if (eval(oursecscnt) > 0) {
          enforcedtimeis=eval('' + oursecscnt); 
          isnotplaying=false;
            document.getElementById('ptitle').innerHTML='Playing YouTube ' + vid + ' starting at ' + oursecscnt + ' seconds ' + of + ' for ' + playtime / 1000 + ' seconds ... is ' + duration + ' seconds altogether.' + etc_volume(); 
            document.title='Playing YouTube ' + vid + ' starting at ' + oursecscnt + ' seconds ' + of + ' for ' + playtime / 1000 + ' seconds ... is ' + duration + ' seconds altogether.'; 
          if (yes_esp) {
            if (parent.parent.document.getElementById('progress_' + vid)) {
              parent.parent.document.getElementById('progress_' + vid).style.visibility='visible';  
              parent.parent.document.getElementById('progress_' + vid).max='' + duration;  
              parent.parent.document.getElementById('progress_' + vid).value='' + oursecscnt; 
              parent.parent.document.getElementById('progress_' + vid).title='At ' + oursecscnt + ' of ' + duration + ' seconds of ' + parent.parent.getlastreltitle(); //parent.getElementById('myh1').innerHTML; 
              if (parent.parent.document.getElementById('progress' + vid)) {
                parent.parent.document.getElementById('progress' + vid).title=parent.parent.document.getElementById('progress_' + vid).title;
              }
            } else {
            //parent.parent.document.getElementsByTagName('h4')[0].style.visibility='visible';
            parent.parent.document.getElementsByTagName('h4')[0].title=document.title;
            //parent.parent.document.getElementsByTagName('h4')[0].innerHTML=document.title;
            }
          }
          if (kpi == -9) {
          //alert(909);
        if (document.URL.indexOf('start=') != -1 && document.URL.indexOf('playtime=') != -1) {
          //alert(90900);
        if (document.URL.indexOf('start=0') == -1 || document.URL.indexOf('playtime=0') == -1) {
          //alert(909000);
            kpi=-8;
            kpi=event.target.getCurrentTime();
          if (wpwp) { if (88 == 89 || wpwp.document.getElementById('curct').innerHTML == '') {
            alert('68:' + '' + eval(event.target.getCurrentTime()).toFixed(3));
            wpwp.document.getElementById('curct').innerHTML='' + eval(event.target.getCurrentTime()).toFixed(3);
          } }
            if (('' + kpi) == 'undefined') {
                      alert('iVID=' + ivid + ' vid=' + vid + ' url=' + document.URL);
            }
            //alert(kpi);
            keepParentInformed();
            }
            }
          }
        //alert("+" + oursecscnt + ' ... ' + playtime);
            event.target.cueVideoById(vid, eval('' + oursecscnt), eval('' + oursecscnt) + eval(eval('' + playtime) / 1000.0), "medium"); 
            oursecscnt=-1;
          }
          }
        } 
      }
      
      function mpp(wht, vd) {
          if (yes_esp) {
            if (parent.parent.document.getElementById('progress_' + vd)) {
            if (('' + wht).indexOf('-') == 0) { 
              parent.parent.document.getElementById('progress_' + vd).style.visibility='hidden';  
              if (parent.parent.document.getElementById('progress_' + vd).title.indexOf('At ') == 0) {  
              parent.parent.document.getElementById('progress_' + vd).title=parent.parent.document.getElementById('progress_' + vd).title.replace('At ' + parent.parent.document.getElementById('progress_' + vd).title.substring(3).split(' ')[0] + ' ','At end ');
              }
              if (parent.parent.document.getElementById('progress' + vid)) {
                parent.parent.document.getElementById('progress' + vid).title=parent.parent.document.getElementById('progress_' + vid).title;
              }
            } else if (('' + wht).indexOf(' ') == -1) {
              parent.parent.document.getElementById('progress_' + vd).value='' + wht;
              if (parent.parent.document.getElementById('progress_' + vd).title == '') {
              //alert(56);
              //alert('' + parent.parent.document.getElementById('progress_' + vd).max);
              parent.parent.document.getElementById('progress_' + vd).title='At 0 of ' + parent.parent.document.getElementById('progress_' + vd).max + ' seconds of ' + parent.parent.getlastreltitle(); //parent.getElementById('myh1').innerHTML; 
              //alert(356);
              }
              if (parent.parent.document.getElementById('progress_' + vd).title.indexOf('At ') == 0) {  
              parent.parent.document.getElementById('progress_' + vd).title=parent.parent.document.getElementById('progress_' + vd).title.replace('At ' + parent.parent.document.getElementById('progress_' + vd).title.substring(3).split(' ')[0] + ' ','At ' + wht + ' ');
              }
              if (parent.parent.document.getElementById('progress' + vid)) {
                parent.parent.document.getElementById('progress' + vid).title=parent.parent.document.getElementById('progress_' + vid).title;
              }
            }
            } else {
            //parent.parent.document.getElementsByTagName('h4')[0].style.visibility='visible';
            parent.parent.document.getElementsByTagName('h4')[0].title='' + wht;
            //parent.parent.document.getElementsByTagName('h4')[0].innerHTML=wht;
            }
          }
          return wht;
      }
      
      function keepParentInformed() {
       var xkpi='';
       if (ismobileplaylistplay) { return '';  }
       console.log('vid=' + vid + ' and ivid=' + ivid + ' and kpi=' + kpi);
            if (('' + kpi) == 'undefined') {
                      kpi=0;
       console.log('vid=' + vid + ' and ivid=' + ivid + ' And kpi=' + kpi);
            }
       if (eval(kpi) < 0) {
          if (wpwp) { if (88 == 89 || wpwp.document.getElementById('curct').innerHTML == '') {
            //alert('691:' + '' + mpp(kpi, vid));
            wpwp.document.getElementById('curct').innerHTML='' + mpp(kpi, vid);
          } }
        parent.document.getElementById('conduit').value=mpp(kpi, vid);
       } else {
        try {
        xkpi=event.target.getCurrentTime();
          if (wpwp) { if (88 == 89 || wpwp.document.getElementById('curct').innerHTML == '') { 
            //alert('69:' + '' + eval(event.target.getCurrentTime()).toFixed(3));
            wpwp.document.getElementById('curct').innerHTML='' + eval(event.target.getCurrentTime()).toFixed(3);
          } }
        } catch(ryy) {
        //if (eval('' + vid.length) != 11) {
        //alert('vid=' + vid);
        //}
        }
        //ttt.title=xkpi;
        if (('' + xkpi).indexOf('undefined') == -1) kpi=eval(xkpi);
          if (wpwp) { if (88 == 89 || wpwp.document.getElementById('curct').innerHTML == '') { 
            //alert('6912:' + '' + mpp(kpi, vid));
            wpwp.document.getElementById('curct').innerHTML='' + mpp(kpi, vid);
          } }
        parent.document.getElementById('conduit').value=mpp(kpi, vid);
        //parent.document.getElementById('myh1').innerHTML+=' ' + kpi;
       }
       if (eval(kpi) != -1) {
        //alert(kpi);
         setTimeout(keepParentInformed, 600);
       } //else {
        //alert('why is kpi=' + kpi);
       //}
      }
      
      function sagain() {
         startagain=true;
         if (('' + parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).getAttribute('data-val')).replace(/^undefined/g,'').replace(/^null/g,'') != '') {
            parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-loop','y');
         }
      }
      
      function sanitycheck() {
            if (numericalssamecount >= 10) {
                           numericals=parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value;
                           if (numericals.replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'').trim() == '') {
                              if (eval(numericals) >= 0 && eval(numericals) <= eval('' + duration)) {
                                event.target.seekTo(eval(numericals.trim()));
          if (wpwp) { if (88 == 88 || wpwp.document.getElementById('curct').innerHTML == '') {
            wpwp.document.getElementById('curct').innerHTML='' + eval(numericals.trim());
            wpwp.document.getElementById('curct').title='';
          } }
                                enforcedtimeis=eval(numericals.trim());
                                isnotplaying=false;
                                if (cursecselapsed >= 0.0) { cursubi=0; }
                              }
                              parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='';                              
                              numericals='';
                              numericalssamecount=0;
                              //ttt.title='Zero';
                           } else {
                              ytsearch(parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value);
                              numericals='';
                              numericalssamecount=0;
                              //ttt.title='zero';
                           }
            }
      }
      
      function ytsearch(intysidea) {
        var afternums='', isanum=true, beforenums='', wasph='';
        for (var ihj=0; ihj<intysidea.length; ihj++) {
           if (isanum) {
             if (intysidea.substring(ihj).substring(0,1) < '0' || intysidea.substring(ihj).substring(0,1) > '9') {
               isanum=false;
               if (intysidea.substring(ihj).substring(0,1) != ' ') {
                 afternums+=intysidea.substring(ihj).substring(0,1);
               }
             } else {
               beforenums+=intysidea.substring(ihj).substring(0,1);
             }
           } else {
             afternums+=intysidea.substring(ihj).substring(0,1);
           }
        }
        parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='';
        if (afternums.trim() != '') {
         if (parent.parent.document.getElementById('yts' + location.hash.replace(/\#/g,'').substring(3).split('_')[0])) {
          wasph=parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder;
          parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder='';
          parent.parent.document.getElementById('yts' + location.hash.replace(/\#/g,'').substring(3).split('_')[0]).src='//www.rjmprogramming.com.au/HTMLCSS/karaoke_youtube_api.htm?youtubeid=++++++++++++' + encodeURIComponent(afternums) + '&audioonlys=' + (beforenums.trim() == '' ? '5' : beforenums) + '&paridis=' + ouraidis + '&wasph=' + encodeURIComponent(wasph) + '#tonlyaudios';
          parent.parent.document.getElementById('' + location.hash.replace(/\#/g,'').substring(3).split('_')[0]).scrollIntoView();
         } else if (top.document.getElementById('ldi' + location.hash.replace(/\#/g,'').substring(3).split('_')[0])) {
          wasph=parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder;
          parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder='';
          parent.parent.document.getElementById('ldi' + location.hash.replace(/\#/g,'').substring(3).split('_')[0]).innerHTML+='<iframe style=height:250px; id="yts' +  + ouraidis + '" src="' + '//www.rjmprogramming.com.au/HTMLCSS/karaoke_youtube_api.htm?youtubeid=++++++++++++' + encodeURIComponent(afternums) + '&audioonlys=' + (beforenums.trim() == '' ? '5' : beforenums) + '&paridis=' + ouraidis + '&wasph=' + encodeURIComponent(wasph) + '#tonlyaudios"></iframe>';
          parent.parent.document.getElementById('' + location.hash.replace(/\#/g,'').substring(3).split('_')[0]).scrollIntoView();
          parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder=wasph;
         } else {
          wasph=parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder;
          parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder='';
          parent.parent.document.getElementById('' + location.hash.replace(/\#/g,'').substring(3).split('_')[0]).innerHTML+='<iframe style=height:250px; id="yts' +  + ouraidis + '" src="' + '//www.rjmprogramming.com.au/HTMLCSS/karaoke_youtube_api.htm?youtubeid=++++++++++++' + encodeURIComponent(afternums) + '&audioonlys=' + (beforenums.trim() == '' ? '5' : beforenums) + '&paridis=' + ouraidis + '&wasph=' + encodeURIComponent(wasph) + '#tonlyaudios"></iframe>';
          parent.parent.document.getElementById('' + location.hash.replace(/\#/g,'').substring(3).split('_')[0]).scrollIntoView();
          parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder=wasph;
         }
        }
      }
      
      function playingvideo() {
          inplaying=true;
          if (thatisit) { inplaying=false; return ''; }
          psuf='';
          if (startagain) {
             if (1 == 6 && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
             psuf=' via button reclick ' + String.fromCodePoint(10004);
             } else {
             psuf=' ' + String.fromCodePoint(10004);
             }
          }
          if (('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/\#/g,'') != '') {
            if (eval('' + duration) == 0 && Math.round(player.getCurrentTime()) < 1) {  // used to be event.target.getCurrentTime
                   if (one == 1 || onepause != 1) {
                     if (1 == 4) { event.target.pauseVideo(); }
                   } else {
                     event.target.playVideo();
                   }
              if (!inplaying) { inplaying=true; setTimeout(playingvideo, 1000); }
            } else {
            if (parent.parent.document.getElementById(location.hash.replace(/\#/g,''))) {
              if (('' + parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).getAttribute('data-val')).replace(/^undefined/g,'').replace(/^null/g,'') != '') {
                   parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value= parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).getAttribute('data-val');
                   parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-val','');
              }
              switch (('' + parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value.toUpperCase() + ' ').substring(0,1)) {
                 case 'Y':
                   if (document.URL.indexOf('start=') != -1 && document.URL.indexOf('start=0') == -1) {
                   window.open('//www.youtube.com/watch?v=' + vid + '&t=' + document.URL.split('start=')[1].split('&')[0].split('#')[0] + 's', '_blank', 'top=100,left=100,width=600,height=600');
                   } else {
                   window.open('//www.youtube.com/watch?v=' + vid, '_blank', 'top=100,left=100,width=600,height=600');
                   }
                   parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='';
                   break;
                   
                 case 'G':
                   window.open('//www.google.com/search?q=' + encodeURIComponent(parent.document.getElementsByTagName('h1')[0].innerHTML), '_blank', 'top=110,left=110,width=600,height=600');
                   parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='';
                   break;
                   
                 case 'W':
                   window.open('//wikipedia.org/wiki/' + encodeURIComponent(parent.document.getElementsByTagName('h1')[0].innerHTML), '_blank', 'top=120,left=120,width=600,height=600');
                   parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='';
                   break;
                   
                 case 'L':
                   if (numericalssamecount <= 0) {
                   startagain=true;
                   if (('' + window.sessionStorage.getItem('loop_' + vid.split(',')[0])).replace(/^undefined/g,'').replace(/^null/g,'').trim() == '') {
                   setInterval(retry, 5000);
                   } else {
                   window.sessionStorage.removeItem('loop_' + vid);
                   }
                   window.sessionStorage.setItem('loop_' + vid, 'y');
          psuf='';
          if (startagain) {
             psuf=' ' + String.fromCodePoint(10004);
          }
                   dostumps=false;
                   parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='';
                   } else {
                   numericalssamecount++;
                   }
                   break;
                 case 'S':
                   if (numericalssamecount <= 0) {
                   startagain=false;
          psuf='';
          if (startagain) {
             psuf=' ' + String.fromCodePoint(10004);
          }
                   dostumps=true;
                   event.target.stopVideo();
                   parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='';
                   try {
                     window.sessionStorage.removeItem('loop_' + vid);
                   } catch(hdgf) { }
                   } else {
                   numericalssamecount++;
                   }
                   break;
                 case 'P':
                   if (numericalssamecount <= 0) {
                   if (one == 1 || onepause != 1) {
                     event.target.pauseVideo();
                   } else {
                     event.target.playVideo();
                   }
                   parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='';
                   } else {
                   numericalssamecount++;
                   }
                   break;
                 case 'M':
                   if (numericalssamecount <= 0) {
                   event.target.mute();
                   parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).removeAttribute('data-mute');
                   parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-mute', 'y');
                   mletter='M';
                   uletter='u';
                   parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='';
                   } else {
                   numericalssamecount++;
                   }
                   break;
                 case 'U':
                   if (numericalssamecount <= 0) {
                   event.target.unMute();
                   parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).removeAttribute('data-mute');
                   parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-mute', '');
                   mletter='m';
                   uletter='U';
                   parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='';
                   } else {
                   numericalssamecount++;
                   }
                   break;
                 case '0':
                 case '1':
                 case '2':
                 case '3':
                 case '4':
                 case '5':
                 case '6':
                 case '7':
                 case '8':
                 case '9':
                   if (2 == 2 || !navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
                      if (numericals == '') {
                        numericalssamecount=1;
                        numericals=parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value;
                        setTimeout(sanitycheck, 12000);
                      } else if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value == numericals) {
                        numericalssamecount++;
                        if (numericalssamecount >= 10) {
                           if (numericals.replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'').trim() == '') {
                              if (eval(numericals) >= 0 && eval(numericals) <= eval('' + duration)) {
                                event.target.seekTo(eval(numericals.trim()));
          if (wpwp) { if (88 == 88 || wpwp.document.getElementById('curct').innerHTML == '') {
            wpwp.document.getElementById('curct').innerHTML='' + eval(numericals.trim());
            wpwp.document.getElementById('curct').title='';
          } }
                                enforcedtimeis=eval(numericals.trim());
                                isnotplaying=false;
                                if (cursecselapsed >= 0.0) { cursubi=0; }
                              }
                              parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='';                              
                              numericals='';
                              numericalssamecount=0;
                              //ttt.title='ZerO';
                           } else {
                              ytsearch(parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value);
                              numericals='';
                              numericalssamecount=0;
                              //ttt.title='ZeRO';
                           }
                        }
                      } else {
                        numericalssamecount=1;
                        numericals=parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value;
                        setTimeout(sanitycheck, 12000);
                      }
                   }
                   break;
                 default:
                   if (numericalssamecount > 0) {
                     numericalssamecount++;
                   }
                   break;
              }
              if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder.replace('/p','').indexOf('/') != -1) {
              var altduration=duration;
              if (document.URL.indexOf('playtime=') != -1 && document.URL.indexOf('start=') != -1) {
                altduration=eval(eval('' + document.URL.split('start=')[1].split('&')[0].split('#')[0]) + eval('' + document.URL.split('playtime=')[1].split('&')[0].split('#')[0]));
                //ttt.title='' + altduration + ' via ' + document.URL.split('&play')[1];   // was event.target.getCurrentTime below previously
                if (!startagain && altduration < duration && eval(1.2 + Math.round(player.getCurrentTime())) > Math.floor(eval('' + altduration)) && eval('' + duration) > 0) {
                    event.target.seekTo(duration); 
          if (wpwp) { if (88 == 88 || wpwp.document.getElementById('curct').innerHTML == '') {
            wpwp.document.getElementById('curct').innerHTML='' + eval('' + duration);
            wpwp.document.getElementById('curct').title='';
          } }
                    enforcedtimeis=eval('' + duration);
                    isnotplaying=false;
                    if (cursecselapsed >= 0.0) { cursubi=0; }
                }
              }
              if (startagain && eval(2.2 + Math.round(event.target.getCurrentTime())) > Math.floor(eval('' + altduration)) && eval('' + duration) > 0) {
                thatisit=true;
                lastokn=0;
                //alert(4);
                if (('' + window.sessionStorage.getItem('loop_' + vid.split(',')[0])).replace(/^undefined/g,'').replace(/^null/g,'').trim() != '') {
                //alert(44);
                   window.sessionStorage.removeItem('loop_' + vid.split(',')[0]);
                }
                window.sessionStorage.setItem('loop_' + vid.split(',')[0], 'y');
                //alert(444);
                secscnt=eval(0.001 + duration);
                enforcedtimeis=eval(0.001 + duration);
                if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
                parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-loop','y');
                setTimeout(function(){ 
                  if (1 == 11) {   
                  setTimeout(startVideo, playtime + delay); 
                  thatisit=false; setTimeout(playingvideo, 1900); 
                  } else { 
                  var huhc=false;
                  // huhc=confirm('Okay to loop?');
                  if (huhc && 1 == 7) {
                  event.target.seekTo(0.01); 
          if (wpwp) { if (88 == 88 || wpwp.document.getElementById('curct').innerHTML == '') {
            wpwp.document.getElementById('curct').innerHTML='0.01';
            wpwp.document.getElementById('curct').title='';
          } }
                  secscnt=0.01;
                  oursecscnt=0.01;
                  event.target.playVideo(); 
                  thatisit=false; setTimeout(playingvideo, 1900);  
                  } else if (9 == 5) {
                  window.parent.focus();
                  parent.location.href=parent.document.URL.split('&random=')[0] + '&random=' + Math.floor(Math.random() * 1987865) + '&startagain=y' + ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^\#$/g,'');
                  window.parent.scrollTo(0,0);
                  } else {
                  event.target.seekTo(1);
          if (wpwp) { if (88 == 88 || wpwp.document.getElementById('curct').innerHTML == '') {
            wpwp.document.getElementById('curct').innerHTML='1.0';
            wpwp.document.getElementById('curct').title='';
          } }
                  thatisit=false; setTimeout(playingvideo, 3000);
                  setTimeout(retry, 5000);
                 //alert(4444);
                 }
                  } }, 1500);
                inplaying=false;
                return ''; 
                } else {
                parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-loop','y');
                setTimeout(function(){  window.top.focus(); parent.parent.document.getElementById(location.hash.replace(/\#/g,'').substring(3).split('_')[0]).click();   }, 1500);
                inplaying=false;
                return ''; 
                }
              }
              if (one == 1 || onepause != 1) {
              if (eval('' + duration) == 0) { 
                duration=event.target.getDuration();  
                stduration=eval('' + duration);
        //if (('' + top.document.URL).indexOf('/select_palette.') != -1) {
        //  alert('6987:' + duration);
        //}
          if (parent.document.getElementById('youtube_duration')) {
            if (parent.document.getElementById('youtube_duration').value.indexOf('22221') == 0 && ('' + duration) != 'undefined') {
              parent.document.getElementById('youtube_duration').value='' + duration;
              if (parent.document.getElementById('j0')) {
                if (parent.document.getElementById('j0').value == '22221') {
                  parent.document.getElementById('j0').value='' + duration;
                if (window.parent) {
                if (parent.window.opener) {
                  if (typeof parent.window.opener.setvurl == 'function') {
                   setTimeout(function(){
                    parent.window.opener.setvurl(parent.document.getElementById('youtubeid').value, parent.document.getElementById('myh1').innerHTML, parent.document.getElementById('youtube_duration').value);
                   }, 2000);
                  }
                }
                }
                }
              }
            }
          }
              }   // used to be event.target.getCurrentTime below previously
              parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).style.fontSize='7px';
              enforcedtimeis=eval('' + player.getCurrentTime());
          if (wpwp) { if (88 == 89 || wpwp.document.getElementById('curct').innerHTML == '') {
            alert('7:' + '' + eval(player.getCurrentTime()).toFixed(3));
            wpwp.document.getElementById('curct').innerHTML='' + eval(player.getCurrentTime()).toFixed(3);
          } }
              parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder='' + Math.round(player.getCurrentTime()) + '/' + duration + ' ... ' + 'P=pause/play S=stop M=' + mletter + 'ute U=' + uletter + 'nmute L=loop Y=YouTube G=Google W=Wikipedia' + psuf;
    if (('' + top.document.URL).indexOf('/select_palette.') != -1) {
      if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).outerHTML.indexOf('<textarea ') != -1) {
        if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).outerHTML.split('<textarea ')[1].split('</')[0].indexOf('display:none') != -1) {
          if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).outerHTML.split('<textarea ')[1].split('</')[0].indexOf(' id="') != -1) {
            parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).style.display='inline-block';
          }
        //} else if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).outerHTML.split('<textarea ')[1].split('</')[0].indexOf('inline-block') == -1) {
        //  alert(parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).outerHTML);
        }
      }
    }
              } else {
              if (eval('' + duration) == 0) { 
                duration=event.target.getDuration();  
                stduration=eval('' + duration);
        //if (('' + top.document.URL).indexOf('/select_palette.') != -1) {
        //  alert('7987:' + duration);
        //}
          if (parent.document.getElementById('youtube_duration')) {
            if (parent.document.getElementById('youtube_duration').value.indexOf('22221') == 0 && ('' + duration) != 'undefined') {
              parent.document.getElementById('youtube_duration').value='' + duration;
              if (parent.document.getElementById('j0')) {
                if (parent.document.getElementById('j0').value == '22221') {
                  parent.document.getElementById('j0').value='' + duration;
                if (window.parent) {
                if (parent.window.opener) {
                  if (typeof parent.window.opener.setvurl == 'function') {
                   setTimeout(function(){
                    parent.window.opener.setvurl(parent.document.getElementById('youtubeid').value, parent.document.getElementById('myh1').innerHTML, parent.document.getElementById('youtube_duration').value);
                   }, 2000);
                  }
                }
                }
                }
              }
            }
          }
              }
              parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).style.fontSize='7px';
              enforcedtimeis=eval('' + event.target.getCurrentTime());
          if (wpwp) { {
            alert('76:' + '' + eval(player.getCurrentTime()).toFixed(3));
            wpwp.document.getElementById('curct').innerHTML='' + eval(player.getCurrentTime()).toFixed(3);
          } }
              parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder='' + Math.round(event.target.getCurrentTime()) + '/' + duration + ' ... ' + 'P=play/pause S=stop M=' + mletter + 'ute U=' + uletter + 'nmute L=loop Y=YouTube G=Google W=Wikipedia' + psuf;
    if (('' + top.document.URL).indexOf('/select_palette.') != -1) {
      if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).outerHTML.indexOf('<textarea ') != -1) {
        if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).outerHTML.split('<textarea ')[1].split('</')[0].indexOf('display:none') != -1) {
          if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).outerHTML.split('<textarea ')[1].split('</')[0].indexOf(' id="') != -1) {
            parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).style.display='inline-block';
          }
        //} else if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).outerHTML.split('<textarea ')[1].split('</')[0].indexOf('inline-block') == -1) {
        //  alert(parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).outerHTML);
        }
      }
    }
              setTimeout(addablank, 3000);
              }
              setTimeout(playingvideo, 1000);
              }
              }
            }
          }
      }
      
      function addablank() {
        if (one == 1 || onepause != 1) {
          one=one;
        } else {
          parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder+=' ';
          setTimeout(addablank, 3000);
        }
      }
      
      function retry() {
            if (parent.parent.document.getElementById(location.hash.replace(/\#/g,''))) {
              if (('' + parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder).indexOf('0/0 ...') == 0) {
                  if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder.indexOf(' to continue looping') == -1) {
             if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
                  parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder+=' try click of red button to continue looping';
             } else {
                  parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder+=' try click of link to continue looping';
             }
                  if (lastokn > 0) {
                   if (('' + window.sessionStorage.getItem('loop_' + vid.split(',')[0])).replace(/^undefined/g,'').replace(/^null/g,'').trim() != '') {
                   window.sessionStorage.removeItem('loop_' + vid);
                   }
                   window.sessionStorage.setItem('loop_' + vid, '' + lastokn);
                  }
                  window.parent.focus();
                  parent.location.href=parent.document.URL.split('&random=')[0] + '&random=' + Math.floor(Math.random() * 1987865) + '&startagain=y' + ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^\#$/g,'');
                  window.parent.scrollTo(0,0);
                  }
              } else if (('' + parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder).indexOf('P=pause/play') != -1) {
                  if (('' + parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder).replace('pause/play','').indexOf('/') != -1) {
                    lastokn=eval(('' + parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder).split('/')[0]);
                  }
                  if (prevretry == '') {
                     prevretry=parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder;
                  } else if (prevretry == parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder) {
                     if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder.indexOf(' to continue looping') == -1) {
             if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
                     parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder+=' ... try click of red button to continue looping';
             } else {
                     parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder+=' ... try click of link to continue looping';
             }
                     }
                  } else {
                     prevretry=parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder;
                  }
              } else if (('' + parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder).indexOf('P=play/pause') != -1) {
                  if (('' + parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder).replace('play/pause','').indexOf('/') != -1) {
                    lastokn=eval(('' + parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder).split('/')[0]);
                  }
                  if (prevretry == '') {
                     prevretry=parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder;
                  } else if (prevretry == parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder) {
                     if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder.indexOf(' to continue looping') == -1) {
             if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
                     parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder+=' ... try click of red button to continue looping';
             } else {
                     parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder+=' ... try click of link to continue looping';
             }
                     }
                  } else {
                     prevretry=parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder;
                  }
              }
            }
      }
      
      function stopVideo() {
        //   if (('' + parent.document.getElementById('youtube_duration').value).indexOf("22222.") == 0) {
        //     //alert(5675);
        //     if (('' + parent.document.getElementById('youtube_duration').title) != '') {
        //     //alert(675);
        //     event.target.unMute();
        //     }
        //   }
        if (cntpause > 0) {
          if (('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/\#/g,'') != '') {
            if (parent.parent.document.getElementById(location.hash.replace(/\#/g,''))) {
              if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder.replace('/p','').indexOf('/') != -1) {
              parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).style.fontSize='7px';
              enforcedtimeis=eval(1 + eval('' + parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder.split('/')[0]));
              parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder='' + eval(1 + eval('' + parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder.split('/')[0])) + '/' + duration + ' ... ' + 'P=pause/play S=stop M=mute U=unmute L=loop Y=YouTube G=Google W=Wikipedia ';
    if (('' + top.document.URL).indexOf('/select_palette.') != -1) {
      if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).outerHTML.indexOf('<textarea ') != -1) {
        if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).outerHTML.split('<textarea ')[1].split('</')[0].indexOf('display:none') != -1) {
          if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).outerHTML.split('<textarea ')[1].split('</')[0].indexOf(' id="') != -1) {
            parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).style.display='inline-block';
          }
        //} else if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).outerHTML.split('<textarea ')[1].split('</')[0].indexOf('inline-block') == -1) {
        //  alert(parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).outerHTML);
        }
      }
    }
              }
            }
          }
          setTimeout(stopVideo, cntpause * 1000);
          cntpause=0;
        } else {
        //alert('stop');
        var dorest=true;
        toggle=1;
        try {
        secscnt=event.target.getCurrentTime();
          if (wpwp) {  if (88 == 89 || wpwp.document.getElementById('curct').innerHTML == '') {
            alert('8:' + '' + eval(event.target.getCurrentTime()).toFixed(3));
            wpwp.document.getElementById('curct').innerHTML='' + eval(event.target.getCurrentTime()).toFixed(3);
          } }
        enforcedtimeis=eval('' + secscnt);
        } catch(rtfgr) {
        secscnt=0;
        }
        try {
        duration=event.target.getDuration();
        stduration=eval('' + duration);
        //if (('' + top.document.URL).indexOf('/select_palette.') != -1) {
        //  alert('8987:' + duration);
        //}
          if (parent.document.getElementById('youtube_duration')) {
            if (parent.document.getElementById('youtube_duration').value.indexOf('22221') == 0 && ('' + duration) != 'undefined') {
              parent.document.getElementById('youtube_duration').value='' + duration;
              if (parent.document.getElementById('j0')) {
                if (parent.document.getElementById('j0').value == '22221') {
                  parent.document.getElementById('j0').value='' + duration;
                if (window.parent) {
                if (parent.window.opener) {
                  if (typeof parent.window.opener.setvurl == 'function') {
                   setTimeout(function(){
                    parent.window.opener.setvurl(parent.document.getElementById('youtubeid').value, parent.document.getElementById('myh1').innerHTML, parent.document.getElementById('youtube_duration').value);
                   }, 2000);
                  }
                }
                }
                }
              }
            }
          }
        } catch(rtfgrs) {
        duration=0;
        //if (('' + top.document.URL).indexOf('/select_palette.') != -1) {
        //  alert('oops:' + duration);
        //}
        }
          if (('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/\#/g,'') != '') {
            if (('' + parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).getAttribute('data-mute')).replace(/^undefined/g,'').replace(/^null/g,'') != '') {
              event.target.mute();
            }
            if (parent.parent.document.getElementById(location.hash.replace(/\#/g,''))) {
              parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-duration', '' + duration);
              if (!inplaying) { inplaying=true; setTimeout(playingvideo, 1000); }
              if (('' + parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).getAttribute('data-loop')).replace(/^undefined/g,'').replace(/^null/g,'') != '') {
                  startagain=true;
                  parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-loop', '');
              }
          psuf='';
          if (startagain) {
             psuf=' ' + String.fromCodePoint(10004);
          }
              parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder='' + secscnt + '/' + duration + ' ...';
            }
          }
        if (eval('' + endcnt) == 1) {
          endcnt=0;
          setTimeout(yeswell, eval(eval(10 + eval('' + duration)) * 1000));
        }
        //alert('preone' + playtime);
        if (playtime < 0) playtime=duration * 1000;
        //alert('Preone' + dorest);
        if (!ismobileplaylistplay) {
        //alert(1);
        if (parent.getnim()) {
         //alert(11);
          parent.setnim(false);
         //alert(111);
          parent.queuenext();
         //alert(1111);
        }
        try {
        event.target.stopVideo();
        } catch(fgh) {  }
        //if (('' + event.target).replace(/^null/g,'').replace(/^undefined/g,'') != '') {
        //event.target.stopVideo();
        //} else {
        //player.stopVideo();
        //}
        }
        if (document.URL.indexOf('start=') != -1 && document.URL.indexOf('playtime=') != -1) {
        if (document.URL.indexOf('start=0') == -1 || document.URL.indexOf('playtime=0') == -1) {
          //alert(secscnt + ' ' + document.URL);
          kpi=-1;
          keepParentInformed();
        }
        }
        if (eval(oursecscnt) < 0) {  // new Karaoke ideas in this "if"
          //alert(9);
          secscnt = duration;
          if (('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/\#/g,'') != '') {
            if (parent.parent.document.getElementById(location.hash.replace(/\#/g,''))) {
              parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder='' + secscnt + '/' + duration + ' ...';
            }
          }
          tobechecked=null;
          dorest=false;
        }
        //alert(secscnt);
        if (secscnt >= duration) {
        if (tobechecked != null) {
          if (tobechecked.value != '') {
            dorest=false;
            document.getElementById('oform').submit();
            //document.getElementById('bsubmit').click();
          }
        }
        if (dorest) {
        if (nexturl != "") {
        if (urlis == '') location.href=nexturl + ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^\#$/g,'');
        } else if ('old' == 'new') {
        if (document.URL.indexOf('nowo=') == -1 && document.URL.indexOf('start=') == -1) alert("Stumps has been called.  End of play.");
        } else if (dostumps && document.URL.indexOf('nowo=') == -1) {
        dostumps=false;
        var donext=null;
        if (document.URL.indexOf('start=') == -1) prompt("Stumps has been called.  End of play.  Is there a YouTube video id to play next?", "");
        if (donext == null) donext='';
        if (donext != '' && urlis == '') location.href='./stop_start_youtube.html?vid=' + donext + ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^\#$/g,'');
        }
        }
        } else {
        setTimeout(startVideo, playtime + delay);
        }
        }
      }
      
      function doamute() {
         event.target.setVolume(0);
      }
      
      
      function doaunmute() {
         event.target.setVolume(lastvolume);
      }
      
      function startVideo() {
        var dorest=true;
        //alert('PREone ' + secscnt + ' ' + duration + ':' + dorest);
        if (secscnt >= duration) {
        if (tobechecked != null) {
          if (tobechecked.value != '') {
            dorest=false;
            document.getElementById('oform').submit();
            //document.getElementById('bsubmit').click();
          }
        }
        if (dorest) {
        if (nexturl != "") {
        if (urlis == '') location.href=nexturl;
        } else if ('old' == 'new') {
        if (document.URL.indexOf('nowo=') == -1) alert("Stumps is called.  End of play.");
        } else if (dostumps && document.URL.indexOf('nowo=') == -1) {
        dostumps=false;
        var donext=prompt("Stumps is called.  End of play.  Is there a YouTube video id to play next?", "");
        if (donext == null) donext='';
        if (donext != '' && urlis == '') location.href='./stop_start_youtube.html?vid=' + donext + ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^\#$/g,'');
        }
        }
        } else {
        //alert('two');
          if (document.URL.indexOf('start=0') != -1 && document.URL.indexOf('playtime=0') != -1) {
          //alert('+' + duration);
          oursecscnt=-1;
          setTimeout(stopVideo, 10);
          if (parent.document.getElementById('youtube_duration').value.indexOf("22222.") != 0) {
          parent.document.getElementById('youtube_duration').value='' + duration;
          }
          if (window.top) {
            if (top.document.getElementById('list_eleven')) {
             top.document.getElementById('list_eleven').title='' + duration;
             //try {
             //top.document.getElementById('list_eleven').title+='|' + event.target.getVideoData().title;
             //} catch(errt) { 
             //top.document.getElementById('list_eleven').title='' + duration;
             //}
            }
          }
          parent.document.getElementById('myh1').innerHTML=event.target.getVideoData().title;
          if (kpi == -9) {
          //alert(99000);
        if (document.URL.indexOf('start=') != -1 && document.URL.indexOf('playtime=') != -1) {
          //alert(990000);
        if (document.URL.indexOf('start=0') == -1 || document.URL.indexOf('playtime=0') == -1) {
          //alert(9900000);
            kpi=-8;
            kpi=event.target.getCurrentTime();
          if (wpwp) { if (88 == 89 || wpwp.document.getElementById('curct').innerHTML == '') {
                      alert('9:' + '' + eval(event.target.getCurrentTime()).toFixed(3)); 
            wpwp.document.getElementById('curct').innerHTML='' + eval(event.target.getCurrentTime()).toFixed(3);
          } }
            if (('' + kpi) == 'undefined') {
                      alert('IViD=' + ivid + ' vid=' + vid + ' url=' + document.URL);
            }
            keepParentInformed();
            }
            }
          }
          //stopVideo();
          return;
          } else {
        document.title='-YouTube ' + vid + ' starting at ' + secscnt + ' seconds to ' + Math.min(duration, eval(secscnt + (playtime / 1000))) + ' seconds for up to ' + playtime / 1000 + ' seconds ... is ' + duration + ' seconds altogether.'; 
          enforcedtimeis=eval('' + secscnt); 
          isnotplaying=false;
        document.getElementById('ptitle').innerHTML='Playing YouTube ' + vid + ' starting at ' + secscnt + ' seconds to ' + Math.min(duration, eval(secscnt + (playtime / 1000))) + ' seconds for up to ' + playtime / 1000 + ' seconds ... is ' + duration + ' seconds altogether.' + etc_volume(); 
        document.getElementById('ivol').value=event.target.getVolume(); 
        document.getElementById('ipbr').value=event.target.getPlaybackRate(); 
        document.getElementById('iqty').value=event.target.getPlaybackQuality();
        eventtarget.cueVideoById(vid, secscnt, secscnt + playtime / 1000, "medium"); 
        if (eval(oursecscnt) > 0) {
        //alert(oursecscnt);
          if (('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/\#/g,'') != '') {
            if (parent.parent.document.getElementById(location.hash.replace(/\#/g,''))) {
              parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder='' + oursecscnt + '/' + duration + ' ...';
            }
          }
          enforcedtimeis=eval('' + oursecscnt); 
          isnotplaying=false;
            document.getElementById('ptitle').innerHTML='Playing YouTube ' + vid + ' starting at ' + oursecscnt + ' seconds to ' + Math.min(duration, eval(secscnt + (playtime / 1000))) + ' seconds for up to ' + playtime / 1000 + ' seconds ... is ' + duration + ' seconds altogether.' + etc_volume(); 
            document.title='Playing YouTube ' + vid + ' starting at ' + oursecscnt + ' seconds ' + of + ' for ' + playtime / 1000 + ' seconds ... is ' + duration + ' seconds altogether.'; 
          if (kpi == -9) {
          //alert(909);
        if (document.URL.indexOf('start=') != -1 && document.URL.indexOf('playtime=') != -1) {
          //alert(9090);
        if (document.URL.indexOf('start=0') == -1 || document.URL.indexOf('playtime=0') == -1) {
          //alert(90900);
            kpi=-8;
            kpi=event.target.getCurrentTime();
          if (wpwp) { if (88 == 89 || wpwp.document.getElementById('curct').innerHTML == '') {
            alert('73:' + '' + eval(event.target.getCurrentTime()).toFixed(3));
            wpwp.document.getElementById('curct').innerHTML='' + eval(event.target.getCurrentTime()).toFixed(3);
          } }
            if (('' + kpi) == 'undefined') {
                      alert('iVID=' + ivid + ' vid=' + vid + ' url=' + document.URL);
            }
            //alert(kpi + ".");
            keepParentInformed();
            }
            }
          }
            //eventtarget.loadVideoById(vid, eval(oursecscnt), eval(oursecscnt + playtime / 1000), "medium"); 
            eventtarget.loadVideoById(vid, eval('' + oursecscnt), eval('' + oursecscnt) + eval(eval('' + playtime) / 1000.0), "medium"); 
            oursecscnt=-1;
        }
        toggle=0;
        event.target.playVideo();
        setTimeout(stopVideo, playtime + delay);
        }
          }
      }
 function iflhme(lhwhat) {
   if (lhwhat.indexOf('#') == 0 && ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').indexOf(lhwhat) == -1) {
      if (ggstr != '') {
      if (lhwhat.indexOf(ggstr) != -1) {
      location.hash=lhwhat;
      } else {
      lhwhat+=ggstr;
      location.hash=lhwhat;
      ggstr='';
      }
      } else {
      location.hash=lhwhat;
      }
      passthislhon=lhwhat;
   }
   return lhwhat;
 }
      
      function subripize() {
        if (document.getElementById('result')) {
         if (document.getElementById('result').innerHTML != '') {
           if (document.getElementById('result').innerHTML.indexOf(';base64,') != -1) {
              var washg=hgrip;
              hgrip=window.atob(document.getElementById('result').innerHTML.split(';base64,')[1]); //iflhme('#srt=' + encodeURIComponent(window.atob(document.getElementById('result').innerHTML.split(';base64,')[1])));
              document.getElementById('mysubrip').innerHTML=hgrip;
              document.getElementById('result').innerHTML='';
              document.getElementById('divcbi').innerHTML=sdivcbi;
              hgans='.';
        gsrt=hgrip;
        processsrt('');
        if (washg == '') {
                       if (window.opener) {
                      
                      if (window.opener.window.opener) {
                      if (window.opener.document.URL.indexOf('/karaoke_') != -1 && ('' + window.opener.document.URL + '~').indexOf('srt=~') != -1) {
                      if (window.opener.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                        fauxpas_w=window.opener.window.opener; //alert('yEs FounD');
                      } else if (window.opener.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=window.opener.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      
                           if (window.opener.document.getElementById('stduration')) {
                             window.opener.document.getElementById('stduration').innerHTML='' + fromsecs(stduration) + '#' + vid;
                           }
                       }
                       if (window.top) {
                       //alert('Top');
                         if (top.document.getElementById('stduration')) {
                           top.document.getElementById('stduration').innerHTML='' + fromsecs(stduration) + '#' + vid;
                         } else if (window.parent) {
                       //alert('ParenT');
                           if (parent.document.getElementById('stduration')) {
                             parent.document.getElementById('stduration').innerHTML='' + fromsecs(stduration) + '#' + vid;
                           }
                         }
                       } else if (window.parent) {
                       //alert('Parent');
                      if (window.parent) {
                      if (parent.document.URL.indexOf('/karaoke_') != -1 && ('' + parent.document.URL + '~').indexOf('srt=~') != -1) {
                      if (parent.window.opener) {
                      if (parent.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                        fauxpas_w=parent.window.opener; //alert('fouNd');
                      } else if (parent.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=parent.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      }
                      
                           if (parent.document.getElementById('stduration')) {
                             parent.document.getElementById('stduration').innerHTML='' + fromsecs(stduration) + '#' + vid;
                           }
                       }
                       document.getElementById('subtitlegoeshere').title='Captions and subtitles';
        }
           }
         }
        }
        if (hgrip != '' && document.getElementById('subtitlegoeshere') && lasthgrip != hgrip) {
            lasthgrip=hgrip;
                       if (window.opener) {
                      
                      if (window.opener.window.opener) {
                      if (window.opener.document.URL.indexOf('/karaoke_') != -1 && ('' + window.opener.document.URL + '~').indexOf('srt=~') != -1) {
                      if (window.opener.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                        fauxpas_w=window.opener.window.opener; //alert('YES FounD');
                      } else if (window.opener.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=window.opener.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      
                           if (window.opener.document.getElementById('durationlh')) {
                             window.opener.document.getElementById('durationlh').innerHTML='' + hgrip; //.replace(/\>/g, '>').replace(/\</g, '<');
                           }
                       } else {
                                   if (window.top) {
                         if (top.document.getElementById('durationlh')) {
                           top.document.getElementById('durationlh').innerHTML='' + hgrip.replace(/\>/g, '>').replace(/\</g, '<');
                         } else if (window.parent) {
                           if (parent.document.getElementById('durationlh')) {
                             parent.document.getElementById('durationlh').innerHTML='' + hgrip.replace(/\>/g, '>').replace(/\</g, '<');
                           }
                         }
                       } else if (window.parent) {
                      if (window.parent) {
                      if (parent.document.URL.indexOf('/karaoke_') != -1 && ('' + parent.document.URL + '~').indexOf('srt=~') != -1) {
                      if (parent.window.opener) {
                      if (parent.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                        fauxpas_w=parent.window.opener; //alert('fOuNd');
                      } else if (parent.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=parent.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      }
                      
                           if (parent.document.getElementById('durationlh')) {
                             parent.document.getElementById('durationlh').innerHTML='' + hgrip.replace(/\>/g, '>').replace(/\</g, '<');
                           }
                         }
                        }
                        
            document.getElementById('subripcommentary').innerHTML=document.getElementById('subtitlegoeshere').title + '<br><textarea onblur="hgrip=massage(this.value,hgrip);" id=mysubrip style=width:300px;height:500px;background-color:#f9f9f9;>' + hgrip.replace(/youllneverfindthis/g,'{Awaiting pause}') + '</textarea>';
        }
      }
 
      function yesthreethree(restis) {
        var washg=hgrip;
        hgrip=restis;
        hgans='.';
        document.getElementById('mysubrip').innerHTML=hgrip;
        document.getElementById('result').innerHTML='';
        document.getElementById('divcbi').innerHTML=sdivcbi;
        if (washg == '') {
                       if (window.opener) {
                      
                      if (window.opener.window.opener) {
                      if (window.opener.document.URL.indexOf('/karaoke_') != -1 && ('' + window.opener.document.URL + '~').indexOf('srt=~') != -1) {
                      if (window.opener.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                        fauxpas_w=window.opener.window.opener; //alert('yes FoUnD');
                      } else if (window.opener.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=window.opener.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      
                           if (window.opener.document.getElementById('stduration')) {
                             window.opener.document.getElementById('stduration').innerHTML='' + fromsecs(stduration) + '#' + vid;
                           }
                       }
                       if (window.top) {
                       //alert('Top');
                         if (top.document.getElementById('stduration')) {
                           top.document.getElementById('stduration').innerHTML='' + fromsecs(stduration) + '#' + vid;
                         } else if (window.parent) {
                       //alert('ParenT');
                           if (parent.document.getElementById('stduration')) {
                             parent.document.getElementById('stduration').innerHTML='' + fromsecs(stduration) + '#' + vid;
                           }
                         }
                       } else if (window.parent) {
                       //alert('Parent');
                      if (window.parent) {
                      if (parent.document.URL.indexOf('/karaoke_') != -1 && ('' + parent.document.URL + '~').indexOf('srt=~') != -1) {
                      if (parent.window.opener) {
                      if (parent.window.opener.document.URL.replace('/video_commentary.htm', '/song_lyric_faux_pas.htm').indexOf('/song_lyric_faux_pas.htm') != -1) {
                        fauxpas_w=parent.window.opener; //alert('FounD');
                      } else if (parent.window.opener.getElementById('cbbeep')) {
                        fauxpas_w=parent.window.opener; //alert('yes FounD');
                      }
                      }
                      }
                      }
                      
                           if (parent.document.getElementById('stduration')) {
                             parent.document.getElementById('stduration').innerHTML='' + fromsecs(stduration) + '#' + vid;
                           }
                       }
                       document.getElementById('subtitlegoeshere').title='Captions and subtitles';
        }
        gsrt=hgrip;
        processsrt('');
        subripize();
      } 
     
      function massage(altval, actval) {
        if (1 == 1) {
          return altval.replace(/\{Awaiting\ pause\}/g,'youllneverfindthis').replace(/00\:\00\:00\,000/g, '00:00:00,001').replace(/00\:\00\:00\.000/g, '00:00:00.001');
        }
        return actval;
      }
    </script>
  <h1 style='align:right;'>YouTube Embedded Iframe API Usage</h1>
  <h3 style='align:right;'>RJM Programming - June, 2016</h3>
  <table><tr><td id=tdleft style=vertical-align:top;>
  <div id='ptitle'></div>
  <div id='dform' style='background-color:yellow;'></div>
  <div id='subtitlegoeshere' style='background-color:orange;' onclick=alert(this.title); title='Captions and subtitles'></div></td><td id=subripcommentary style=vertical-align:top;background-color:yellow;width:65%;></td></tr></table>
<div id="doverlay"></div>
<div id="result" style=display:none;></div>
<div id="resultaJUNKv" style=display:none;></div>
<div id="resultout" style=display:none;></div>
<div id="resultrestout" style=display:none;></div>
<div id="resultsrtout" style=display:none;></div>
<div id="resultvttout" style=display:none;></div>
<div id="txtsrtout" style=display:none;></div>
<div id="videoag" style=display:none;></div>
<input type=hidden id="audioname" style=display:none; value=''></input>
<input type=hidden id="outputname" style=display:none; value=''></input>
<input type=hidden id="cto" style=display:none; value=''></input>
<input type=hidden id="thewords" style=display:none; value=''></input>
<input type=hidden id="saysub" style=display:none; value=''></input>
  </body>
</html>