<!doctype html>
<html>
<head>
<title>Splicing Audio - RJM Programming - August, 2016</title>
<script type='text/javascript'>
var audioobj=[];
var astarts=[0,0,0,0,0,0,0,0,0];
var aends=[-1,-1,-1,-1,-1,-1,-1,-1,-1];
var vstarts=[0,0,0,0,0,0,0,0,0];
var vends=[-1,-1,-1,-1,-1,-1,-1,-1,-1];
var audiofiles=['','','','','','','','',''];
var audiotype=['Audio','Audio','Audio','Audio','Audio','Audio','Audio','Audio','Audio'];
var audiooverlay=['Optional','Optional','Optional','Optional','Optional','Optional','Optional','Optional','Optional',''];
var zero=0, numthatare=0, prevnumthatare=0;
var delay=0.0;
var noneblock='block';
var hideform='on';
var hideformlater='off', durtoid='';
var burl='', uniqu='';
var wo=null;
var isaudio=true;
var lastvideo='';
var cmd='';
var spareaudiourl='';
var suffix='', divanaudio='', divanvideo='', divanimg='';
var spareanaudio='', spareanvideo='', spareanimg='', spareelse='';
var minushash;
var vstart=0;
var vend=-1;
var astart=0;
var aend=-1;
var documentURL=document.URL;
var mtypes=["audio/x-aiff","audio/wav","audio/x-wav","audio/x-pn-realaudio","audio/x-mpegurl","audio/x-aiff","audio/mpeg","audio/mid",
      "audio/basic","audio/ogg","video/x-sgi-movie","video/x-msvideo","video/quicktime","audio/mp3","video/mp4","video/mpeg","video/mp4",
      "video/x-la-asf","video/ogg","video/webm","audio/mp4", "image/jpeg", "image/jpeg", "image/png", "image/gif", "image/bmp", "image/tif"];
var mexts=[".aiff",".wav",".wav",".ram",".m3u",".aiff",".mp3",".rmi",
      ".snd",".ogg",".movie",".avi",".mov",".mp3",".m4v",".mpeg", ".mp4",
      ".lsx",".ogv",".webm",".m4a", ".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tif"];
function seqe() {
      var suff=' of 1', lzero=0;
      if (document.getElementById('end' + eval(1 + zero)) && (spareanvideo != '' || spareanaudio != '' || spareelse != '' || zero > 0)) { 
      while (audiofiles[eval(0 + lzero)].trim() != '') {
        lzero++;
      }
      suff=' of ' + lzero;    
      if (audiofiles[eval(0 + zero)].indexOf('data:audio/') == 0) {
      isaudio=true;
      document.getElementById('subis').value='Currently Playing Audio ' + eval(1 + zero) + suff; // + ': ' + audiofiles[eval(0 + zero)].replace(/\ /g,'+'); // + " via Google Translate if you press speaker and am waiting for you to close that window.";
      //var xc=prompt(divanaudio.replace('<source ', '<source type=audio/' + audiofiles[eval(0 + zero)].split('data:audio/')[1].split(',')[0].split(';')[0] + ' ').replace(' src=""', ' src="' + audiofiles[eval(0 + zero)].replace(/\ /g,'+') + '"').replace('none','BLOCK'),divanaudio.replace('<source ', '<source type=audio/' + audiofiles[eval(0 + zero)].split('data:audio/')[1].split(',')[0].split(';')[0] + ' ').replace(' src=""', ' src="' + audiofiles[eval(0 + zero)].replace(/\ /g,'+') + '"').replace('none','BLOCK'));
      document.getElementById('divanaudio').style.width='100%';
      document.getElementById('divanaudio').innerHTML=divanaudio.replace('>',' controls>').replace(' title=""', ' title="Play"').replace('<source ', '<source type=audio/' + audiofiles[eval(0 + zero)].split('data:audio/')[1].split(',')[0].split(';')[0] + ' ').replace(' src=""', ' src="' + audiofiles[eval(0 + zero)].replace(/\ /g,'+') + '"').replace('none','BLOCK');
      if (document.getElementById('end' + eval(1 + zero)).value.replace(/^0/g,'-').indexOf('-') == -1) {
        setTimeout(function(){  zero++; seqe(); }, eval(1000 * (eval('' + document.getElementById('end' + eval(1 + zero)).value) + 4 - eval('' + document.getElementById('start' + eval(1 + zero)).value))));
      }
      } else if (audiofiles[eval(0 + zero)].indexOf('data:video/') == 0) {
      isaudio=false;
      document.getElementById('subis').value='Currently Playing Video ' + eval(1 + zero) + suff; // + ': ' + audiofiles[eval(0 + zero)].replace(/\ /g,'+'); // + " via Google Translate if you press speaker and am waiting for you to close that window.";
      document.getElementById('divanvideo').style.width='100%';
      document.getElementById('divanvideo').innerHTML=divanvideo.replace('>',' controls>').replace(' title=""', ' title="Play"').replace('<source ', '<source type=video/' + videofiles[eval(0 + zero)].split('data:video/')[1].split(',')[0].split(';')[0] + ' ').replace(' src=""', ' src="' + videofiles[eval(0 + zero)].replace(/\ /g,'+') + '"').replace('none','BLOCK');
      if (document.getElementById('end' + eval(1 + zero)).value.replace(/^0/g,'-').indexOf('-') == -1) {
        setTimeout(function(){  zero++; seqe(); }, eval(1000 * (eval('' + document.getElementById('end' + eval(1 + zero)).value) + 4 - eval('' + document.getElementById('start' + eval(1 + zero)).value))));
      }
      } else if (audiofiles[eval(0 + zero)].indexOf('data:image/') == 0) {
      isaudio=false;
      document.getElementById('subis').value='Currently Showing Image ' + eval(1 + zero) + suff; // + ': ' + audiofiles[eval(0 + zero)].replace(/\ /g,'+'); // + " via Google Translate if you press speaker and am waiting for you to close that window.";
      document.getElementById('divanimg').style.width='100%';
      document.getElementById('divanimg').innerHTML=divanimg.replace('>',' controls>').replace(' title=""', ' title="Play"').replace('<source ', '<source type=img/' + imgfiles[eval(0 + zero)].split('data:img/')[1].split(',')[0].split(';')[0] + ' ').replace(' src=""', ' src="' + imgfiles[eval(0 + zero)].replace(/\ /g,'+') + '"').replace('none','BLOCK');
      if (document.getElementById('end' + eval(1 + zero)).value.replace(/^0/g,'-').indexOf('-') == -1) {
        setTimeout(function(){  zero++; seqe(); }, eval(1000 * (eval('' + document.getElementById('end' + eval(1 + zero)).value) + 4 - eval('' + document.getElementById('start' + eval(1 + zero)).value))));
      }
      } else if (audiofiles[eval(0 + zero)] != '') {
      isaudio=true;
      document.getElementById('subis').value='Currently Playing Audio ' + eval(1 + zero) + ': ' + noplus(audiofiles[eval(0 + zero)]) + " via Google Translate if you press speaker and am waiting for you to close that window " + suff;
      wo=window.open('https://translate.google.com/#auto/en/' + encodeURIComponent(noplus(audiofiles[eval(0 + zero)])),'_blank','top=50,left=50,width=600,height=600');
      }
      setTimeout(precheckget, 20);
      }
}
function overlaydosel(sio) {
  audiooverlay[eval(-1 + eval(sio.id.replace('osel','')))]=sio.value;
}
function dosel(sio) {
  audiotype[eval(-1 + eval(sio.id.replace('sel','')))]=sio.value;
}
function doinput(sio) {
  var ij=0;
  if (sio.value.indexOf('data:audio/') == 0 && document.URL.replace('#','?').indexOf('?') == -1) {
    if (sio.value.indexOf(';base64,') != -1) {
    durtoid='end' + sio.id.replace('audio','');
    document.getElementById('sel' + sio.id.replace('audio','')).value='Audio';
    document.getElementById('divanaudio').innerHTML=divanaudio.replace('<source ', '<source type=audio/' + sio.value.split('data:audio/')[1].split(',')[0].split(';')[0] + ' ').replace(' src=""', ' src="' + sio.value + '"').replace('none','NONE');
    document.getElementById('myif').src='/HTMLCSS/do_away_with_the_boring_bits.php?uniquify=' + uniqu + '&rand=' + encodeURIComponent(sio.value.split(';base64,')[0] + ';base64,');
    document.getElementById('myifurl').value=sio.value;
    document.getElementById('myifdurto').value=durtoid;
    document.getElementById('myifjustfgcdu').value=sio.value.split(';base64,')[0] + ';base64,';
    setTimeout(function(){
    document.getElementById('myifb').click(); 
    setTimeout(function(){ uniqu+='0'; document.getElementById('uniquify').innerHTML="<input type=hidden name=uniquify id=myuniquify value='" + uniqu + "'></input>"; }, 1000);
    }, 2000);
    }
  } else if (sio.value.indexOf('data:video/') == 0 && document.URL.replace('#','?').indexOf('?') == -1) {
    if (sio.value.indexOf(';base64,') != -1) {
    durtoid='end' + sio.id.replace('audio','');
    document.getElementById('sel' + sio.id.replace('audio','')).value='Video';
    document.getElementById('divanvideo').innerHTML=divanvideo.replace('<source ', '<source type=video/' + sio.value.split('data:video/')[1].split(',')[0].split(';')[0] + ' ').replace(' src=""', ' src="' + sio.value + '"').replace('none','NONE');
    document.getElementById('myif').src='/HTMLCSS/do_away_with_the_boring_bits.php?uniquify=' + uniqu + '&rand=' + encodeURIComponent(sio.value.split(';base64,')[0] + ';base64,');
    document.getElementById('myifurl').value=sio.value;
    document.getElementById('myifdurto').value=durtoid;
    document.getElementById('myifjustfgcdu').value=sio.value.split(';base64,')[0] + ';base64,';
    setTimeout(function(){
    document.getElementById('myifb').click();
    setTimeout(function(){ uniqu+='0'; document.getElementById('uniquify').innerHTML="<input type=hidden name=uniquify id=myuniquify value='" + uniqu + "'></input>"; }, 1000);
    }, 2000);
    }
  } else if (sio.value.indexOf('data:image/') == 0 && document.URL.replace('#','?').indexOf('?') == -1) {
    if (sio.value.indexOf(';base64,') != -1) {
    durtoid='end' + sio.id.replace('audio','');
    document.getElementById('sel' + sio.id.replace('audio','')).value='Image';
    document.getElementById('divanimg').innerHTML=divanimg.replace(' src=""', ' src="' + sio.value + '"').replace('none','NONE');
    document.getElementById('myif').src='/HTMLCSS/do_away_with_the_boring_bits.php?uniquify=' + uniqu + '&rand=' + encodeURIComponent(sio.value.split(';base64,')[0] + ';base64,');
    document.getElementById('myifurl').value=sio.value;
    document.getElementById('myifdurto').value=durtoid;
    document.getElementById('myifjustfgcdu').value=sio.value.split(';base64,')[0] + ';base64,';
    setTimeout(function(){
    document.getElementById('myifb').click();
    setTimeout(function(){ uniqu+='0'; document.getElementById('uniquify').innerHTML="<input type=hidden name=uniquify id=myuniquify value='" + uniqu + "'></input>"; }, 1000);
    }, 2000);
    }
  } else if (('     ' + sio.value.replace(/\.$/g,'')).slice(-5).indexOf('.') != -1 && document.URL.replace('#','?').indexOf('?') == -1) {
    for (ij=0; ij<mexts.length; ij++) {
      if ((sio.value + '~').indexOf(mexts[ij] + '~') != -1) {
         durtoid='end' + sio.id.replace('audio','');
         document.getElementById('sel' + sio.id.replace('audio','')).value=mtypes[ij].split('/')[0].substring(0,1).toUpperCase() + mtypes[ij].split('/')[0].substring(1).toLowerCase();
         switch (mtypes[ij].split('/')[0]) {
           case "audio":
             document.getElementById('myif').src='/HTMLCSS/do_away_with_the_boring_bits.php?url=' + encodeURIComponent(sio.value) + '&durto=end' + sio.id.replace('audio','') + '&justfgcdu=' + encodeURIComponent('data:' + mtypes[ij] + ';base64,');
             break;
           case "video":
             document.getElementById('myif').src='/HTMLCSS/do_away_with_the_boring_bits.php?url=' + encodeURIComponent(sio.value) + '&durto=end' + sio.id.replace('audio','') + '&justfgcdu=' + encodeURIComponent('data:' + mtypes[ij] + ';base64,');
             break;
             
           default:
             break;
         
         }
      }
    }
  }
  audiofiles[eval(-1 + eval(sio.id.replace('audio','')))]=sio.value;
}
function startend(mh) {
  var postmh;
  if (audiotype[eval(0 + zero)] == 'Video') {
    vstart=0;
    vend=-1;
    postmh=mh.replace('+',' ').replace('+',' ').replace('+',' ').split('.');
    if (postmh[0] == '') {
      if (postmh.length > 1) {
       vend=eval(postmh[1]);
       vends[zero]=vend;
       document.getElementById('end' + eval(1 + zero)).value=eval(postmh[1]);
      }
    } else if (postmh.length > 1) {
//alert(mh);
      vstart=eval(postmh[0]);
      vend=eval(postmh[1]);
       vstarts[zero]=vstart;
       vends[zero]=vend;
      document.getElementById('start' + eval(1 + zero)).value=butv('start' + eval(1 + zero), eval(postmh[0]));
      document.getElementById('end' + eval(1 + zero)).value=butv('end' + eval(1 + zero), eval(postmh[1]));
    } else {
// http://localhost:8888/splice_audio.htm?audio1=http%3A%2F%2Fwww.rjmprogramming.com.au%2FMac%2FGoToMeeting%2FGoToMeeting.m4v+%235+%2315.28&audio2=+http%3A%2F%2Fwww.rjmprogramming.com.au%2FMac%2FGoToMeeting%2FGoToMeeting.m4a&audio3=http%3A%2F%2Fwww.rjmprogramming.com.au%2FMac%2FGoToMeeting%2FGoToMeeting.m4v+&audio4=&audio5=&audio6=&audio7=&audio8=&audio9=&background=&hide=offoff
//alert(mh);
      vstart=eval(postmh[0]);
       vstarts[zero]=vstart;
      document.getElementById('start' + eval(1 + zero)).value=butv('start' + eval(1 + zero), eval(postmh[0]));
    }
  } else if (audiotype[eval(0 + zero)] == 'Audio') {
    astart=0;
    aend=-1;
    postmh=mh.split('.');
    if (postmh[0] == '') {
      if (postmh.length > 1) {
       aend=eval(postmh[1]);
       aends[zero]=aend;
       document.getElementById('end' + eval(1 + zero)).value=butv('end' + eval(1 + zero), eval(postmh[1]));
      }
    } else if (postmh.length > 1) {
      astart=eval(postmh[0]);
      aend=eval(postmh[1]);
       astarts[zero]=astart;
       aends[zero]=aend;
      document.getElementById('start' + eval(1 + zero)).value=butv('start' + eval(1 + zero), eval(postmh[0]));
      document.getElementById('end' + eval(1 + zero)).value=butv('end' + eval(1 + zero), eval(postmh[1]));
    } else {
      astart=eval(postmh[0]);
      document.getElementById('start' + eval(1 + zero)).value=butv('start' + eval(1 + zero), eval(postmh[0]));
       astarts[zero]=astart;
    }
  }
}
function noplus(inp) {
  minushash=inp.split('#');
  var outp=minushash[0];
  isaudio=true;
  if (outp.indexOf(' ') == 0) outp=outp.replace(' ','');
  if (outp.indexOf('+') == 0) outp=outp.replace('+','');
  while (outp.indexOf('+') != -1) {
    outp=outp.replace('+',' ');
  }
  if (outp != outp.trim()) {
    if (eval(outp.length) > eval(1 + outp.trim().length)) {
    //alert(9);
    document.getElementById('audio' + eval(1 + zero)).value=outp.trim();
    document.getElementById('sel' +  eval(1 + zero)).value='Image';
    audiotype[eval(0 + zero)]='Image';
    document.body.style.opacity=0.6;
    document.body.style.background=" url('" + outp.trim() + "')";
    delay=5.0;
    } else {
    isaudio=false;
    audiotype[eval(0 + zero)]='Video';
    }
  }
  if (minushash.length > 1) startend(minushash[1]);
  return outp.trim();
}
function fixtypes() {
  var sparef;
  for (var ii=1; ii<=audiofiles.length; ii++) {
    if (audiofiles[eval(-1 + ii)].indexOf('+') == 0) {
      audiooverlay[eval(-1 + ii)]='Overlay';
      audiofiles[eval(-1 + ii)]=audiofiles[eval(-1 + ii)].substring(1);
    } else if (audiofiles[eval(-1 + ii)].indexOf(' ') == 0) {
      audiooverlay[eval(-1 + ii)]='Overlay';
      audiofiles[eval(-1 + ii)]=audiofiles[eval(-1 + ii)].substring(1);
    }
    if (audiofiles[eval(-1 + ii)].indexOf('++') != -1 || eval(audiofiles[eval(-1 + ii)].length) > eval(1 + audiofiles[eval(-1 + ii)].trim().length)) {
      document.getElementById('sel' + ii).value = 'Image';
      audiotype[eval(-1 + ii)]='Image';
    } else if (audiofiles[eval(-1 + ii)].indexOf('+') != -1 || eval(audiofiles[eval(-1 + ii)].length) > eval(audiofiles[eval(-1 + ii)].trim().length)) {
      document.getElementById('sel' + ii).value = 'Video';
      audiotype[eval(-1 + ii)]='Video';
    }
  }
  var prezero=zero;
  zero=0;
  for (var iii=1; iii<=audiofiles.length; iii++) {
    minushash=audiofiles[eval(-1 + iii)].split('#');
    if (minushash.length > 1) startend(minushash[1]);
    zero++;
  }
  zero=prezero;
  for (var ii=2; ii<=audiofiles.length; ii++) {
    if (audiooverlay[eval(-1 + ii)] == 'Overlay' && audiooverlay[eval(-2 + ii)] != 'Overlay') {
       //alert(990 + ' ... ' + audiotype[eval(-1 + ii)] + ' ... ' + audiotype[eval(-2 + ii)]);
     if (audiotype[eval(-1 + ii)] == 'Video' && audiotype[eval(-2 + ii)] == 'Audio') {
       //alert(99);
       sparef=audiofiles[eval(-2 + ii)];
       audiofiles[eval(-2 + ii)]=audiofiles[eval(-1 + ii)];
       audiofiles[eval(-1 + ii)]=sparef;
       audiotype[eval(-2 + ii)]='Video';
       audiotype[eval(-1 + ii)]='Audio';
       document.getElementById('audio' + eval(-1 + ii)).value=audiofiles[eval(-2 + ii)].replace('+','').replace('+','').replace('+','');
       document.getElementById('audio' + eval(ii)).value=audiofiles[eval(-1 + ii)].replace('+','').replace('+','').replace('+','');
       //alert(99);
     }
    }
  }
}
function fixstartend() {
  for (var ii=1; ii<=audiofiles.length; ii++) {
    if (eval(document.getElementById('start' + ii).value) != 0 && eval(document.getElementById('end' + ii).value) != -1) {
      if (audiotype[eval(-1 + ii)] == 'Audio') {
        astarts[eval(-1 + ii)]=eval(document.getElementById('start' + ii).value);
        aends[eval(-1 + ii)]=eval(document.getElementById('end' + ii).value);
        document.getElementById('audio' + ii).value=document.getElementById('audio' + ii).value.split('#')[0] + "#" + eval(document.getElementById('start' + ii).value) + "." + eval(document.getElementById('end' + ii).value);
      } else if (audiotype[eval(-1 + ii)] == 'Video') {
        vstarts[eval(-1 + ii)]=eval(document.getElementById('start' + ii).value);
        vends[eval(-1 + ii)]=eval(document.getElementById('end' + ii).value);
        document.getElementById('audio' + ii).value=document.getElementById('audio' + ii).value.split('#')[0] + "#" + eval(document.getElementById('start' + ii).value) + "." + eval(document.getElementById('end' + ii).value);
      }
    } else if (eval(document.getElementById('start' + ii).value) != 0) {
      if (audiotype[eval(-1 + ii)] == 'Audio') {
        astarts[eval(-1 + ii)]=eval(document.getElementById('start' + ii).value);
        document.getElementById('audio' + ii).value=document.getElementById('audio' + ii).value.split('#')[0] + "#" + eval(document.getElementById('start' + ii).value); 
      } else if (audiotype[eval(-1 + ii)] == 'Video') {
        vstarts[eval(-1 + ii)]=eval(document.getElementById('start' + ii).value);
        document.getElementById('audio' + ii).value=document.getElementById('audio' + ii).value.split('#')[0] + "#" + eval(document.getElementById('start' + ii).value); 
      }
    } else if (eval(document.getElementById('end' + ii).value) != -1) {
      if (audiotype[eval(-1 + ii)] == 'Audio') {
        aends[eval(-1 + ii)]=eval(document.getElementById('end' + ii).value);
        document.getElementById('audio' + ii).value=document.getElementById('audio' + ii).value.split('#')[0] + "#." + eval(document.getElementById('end' + ii).value); 
      } else if (audiotype[eval(-1 + ii)] == 'Video') {
        vends[eval(-1 + ii)]=eval(document.getElementById('end' + ii).value);
        document.getElementById('audio' + ii).value=document.getElementById('audio' + ii).value.split('#')[0] + "#." + eval(document.getElementById('end' + ii).value); 
      }
    }
  }
}
function fixtype() {
  var typeis, ovis, prefix='';
  for (var ii=1; ii<=audiofiles.length; ii++) {
    if (document.getElementById('osel' + ii).value != audiooverlay[eval(-1 + ii)]) document.getElementById('osel' + ii).value = audiooverlay[eval(-1 + ii)];
    if (document.getElementById('sel' + ii).value != audiotype[eval(-1 + ii)]) document.getElementById('sel' + ii).value = audiotype[eval(-1 + ii)];
    if (document.getElementById('audio' + ii).value != audiofiles[eval(-1 + ii)]) document.getElementById('audio' + ii).value = audiofiles[eval(-1 + ii)].replace('+',' ').replace('+',' ').replace('+',' ');
    ovis=document.getElementById('osel' + ii).value;
    prefix='';
    if (ovis == 'Overlay') prefix=' ';
    typeis=document.getElementById('sel' + ii).value;
    if (typeis.indexOf('ideo') != -1) {
      audiotype[eval(-1 + ii)]='Video';
      fis=document.getElementById('audio' + ii).value;
      if (fis != '') document.getElementById('audio' + ii).value=prefix + document.getElementById('audio' + ii).value.trim() + ' ';
    } else if (typeis.indexOf('mage') != -1) {
      audiotype[eval(-1 + ii)]='Image';
      fis=document.getElementById('audio' + ii).value;
      if (fis != '') document.getElementById('audio' + ii).value=prefix + document.getElementById('audio' + ii).value.trim() + '  ';
    } else {
      audiotype[eval(-1 + ii)]='Audio';
      fis=document.getElementById('audio' + ii).value;
      if (fis != '') document.getElementById('audio' + ii).value=prefix + document.getElementById('audio' + ii).value.trim();
    }
  }
}
function butv(thelab, thedef) {
  var outdef=thedef;
  switch (thelab) {
    case 'start1':
    outdef=(location.search + location.hash).split('start1=')[1] ? decodeURIComponent((location.search + location.hash).split('start1=')[1].split('&')[0]) : thedef;
     break;
    case 'start2':
    outdef=(location.search + location.hash).split('start2=')[1] ? decodeURIComponent((location.search + location.hash).split('start2=')[1].split('&')[0]) : thedef;
     break;
    case 'start3':
    outdef=(location.search + location.hash).split('start3=')[1] ? decodeURIComponent((location.search + location.hash).split('start3=')[1].split('&')[0]) : thedef;
     break;
    case 'start4':
    outdef=(location.search + location.hash).split('start4=')[1] ? decodeURIComponent((location.search + location.hash).split('start4=')[1].split('&')[0]) : thedef;
     break;
    case 'start5':
    outdef=(location.search + location.hash).split('start5=')[1] ? decodeURIComponent((location.search + location.hash).split('start5=')[1].split('&')[0]) : thedef;
     break;
    case 'start6':
    outdef=(location.search + location.hash).split('start6=')[1] ? decodeURIComponent((location.search + location.hash).split('start6=')[1].split('&')[0]) : thedef;
     break;
    case 'start7':
    outdef=(location.search + location.hash).split('start7=')[1] ? decodeURIComponent((location.search + location.hash).split('start7=')[1].split('&')[0]) : thedef;
     break;
    case 'start8':
    outdef=(location.search + location.hash).split('start8=')[1] ? decodeURIComponent((location.search + location.hash).split('start8=')[1].split('&')[0]) : thedef;
     break;
    case 'start9':
    outdef=(location.search + location.hash).split('start9=')[1] ? decodeURIComponent((location.search + location.hash).split('start9=')[1].split('&')[0]) : thedef;
     break;
    case 'end1':
    outdef=(location.search + location.hash).split('end1=')[1] ? decodeURIComponent((location.search + location.hash).split('end1=')[1].split('&')[0]) : thedef;
     break;
    case 'end2':
    outdef=(location.search + location.hash).split('end2=')[1] ? decodeURIComponent((location.search + location.hash).split('end2=')[1].split('&')[0]) : thedef;
     break;
    case 'end3':
    outdef=(location.search + location.hash).split('end3=')[1] ? decodeURIComponent((location.search + location.hash).split('end3=')[1].split('&')[0]) : thedef;
     break;
    case 'end4':
    outdef=(location.search + location.hash).split('end4=')[1] ? decodeURIComponent((location.search + location.hash).split('end4=')[1].split('&')[0]) : thedef;
     break;
    case 'end5':
    outdef=(location.search + location.hash).split('end5=')[1] ? decodeURIComponent((location.search + location.hash).split('end5=')[1].split('&')[0]) : thedef;
     break;
    case 'end6':
    outdef=(location.search + location.hash).split('end6=')[1] ? decodeURIComponent((location.search + location.hash).split('end6=')[1].split('&')[0]) : thedef;
     break;
    case 'end7':
    outdef=(location.search + location.hash).split('end7=')[1] ? decodeURIComponent((location.search + location.hash).split('end7=')[1].split('&')[0]) : thedef;
     break;
    case 'end8':
    outdef=(location.search + location.hash).split('end8=')[1] ? decodeURIComponent((location.search + location.hash).split('end8=')[1].split('&')[0]) : thedef;
     break;
    case 'end9':
    outdef=(location.search + location.hash).split('end9=')[1] ? decodeURIComponent((location.search + location.hash).split('end9=')[1].split('&')[0]) : thedef;
     break;
  
    default:
     break;
  }
  return outdef;
}
function fixhide() {
  var sofar='off', typeis='', fis='';
  if (document.getElementById('hideform').checked) {
    sofar='on';
  }
  if (document.getElementById('hideformlater').checked) {
    sofar+='on';
  } else {
    sofar+='off';
  }
  document.getElementById('hide').value=sofar;
  fixtype();
}
function precheckget() {
  if (wo && wo.closed) {
    wo=null;
    zero++;
    setTimeout(checkget, 20);
  } else {
    setTimeout(precheckget, 100);
  }
}
function checkget() {
  var i, xv, ssrc;
  divanaudio=document.getElementById('divanaudio').innerHTML.replace(' src=>', ' src="">');
  divanvideo=document.getElementById('divanvideo').innerHTML.replace(' src=>', ' src="">');
  divanimg=document.getElementById('divanimg').innerHTML.replace(' src=>', ' src="">');
  delay=0.0;
  cmd='';
  if (spareaudiourl == '') spareaudiourl=document.getElementById('spareaudio').src;
  if (zero == 0) {
    audiofiles[0]=(location.search + location.hash).split('audio1=')[1] ? decodeURIComponent((location.search + location.hash).split('audio1=')[1].split('&')[0]) : '';
    audiofiles[1]=(location.search + location.hash).split('audio2=')[1] ? decodeURIComponent((location.search + location.hash).split('audio2=')[1].split('&')[0]) : '';
    audiofiles[2]=(location.search + location.hash).split('audio3=')[1] ? decodeURIComponent((location.search + location.hash).split('audio3=')[1].split('&')[0]) : '';
    audiofiles[3]=(location.search + location.hash).split('audio4=')[1] ? decodeURIComponent((location.search + location.hash).split('audio4=')[1].split('&')[0]) : '';
    audiofiles[4]=(location.search + location.hash).split('audio5=')[1] ? decodeURIComponent((location.search + location.hash).split('audio5=')[1].split('&')[0]) : '';
    audiofiles[5]=(location.search + location.hash).split('audio6=')[1] ? decodeURIComponent((location.search + location.hash).split('audio6=')[1].split('&')[0]) : '';
    audiofiles[6]=(location.search + location.hash).split('audio7=')[1] ? decodeURIComponent((location.search + location.hash).split('audio7=')[1].split('&')[0]) : '';
    audiofiles[7]=(location.search + location.hash).split('audio8=')[1] ? decodeURIComponent((location.search + location.hash).split('audio8=')[1].split('&')[0]) : '';
    audiofiles[8]=(location.search + location.hash).split('audio9=')[1] ? decodeURIComponent((location.search + location.hash).split('audio9=')[1].split('&')[0]) : '';
    fixtypes();
    var hide=location.search.split('hide=')[1] ? decodeURIComponent(location.search.split('hide=')[1].split('&')[0]) : 'offoff';
    document.getElementById('hide').value=hide;
    if (hide.substring(0,2) == 'on') {
      hideform='on';
    } else {
      hideform='off';
    }
    hide=hide.replace(hideform,'');
    //hideform=location.search.split('hideform=')[1] ? decodeURIComponent(location.search.split('hideform=')[1].split('&')[0]) : hideform;
    hideformlater=hide; //location.search.split('hideformlater=')[1] ? decodeURIComponent(location.search.split('hideformlater=')[1].split('&')[0]) : hideformlater;
    if (hideform == 'on') document.getElementById('hideform').checked=true;
    if (hideformlater == 'on') document.getElementById('hideformlater').checked=true;
    burl=location.search.split('background=')[1] ? decodeURIComponent(location.search.split('background=')[1].split('&')[0]) : burl;
    if (burl != '') {
      document.getElementById('background').value=burl;
      document.body.style.background=" url('" + burl + "')";
      if (hideform != 'on') {
        document.body.style.opacity=0.6;
      } else {
        noneblock='none';
      }
    } else {
      if (hideform == 'on') noneblock='none';
    }
    if (audiofiles[eval(0 + zero)] != '') {
      document.getElementById('subis').value='Currently Playing ...';
    }
  }
  if (lastvideo != '') {
    document.getElementById(lastvideo).style.display='none';
    lastvideo='';
  }
  if (audiofiles[eval(0 + zero)] != '') {
    for (i=eval(1 + zero); i<=(1 + zero); i++) {
    vstart=0;
    vend=-1;
    astart=0;
    aend=-1;
     if (noplus(audiofiles[eval(0 + zero)]) != '') {
      if (delay != 0.0) document.getElementById('audio' + i).value=noplus(audiofiles[eval(0 + zero)]);
      //document.getElementById('iaudio' + i).src=audiofiles[eval(0 + zero)];
      //document.getElementById('iaudio' + i).load();
      //document.getElementById('iaudio' + i).play();
      if (eval(delay) != 0.0) {   // is an image
        document.getElementById('subis').value='Currently Showing Image ' + eval(1 + zero) + ': ' + noplus(audiofiles[eval(0 + zero)]) + " for 5 seconds";
        zero++;
        if (zero < audiofiles.length) {
          setTimeout(checkget, eval(1000 * delay));
        }
        delay=0.0;
      } else if (noplus(audiofiles[eval(0 + zero)]).indexOf(' ') != -1) {
      if (zero == 0) {
      if (audiofiles[eval(0 + zero)].indexOf('data:audio/') == 0) {
            spareanaudio=divanaudio.replace('>',' controls>').replace(' title=""', ' title="Play"').replace('<source ', '<source type=audio/' + audiofiles[eval(0 + zero)].split('data:audio/')[1].split(',')[0].split(';')[0] + ' ').replace(' src=""', ' src="' + audiofiles[eval(0 + zero)].replace(/\ /g,'+') + '"').replace('none','BLOCK');
            spareelse='';
            spareanvideo='';
            spareanimg='';
      } else if (audiofiles[eval(0 + zero)].indexOf('data:video/') == 0) {
            spareanvideo=divanvideo.replace('>',' controls>').replace(' title=""', ' title="Play"').replace('<source ', '<source type=video/' + videofiles[eval(0 + zero)].split('data:video/')[1].split(',')[0].split(';')[0] + ' ').replace(' src=""', ' src="' + videofiles[eval(0 + zero)].replace(/\ /g,'+') + '"').replace('none','BLOCK');
            spareelse='';
            spareanaudio='';
            spareanimg='';
      } else if (audiofiles[eval(0 + zero)].indexOf('data:image/') == 0) {
            spareanimg=divanimg.replace(' title=""', ' title="Play"').replace(' src=""', ' src="' + imgfiles[eval(0 + zero)].replace(/\ /g,'+') + '"').replace('none','BLOCK');
            spareelse='';
            spareanaudio='';
            spareanvideo='';
      } else if (audiofiles[eval(0 + zero)] != '') {
            spareelse='https://translate.google.com/#auto/en/' + encodeURIComponent(noplus(audiofiles[eval(0 + zero)]));
            spareanaudio='';
            spareanvideo='';
            spareanimg='';
      }
      seqe();
      } else {
      if (audiofiles[eval(0 + zero)].indexOf('data:audio/') == 0) {
      isaudio=true;
      document.getElementById('subis').value='Currently Playing Audio ' + eval(1 + zero) + ': ' + audiofiles[eval(0 + zero)].replace(/\ /g,'+'); // + " via Google Translate if you press speaker and am waiting for you to close that window.";
      //var xc=prompt(divanaudio.replace('<source ', '<source type=audio/' + audiofiles[eval(0 + zero)].split('data:audio/')[1].split(',')[0].split(';')[0] + ' ').replace(/\ on/g,' data-on').replace(' src=""', ' src="' + audiofiles[eval(0 + zero)].replace(/\ /g,'+') + '"').replace('none','BLOCK'),divanaudio.replace('<source ', '<source type=audio/' + audiofiles[eval(0 + zero)].split('data:audio/')[1].split(',')[0].split(';')[0] + ' ').replace(' src=""', ' src="' + audiofiles[eval(0 + zero)].replace(/\ /g,'+') + '"').replace('none','BLOCK'));
      document.getElementById('divanaudio').innerHTML=divanaudio.replace('>',' controls>').replace(' title=""', ' title="Play"').replace('<source ', '<source type=audio/' + audiofiles[eval(0 + zero)].split('data:audio/')[1].split(',')[0].split(';')[0] + ' ').replace(' src=""', ' src="' + audiofiles[eval(0 + zero)].replace(/\ /g,'+') + '"').replace('none','BLOCK');
      } else if (audiofiles[eval(0 + zero)].indexOf('data:video/') == 0) {
      isaudio=false;
      document.getElementById('subis').value='Currently Playing Video ' + eval(1 + zero) + ': ' + audiofiles[eval(0 + zero)].replace(/\ /g,'+'); // + " via Google Translate if you press speaker and am waiting for you to close that window.";
      //var xc=prompt(divanvideo.replace('<source ', '<source type=video/' + videofiles[eval(0 + zero)].split('data:video/')[1].split(',')[0].split(';')[0] + ' ').replace(/\ on/g,' data-on').replace(' src=""', ' src="' + videofiles[eval(0 + zero)].replace(/\ /g,'+') + '"').replace('none','BLOCK'),divanvideo.replace('<source ', '<source type=video/' + videofiles[eval(0 + zero)].split('data:video/')[1].split(',')[0].split(';')[0] + ' ').replace(' src=""', ' src="' + videofiles[eval(0 + zero)].replace(/\ /g,'+') + '"').replace('none','BLOCK'));
      document.getElementById('divanvideo').innerHTML=divanvideo.replace('>',' controls>').replace(' title=""', ' title="Play"').replace('<source ', '<source type=video/' + videofiles[eval(0 + zero)].split('data:video/')[1].split(',')[0].split(';')[0] + ' ').replace(' src=""', ' src="' + videofiles[eval(0 + zero)].replace(/\ /g,'+') + '"').replace('none','BLOCK');
      } else {
      isaudio=true;
      document.getElementById('subis').value='Currently Playing Audio ' + eval(1 + zero) + ': ' + noplus(audiofiles[eval(0 + zero)]) + " via Google Translate if you press speaker and am waiting for you to close that window.";
      wo=window.open('https://translate.google.com/#auto/en/' + encodeURIComponent(noplus(audiofiles[eval(0 + zero)])),'_blank','top=50,left=50,width=600,height=600');
      }
      setTimeout(precheckget, 20);
      }
      } else {
      if (isaudio == false) document.getElementById('sel' +  eval(1 + zero)).value='Video';
      if (!isaudio) {
      xv=document.createElement("VIDEO");
      xv.autoplay = true;
      xv.src = noplus(audiofiles[eval(0 + zero)]);
      //xv.src=noplus(audiofiles[eval(0 + zero)]);
      xv.id='video' + eval(1 + zero);
      lastvideo=xv.id;
      xv.style.position='absolute';
      xv.style.top='10px';
      xv.style.left='10px';
      //xv.style.width='200px';
      //xv.style.height='200px';
      xv.style.zIndex='10';
      xv.style.display='block';
      //ssrc = document.createElement("source"); 
      //ssrc.type = "video/mp4";
      //ssrc.src = noplus(audiofiles[eval(0 + zero)]);
      //xv.appendChild(ssrc);      
      xv.controls = true;
      audioobj.push(xv);
      var was=document.getElementById('spareaudio').src;
      document.body.appendChild(xv);
      //var sd=document.getElementById('sparediv');
      //sd.appendChild(xv);
      fixtype();
      fixtypes();
      //document.getElementById('spareaudio').src=was;
      vstart=vstarts[eval(0 + zero)];
      vend=vends[eval(0 + zero)];
      astart=astarts[eval(0 + zero)];
      aend=aends[eval(0 + zero)];
      if (eval(1 + zero) < audiofiles.length && audiooverlay[eval(1 + zero)] == 'Overlay') {
      //document.getElementById('formbits').style.display='none';
      //hideform='on';
      //noneblock='NONE';
      document.getElementById('spareaudio').src=spareaudiourl.replace("1=&", "1=" + encodeURIComponent((audiofiles[eval(1 + zero)])) + "&");
   //alert('x: ' + document.getElementById('spareaudio').src);
      //window.open(spareaudiourl.replace("1=&", "1=" + encodeURIComponent(audiofiles[eval(1 + zero)]) + "&"),"_blank","top=50,left=50,width=50,height=50");
      xv.addEventListener('loadedmetadata', function() {
        //alert("Playing " + audioobj[zero].src + ", for: " + audioobj[zero].duration + "seconds.");
        if (eval(vstart) < 0 && eval(vend) < -1) {
        delay+=eval((eval(xv.duration) + eval(vend)) - (eval(vx.duration) + eval(vstart)));
        vstart=eval(eval(xv.duration) + eval(vstart));
        } else if (eval(vstart) < 0 && eval(vend) <= 0) {
        delay+=eval(eval(xv.duration) - eval(eval(xv.duration) + eval(vstart)));
        //alert('Vstart=' + vstart + ' and delay=' + delay + ' and xv.duration=' + xv.duration + ' secbit is ' + eval(eval(xv.duration) + eval(vstart)));
        vstart=eval(eval(xv.duration) + eval(vstart));
        //alert(' vstart now=' + vstart);
        } else if (eval(vstart) < 0) {
        delay+=eval(eval(vend) - (eval(xv.duration) + eval(vstart)));
        vstart=eval(eval(xv.duration) + eval(vstart));
        } else if (eval(vstart) != 0 && eval(vend) != -1) {
        delay+=eval(eval(vend) - eval(vstart));
        } else if (eval(vstart) != 0) {
        delay+=eval(eval(xv.duration) - eval(vstart));
        } else if (eval(vend) != -1) {
        delay+=eval(eval(vend));
        } else {
        delay+=xv.duration;
        }
        suffix=' and ' + audiotype[eval(1 + zero)] + ' ' + eval(2 + zero) + ': ' + (audiofiles[eval(1 + zero)]).split('#')[0].replace('+','').replace('+','').replace('+','');
        document.getElementById('subis').value='Currently Playing Video ' + eval(1 + zero) + ': ' + (audiofiles[eval(0 + zero)]).split('#')[0].replace('+','').replace('+','').replace('+','') + " for " + delay + " seconds" + suffix;
        suffix="";
        zero++;
      audioobj.push(xv);
        zero++;
        if (zero < audiofiles.length) {
        setTimeout(checkget, eval(1000 * delay));
        }
        //alert(vstart);
        xv.play(); 
        if (vstart != 0) xv.currentTime = eval(vstart);
      });  
      } else {
      //alert('vend=' + vend + ' vstart=' + vstart);
      xv.addEventListener('loadedmetadata', function() {
        //alert("Playing " + audioobj[zero].src + ", for: " + audioobj[zero].duration + "seconds.");
        if (eval(vstart) < 0 && eval(vend) < -1) {
        delay+=eval((eval(xv.duration) + eval(vend)) - (eval(vx.duration) + eval(vstart)));
        vstart=eval(eval(xv.duration) + eval(vstart));
        } else if (eval(vstart) < 0 && eval(vend) <= 0) {
        delay+=eval((eval(xv.duration) + 0) - (eval(xv.duration) + eval(vstart)));
        //alert('vstart=' + vstart + ' and delay=' + delay);
        vstart=eval(eval(xv.duration) + eval(vstart));
        } else if (eval(vstart) < 0) {
        delay+=eval(eval(vend) - (eval(xv.duration) + eval(vstart)));
        vstart=eval(eval(xv.duration) + eval(vstart));
        } else if (eval(vstart) != 0 && eval(vend) != -1) {
        delay+=eval(eval(vend) - eval(vstart));
        } else if (eval(vstart) != 0) {
        delay+=eval(eval(xv.duration) - eval(vstart));
        } else if (eval(vend) != -1) {
        delay+=eval(eval(vend));
        } else {
        delay+=xv.duration;
        }
        suffix=' and ' + audiotype[eval(1 + zero)] + ' ' + eval(2 + zero) + ': ' + (audiofiles[eval(1 + zero)]).split('#')[0].replace('+','').replace('+','').replace('+','');
        document.getElementById('subis').value='Currently Playing Video ' + eval(1 + zero) + ': ' + (audiofiles[eval(0 + zero)]).split('#')[0].replace('+','').replace('+','').replace('+','') + " for " + delay + " seconds";
        zero++;
        if (zero < audiofiles.length) {
          setTimeout(checkget, eval(1000 * delay));
        }
        //alert(vstart);
        xv.play(); 
        if (vstart != 0) xv.currentTime = eval(vstart);
      });  
      }
      } else if (delay == 0.0) {
      vstart=0;
      vend=-1;
      astart=0;
      aend=-1;
      if (1 == 1) {
      eval("audioobj.push(document.createElement('" + document.getElementById('sel' +  eval(1 + zero)).value + "'));");
      } else {
      eval("audioobj.push(new " + document.getElementById('sel' +  eval(1 + zero)).value + "())"); // thanks to http://stackoverflow.com/questions/10868249/html5-audio-player-duration-showing-nan
      }
//alert('zero=' + zero + ' ... ' + noplus(audiofiles[eval(0 + zero)]));
      audioobj[eval(zero)].autoplay = true;
      audioobj[eval(zero)].src=noplus(audiofiles[eval(0 + zero)]);
      if (eval(1 + zero) < audiofiles.length && audiooverlay[eval(1 + zero)] == 'Overlay') {
      document.getElementById('spareaudio').src=spareaudiourl.replace("1=&", "1=" + encodeURIComponent((audiofiles[eval(1 + zero)])) + "&");
   //alert(document.getElementById('spareaudio').src);
      audioobj[zero].addEventListener('loadedmetadata', function() {
        //alert("Playing " + audioobj[zero].src + ", for: " + audioobj[zero].duration + "seconds.");
        if (eval(astart) < 0 && eval(aend) < -1) {
        delay+=eval((eval(audioobj[zero].duration) + eval(aend)) - (eval(audioobj[zero].duration) + eval(astart)));
        astart=eval(eval(audioobj[zero].duration) + eval(astart));
        } else if (eval(astart) < 0 && eval(aend) <= 0) {
        delay+=eval((eval(audioobj[zero].duration) + 0) - (eval(audioobj[zero].duration) + eval(astart)));
        astart=eval(eval(audioobj[zero].duration) + eval(astart));
        } else if (eval(astart) < 0) {
        delay+=eval(eval(aend) - (eval(audioobj[zero].duration) + eval(astart)));
        astart=eval(eval(audioobj[zero].duration) + eval(astart));
        } else if (eval(astart) != 0 && eval(aend) != -1) {
        delay+=eval(eval(aend) - eval(astart));
        } else if (eval(astart) != 0) {
        delay+=eval(eval(audioobj[zero].duration) - eval(astart));
        } else if (eval(aend) != -1) {
        delay+=eval(eval(aend));
        } else {
        delay+=audioobj[zero].duration;
        }
        suffix=' and ' + audiotype[eval(1 + zero)] + ' ' + eval(2 + zero) + ': ' + (audiofiles[eval(1 + zero)]).split('#')[0].replace('+','').replace('+','').replace('+','');
        document.getElementById('subis').value='Currently Playing Audio ' + eval(1 + zero) + ': ' +  audioobj[zero].src + " for " + delay + " seconds" + suffix;
        suffix="";
        zero++;
        //document.getElementById('spareaudio').src=spareaudiourl.replace("1=&", "1=" + encodeURIComponent(audiofiles[zero]) + "&");
        audioobj.push(audioobj[eval(-1 + zero)]);
        zero++;
        if (zero < audiofiles.length) {
          setTimeout(checkget, eval(1000 * delay));
        }
        audioobj[eval(-2 + zero)].play(); 
        if (astart != 0) audioobj[eval(-2 + zero)].currentTime = eval(astart);
      });  
      } else {
      audioobj[zero].addEventListener('loadedmetadata', function() {
        //alert("Playing " + audioobj[zero].src + ", for: " + audioobj[zero].duration + "seconds.");
        if (eval(astart) < 0 && eval(aend) < -1) {
        delay+=eval((eval(audioobj[zero].duration) + eval(aend)) - (eval(audioobj[zero].duration) + eval(astart)));
        astart=eval(eval(audioobj[zero].duration) + eval(astart));
        } else if (eval(astart) < 0 && eval(aend) <= 0) {
        delay+=eval((eval(audioobj[zero].duration) + 0) - (eval(audioobj[zero].duration) + eval(astart)));
        astart=eval(eval(audioobj[zero].duration) + eval(astart));
        } else if (eval(astart) < 0) {
        delay+=eval(eval(aend) - (eval(audioobj[zero].duration) + eval(astart)));
        astart=eval(eval(audioobj[zero].duration) + eval(astart));
        } else if (eval(astart) != 0 && eval(aend) != -1) {
        delay+=eval(eval(aend) - eval(astart));
        } else if (eval(astart) != 0) {
        delay+=eval(eval(audioobj[zero].duration) - eval(astart));
        } else if (eval(aend) != -1) {
        delay+=eval(eval(aend));
        } else {
        delay+=audioobj[zero].duration;
        }
        suffix=' and ' + audiotype[eval(1 + zero)] + ' ' + eval(2 + zero) + ': ' + (audiofiles[eval(1 + zero)]).split('#')[0].replace('+','').replace('+','').replace('+','');
        document.getElementById('subis').value='Currently Playing Audio ' + eval(1 + zero) + ': ' +  audioobj[zero].src + " for " + delay + " seconds";
        zero++;
        if (zero < audiofiles.length) {
          setTimeout(checkget, eval(1000 * delay));
        }
        audioobj[eval(-1 + zero)].play(); 
        if (astart != 0) audioobj[eval(-1 + zero)].currentTime = eval(astart);
      });  
      }
      }
      }    
     } else {
      document.getElementById('subis').value='Play Sequentially';
      fixtype();
      if (hideformlater != 'on') {
      //alert(98);
        document.getElementById('formbits').style.display='block';
        document.getElementById('formbits').style.backgroundColor='yellow';
      } else {
        document.getElementById('formbits').style.display='none';
      }
     }
    }
      //alert(980);
    document.getElementById('formbits').style.display=noneblock;
  } else if (zero != 0) {
      //alert(9800);
    vstart=0;
    vend=-1;
    astart=0;
    aend=-1;
    document.getElementById('formbits').style.display=noneblock;
    document.getElementById('subis').value='Play Sequentially';
    fixtype();
    if (hideformlater != 'on') {
      //alert(98000);
        document.getElementById('formbits').style.display='block';
        document.getElementById('formbits').style.backgroundColor='yellow';
    } else {
        document.getElementById('formbits').style.display='none';
    }
  } else {
      //alert(980000);
    document.getElementById('formbits').style.display=noneblock;
  }
        if (cmd != '') {
          if (audiotype[zero] == 'Audio') {
          document.getElementById('spareaudio').src=spareaudiourl.replace("1=&", "1=" + encodeURIComponent((audiofiles[zero])) + "&");
          } else {
          eval(cmd);
          }
          cmd='';
        }
}
function checkdu(iois) {
    if (iois.src.indexOf('/do_away_with_the_boring_bits.') != -1 && iois.src.indexOf('/do_away_with_the_boring_bits.htm') == -1) {
       var twaconto = (iois.contentWindow || iois.contentDocument);
       if (twaconto != null) {
       if (twaconto.document) { twaconto = twaconto.document; }
       if (twaconto.body.innerHTML.replace(/^\/tmp/g, 'data:audio').indexOf('data:audio/') != -1) {
       //alert(twaconto.body.innerHTML);
          //document.getElementById('sanaudio').src=twaconto.body.innerHTML;
          //alert(divanaudio + ' ... ' + twaconto.body.innerHTML);
          if (twaconto.body.innerHTML.indexOf('data:audio/') != -1) {
          document.getElementById('divanaudio').innerHTML=divanaudio.replace('<source ', '<source type=audio/' + twaconto.body.innerHTML.split('data:audio/')[1].split(',')[0].split(';')[0] + ' ').replace(' src=""', ' src="' + twaconto.body.innerHTML + '"').replace('none','NONE');
          } else {
          var pref=1;
          if (document.getElementById('audio' + pref).value.indexOf('data:') == -1) {
          while (document.getElementById('audio' + pref).value.indexOf('data:') == -1) {
             pref++;
          }
          }
          while (document.getElementById('audio' + pref).value.indexOf('data:') == -1) {
             pref++;
          }
          document.getElementById('audio' + pref).value=twaconto.body.innerHTML;
          iois.src='/HTMLCSS/do_away_with_the_boring_bits.php?rand=';
          }
          //alert(document.getElementById('divanaudio').innerHTML);
       } else if (twaconto.body.innerHTML.indexOf('data:video/') != -1) {
          //document.getElementById('sanvideo').src=twaconto.body.innerHTML;
          //alert(divanvideo + ' ... ' + twaconto.body.innerHTML);
          document.getElementById('divanvideo').innerHTML=divanvideo.replace('<source ', '<source type=video/' + twaconto.body.innerHTML.split('data:video/')[1].split(',')[0].split(';')[0] + ' ').replace(' src=""', ' src="' + twaconto.body.innerHTML + '"').replace('none','NONE');
          //alert(document.getElementById('divanvideo').innerHTML);
       }
       //alert(twaconto.body.innerHTML);
       }
    }   
}
function ahere(evt) {
 if (document.getElementById('sanaudio').src.trim() != '') {
  if (document.getElementById('anaudio').title != '') {
  document.getElementById('anaudio').play();
  if (eval('' + document.getElementById('start' + eval(1 + zero)).value) != 0) { document.getElementById('anaudio').currentTime = eval('' + document.getElementById('start' + eval(1 + zero)).value); }
  if (document.getElementById('end' + eval(1 + zero)).value.replace(/^0/g,'-').indexOf('-') != -1) {
        setTimeout(function(){  zero++; seqe(); }, eval(1000 * (eval('' + document.getElementById('anaudio').duration) + 4 - eval('' + document.getElementById('start' + eval(1 + zero)).value))));
  }
  } else {
  document.getElementById(durtoid).value=Math.ceil(eval('' + document.getElementById('anaudio').duration));
  }
  //alert('audio here');
  //alert('audio here ' + document.getElementById('anaudio').duration);
 }
}
function alere(evt) {
 if (document.getElementById('sanaudio').src.trim() != '') {
  document.getElementById(durtoid).value=Math.ceil(eval('' + document.getElementById('anaudio').duration));
  //alert('audio Here');
 }
}
function ihere(evt) {
  if (document.getElementById('animg').title != '') {
      if (document.getElementById('end' + eval(0 + zero)).value.replace(/^0/g,'-').indexOf('-') == -1) {
        setTimeout(function(){  zero++; seqe(); }, 5000);
      }
  }
}
function vhere(evt) {
 if (document.getElementById('sanvideo').src.trim() != '') {
  if (document.getElementById('anvideo').title != '') {
  document.getElementById('anvideo').play();
  if (eval('' + document.getElementById('start' + eval(1 + zero)).value) != 0) { document.getElementById('anvideo').currentTime = eval('' + document.getElementById('start' + eval(1 + zero)).value); }
  if (document.getElementById('end' + eval(1 + zero)).value.replace(/^0/g,'-').indexOf('-') != -1) {
        setTimeout(function(){  zero++; seqe(); }, eval(1000 * (eval('' + document.getElementById('anvideo').duration) + 4 - eval('' + document.getElementById('start' + eval(1 + zero)).value))));
  }
  } else {
  document.getElementById(durtoid).value=Math.ceil(eval('' + document.getElementById('anvideo').duration));
  }
  //alert('video here');
  //alert('video here ' + document.getElementById('anvideo').duration);
 }
}
function vlere(evt) {
 if (document.getElementById('sanvideo').src.trim() != '') {
  document.getElementById(durtoid).value=Math.ceil(eval('' + document.getElementById('anvideo').duration));
  //alert('video Here');
 }
}
function numthataredata() {
  var thisnumare=0, onetoattendto=0, twotoattendto=0;
  for (var ik=1; ik<=9; ik++) {
     if (document.getElementById('audio' + ik).value.indexOf('data:') == 0 && ('' + document.getElementById('audio' + ik).title).indexOf('atch') != -1) {
       if (onetoattendto == 0) {
         onetoattendto=ik;
       } else if (twotoattendto == 0) {
         twotoattendto=ik;
       } 
       thisnumare++;
     }
  }
  if (thisnumare > 0 && thisnumare != prevnumthatare) {
     doinput(document.getElementById('audio' + onetoattendto));
     prevnumthatare=thisnumare;
  }
}
function changeofmind(inna) {
  var adel='?ran=' + Math.floor(Math.random() * 198978760) + '#';
  var althturl=document.URL.split('?')[0].split('#')[0];
  var names=inna.split(' name="');
  for (var inames=1; inames<names.length; inames++) {
    althturl+=adel + names[inames].split('"')[0] + '=' + encodeURIComponent(document.getElementById(names[inames].split('"')[0]).value);
    adel='&';
  }
  location.href=althturl;
  return false;
}
setInterval(numthataredata, 5000);
</script>
</head>
<body onload="checkget(); setTimeout(function(){ if (1 == 1) { document.getElementById('taif').src='/PHP/animegif/tutorial_to_animated_gif.php?aschild=' + Math.floor(Math.random() * 19897865);  } else { window.open('/PHP/animegif/tutorial_to_animated_gif.php?aschild=' + Math.floor(Math.random() * 19897865),'taif'); } document.getElementById('taif').style.display='inline-block'; }, 3000); ">
<div id='formbits' style='display:none;text-align:center; width: 100%; z-index:1; '>
<h1 style='text-align:center; width: 100%;'>Splicing Audio/Video/Image - RJM Programming - August, 2016</h1>
<form data-target=ifresults target=_blank data-twoidea-onsubmit=" document.getElementById('myhr').style.display='block'; document.getElementById('ifresults').style.display='block'; return true;" data-onsubmit='return changeofmind(this.innerHTML);' style='text-align:center; width: 100%;' method='POST' action='./splice_audio.php'>
<select id='osel1' style='display:none;' onchange='overlaydosel(this);'><option value='Optional'>Optional</option></select>Optional <select id='sel1' onchange='dosel(this);'><option value='Audio'>Audio</option><option value='Video'>Video</option><option value='Image'>Image</option></select> File <span id=spif><iframe id=taif data-name=taif style='width:80px;overflow:hidden;height:28px;display:none;' scrolling=no frameborder=0 src='/About_Us.html'></iframe></span> (or Text) 1: <input onblur='doinput(this);' style='width:30%;' type='text' name='audio1' id='audio1' value=''></input> Seconds <span title='Negative for position back from end of media'>Start</span>: <input type=number id=start1 name=start1 value=0 style='width:60px;'></input> End (-1 means To End): <input type=number id=end1 name=end1 value=-1 style='width:60px;'></input><br>
<select id='osel2' onchange='overlaydosel(this);'><option value='Optional'>Optional</option><option value='Overlay'>Overlay</option></select> <select id='sel2' onchange='dosel(this);'><option value='Audio'>Audio</option><option value='Video'>Video</option><option value='Image'>Image</option></select> File (or Text) 2: <input onblur='doinput(this);' style='width:30%;' type='text' name='audio2' id='audio2'></input> <input type=number id=start2 name=start2 value=0 style='width:60px;'></input> <input type=number id=end2 name=end2 value=-1 style='width:60px;'></input><br>
<select id='osel3' onchange='overlaydosel(this);'><option value='Optional'>Optional</option><option value='Overlay'>Overlay</option></select> <select id='sel3' onchange='dosel(this);'><option value='Audio'>Audio</option><option value='Video'>Video</option><option value='Image'>Image</option></select> File (or Text) 3: <input onblur='doinput(this);' style='width:30%;' type='text' name='audio3' id='audio3'></input> <input type=number id=start3 name=start3 value=0 style='width:60px;'></input> <input type=number id=end3 name=end3 value=-1 style='width:60px;'></input><br>
<select id='osel4' onchange='overlaydosel(this);'><option value='Optional'>Optional</option><option value='Overlay'>Overlay</option></select> <select id='sel4' onchange='dosel(this);'><option value='Audio'>Audio</option><option value='Video'>Video</option><option value='Image'>Image</option></select> File (or Text) 4: <input onblur='doinput(this);' style='width:30%;' type='text' name='audio4' id='audio4'></input> <input type=number id=start4 name=start4 value=0 style='width:60px;'></input> <input type=number id=end4 name=end4 value=-1 style='width:60px;'></input><br>
<select id='osel5' onchange='overlaydosel(this);'><option value='Optional'>Optional</option><option value='Overlay'>Overlay</option></select> <select id='sel5' onchange='dosel(this);'><option value='Audio'>Audio</option><option value='Video'>Video</option><option value='Image'>Image</option></select> File (or Text) 5: <input onblur='doinput(this);' style='width:30%;' type='text' name='audio5' id='audio5'></input> <input type=number id=start5 name=start5 value=0 style='width:60px;'></input> <input type=number id=end5 name=end5 value=-1 style='width:60px;'></input><br>
<select id='osel6' onchange='overlaydosel(this);'><option value='Optional'>Optional</option><option value='Overlay'>Overlay</option></select> <select id='sel6' onchange='dosel(this);'><option value='Audio'>Audio</option><option value='Video'>Video</option><option value='Image'>Image</option></select> File (or Text) 6: <input onblur='doinput(this);' style='width:30%;' type='text' name='audio6' id='audio6'></input> <input type=number id=start6 name=start6 value=0 style='width:60px;'></input> <input type=number id=end6 name=end6 value=-1 style='width:60px;'></input><br>
<select id='osel7' onchange='overlaydosel(this);'><option value='Optional'>Optional</option><option value='Overlay'>Overlay</option></select> <select id='sel7' onchange='dosel(this);'><option value='Audio'>Audio</option><option value='Video'>Video</option><option value='Image'>Image</option></select> File (or Text) 7: <input onblur='doinput(this);' style='width:30%;' type='text' name='audio7' id='audio7'></input> <input type=number id=start7 name=start7 value=0 style='width:60px;'></input> <input type=number id=end7 name=end7 value=-1 style='width:60px;'></input><br>
<select id='osel8' onchange='overlaydosel(this);'><option value='Optional'>Optional</option><option value='Overlay'>Overlay</option></select> <select id='sel8' onchange='dosel(this);'><option value='Audio'>Audio</option><option value='Video'>Video</option><option value='Image'>Image</option></select> File (or Text) 8: <input onblur='doinput(this);' style='width:30%;' type='text' name='audio8' id='audio8'></input> <input type=number id=start8 name=start8 value=0 style='width:60px;'></input> <input type=number id=end8 name=end8 value=-1 style='width:60px;'></input><br>
<select id='osel9' onchange='overlaydosel(this);'><option value='Optional'>Optional</option><option value='Overlay'>Overlay</option></select> <select id='sel9' onchange='dosel(this);'><option value='Audio'>Audio</option><option value='Video'>Video</option><option value='Image'>Image</option></select> File (or Text) 9: <input onblur='doinput(this);' style='width:30%;' type='text' name='audio9' id='audio9'></input> <input type=number id=start9 name=start9 value=0 style='width:60px;'></input> <input type=number id=end9 name=end9 value=-1 style='width:60px;'></input><br><br>
Optional Background Image: <input style='width:50%;' type='text' name='background' id='background'></input><br><br>
Hide This Form While Audio Plays? <input onchange='fixhide();' type='checkbox' id='hideform'></input> Hide This Form After Audio Plays? <input onchange='fixhide();' type='checkbox' id='hideformlater'></input><br><br>
<input type='hidden' name='hide' id='hide' value='offoff'></input>
<input onclick='fixhide(); fixstartend();' id='subis' style='text-align:center; background-color: pink; ' type='submit' value='Play Sequentially'></input>
</form>
</div>
<!--audio id='iaudio1' src=''></audio>
<audio id='iaudio2' src=''></audio>
<audio id='iaudio3' src=''></audio>
<audio id='iaudio4' src=''></audio>
<audio id='iaudio5' src=''></audio>
<audio id='iaudio6' src=''></audio>
<audio id='iaudio7' src=''></audio>
<audio id='iaudio8' src=''></audio>
<audio id='iaudio9' src=''></audio-->
<div id='sparediv'></div>
<iframe id='spareaudio' style='display:none;position:absolute;left:-20000px;top:-20000px;' src='//www.rjmprogramming.com.au/Mac/iPad/splice_audio.htm?audio1=&audio2=&audio3=&audio4=&audio5=&audio6=&audio7=&audio8=&audio9=&background=&hide=onon' title='Audio Overlay goes here'></iframe>
<canvas id='canvas' style='display:none;'></canvas>
<div id=divanaudio><audio title="" id='anaudio' onload=alere(event); onloadedmetadata=ahere(event); style=display:none;><source id=sanaudio src=""></source></audio></div>
<div id=divanvideo><video title="" id='anvideo' onload=vlere(event); onloadedmetadata=vhere(event); style=display:none;><source id=sanvideo src=""></source></video></div>
<div id=divanimg><img title="" id='animg' style=display:none;></img></div>
<iframe name=myif onload='checkdu(this);' id=myif src=/HTMLCSS/do_away_with_the_boring_bits.html style=display:none;></iframe>
<form id=myifform method=POST style=display:none; target=myif action=/HTMLCSS/do_away_with_the_boring_bits.php>
<div id=uniquify></div><input type=hidden name=url id=myifurl value=''></input><input type=hidden name=durto id=myifdurto value=''></input><input type=hidden name=justfgcdu id=myifjustfgcdu value=''></input><input type=submit id=myifb value=Submit style=display:none;></input>
</form>
<!--hr id=myhr style=display:none;></hr>
<iframe id=ifresults name=ifresults style="width:100%;height:900px;display:none;" src="/About_Us.html"></iframe-->
</body>
</html>