<?php
// macos_say_record.php
// Supervise and synchronize 'say [words]' (say) some text
     
$types = ["audio/x-m4r","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/x-la-asf","video/ogg","video/webm","audio/mp4", "image/jpeg", "image/jpeg", "image/png", "image/gif", "image/bmp", "image/tif",
      "text/html", "text/html", "text/html", "text/javascript", "text/css", "text/plain", "text/xml", "text/csv",
      "application/vnd.ms-word", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/x-php", "application/pdf",
      "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.ms-powerpoint",
      "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];
$exts = [".m4r",".wav",".wav",".ram",".m3u",".aiff",".mp3",".rmi",
      ".snd",".ogg",".movie",".avi",".mov",".mp3",".m4v",".mpeg",
      ".lsx",".ogv",".webm",".m4a", ".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tif",
      ".htm", ".html", ".htmls", ".js", ".css", ".txt", ".xml", ".csv",
      ".doc", ".docx", ".php", ".pdf",
      ".pptx", ".ppt",
      ".xls", ".xlsx"];

$ort=""; 
$bestext="aiff";
$rtw="Record These Words";
$dsm="";
$trto="en";

$lastmedia=""; 
$pretc="";
$posttc="";
$gtc="";
$tc="";
if (strpos(('' . $_SERVER['HTTP_REFERER']), "/stparam.htm") !== false) {
  $tc.="<input type=hidden name=viareminders value=x></input>";
  $gtc="&viareminders=x";
} else if (isset($_POST['viareminders']) || isset($_GET['viareminders'])) {
  $tc.="<input type=hidden name=viareminders value=z></input>";
  $gtc="&viareminders=z";
}
$htmlfile="";
$langcode="";

$preposttc="pptc(); \n function pptc() { } \n";

if (isset($_GET['topchat'])) {
  $bestext="wav";
  $tc.="<input type=hidden name=topchat value=" . str_replace("+"," ",urldecode($_GET['topchat'])) . "></input>";
  $pretc="&topchat=" . str_replace("+"," ",urldecode($_GET['topchat']));
  if (strpos(strtolower('' . $_SERVER['HTTP_REFERER']), "rjmprogramming.com.au") !== false) {
    $htmlfile="PHP/x_" . str_replace("+"," ",urldecode($_GET['topchat'])) . ".html";
  } else {
    $htmlfile="x_" . str_replace("+"," ",urldecode($_GET['topchat'])) . ".html";
  }
} else if (isset($_POST['topchat'])) {
  $bestext="wav";
  $tc.="<input type=hidden name=topchat value=" . str_replace("+"," ",urldecode($_POST['topchat'])) . "></input>";
  $pretc="&topchat=" . str_replace("+"," ",urldecode($_POST['topchat']));
  if (strpos(strtolower('' . $_SERVER['HTTP_REFERER']), "rjmprogramming.com.au") !== false) {
    $htmlfile="PHP/x_" . str_replace("+"," ",urldecode($_POST['topchat'])) . ".html";
  } else {
    $htmlfile="x_" . str_replace("+"," ",urldecode($_POST['topchat'])) . ".html";
  }
}    

$noncontain='100% calc(100% - 55px)';  // 100% 75%
$noncontainregex="/100\%\ calc\(100\%\ \-\ \d+px\)/g";
$regfrom="youllneverfindthis";
$regto="\\d+px";
$fiftyfive="55";
if (strpos($noncontain, "px)") !== false) {
    $fiftyfive=explode("-",explode(" ",explode("px)", $noncontain)[0])[-1 + sizeof(explode(" ",explode("px)", $noncontain)[0]))])[-1 + sizeof(explode("-",explode(" ",explode("px)", $noncontain)[0])[-1 + sizeof(explode(" ",explode("px)", $noncontain)[0]))]))];
    $regfrom=$fiftyfive . "px";
}
$noncontainregex="/" . str_replace($regfrom,$regto,str_replace("+","\\+",str_replace("-","\\-",str_replace(" ","\\ ",str_replace(")","\\)",str_replace("(","\\(",str_replace("%","\\%",$noncontain))))))) . "/g";   //100\%\ calc\(100\%\ \-\ \d+px\)/g";
$contain="CONTAIN";
if (isset($_GET['contain'])) {
  $contain=str_replace("+"," ",urldecode($_GET['contain']));
} else if (isset($_POST['contain'])) {
  $contain=str_replace("+"," ",urldecode($_POST['contain']));
}
if (isset($_GET['noncontain'])) {
  $noncontain=str_replace("+"," ",urldecode($_GET['noncontain']));
  $regfrom="youllneverfindthis";
  $regto="\\d+px";
  if (strpos($noncontain, "px)") !== false) {
    $fiftyfive=explode("-",explode(" ",explode("px)", $noncontain)[0])[-1 + sizeof(explode(" ",explode("px)", $noncontain)[0]))])[-1 + sizeof(explode("-",explode(" ",explode("px)", $noncontain)[0])[-1 + sizeof(explode(" ",explode("px)", $noncontain)[0]))]))];
    $regfrom=$fiftyfive . "px";
  }
  $noncontainregex="/" . str_replace($regfrom,$regto,str_replace("+","\\+",str_replace("-","\\-",str_replace(" ","\\ ",str_replace(")","\\)",str_replace("(","\\(",str_replace("%","\\%",$noncontain))))))) . "/g";   //100\%\ calc\(100\%\ \-\ \d+px\)/g";
} else if (isset($_POST['noncontain'])) {
  $noncontain=str_replace("+"," ",urldecode($_POST['noncontain']));
  $regfrom="youllneverfindthis";
  $regto="\\d+px";
  if (strpos($noncontain, "px)") !== false) {
    $fiftyfive=explode("-",explode(" ",explode("px)", $noncontain)[0])[-1 + sizeof(explode(" ",explode("px)", $noncontain)[0]))])[-1 + sizeof(explode("-",explode(" ",explode("px)", $noncontain)[0])[-1 + sizeof(explode(" ",explode("px)", $noncontain)[0]))]))];
    $regfrom=$fiftyfive . "px";
  }
  $noncontainregex="/" . str_replace($regfrom,$regto,str_replace("+","\\+",str_replace("-","\\-",str_replace(" ","\\ ",str_replace(")","\\)",str_replace("(","\\(",str_replace("%","\\%",$noncontain))))))) . "/g";   //100\%\ calc\(100\%\ \-\ \d+px\)/g";
}

function topchat($inmedia) {
  global $lastmedia, $tc, $posttc, $htmlfile, $gtc;
  if ($inmedia != $lastmedia) {
    $lastmedia=$inmedia;
    $posttc=" parent.document.getElementById('tdi').innerHTML='" . str_replace(" autoplay","",$lastmedia) . "'; ";
    if (file_exists($htmlfile)) {
        file_put_contents($htmlfile, str_replace("</body>", str_replace(" autoplay","",$lastmedia) . "</body>", file_get_contents($htmlfile)));
    } else {
        file_put_contents($htmlfile, "<body>" . str_replace(" autoplay","",$lastmedia) . "</body>");
    }
  }
  return $inmedia;
}

function server_remote_addr() {
    global $stfle;
    $rma = $_SERVER['REMOTE_ADDR'];
    $ua = strtolower($_SERVER['HTTP_USER_AGENT']);
    // you can add different browsers with the same way ..
    if(preg_match('/(chromium)[ \/]([\w.]+)/', $ua))
            $rma = '000000'.$rma;
    elseif(preg_match('/(chrome)[ \/]([\w.]+)/', $ua))
            $rma = '00000'.$rma;
    elseif(preg_match('/(safari)[ \/]([\w.]+)/', $ua))
            $rma = '0000'.$rma;
    elseif(preg_match('/(opera)[ \/]([\w.]+)/', $ua))
            $rma = '000'.$rma;
    elseif(preg_match('/(msie)[ \/]([\w.]+)/', $ua))
            $rma = '00'.$rma;
    elseif(preg_match('/(mozilla)[ \/]([\w.]+)/', $ua))
            $rma = '0'.$rma;
    if (isset($_GET['outfile'])) {
      if (urldecode($_GET['outfile']) != "") {
        $stfle='<input type=hidden name=outfile id=outfile value="' . urldecode($_GET['outfile']) . '"></input> ';
        return urldecode($_GET['outfile']);
      }
    } else if (isset($_POST['outfile'])) {
      if (urldecode($_POST['outfile']) != "") {
        $stfle='<input type=hidden name=outfile id=outfile value="' . urldecode($_POST['outfile']) . '"></input> ';
        return urldecode($_POST['outfile']);
      }
    }
    return str_replace(":", "_", $rma);
}

// ffmpeg work via PHP exec conduit to command line ...
$ffmpegcommand="";
$ffmpegselect="";
$ffmpegform="";
if (file_exists("/usr/local/bin/ffmpeg")) {
  $ffmpegcommand="/usr/local/bin/ffmpeg ";
  $ffmpegselect="&nbsp;<select style=display:none;height:30px;vertical-align:text-bottom; id=fmsel onchange=fmselit(this.value);><option value=''>V/A++? V+A?</option><option value='+='>[V+A] &#128483;</option><option value='+='>-V+A- <span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127909;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128483;</span></option><option value=''>V/A++? V+A?</option><option value='+=90'>[V+A] &#128483; +90</option><option value='+=90'>-V+A- <span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127909;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128483;</span> +90</option><option value=''>V/A++? V+A?</option><option value='+=180'>[V+A] &#128483; +180</option><option value='+=180'>-V+A- <span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127909;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128483;</span> +180</option><option value=''>V/A++? V+A?</option><option value='+=270'>[V+A] &#128483; +270</option><option value='+=270'>-V+A- <span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127909;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128483;</span> +270</option><option value='++'>V/A+V/A &#127909;+&#127909;</option></select>";
  $ffmpegform="<form onsubmit='return subperhaps();' target=dothework style=display:none; action=./macos_say_record.php method=POST>" . $tc . "<div><input style=display:none; type=hidden id='eangle' name='eangle' value=''></input><input style=display:none; type=hidden id='m1' name='m1' value=''></input><input style=display:none; type=hidden id='m2' name='m2' value=''></input><input style=display:none; type=hidden name='actionis' id='actionis' value='+='></input></div><input name=fprefix value='" . $ffmpegcommand . "'></input><input style=display:none; type=submit id='fmpg'></input></form>";
} else if (file_exists("/usr/bin/ffmpeg")) {
  $ffmpegcommand="/usr/bin/ffmpeg ";
  $ffmpegselect="&nbsp;<select style=display:none;height:30px;vertical-align:text-bottom; id=fmsel onchange=fmselit(this.value);><option value=''>V/A++? V+A?</option><option value='+='>[V+A] &#128483;</option><option value='+='>-V+A- <span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127909;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128483;</span></option><option value=''>V/A++? V+A?</option><option value='+=90'>[V+A] &#128483; +90</option><option value='+=90'>-V+A- <span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127909;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128483;</span> +90</option><option value=''>V/A++? V+A?</option><option value='+=180'>[V+A] &#128483; +180</option><option value='+=180'>-V+A- <span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127909;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128483;</span> +180</option><option value=''>V/A++? V+A?</option><option value='+=270'>[V+A] &#128483; +270</option><option value='+=270'>-V+A- <span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127909;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128483;</span> +270</option><option value='++'>V/A+V/A &#127909;+&#127909;</option></select>";
  $ffmpegform="<form onsubmit='return subperhaps();' target=dothework style=display:none; action=./macos_say_record.php method=POST>" . $tc . "<div><input style=display:none; type=hidden id='eangle' name='eangle' value=''></input><input style=display:none; type=hidden id='m1' name='m1' value=''></input><input style=display:none; type=hidden id='m2' name='m2' value=''></input><input style=display:none; type=hidden name='actionis' id='actionis' value='+='></input></div><input name=fprefix value='" . $ffmpegcommand . "'></input><input style=display:none; type=submit id='fmpg'></input></form>";
} else {
shell_exec("ffmpeg -codecs > " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "ffmhuhpeg.huh");
if (file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ffmhuhpeg.huh")) {
  $retblurb=file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ffmhuhpeg.huh");
  unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ffmhuhpeg.huh");
  if (strpos($retblurb, "odecs") !== false) {
    $ffmpegcommand="ffmpeg ";
    $ffmpegselect="&nbsp;<select style=display:none;height:30px;vertical-align:text-bottom; id=fmsel onchange=fmselit(this.value);><option value=''>V/A++? V+A?</option><option value='+='>[V+A] &#128483;</option><option value='+='>-V+A- <span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127909;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128483;</span></option><option value=''>V/A++? V+A?</option><option value='+=90'>[V+A] &#128483; +90</option><option value='+=90'>-V+A- <span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127909;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128483;</span> +90</option><option value=''>V/A++? V+A?</option><option value='+=180'>[V+A] &#128483; +180</option><option value='+=180'>-V+A- <span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127909;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128483;</span> +180</option><option value=''>V/A++? V+A?</option><option value='+=270'>[V+A] &#128483; +270</option><option value='+=270'>-V+A- <span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127909;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128483;</span> +270</option><option value='++'>V/A+V/A &#127909;+&#127909;</option></select>";
    $ffmpegform="<form onsubmit='return subperhaps();' target=dothework style=display:none; action=./macos_say_record.php method=POST>" . $tc . "<div><input style=display:none; type=hidden id='eangle' name='eangle' value=''></input><input style=display:none; type=hidden id='m1' name='m1' value=''></input><input style=display:none; type=hidden id='m2' name='m2' value=''></input><input style=display:none; type=hidden name='actionis' id='actionis' value='+='></input></div><input name=fprefix value='" . $ffmpegcommand . "'></input><input style=display:none; type=submit id='fmpg'></input></form>";
  } 
} else if (file_exists("/usr/local/bin/ffmpeg")) {
  $ffmpegcommand="/usr/local/bin/ffmpeg ";
  $ffmpegselect="&nbsp;<select style=display:none;height:30px;vertical-align:text-bottom; id=fmsel onchange=fmselit(this.value);><option value=''>V/A++? V+A?</option><option value='+='>[V+A] &#128483;</option><option value='+='>-V+A- <span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127909;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128483;</span></option><option value=''>V/A++? V+A?</option><option value='+=90'>[V+A] &#128483; +90</option><option value='+=90'>-V+A- <span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127909;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128483;</span> +90</option><option value=''>V/A++? V+A?</option><option value='+=180'>[V+A] &#128483; +180</option><option value='+=180'>-V+A- <span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127909;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128483;</span> +180</option><option value=''>V/A++? V+A?</option><option value='+=270'>[V+A] &#128483; +270</option><option value='+=270'>-V+A- <span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127909;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128483;</span> +270</option><option value='++'>V/A+V/A &#127909;+&#127909;</option></select>";
  $ffmpegform="<form onsubmit='return subperhaps();' target=dothework style=display:none; action=./macos_say_record.php method=POST>" . $tc . "<div><input style=display:none; type=hidden id='eangle' name='eangle' value=''></input><input style=display:none; type=hidden id='m1' name='m1' value=''></input><input style=display:none; type=hidden id='m2' name='m2' value=''></input><input style=display:none; type=hidden name='actionis' id='actionis' value='+='></input></div><input name=fprefix value='" . $ffmpegcommand . "'></input><input style=display:none; type=submit id='fmpg'></input></form>";
} else if (file_exists("/usr/bin/ffmpeg")) {
  $ffmpegcommand="/usr/bin/ffmpeg ";
  $ffmpegselect="&nbsp;<select style=display:none;height:30px;vertical-align:text-bottom; id=fmsel onchange=fmselit(this.value);><option value=''>V/A++? V+A?</option><option value='+='>[V+A] &#128483;</option><option value='+='>-V+A- <span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127909;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128483;</span></option><option value=''>V/A++? V+A?</option><option value='+=90'>[V+A] &#128483; +90</option><option value='+=90'>-V+A- <span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127909;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128483;</span> +90</option><option value=''>V/A++? V+A?</option><option value='+=180'>[V+A] &#128483; +180</option><option value='+=180'>-V+A- <span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127909;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128483;</span> +180</option><option value=''>V/A++? V+A?</option><option value='+=270'>[V+A] &#128483; +270</option><option value='+=270'>-V+A- <span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127909;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128483;</span> +270</option><option value='++'>V/A+V/A &#127909;+&#127909;</option></select>";
  $ffmpegform="<form onsubmit='return subperhaps();' target=dothework style=display:none; action=./macos_say_record.php method=POST>" . $tc . "<div><input style=display:none; type=hidden id='eangle' name='eangle' value=''></input><input style=display:none; type=hidden id='m1' name='m1' value=''></input><input style=display:none; type=hidden id='m2' name='m2' value=''></input><input style=display:none; type=hidden name='actionis' id='actionis' value='+='></input></div><input name=fprefix value='" . $ffmpegcommand . "'></input><input style=display:none; type=submit id='fmpg'></input></form>";
} 
}

if (isset($_GET['getme'])) {
  $om="image/gif";
  $fbits="";
  $ivd="";
  $ugg=explode("?",explode("#",str_replace("+"," ",urldecode($_GET['getme'])))[0])[0];
  $qourext=explode(".",$ugg)[-1 + sizeof(explode(".",$ugg))];
  for ($xib=0; $xib<sizeof($exts); $xib++) {
       if (strtolower("." . $qourext) == strtolower($exts[$xib])) $om=$types[$xib];
  }
  $two=str_replace("+"," ",urldecode($_GET['getme']));
  if (strpos(strtolower($ugg), "rjmprogramming.com.au") !== false && strpos(strtolower($ugg), "http") === false) {
    $ivd = str_replace("::",":","http://" . $_SERVER['SERVER_NAME'] . ":" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "" . str_replace("?" . $_SERVER['QUERY_STRING'], "", str_replace("macos_say_record.php", "", $_SERVER['REQUEST_URI'])));
    if (strpos($ivd, "//localhost:8888/") !== false) {
    $fbits=$ivd . "Htdocs/";
    $two=explode("rjmprogramming.com.au/", $ugg)[1];
    } else {
    $fbits="http:";
    }
  }
  if (isset($_GET['topchat']) || isset($_POST['topchat'])) {
  $langcode = lixlpixel_detect_lang($langcode); //insert lang var system in a new var for conditional statement
  if (isset($_GET['alangis']) && isset($_GET['awords'])) {
  $preposttc="pptc(); \n function pptc() { var windowopen=('https://translate.google.com/#view=home&op=translate&sl=' + ('" . substr(strtolower(str_replace("+"," ",urldecode($_GET['alangis'])) . $langcode),0,2) . "').substring(0,2).replace('he','iw').replace('zh','zh-CN').replace('" . $trto . "','auto') + '&tl=" . $trto . "&text=' + encodeURIComponent('" . str_replace("<br>","\n",str_replace("+"," ",urldecode($_GET['awords']))) . "')); if (top.document.getElementById('ootw')) { top.document.getElementById('ootw').value=windowopen;  } else { window.open(windowopen, '_blank', 'left=100,top=100,width=500,height=500');  } } \n";
  } else {
  $preposttc="pptc(); \n function pptc() { if (top.document.getElementById('ootw')) { top.document.getElementById('ootw').value=('" . $langcode . "en').toLowerCase().substring(0,2) + '" . $trto . "';  } } \n";
  }
  //file_put_contents("a.1","");
  echo "<html><head><script type='text/javascript'>" . str_replace(explode("\n",$preposttc)[0] . "\n","",$preposttc) . "</script></head><body onload=\" " . explode(" ",$preposttc)[0] . "  parent.document.getElementById('tdi').innerHTML='" . str_replace(" autoplay","",$lastmedia) . "';\"></body></html>";
  } else if (isset($_GET['haiku'])) {
  //file_put_contents("a.2","");
  echo "<html><head><script type='text/javascript'>" . str_replace(explode("\n",$preposttc)[0] . "\n","",$preposttc) . "</script></head><body onload=\" " . explode(" ",$preposttc)[0] . "  parent.document.getElementById('result').innerHTML='data:" . strtolower($om) . ";base64," . base64_encode(file_get_contents($fbits . $two)) . "'; parent.prevlastisaved='data:" . strtolower($om) . ";base64," . base64_encode(file_get_contents($fbits . $two)) . "';  parent.document.getElementById('avideo').click();\"></body></html>";
  } else if (isset($_GET['topchat']) || isset($_POST['topchat'])) {
  //file_put_contents("a.3","");
  echo "<html><head><script type='text/javascript'>" . str_replace(explode("\n",$preposttc)[0] . "\n","",$preposttc) . "</script></head><body onload=\" " . explode(" ",$preposttc)[0] . "  parent.document.getElementById('tdi').innerHTML='" . str_replace(" autoplay","",$lastmedia) . "';\"></body></html>";
  } else {
  //file_put_contents("a.4","");
  echo "<html><head><script type='text/javascript'>" . str_replace(explode("\n",$preposttc)[0] . "\n","",$preposttc) . "</script></head><body onload=\" " . explode(" ",$preposttc)[0] . "  parent.document.getElementById('fmsel').value=''; parent.document.getElementById('urli').value='';\"><p>data:" . $om . ";base64," . base64_encode(file_get_contents($fbits . str_replace("+"," ",urldecode($_GET['getme'])))) . "</p></body></html>";
  }
  exit;
}

$giffilename=server_remote_addr() . ".gif";

if (isset($_GET['getts']) || isset($_POST['getts'])) {
  $ivd = str_replace("::",":","http://" . $_SERVER['SERVER_NAME'] . ":" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "" . str_replace("?" . $_SERVER['QUERY_STRING'], "", str_replace("macos_say_record.php", "", $_SERVER['REQUEST_URI'])));
  $fbits=str_replace("http://" . explode("/",substr($ivd,7))[0] . "",$_SERVER['DOCUMENT_ROOT'],$ivd . "PHP/animegif/");
  if (strpos($ivd, "//localhost:8888/") !== false) {
    $fbits=str_replace("http://" . explode("/",substr($ivd,7))[0] . "",$_SERVER['DOCUMENT_ROOT'],$ivd . "Htdocs/PHP/animegif/");
  }
  if (!file_exists($fbits . $giffilename)) {
    echo "<html><body onload=\" if (top.document.getElementById('divts')) {  top.document.getElementById('divts').innerHTML=' ';  } \"></body></html>";
  } else {
    echo "<html><body onload=\" if (top.document.getElementById('divts')) {  top.document.getElementById('divts').innerHTML='" . filesize($fbits . $giffilename) . " " . filemtime($fbits . $giffilename) . "';  } \"></body></html>";
  }
  exit;
}

if (isset($_GET['audiosize'])) {
//  if (file_exists('HTTP://www.rjmprogramming.com.au/MarkItUp/html/audio/audio.wav')) {
    if (isset($_GET['getmecontent'])) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'HTTP://www.rjmprogramming.com.au/MarkItUp/html/audio/audio.wav');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
    echo "<html><body onload=\" parent.document.getElementById('audioname').value='audiocapture.wav'; parent.document.getElementById('daudiolater').innerHTML=topchat('<audio id=thataudio controls autoplay><source type=audio/x-wav src=" . "data:audio/x-wav;base64," . base64_encode($output) . "></source></audio>') + '&nbsp;<a style=display:inline-block;text-decoration:none;cursor:pointer;font-size:84px; onclick=emailit(); id=aemailo title=Email>&#128231;</a><div id=ifem style=display:inline-block;></div>';\"><p>" . strlen($output) . "</p><div>data:audio/x-wav;base64," . base64_encode($output) . "</div></body></html>";
    } else {
    //$context = stream_context_create(array('http' => array('header'=>'Connection: close\r\n')));
    //$ct=file_get_contents('HTTP://www.rjmprogramming.com.au/MarkItUp/html/audio/audio.wav',false,$context);
    //file_put_contents("x.x",strlen($ct));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'HTTP://www.rjmprogramming.com.au/MarkItUp/html/audio/audio.wav');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
    echo "<html><body><p>" . strlen($output) . "</p><div></div></body></html>";
    }
//  } else {    
//    echo "<html><body><p>-1</p><div></div></body></html>";
//  }
  exit;
} else if (isset($_GET['vsfs']) && isset($_GET['vsfn']) && isset($_GET['vsfi']) && isset($_GET['vsfu'])) {
  $docroot=dirname(__FILE__);
  if (file_exists("lookup_" . str_replace(")","",str_replace("(","",str_replace("+"," ",urldecode($_GET['vsfn'])))))) {
    unlink("lookup_" . str_replace(")","",str_replace("(","",str_replace("+"," ",urldecode($_GET['vsfn'])))));
  }
  exec("find " . $_SERVER['DOCUMENT_ROOT'] . " -name '" . str_replace(")","*",str_replace("(","*",str_replace("+"," ",urldecode($_GET['vsfn'])))) . "' -exec ls -l {} \\; 2> /dev/null > lookup_" . str_replace(")","",str_replace("(","",str_replace("+"," ",urldecode($_GET['vsfn'])))));
  if (file_exists("lookup_" . str_replace(")","",str_replace("(","",str_replace("+"," ",urldecode($_GET['vsfn'])))))) {
    $infois=file_get_contents(("lookup_" . str_replace(")","",str_replace("(","",str_replace("+"," ",urldecode($_GET['vsfn']))))));
    $lines=explode("\n", $infois);
    for ($il=0; $il<sizeof($lines); $il++) {
      $lines[$il]=str_replace("\r","",$lines[$il]);
      if (strpos($lines[$il], " " . $_GET['vsfs'] . " ") !== false) {
        //file_put_contents("look_" . str_replace(")","",str_replace("(","",str_replace("+"," ",urldecode($_GET['vsfn'])))), "thisplace=" . $docroot . "\n" . "rootplace=" . $_SERVER['DOCUMENT_ROOT'] . "\n" . "origplace=" . str_replace("+"," ",urldecode($_GET['vsfu'])) . "\n" . "foundplace=" . explode(" ", $lines[$il])[-1 + sizeof( explode(" ", $lines[$il]))] . "\n" . '<html><body onload=" parent.document.getElementById(' . "'" . str_replace("+"," ",urldecode($_GET['vsfi'])) . "'" . ").value='" . str_replace($_SERVER['DOCUMENT_ROOT'],explode("localhost",str_replace("+"," ",urldecode($_GET['vsfu'])))[0] . "localhost" . explode("/",explode("localhost",str_replace("+"," ",urldecode($_GET['vsfu'])))[1])[0] . "",explode(" ", $lines[$il])[-1 + sizeof( explode(" ", $lines[$il]))]) . "'; " . '"></body></html>');
        if (strpos(explode(" ", $lines[$il])[-1 + sizeof( explode(" ", $lines[$il]))], $_SERVER['DOCUMENT_ROOT']) !== false) {
          if (isset($_GET['exif'])) {
          $ort="";
          //file_put_contents("x5.x5",explode(' ', $lines[$il])[-1 + sizeof(explode(' ', $lines[$il]))]);
          if (function_exists('exif_read_data')) {
          $exif = exif_read_data(explode(' ', $lines[$il])[-1 + sizeof(explode(' ', $lines[$il]))]);
          //file_put_contents("x6.x6","");
          if (isset($exif['Orientation'])) {
          $ort = $exif['Orientation'];
          }
          }
          //file_put_contents("x7.x7",'<html><body onload=" if (parent.document.getElementById(' . "'" . 'eangle' . "'" . ')) { parent.document.getElementById(' . "'" . 'eangle' . "'" . ').value=' . "'" . $ort . "'" . ';  } top.document.getElementById(' . "'" . str_replace("+"," ",urldecode($_GET['vsfi'])) . "'" . ").value='" . $ort . "'; " . '"></body></html>');
          echo '<html><body onload=" if (parent.document.getElementById(' . "'" . 'eangle' . "'" . ')) { parent.document.getElementById(' . "'" . 'eangle' . "'" . ').value=' . "'" . $ort . "'" . ';  } top.document.getElementById(' . "'" . str_replace("+"," ",urldecode($_GET['vsfi'])) . "'" . ").value='" . $ort . "'; " . '"></body></html>'; 
          } else if (isset($_GET['burl'])) {      
          echo '<html><body onload=" top.document.getElementById(' . "'" . 'burl' . "'" . ").placeholder='" . str_replace($_SERVER['DOCUMENT_ROOT'],explode("localhost",str_replace("+"," ",urldecode($_GET['vsfu'])))[0] . "localhost" . explode("/",explode("localhost",str_replace("+"," ",urldecode($_GET['vsfu'])))[1])[0] . "",explode(" ", $lines[$il])[-1 + sizeof( explode(" ", $lines[$il]))]) . "'; " . '  top.document.getElementById(' . "'" . 'burl' . "'" . ').title=top.document.getElementById(' . "'" . 'burl' . "'" . ').placeholder;   top.document.getElementById(' . "'" . 'vurl' . "'" . ').title=top.document.getElementById(' . "'" . 'vurl' . "'" . ').title.replace( top.document.getElementById(' . "'" . 'burl' . "'" . ').value, top.document.getElementById(' . "'" . 'burl' . "'" . ').placeholder);   top.document.getElementById(' . "'" . 'vurl' . "'" . ').title=top.document.getElementById(' . "'" . 'aurl' . "'" . ').title.replace( top.document.getElementById(' . "'" . 'burl' . "'" . ').value, top.document.getElementById(' . "'" . 'burl' . "'" . ').placeholder);  top.document.getElementById(' . "'" . 'burl' . "'" . ').value=top.document.getElementById(' . "'" . 'burl' . "'" . ').placeholder;  "></body></html>'; 
          } else { 
          echo '<html><body onload=" parent.document.getElementById(' . "'" . str_replace("+"," ",urldecode($_GET['vsfi'])) . "'" . ").value='" . str_replace($_SERVER['DOCUMENT_ROOT'],explode("localhost",str_replace("+"," ",urldecode($_GET['vsfu'])))[0] . "localhost" . explode("/",explode("localhost",str_replace("+"," ",urldecode($_GET['vsfu'])))[1])[0] . "",explode(" ", $lines[$il])[-1 + sizeof( explode(" ", $lines[$il]))]) . "'; " . '"></body></html>'; 
          }
        }
        unlink("lookup_" . str_replace(")","",str_replace("(","",str_replace("+"," ",urldecode($_GET['vsfn']))))); 
      } else {
        unlink("lookup_" . str_replace(")","",str_replace("(","",str_replace("+"," ",urldecode($_GET['vsfn']))))); 
      }
    }
  } 
  exit;
}

$hidden="hidden";
$sosw="";
 $thwords="Word Suggestion(s) for Voiceover Purposes"; 
if (PHP_OS == "Darwin") { 
  $hidden="visible";  
  $sosw="Supervise &amp; synchronize '<select style=display:inline-block; id=saymode onchange=saymodeit(this);><option value=''>say</option><option value='gt'>Google Translate</option><option value='mm'>My Memory</option></select> [<span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127760;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128214;</span> words]' or "; 
  $thwords="Words";   
} else {
  $dsm="gt";
  $rtw="Hear These Words";
  $hidden="visible";  
  $sosw="Supervise '<select style=display:inline-block; id=saymode onchange=saymodeit(this);><option value='gt'>Google Translate</option><option value='mm'>My Memory</option></select> [<span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127760;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128214;</span> words]' or "; 
  $thwords="Words";   
}
$mms="My macOS say";
$aname="";
$precursur="";
$thecontent="";
$tastuff="";
$daudio="";
$audiois="";
$dcv="";
$langrest="";
$htmltop="<html>";
$sayprefix="";
$langsuffix="";
$voicecode="";
$voicesrest="";
$defvoice="";
$retdefvoice="";

if (isset($_POST['mediais'])) {
  $audiois="<" . explode("/",explode("ata:", str_replace(" ","+",urldecode($_POST['mediais'])))[1])[0] . " id=thataudio controls autoplay><source type=" . explode(";",explode("ata:", str_replace(" ","+",urldecode($_POST['mediais'])))[1])[0] . " src=" . explode("#",str_replace(" ","+",urldecode($_POST['mediais'])))[0] . "></source></" . explode("/",explode("ata:", str_replace(" ","+",urldecode($_POST['mediais'])))[1])[0] . ">&nbsp;<a style=display:inline-block;text-decoration:none;cursor:pointer;font-size:84px; onclick=emailit(); title=Email>&#128231;</a><div id=ifem style=display:inline-block;></div>";
  $thecontent=str_replace(" ","+",urldecode($_POST['mediais']));
  $aname="\n document.getElementById('audioname').value='" . str_replace("+"," ",urldecode($_POST['audioname'])) . "'; \n";
  $mms="My media share";
}

if (isset($_GET['saythis'])) {
    $tastuff=str_replace("+"," ",urldecode($_GET['saythis']));
} else if (isset($_GET['saythis'])) {
    $tastuff=str_replace("+"," ",urldecode($_POST['saythis']));
}


$sayvoices="Alex                en_US    # Most people recognize me by my voice.
Alice               it_IT    # Salve, mi chiamo Alice e sono una voce italiana.
Alva                sv_SE    # Hej, jag heter Alva. Jag är en svensk röst.
Amelie              fr_CA    # Bonjour, je m’appelle Amelie. Je suis une voix canadienne.
Anna                de_DE    # Hallo, ich heiße Anna und ich bin eine deutsche Stimme.
Carmit              he_IL    # שלום. קוראים לי כרמית, ואני קול בשפה העברית.
Damayanti           id_ID    # Halo, nama saya Damayanti. Saya berbahasa Indonesia.
Daniel              en_GB    # Hello, my name is Daniel. I am a British-English voice.
Diego               es_AR    # Hola, me llamo Diego y soy una voz española.
Ellen               nl_BE    # Hallo, mijn naam is Ellen. Ik ben een Belgische stem.
Fiona               en_scotland # Hello, my name is Fiona. I am a Scottish-English voice.
Fred                en_US    # I sure like being inside this fancy computer
Ioana               ro_RO    # Bună, mă cheamă Ioana . Sunt o voce românească.
Joana               pt_PT    # Olá, chamo-me Joana e dou voz ao português falado em Portugal.
Jorge               es_ES    # Hola, me llamo Jorge y soy una voz española.
Juan                es_MX    # Hola, me llamo Juan y soy una voz mexicana.
Kanya               th_TH    # สวัสดีค่ะ ดิฉันชื่อKanya
Karen               en_AU    # Hello, my name is Karen. I am an Australian-English voice.
Kyoko               ja_JP    # こんにちは、私の名前はKyokoです。日本語の音声をお届けします。
Laura               sk_SK    # Ahoj. Volám sa Laura . Som hlas v slovenskom jazyku.
Lekha               hi_IN    # नमस्कार, मेरा नाम लेखा है. मैं हिन्दी में बोलने वाली आवाज़ हूँ.
Luca                it_IT    # Salve, mi chiamo Luca e sono una voce italiana.
Luciana             pt_BR    # Olá, o meu nome é Luciana e a minha voz corresponde ao português que é falado no Brasil
Maged               ar_SA    # مرحبًا اسمي Maged. أنا عربي من السعودية.
Mariska             hu_HU    # Üdvözlöm! Mariska vagyok. Én vagyok a magyar hang.
Mei-Jia             zh_TW    # 您好，我叫美佳。我說國語。
Melina              el_GR    # Γεια σας, ονομάζομαι Melina. Είμαι μια ελληνική φωνή.
Milena              ru_RU    # Здравствуйте, меня зовут Milena. Я – русский голос системы.
Moira               en_IE    # Hello, my name is Moira. I am an Irish-English voice.
Monica              es_ES    # Hola, me llamo Monica y soy una voz española.
Nora                nb_NO    # Hei, jeg heter Nora. Jeg er en norsk stemme.
Paulina             es_MX    # Hola, me llamo Paulina y soy una voz mexicana.
Samantha            en_US    # Hello, my name is Samantha. I am an American-English voice.
Sara                da_DK    # Hej, jeg hedder Sara. Jeg er en dansk stemme.
Satu                fi_FI    # Hei, minun nimeni on Satu. Olen suomalainen ääni.
Sin-ji              zh_HK    # 您好，我叫 Sin-ji。我講廣東話。
Tessa               en_ZA    # Hello, my name is Tessa. I am a South African-English voice.
Thomas              fr_FR    # Bonjour, je m’appelle Thomas. Je suis une voix française.
Ting-Ting           zh_CN    # 您好，我叫Ting-Ting。我讲中文普通话。
Veena               en_IN    # Hello, my name is Veena. I am an Indian-English voice.
Victoria            en_US    # Isn't it nice to have a computer that will talk to you?
Xander              nl_NL    # Hallo, mijn naam is Xander. Ik ben een Nederlandse stem.
Yelda               tr_TR    # Merhaba, benim adım Yelda. Ben Türkçe bir sesim.
Yuna                ko_KR    # 안녕하세요. 제 이름은 Yuna입니다. 저는 한국어 음성입니다.
Yuri                ru_RU    # Здравствуйте, меня зовут Yuri. Я – русский голос системы.
Zosia               pl_PL    # Witaj. Mam na imię Zosia, jestem głosem kobiecym dla języka polskiego.
Zuzana              cs_CZ    # Dobrý den, jmenuji se Zuzana. Jsem český hlas.
";

// Define default language.
$GLOBALS['_DLANG']='en';

// Define all available languages.
// WARNING: uncomment all available languages

$GLOBALS['_LANG'] = array(
'af-Afrikaans', // afrikaans.
'ar-Arabic', // arabic.
'bg-Bulgarian', // bulgarian.
'ca-Catalan', // catalan.
'cs-Czech', // czech.
'da-Danish', // danish.
'de-German', // german.
'el-Greek', // greek.
'en-English', // english.
'es-Spanish', // spanish.
'et-Estonian', // estonian.
'fi-Finnish', // finnish.
'fr-French', // french.
'gl-Galician', // galician.
'he-Hebrew', // hebrew.
'hi-Hindi', // hindi.
'hr-Croatian', // croatian.
'hu-Hungarian', // hungarian.
'id-Indonesian', // indonesian.
'it-Italian', // italian.
'ja-Japanese', // japanese.
'ko-Korean', // korean.
'ka-Georgian', // georgian.
'lt-Lithuanian', // lithuanian.
'lv-Latvian', // latvian.
'ms-Malay', // malay.
'nl-Dutch', // dutch.
'no-Norwegian', // norwegian.
'pl-Polish', // polish.
'pt-Portuguese', // portuguese.
'ro-Romanian', // romanian.
'ru-Russian', // russian.
'sk-Slovak', // slovak.
'sl-Slovenian', // slovenian.
'sq-Albanian', // albanian.
'sr-Serbian', // serbian.
'sv-Swedish', // swedish.
'th-Thai', // thai.
'tr-Turkish', // turkish.
'uk-Ukrainian', // ukrainian.
'zh-Chinese' // chinese.
);


$lri="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$dri=["127462","127463","127464","127465","127466","127467","127468","127469","127470","127471","127472","127473","127474","127475","127476","127477","127478","127479","127480","127481","127482","127483","127484","127485","127486","127487"];


// Detect language from user agent browser ... thanks to https://stackoverflow.com/questions/3770513/detect-browser-language-in-php
function lixlpixel_get_env_var($Var) {
     global $GLOBALS, $langrest, $trto;
     if (empty($GLOBALS[$Var])) {
         $GLOBALS[$Var]=(!empty($GLOBALS['_SERVER'][$Var]))?
         $GLOBALS['_SERVER'][$Var] : (!empty($GLOBALS['HTTP_SERVER_VARS'][$Var])) ? $GLOBALS['HTTP_SERVER_VARS'][$Var]:'';
     }
}

function lixlpixel_detect_lang($defl) {
     global $GLOBALS, $langrest, $sayvoices, $voicecode, $voicesrest, $tastuff, $defvoice, $retdefvoice, $lri, $dri, $trto;
     $mappings="gb;en|cz;cs|dk;da|gr;el|il;he;|in;hi;|jp;ja;|kr;ko|ge;ka|al;sq|ua;uk|cn;zh|my;ms|ad;ca|rs;sr|ee;et|sa;ar|za;af|";
     $voicesprefix="";
     $voicessuffix="";
     $selected=" selected";
     $M="";
     // Detect HTTP_ACCEPT_LANGUAGE & HTTP_USER_AGENT.
     lixlpixel_get_env_var('HTTP_ACCEPT_LANGUAGE');
     lixlpixel_get_env_var('HTTP_USER_AGENT');

     $_AL=strtolower($GLOBALS['HTTP_ACCEPT_LANGUAGE']);
     $_UA=strtolower($GLOBALS['HTTP_USER_AGENT']);
     
     if ("$_AL" == "" && "$_UA" == "") {
     $_AL=strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']);
     $_UA=strtolower($_SERVER['HTTP_USER_AGENT']);
     }
     
     if ($defl != "") {
     $_AL=strtolower($defl);
     $_UA=strtolower($defl);
     }

     $trto=strtolower(substr(('' . $GLOBALS['_DLANG'] . 'en'),0,2)); 
     
     // Try to detect Primary language if several languages are accepted.
     foreach ($GLOBALS['_LANG'] as $K) {
         $sayps=explode(" " . strtolower(explode("-", $K)[0]) . "_", $sayvoices);
         if (strpos($_AL, explode("-", $K)[0]) === 0) {  
           if (sizeof($sayps) > 1) {
             for ($ii=1; $ii<sizeof($sayps); $ii++) {
             $thisname=trim(explode("\n", $sayps[-1 + $ii])[-1 + sizeof(explode("\n", $sayps[-1 + $ii]))]);
             $thisnuance=strtolower(explode("-", $K)[0]) . "_" . explode(" ", $sayps[$ii])[0];
             $thisdefwords=trim(explode("#",explode("\n", $sayps[$ii])[0])[1]);
             $voicesprefix.="<option value='" . $thisnuance . " " . $thisname . "'" . $selected . ">" . $thisname . " " . $thisnuance . " " . $thisdefwords . "</option>";
             if ($defvoice == ($thisnuance . " " . $thisname)) {  $tastuff=$thisdefwords;  } 
             if ($voicecode == "") { if ($defvoice != "") { $voicecode=$defvoice;   } else { $voicecode=$thisnuance . " " . $thisname; $retdefvoice=$thisdefwords; }  } 
             $selected="";
             }
           }
           $pref=" "; // &#127462;&#127482;
           $pcc=explode("-", $K)[0];
           $pccs=explode(";" . $pcc, $mappings);
           if (sizeof($pccs) > 1) {
             $pcc=explode("|", explode(";" . $pcc, $mappings)[0])[-1 + sizeof(explode("|", explode(";" . $pcc, $mappings)[0]))];
           }
           for ($ijk=0; $ijk<strlen($lri); $ijk++) {
             if (substr(strtolower($lri),$ijk,1) == substr(strtolower($pcc),0,1)) {
               $pref.="&#" . $dri[$ijk] . ";";
             }
           }
           for ($ijk=0; $ijk<strlen($lri); $ijk++) {
             if (substr(strtolower($lri),$ijk,1) == substr(strtolower($pcc),1,1)) {
               $pref.="&#" . $dri[$ijk] . ";";
             }
           }
           $langrest.="<option value='" . explode("-", $K)[0] . "' selected>" . explode("-", $K)[1] . $pref . "</option>"; 
           $M=$K; 
         } else { 
           if (sizeof($sayps) > 1) {
             for ($ii=1; $ii<sizeof($sayps); $ii++) {
             $thisname=trim(explode("\n", $sayps[-1 + $ii])[-1 + sizeof(explode("\n", $sayps[-1 + $ii]))]);
             $thisnuance=strtolower(explode("-", $K)[0]) . "_" . explode(" ", $sayps[$ii])[0];
             $thisdefwords=trim(explode("#",explode("\n", $sayps[$ii])[0])[1]);
             if ($defvoice == ($thisnuance . " " . $thisname)) {  $tastuff=$thisdefwords;  $voicecode=$defvoice;   } 
             $voicessuffix.="<option value='" . $thisnuance . " " . $thisname . "'>" . $thisname . " " . $thisnuance . " " . $thisdefwords . "</option>";
             }
           }
           $pref=" "; // &#127462;&#127482;
           $pcc=explode("-", $K)[0];
           $pccs=explode(";" . $pcc, $mappings);
           if (sizeof($pccs) > 1) {
             $pcc=explode("|", explode(";" . $pcc, $mappings)[0])[-1 + sizeof(explode("|", explode(";" . $pcc, $mappings)[0]))];
           }
           for ($ijk=0; $ijk<strlen($lri); $ijk++) {
             if (substr(strtolower($lri),$ijk,1) == substr(strtolower($pcc),0,1)) {
               $pref.="&#" . $dri[$ijk] . ";";
             }
           }
           for ($ijk=0; $ijk<strlen($lri); $ijk++) {
             if (substr(strtolower($lri),$ijk,1) == substr(strtolower($pcc),1,1)) {
               $pref.="&#" . $dri[$ijk] . ";";
             }
           }
           $langrest.="<option value='" . explode("-", $K)[0] . "'>" . explode("-", $K)[1] . $pref . "</option>"; 
         }
     }
     
     $voicesrest=$voicesprefix . $voicessuffix;
     
     if ("$M" != "") { if (1 == 2) { $trto=strtolower(substr($M,0,2)); }  return $M; }

     // Try to detect any language if not yet detected.
     foreach ($GLOBALS['_LANG'] as $K) {
         if (strpos($_AL, explode("-", $K)[0]) !== false) { if (1 == 2) { $trto=strtolower(substr($K,0,2)); }  return $K; }
     }
     foreach ($GLOBALS['_LANG'] as $K) {
         //if(preg_match("/[[( ]{$K}[;,_-)]/",$_UA)) // matching other letters (create an error for seo spyder)
         if (1 == 2) { $trto=strtolower(substr($K,0,2));  }
         return $K;
     }

     // Return default language if language is not yet detected.
     if (1 == 2) { $trto=strtolower(substr(('' . $GLOBALS['_DLANG'] . 'en'),0,2)); } 
     return $GLOBALS['_DLANG'];
}


function bestis() {
    global $bestext;
    if ($bestext != "wav" || 1 == 1) {
    $bestext = "aiff";
    $ua = strtolower($_SERVER['HTTP_USER_AGENT']);
    // you can add different browsers with the same way ..
    if (preg_match('/(chromium)[ \/]([\w.]+)/', $ua))
            $bestext = 'm4a';
    elseif(preg_match('/(chrome)[ \/]([\w.]+)/', $ua))
            $bestext = 'm4a';
    elseif(preg_match('/(safari)[ \/]([\w.]+)/', $ua))
            $bestext = 'aiff';
    elseif(preg_match('/(opera)[ \/]([\w.]+)/', $ua))
            $bestext = 'm4a';
    elseif(preg_match('/(msie)[ \/]([\w.]+)/', $ua))
            $bestext = 'm4a';
    elseif(preg_match('/(mozilla)[ \/]([\w.]+)/', $ua))
            $bestext = 'm4a';
    } else {
    $bestext = "aiff";
    }
    return $bestext;
}


if (isset($_GET['thevoice']) || isset($_POST['thevoice']) || isset($_GET['thelang']) || isset($_POST['thelang'])) {
  if (isset($_GET['thevoice'])) {
      $defvoice=str_replace("+"," ",urldecode($_GET['thevoice']));
  } else if (isset($_POST['thevoice'])) {
      $defvoice=str_replace("+"," ",urldecode($_POST['thevoice']));
  }
  if (isset($_GET['thelang'])) {
      $langcode=urldecode($_GET['thelang']);
  } else if (isset($_POST['thelang'])) {
      $langcode=urldecode($_POST['thelang']);
  } else if (isset($_GET['thevoice'])) {
      $langcode=explode("_",urldecode($_GET['thevoice']))[0];
  } else if (isset($_POST['thevoice'])) {
      $langcode=explode("_",urldecode($_POST['thevoice']))[0];
  }  
  $langcode = lixlpixel_detect_lang($langcode); //insert lang var system in a new var for conditional statement
  $langrest=str_replace(" selected", "", $langrest);
  if (isset($_GET['thelang'])) {
      $langcode=urldecode($_GET['thelang']);
      $langrest=str_replace("'" . $langcode . "'", "'" . $langcode . "' selected", $langrest);
  } else if (isset($_POST['thelang'])) {
      $langcode=urldecode($_POST['thelang']);
      $langrest=str_replace("'" . $langcode . "'", "'" . $langcode . "' selected", $langrest);
  } else if (isset($_GET['thevoice'])) {
      $langcode=explode("_",urldecode($_GET['thevoice']))[0];
      $langrest=str_replace("'" . $langcode . "'", "'" . $langcode . "' selected", $langrest);
  } else if (isset($_POST['thevoice'])) {
      $langcode=explode("_",urldecode($_POST['thevoice']))[0];
      $langrest=str_replace("'" . $langcode . "'", "'" . $langcode . "' selected", $langrest);
  }  
  if (isset($_GET['thevoice'])) {
      $voicesrest=str_replace(" selected", "", $voicesrest);
      $voicecode=str_replace("+"," ",urldecode($_GET['thevoice']));
      $voicesrest=str_replace("'" . $voicecode . "'", "'" . $voicecode . "' selected", $voicesrest);
      //echo $voicecode . " " . $voicesrest;
      //exit;
      $sayprefix=" -v " . trim(explode(" ",$voicecode)[1]) . "";
  } else if (isset($_POST['thevoice'])) {
      $voicesrest=str_replace(" selected", "", $voicesrest);
      $voicecode=str_replace("+"," ",urldecode($_POST['thevoice']));
      $voicesrest=str_replace("'" . $voicecode . "'", "'" . $voicecode . "' selected", $voicesrest);
      //echo $voicecode . " " . $voicesrest;
      //exit;
      $sayprefix=" -v " . trim(explode(" ",$voicecode)[1]) . "";
  }
  } else if (isset($_GET['thelang']) || isset($_POST['thelang'])) {
  $langcode = lixlpixel_detect_lang($langcode); //insert lang var system in a new var for conditional statement
  $langrest=str_replace(" selected", "", $langrest);
  if (isset($_GET['thelang'])) {
      $langcode=urldecode($_GET['thelang']);
      $langrest=str_replace("'" . $langcode . "'", "'" . $langcode . "' selected", $langrest);
  } else {
      $langcode=urldecode($_POST['thelang']);
      $langrest=str_replace("'" . $langcode . "'", "'" . $langcode . "' selected", $langrest);
  }
} else { // Thanks to 

// Redirect to the correct location.
// Example Implementation aff var lang to name file
/*
echo 'The Language detected is: '.lixlpixel_detect_lang(); // For Demonstration
echo "<br />";    
*/
$langcode = lixlpixel_detect_lang($langcode); //insert lang var system in a new var for conditional statement

//echo "<br />";    

//echo $lang_var; // print var for trace

//echo "<br />";    
//exit;
}

$sayps=explode(" " . strtolower($langcode) . "_", $sayvoices);
if (sizeof($sayps) > 1) {
    if ($sayprefix == "") { $sayprefix=" -v " . trim(explode("#", $sayps[0])[-1 + sizeof(explode("#", $sayps[0]))]) . ""; }
}
$langsuffix='thelang=' . urlencode($langcode) . $pretc . '&thevoice=' . urlencode($voicecode) . $gtc . '&';


if (isset($_GET['alangis']) && isset($_GET['awords'])) {
 $preposttc="pptc(); \n function pptc() { var windowopen=('https://translate.google.com/#view=home&op=translate&sl=' + ('" . substr(strtolower(str_replace("+"," ",urldecode($_GET['alangis'])) . $langcode),0,2) . "').substring(0,2).replace('he','iw').replace('zh','zh-CN').replace('" . $trto . "','auto') + '&tl=" . $trto . "&text=' + encodeURIComponent('" . str_replace("<br>","\n",str_replace("+"," ",urldecode($_GET['awords']))) . "')); if (top.document.getElementById('ootw')) { top.document.getElementById('ootw').value=windowopen;  } else { window.open(windowopen, '_blank', 'left=100,top=100,width=500,height=500');  } } \n";
} else {
 $preposttc="pptc(); \n function pptc() { if (top.document.getElementById('ootw')) { top.document.getElementById('ootw').value=('" . $langcode . "en').toLowerCase().substring(0,2) + '" . $trto . "';  } } \n";
}


$htmltop="<!DOCTYPE html><html lang='" . urldecode($langcode) . "'>";
//$langchange=" lang='" . urldecode($langcode) . "'>";
if ($tastuff == "" && $retdefvoice != "") {
  $tastuff=$retdefvoice; 
}

bestis();

if (PHP_OS != "Darwin") {
$precursor=" if (two == twotwo) { alert('Sorry ... this only works with an underlying macOS or Mac OS X system that supports the say command.'); return false; } ";
}
if (PHP_OS == "Darwin" || 1 == 1) {
if (isset($_GET['saythis']) && isset($_GET['audioname'])) {
  if ($_GET['saythis'] != "") {
  //file_put_contents("xqx.xqx","say -o " . dirname(__FILE__) . "/" . str_replace("+"," ",urldecode($_GET['audioname'])) . " " . str_replace("\n",",,,,,,",$thewords) . " > " . dirname(__FILE__) . "/sayout.out" . " 2> " . dirname(__FILE__) . "/sayerr.err");
  $thewords=str_replace("+"," ",urldecode($_GET['saythis']));
  //file_put_contents("xq.xq","say -o " . dirname(__FILE__) . "/" . str_replace("+"," ",urldecode($_GET['audioname'])) . " " . str_replace("\n",",,,,,,",$thewords) . " > " . dirname(__FILE__) . "/sayout.out" . " 2> " . dirname(__FILE__) . "/sayerr.err");
  //file_put_contents("xq.xq",$sayprefix . " " . $voicecode . " " . $_POST['thevoice']);
  //exit;
  exec("say" . $sayprefix . " -o " . dirname(__FILE__) . "/" . str_replace("+"," ",urldecode($_GET['audioname'])) . " " . str_replace("\n",",,,,,,",$thewords) . " > " . dirname(__FILE__) . "/sayout.out" . " 2> " . dirname(__FILE__) . "/sayerr.err");
  if (isset($_POST['viareminders']) || isset($_GET['viareminders'])) {
  //file_put_contents("a.9", "reminders");
  $oext=explode(".", str_replace("+"," ",urldecode($_POST['audioname'])))[1];
  $omimetype="audio/" . $oext;
  for ($xib=0; $xib<sizeof($exts); $xib++) {
       if (strtolower("." . $oext) == strtolower($exts[$xib])) { $omimetype=$types[$xib]; } 
  }
  echo "<html><body onload=\" top.document.getElementById('audioname').value='audiocapture." . $oext . "'; top.document.getElementById('result').innerHTML='data:" . $omimetype . ";base64," . base64_encode(file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture." . $oext)) . "';  parent.document.getElementById('audioname').value='audiocapture." . $oext . "'; parent.document.getElementById('result').innerHTML='data:" . $omimetype . ";base64," . base64_encode(file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture." . $oext)) . "'; if (1 == 2) { if (('" . $omimetype . "').indexOf('video/') == 0 && '" . $actc . "' != '++' && parent.document.getElementById('vsource')) { var xaud=parent.document.getElementById('dvaudio'); if (xaud) { xaud.innerHTML=''; }  var auds=parent.document.getElementsByTagName('audio');   for (var iauds=0; iauds<auds.length; iauds++) {  auds[iauds].style.display='none';  }  if (1 == 1) { var vsi=parent.document.getElementById('vsource').src;  parent.document.getElementById('topleftx').innerHTML=parent.document.getElementById('topleftx').innerHTML.replace(vsi, 'data:" . $omimetype . ";base64," . base64_encode(file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture." . $oext)) . "');  } else { parent.document.getElementById('vsource').value='data:" . $omimetype . ";base64," . base64_encode(file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture." . $oext)) . "'; } } else {  parent.document.getElementById('topleftx').innerHTML='<br><div id=after>" . "<" . explode('/',$omimetype)[0] . "' + parent.cvis + ' id=thataudio controls autoplay><source id=vsource type=" . $omimetype . " src=" . "data:" . $omimetype . ";base64," . base64_encode(file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture." . $oext)) . "></source></" . explode('/',$omimetype)[0] . ">" . "</div>'; } } \"></body></html>";
  exit;
  } //else {
  //file_put_contents("a.09", $_SERVER['HTTP_REFERER']);
  //}
  }
} else if (isset($_POST['saythis']) && isset($_POST['audioname'])) {
  if ($_POST['saythis'] != "") {
  //file_put_contents("xqqx.xqqx","say -o " . dirname(__FILE__) . "/" . str_replace("+"," ",urldecode($_POST['audioname'])) . " " . str_replace("\n",",,,,,,",$thewords) . " > " . dirname(__FILE__) . "/sayout.out" . " 2> " . dirname(__FILE__) . "/sayerr.err");
  $thewords=str_replace("+"," ",urldecode($_POST['saythis']));
  //echo "say -o " . dirname(__FILE__) . "/" . str_replace("+"," ",urldecode($_POST['audioname'])) . " " . str_replace("\n",",,,,,,",$thewords);
  //exit;
  //file_put_contents("xqq.xqq","say -o " . dirname(__FILE__) . "/" . str_replace("+"," ",urldecode($_POST['audioname'])) . " " . str_replace("\n",",,,,,,",$thewords) . " > " . dirname(__FILE__) . "/sayout.out" . " 2> " . dirname(__FILE__) . "/sayerr.err");
  //file_put_contents("xqv.xqv",$sayprefix . " " . $voicecode . " " . $_POST['thevoice']);
  //echo $sayprefix;
  //exit;
  exec("say" . $sayprefix . " -o " . dirname(__FILE__) . "/" . str_replace("+"," ",urldecode($_POST['audioname'])) . " " . str_replace("\n",",,,,,,",$thewords) . " > " . dirname(__FILE__) . "/sayout.out" . " 2> " . dirname(__FILE__) . "/sayerr.err");
  if (isset($_POST['viareminders']) || isset($_GET['viareminders'])) {
  //file_put_contents("a.9b", "reminders");
  $oext=explode(".", str_replace("+"," ",urldecode($_POST['audioname'])))[1];
  $omimetype="audio/" . $oext;
  for ($xib=0; $xib<sizeof($exts); $xib++) {
       if (strtolower("." . $oext) == strtolower($exts[$xib])) { $omimetype=$types[$xib]; } 
  }
  echo "<html><body onload=\" top.document.getElementById('result').innerHTML='data:" . $omimetype . ";base64," . base64_encode(file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture." . $oext)) . "';  parent.document.getElementById('result').innerHTML='data:" . $omimetype . ";base64," . base64_encode(file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture." . $oext)) . "';  top.document.getElementById('audioname').value='audiocapture." . $oext . "'; parent.document.getElementById('audioname').value='audiocapture." . $oext . "'; if (1 == 2) { if (('" . $omimetype . "').indexOf('video/') == 0 && '" . $actc . "' != '++' && parent.document.getElementById('vsource')) { var xaud=parent.document.getElementById('dvaudio'); if (xaud) { xaud.innerHTML=''; }  var auds=parent.document.getElementsByTagName('audio');   for (var iauds=0; iauds<auds.length; iauds++) {  auds[iauds].style.display='none';  }  if (1 == 1) { var vsi=parent.document.getElementById('vsource').src;  parent.document.getElementById('topleftx').innerHTML=parent.document.getElementById('topleftx').innerHTML.replace(vsi, 'data:" . $omimetype . ";base64," . base64_encode(file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture." . $oext)) . "');  } else { parent.document.getElementById('vsource').value='data:" . $omimetype . ";base64," . base64_encode(file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture." . $oext)) . "'; } } else {  parent.document.getElementById('topleftx').innerHTML='<br><div id=after>" . "<" . explode('/',$omimetype)[0] . "' + parent.cvis + ' id=thataudio controls autoplay><source id=vsource type=" . $omimetype . " src=" . "data:" . $omimetype . ";base64," . base64_encode(file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture." . $oext)) . "></source></" . explode('/',$omimetype)[0] . ">" . "</div>'; } } \"></body></html>";
  exit;
  } //else {
  //file_put_contents("a.09b", $_SERVER['HTTP_REFERER']);
  //}
  }
} else if (isset($_POST['mediais']) || ((!isset($_GET['saythis']) && !isset($_POST['saythis'])) || !isset($_GET['audioname']) || !isset($_POST['audioname']))) {
  if (!isset($_POST['mediais'])) { $audiois=""; }
  if (isset($_GET['audioname'])) {
    $ourmime="audio/x-aiff";
    $ourext=explode(".",str_replace("+"," ",urldecode($_GET['audioname'])))[-1 + sizeof(explode(".",str_replace("+"," ",urldecode($_GET['audioname']))))];
    for ($ib=0; $ib<sizeof($exts); $ib++) {
       if (strtolower("." . $ourext) == strtolower($exts[$ib])) $ourmime=$types[$ib];
    }
    $audiois=topchat("<audio id=thataudio controls autoplay><source type=" . $ourmime . " src=" . str_replace("+"," ",urldecode($_GET['audioname'])) . "?rand=" . rand(0,198765432) . "></source></audio>") . "&nbsp;<a style='display:inline-block;text-decoration:none;cursor:pointer;font-size:84px;' onclick=emailit(); title=Email>&#128231;</a><div id=ifem style=display:inline-block;></div>";
    $thecontent="data:" . $ourmime . ";base64," . base64_encode(file_get_contents(dirname(__FILE__) . "/" . str_replace("+"," ",urldecode($_GET['audioname']))));
    $daudio=topchat("<audio id=thisaudio controls><source type=" . $ourmime . " src=" . explode("#",$thecontent)[0] . "></source></audio>");
    //unlink(dirname(__FILE__) . "/" . str_replace("+"," ",urldecode($_GET['audioname'])));
  } else if (isset($_POST['audioname'])) {  
    $ourmime="audio/x-aiff";
    $ourext=explode(".",str_replace("+"," ",urldecode($_POST['audioname'])))[-1 + sizeof(explode(".",str_replace("+"," ",urldecode($_POST['audioname']))))];
    for ($ib=0; $ib<sizeof($exts); $ib++) {
       if (strtolower("." . $ourext) == strtolower($exts[$ib])) $ourmime=$types[$ib];
    }
    if ($audiois == "") {
    $audiois=topchat("<audio id=thataudio controls autoplay><source type=" . $ourmime . " src=" . str_replace("+"," ",urldecode($_POST['audioname'])) . "?rand=" . rand(0,198765432) . "></source></audio>");
    $thecontent="data:" . $ourmime . ";base64," . base64_encode(file_get_contents(dirname(__FILE__) . "/" . str_replace("+"," ",urldecode($_POST['audioname']))));
    }
    $daudio=topchat("<audio id=thisaudio controls><source type=" . $ourmime . " src=" . explode("#",$thecontent)[0] . "></source></audio>");
    //unlink(dirname(__FILE__) . "/" . str_replace("+"," ",urldecode($_POST['audioname'])));
  }
  if (isset($_GET['saythis'])) {
    $tastuff=str_replace("+"," ",urldecode($_GET['saythis']));
  } else if (isset($_GET['saythis'])) {
    $tastuff=str_replace("+"," ",urldecode($_POST['saythis']));
  }
  if (isset($_GET['dummysaythis'])) {
    $dcv=str_replace("\n","&#10;",str_replace("+"," ",urldecode($_GET['dummysaythis'])));
    $dcv=str_replace("+"," ",urldecode($_GET['dummysaythis']));
    $tastuff=str_replace("+"," ",urldecode($_GET['dummysaythis']));
  } else if (isset($_GET['dummysaythis'])) {
    $dcv=str_replace("\n","&#10;",str_replace("+"," ",urldecode($_POST['dummysaythis'])));
    $dcv=str_replace("+"," ",urldecode($_POST['dummysaythis']));
    $tastuff=str_replace("+"," ",urldecode($_POST['dummysaythis']));
  }
  $xtastuff=$tastuff;
  if ($xtastuff == "") { $xtastuff="youllneverfindthis"; }
  
  // ffmpeg work via PHP exec conduit to command line ...
  // Thanks to https://superuser.com/questions/277642/how-to-merge-audio-and-video-file-in-ffmpeg and https://trac.ffmpeg.org/wiki/Concatenate
  if (isset($_GET['actionis']) || isset($_POST['actionis'])) {  // fmpeg ideas with actionis +=/+/++ and m1 and m2
    $inmimetype="video/mp4";
    $inext="mp4";
    $immimetype="video/mp4";
    $imext="mp4";
    $actc="";
    $extraswitch="";
    $cmdpref="";
    $interimext=$inext;
    $i1=" -i " . dirname(__FILE__) . DIRECTORY_SEPARATOR;
    $i2=" -i " . dirname(__FILE__) . DIRECTORY_SEPARATOR;
    if (isset($_GET['fprefix'])) {
      $cmdpref=str_replace("+"," ",urldecode($_GET['fprefix']));
    } else if (isset($_POST['fprefix'])) {
      $cmdpref=str_replace("+"," ",urldecode($_POST['fprefix']));
    }
    if (isset($_GET['actionis'])) {
      $actc=str_replace(" ","+",urldecode($_GET['actionis']));
    } else if (isset($_POST['actionis'])) {
      $actc=str_replace(" ","+",urldecode($_POST['actionis']));
    }
    if ($actc == "+=") {
      $extraswitch=" -shortest ";
    } else if ($actc == "++") {
      $interimext="ts";
    }
    $interimname=" -c copy " . $extraswitch . dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio__capture.";

    if (isset($_GET['m1'])) {
      $inmimetype=str_replace("video/quicktime","video/mp4",explode(";", explode("ata:", urldecode($_GET['m1']))[1])[0]);
      $inext=str_replace("mov","mp4",str_replace("x-","",explode("/", $inmimetype)[1]));
      file_put_contents("audio_capture." . $inext, base64_decode(explode(explode(";", explode("ata:", urldecode($_GET['m1']))[1])[0] . ";base64,",str_replace(" ","+",urldecode($_GET['m1'])))[1] ));
      $ort="";
      if (function_exists('exif_read_data')) {
      $exif = exif_read_data(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio_capture." . $inext);
      if (isset($exif['Orientation'])) {
      $ort = $exif['Orientation'];
      }
      }
      $i1.="audio_capture." . $inext;
      $interimext=$inext;
      if (file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio__capture." . $interimext)) {
          unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio__capture." . $interimext);
      }
      $outputname="; " . $cmdpref . " -i " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio__capture." . $interimext . " " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture.";
    } else if (isset($_POST['m1'])) {
      $inmimetype=str_replace("video/quicktime","video/mp4",explode(";", explode("ata:", urldecode($_POST['m1']))[1])[0]);
      $inext=str_replace("mov","mp4",str_replace("x-","",explode("/", $inmimetype)[1]));
      file_put_contents("audio_capture." . $inext, base64_decode(explode(explode(";", explode("ata:", urldecode($_POST['m1']))[1])[0] . ";base64,",str_replace(" ","+",urldecode($_POST['m1'])))[1] ));
      $ort="";
      if (function_exists('exif_read_data')) {
      $exif = exif_read_data(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio_capture." . $inext);
      if (isset($exif['Orientation'])) {
      $ort = $exif['Orientation'];
      }
      }
      $i1.="audio_capture." . $inext;
      $interimext=$inext;
      if (file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio__capture." . $interimext)) {
          unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio__capture." . $interimext);
      }
      $outputname="; " . $cmdpref . " -i " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio__capture." . $interimext . " " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture.";
    }
    if (isset($_GET['m2'])) {
      $immimetype=str_replace("video/quicktime","video/mp4",explode(";", explode("ata:", urldecode($_GET['m2']))[1])[0]);
      $imext=str_replace("mov","mp4",str_replace("x-","",explode("/", $immimetype)[1]));
      file_put_contents("audio__capture." . $imext, base64_decode(explode(explode(";", explode("ata:", urldecode($_GET['m2']))[1])[0] . ";base64,",str_replace(" ","+",urldecode($_GET['m2'])))[1] ));
      $i2.="audio__capture." . $imext;
      $interimext="ts";
      if (strpos($inmimetype, "video/") !== false && strpos($immimetype, "audio/") !== false) {
        $interimext="mkv";
      } else if (strpos($immimetype, "video/") !== false && strpos($inmimetype, "audio/") !== false) {
        $interimext="mkv";
      }
      if (file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio__capture." . $interimext)) {
          unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio__capture." . $interimext);
      }
      $outputname="; " . $cmdpref . " -i " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio__capture." . $interimext . " " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture.";
    } else if (isset($_POST['m2'])) {
      $immimetype=str_replace("video/quicktime","video/mp4",explode(";", explode("ata:", urldecode($_POST['m2']))[1])[0]);
      $imext=str_replace("mov","mp4",str_replace("x-","",explode("/", $immimetype)[1]));
      file_put_contents("xx.xx", "audio__capture." . $imext . ' ' . strlen(str_replace(" ","+",urldecode($_POST['m2']))));
      file_put_contents("audio__capture." . $imext, base64_decode(explode(explode(";", explode("ata:", urldecode($_POST['m2']))[1])[0] . ";base64,",str_replace(" ","+",urldecode($_POST['m2'])))[1] ));
      $i2.="audio__capture." . $imext;
      $interimext="ts";
      if (strpos($inmimetype, "video/") !== false && strpos($immimetype, "audio/") !== false) {
        $interimext="mkv";
      } else if (strpos($immimetype, "video/") !== false && strpos($inmimetype, "audio/") !== false) {
        $interimext="mkv";
      }
      if (file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio__capture." . $interimext)) {
          unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio__capture." . $interimext);
      }
      $outputname="; " . $cmdpref . " -i " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio__capture." . $interimext . " " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture.";
    }
    $omimetype=str_replace("video/quicktime","video/mp4",$inmimetype);
    $oext=str_replace("mov","mp4",$inext);
    $ort="";
    
    if (isset($_GET['fprefix']) || isset($_POST['fprefix'])) { 
      if ($actc == "++") {
        if (file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio1capture.ts")) {
          unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio1capture.ts");
        }
        if (file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio2capture.ts")) {
          unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio2capture.ts");
        }
        if (file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio_capture.ts")) {
          unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio_capture.ts");
        }
        // ffmpeg -i  air_drop_messages_live_0photo.mov air_drop_messages_live_0photo.ts
        // ffmpeg -i  air_drop_messages_live_photo.mov air_drop_messages_live_photo.ts
        $xexec=($cmdpref . $i1 . " " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio1capture.ts"); 
        $xexec.="; " . ($cmdpref . $i2 . " " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio2capture.ts"); 
        // ffmpeg -i "concat:air_drop_messages_live_0photo.ts|air_drop_messages_live_photo.ts" -c copy  air_drop_messages_live_photo_more.ts
        $xexec.="; " . ($cmdpref . " -i \"concat:" . dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio1capture.ts|" . dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio2capture.ts\" -c copy " .  dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio_capture.ts"); 
        // ffmpeg -i air_drop_messages_live_photo_more.ts  air_drop_messages_live_photo_more.mp4
        //file_put_contents("x.x", $xexec);
        exec($xexec);
        if (file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture." . $oext)) {
          unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture." . $oext);
        }
        exec($cmdpref . " -i " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "audio_capture.ts " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture." . $oext); 
      } else { // eg. ffmpeg -i video.mp4 -i audio.wav -c copy output.mkv
        //file_put_contents("x.x", $cmdpref . $i1 . $i2 . $interimname . $interimext . "\n\n\n" . trim(substr($outputname,1) . $oext));
        exec($cmdpref . $i1 . $i2 . $interimname . $interimext);
        if (file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture." . $oext)) {
          unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture." . $oext);
        }
        exec(trim(substr($outputname,1) . $oext));
      }  
    } 
    //file_put_contents("a.7","");
    echo "<html><body onload=\" parent.document.getElementById('audioname').value='audiocapture." . $oext . "'; parent.document.getElementById('result').innerHTML='data:" . $omimetype . ";base64," . base64_encode(file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture." . $oext)) . "'; if (('" . $omimetype . "').indexOf('video/') == 0 && '" . $actc . "' != '++' && parent.document.getElementById('vsource')) { var xaud=parent.document.getElementById('dvaudio'); if (xaud) { xaud.innerHTML=''; }  var auds=parent.document.getElementsByTagName('audio');   for (var iauds=0; iauds<auds.length; iauds++) {  auds[iauds].style.display='none';  }  if (1 == 1) { var vsi=parent.document.getElementById('vsource').src;  parent.document.getElementById('topleftx').innerHTML=parent.document.getElementById('topleftx').innerHTML.replace(vsi, 'data:" . $omimetype . ";base64," . base64_encode(file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture." . $oext)) . "');  } else { parent.document.getElementById('vsource').value='data:" . $omimetype . ";base64," . base64_encode(file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture." . $oext)) . "'; } } else {  parent.document.getElementById('topleftx').innerHTML='<br><div id=after>" . "<" . explode('/',$omimetype)[0] . "' + parent.cvis + ' id=thataudio controls autoplay><source id=vsource type=" . $omimetype . " src=" . "data:" . $omimetype . ";base64," . base64_encode(file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . "audiocapture." . $oext)) . "></source></" . explode('/',$omimetype)[0] . ">" . "</div>'; } \"></body></html>";
    exit;
  }
  
  echo $htmltop . "
<head>
<title>Voiceover ideas ... Supervise and synchronize 'say [words]' or Flash Player Record or Input audio/* capture</title>
<meta charset='utf-8'/>
<style>
textarea {
  white-space: pre-line;
}

.videoninety {
   transform:rotate(90deg);
}

.videooneeighty {
   transform:rotate(180deg);
}

.videotwoseventy {
   transform:rotate(270deg);
}

.videozero {
   transform:rotate(0deg);
}
</style>
<script type='text/javascript'>
  var attachment='';
  var imgd=null, imgh=-1, imgw=-1, altimgw=-1, altimgh=-1, two=2, twotwo=2, wasv='', firstgo=true, ewo=null, ewf=null, prevffs=-11, ffs=-1;
  var vtrue=true, twentythousand=20000, altsubject='', prevlastisaved='', prevlastvsaved='', prevlastasaved='', lastvsaved='', lastasaved='', lastisaved='', lastaudioname='', lastresult='';
  var vsres='', zhr=null, zform=null, lastacnt=1, tgsps=[], tgspsop=[], newres='', preurl='', tgspsopwhat=[], cvis='', prevsv='', thissv='', haikusuffix='', lastu='';
  var noncontain='" . $noncontain . "';  // 100% 75%
  var contain='" . $contain . "';
  var origfiftyfive='" . $fiftyfive . "px';  
  var fiftyfive='" . $fiftyfive . "px';  
  var nextfiftyfive='" . $fiftyfive . "px'; 
  
  var saymode='" . $dsm . "';
  
  var lastmedia='';
  var pretc='" . $pretc . "'; 
  var posttc=\"" . $posttc . "\";

if (!String.fromCodePoint) {   // thanks to http://xahlee.info/js/js_unicode_code_point.html
// ES6 Unicode Shims 0.1 , © 2012 Steven Levithan , MIT License
    String.fromCodePoint = function fromCodePoint () {
        var chars = [], point, offset, units, i;
        for (i = 0; i < arguments.length; ++i) {
            point = arguments[i];
            offset = point - 0x10000;
            units = point > 0xFFFF ? [0xD800 + (offset >> 10), 0xDC00 + (offset & 0x3FF)] : [point];
            chars.push(String.fromCharCode.apply(null, units));
        }
        return chars.join('');
    }
}

 function subperhaps() {
   console.log('saymode=' + saymode);
   if (saymode == '') return true;
   if (saymode == 'gt') {
     console.log('https://translate.google.com/#view=home&op=translate&sl=' + document.getElementById('slangcode').value.substring(0,2).replace('he','iw').replace('zh','zh-CN').replace('" . $trto . "','auto') + '&tl=" . $trto . "&text=' + encodeURIComponent(document.getElementById('thewords').value));
     window.open('https://translate.google.com/#view=home&op=translate&sl=' + document.getElementById('slangcode').value.substring(0,2).replace('he','iw').replace('zh','zh-CN').replace('" . $trto . "','auto') + '&tl=" . $trto . "&text=' + encodeURIComponent(document.getElementById('thewords').value), '_blank', 'left=100,top=100,width=500,height=500');
     return false;
   } else if (saymode == 'mm') {
     // https://mymemory.translated.net/en/English/German/hello
     if (eval('' + document.getElementById('slangcode').value.length) > 2) {
     window.open('https://mymemory.translated.net/" . $trto . "/' + document.getElementById('slangcode').value + '/" . $trto . "/' + encodeURIComponent(document.getElementById('thewords').value), '_blank', 'left=100,top=100,width=500,height=500');
     } else {
     window.open('https://mymemory.translated.net/" . $trto . "/' + document.getElementById('slangcode').value.substring(0,2).replace('he','Hebrew').replace('zh','zh-CN').replace('" . $trto . "','auto') + '/" . $trto . "/' + encodeURIComponent(document.getElementById('thewords').value), '_blank', 'left=100,top=100,width=500,height=500');
     }
     return false;
   }
   return true;
 }
 
 function setslc() {
   document.getElementById('slangcode').value=(location.search.split('thelang=')[1] ? decodeURIComponent(location.search.split('thelang=')[1].split('&')[0]) : '');
   document.getElementById('saymode').value='mm';
   saymode='mm';
   document.getElementById('saysub').value='Translate These Words';
 }
 
 function smimm(sto) {
     if (document.getElementById('slangcode').innerHTML.indexOf(document.getElementById('select_source_mm').innerHTML) == -1) {
       var wasv=document.getElementById('slangcode').value;
       document.getElementById('slangcode').innerHTML+=document.getElementById('select_source_mm').innerHTML;
       document.getElementById('slangcode').value=wasv;
       if (document.URL.indexOf('thelang=') != -1) {
         setTimeout(setslc, 2000);
       }
     }
 }

 function saymodeit(sino) {
   saymode=sino.value;
   if (saymode == 'gt') {
     document.getElementById('saysub').value='Hear These Words';
   } else if (saymode == 'mm') {
     document.getElementById('saysub').value='Translate These Words';
     smimm(0);
   } else if (saymode == '') {
     document.getElementById('saysub').value='Record These Words';
   }
 }

 function topchat(inmedia) {
   if (inmedia != lastmedia) {
    lastmedia=inmedia;
   }
   return inmedia;
 }
 
 function fmselit(sv) {  // ffmpeg work
   var doaclick=true;
   if (sv != '') {
     document.getElementById('actionis').value=sv;
     if (sv != '' && document.getElementById('result').innerHTML != '' && document.getElementById('topleft').innerHTML.indexOf(document.getElementById('result').innerHTML) == -1) {
       if (lastasaved != '' && lastvsaved != '') {
        document.getElementById('avideo').click(); 
       }
     }
     if (sv.indexOf('90') != -1) {
       cvis=' class=videoninety ';
       if (prevsv == sv.replace('90','')) {
       if (document.getElementById('thataudio')) {
         lastvsaved=topchat(lastvsaved.replace(' class=',' data-class' + Math.floor(Math.random() * 19876543) + '=').replace('<video ','<video class=videoninety '));
         document.getElementById('thataudio').className='videoninety';
         doaclick=false;
       }
       sv=sv.replace('90','');
       } else {
       sv=sv.replace('90','');
       }
       prevsv=sv;
     } else if (sv.indexOf('180') != -1) {
       cvis=' class=videooneeighty ';
       if (prevsv == sv.replace('180','')) {
       if (document.getElementById('thataudio')) {
         lastvsaved=topchat(lastvsaved.replace(' class=',' data-class' + Math.floor(Math.random() * 19876543) + '=').replace('<video ','<video class=videooneeighty '));
         document.getElementById('thataudio').className='videooneeighty';
         doaclick=false;
       }
       sv=sv.replace('180','');
       } else {
       sv=sv.replace('180','');
       }
       prevsv=sv;
     } else if (sv.indexOf('270') != -1) {
       cvis=' class=videotwoseventy ';
       if (prevsv == sv.replace('270','')) {
       if (document.getElementById('thataudio')) {
         lastvsaved=topchat(lastvsaved.replace(' class=',' data-class' + Math.floor(Math.random() * 19876543) + '=').replace('<video ','<video class=videotwoseventy '));
         document.getElementById('thataudio').className='videotwoseventy';
         doaclick=false;
       }
       sv=sv.replace('270','');
       } else {
       sv=sv.replace('270','');
       }
       prevsv=sv;
     } else if (sv != '') { 
       if (prevsv == sv) {
       if (document.getElementById('thataudio')) {
         lastvsaved=topchat(lastvsaved.replace(' class=',' data-class' + Math.floor(Math.random() * 19876543) + '=').replace('<video ','<video class=videozero '));
         document.getElementById('thataudio').className='videozero';
         doaclick=false;
       }
       }
       cvis='';
       prevsv=sv;
     }
     if (sv == '+=') {  // voiceover audio onto video and apply 'shortest' switch
       if (lastasaved != '' && lastvsaved != '') {
         if (prevlastvsaved != '') {
         document.getElementById('m1').value=prevlastvsaved;
         lastvsaved=prevlastvsaved;
         } else {
         document.getElementById('m1').value=lastvsaved;
         }
         document.getElementById('m2').value=lastasaved;
         if (doaclick) { document.getElementById('fmpg').click(); }
       }
     } else if (sv == '+') { // voiceover audio onto video for as long as possible
       if (lastasaved != '' && lastvsaved != '') {
         if (prevlastvsaved != '') {
         document.getElementById('m1').value=prevlastvsaved;
         lastvsaved=prevlastvsaved;
         } else {
         document.getElementById('m1').value=lastvsaved;
         }
         document.getElementById('m2').value=lastasaved;
         if (doaclick) { document.getElementById('fmpg').click(); }
       }
     } else if (sv == '++') { // concatenate two videos or two audios
       if (lastvsaved != '' && prevlastvsaved != '') {
         document.getElementById('m1').value=prevlastvsaved;
         document.getElementById('m2').value=lastvsaved;
         if (doaclick) { document.getElementById('fmpg').click(); }
       } else if (lastasaved != '' && prevlastasaved != '') {
         document.getElementById('m1').value=prevlastasaved;
         document.getElementById('m2').value=lastasaved;
         if (doaclick) { document.getElementById('fmpg').click(); }
       }
     } 
   }
 }
  
  function notwotwo() {
    twotwo=33;
    vtrue=false;
    twentythousand=200;
  }

  function copy_to_clipboard(containerid) {
    //var contentHolder = document.getElementById(containerid);
    document.getElementById(containerid).focus();
    // We will need a range object and a selection.
    var range = document.createRange(),
    selection = window.getSelection();

    // Clear selection from any previous data.
    selection.removeAllRanges();

    // Make the range select the entire content of the contentHolder paragraph.
    range.selectNodeContents(document.getElementById(containerid));

    // Add that range to the selection.
    selection.addRange(range);

    // Copy the selection to clipboard.
    document.execCommand('copy');

    // Clear selection if you want to.
    selection.removeAllRanges();
  }
  
  function thatencodeURIComponent(inz) {
    if (altsubject != '') { inz=altsubject; }
    return encodeURIComponent(inz);
  }
  
  function thisencodeURIComponent(inz) {
    if (altsubject != '') { inz=altsubject; }
    if (inz.indexOf('My media share') == 0) {
      return encodeURIComponent('My media share ... ')
    } else if (inz.indexOf('My Media Mix ... ') == 0) {
      return encodeURIComponent('My media share ... ')
    } 
    return encodeURIComponent(inz);
  }
 
  function showStuff(evt) {
  if (zhr.readyState == 4) {
    if (zhr.status == 200) {
     if (zhr.responseText.trim() == '') { alert('Email sent.'); } else { alert(zhr.responseText.split('</')[0].split('>')[eval(-1 + zhr.responseText.split('</')[0].split('>').length)]); } 
    }
  }
  }
  
  function lfh(purl) {
    var waspu=preurl;
    if (purl.indexOf('<') != -1 || haikusuffix != '') {
      if (document.URL.indexOf('rjmprogramming.com.au/') == -1) {
      if (purl.indexOf('<') != -1) { preurl=purl.replace(purl.split('<')[0] + '<','<'); } else if (haikusuffix != '') { preurl=haikusuffix; }
      }
    }
    return purl;
  }
  
  function vsattach(intlx, myatt, imgidea) {
    if (intlx.indexOf(\"url('#$%')\") != -1 && myatt == '') {
      return imgidea + intlx.replace(\"url('#$%')\", \"none\").replace(/audio\ style\=/g,'audio data-style=').replace(/video\ style\=/g,'video data-style=');
    }
    return intlx;
  }
 
  function emailit() {
  var xpe='';
  var selector;
  var audios=document.getElementsByTagName('audio');
  var tois='';
  preurl='';
  if (audios.length == 0) {  audios=document.getElementsByTagName('video');   }
  for (var iu=0; iu<audios.length; iu++) {
  if (iu == 0) {
  tois='';
  if (document.getElementById('pemail').innerHTML == '') {
  if (window.opener) {
    xpe=lfh(window.opener.document.getElementById('pemail').innerHTML);
    if (xpe != '') {  document.getElementById('pemail').innerHTML=xpe;  }
  }
  }
  if (document.getElementById('pemail').innerHTML == '') {
  if (window.opener) {
    xpe=lfh(window.opener.document.getElementById('pemail').innerHTML);
    if (xpe != '') {  document.getElementById('pemail').innerHTML=xpe;  }
  }
  }
  if (document.getElementById('pemail').innerHTML != '') {
  attachment='';
  tois=lfh(document.getElementById('pemail').innerHTML);
  document.getElementById('pemail').innerHTML='';
  } else {
  if (document.URL.indexOf('/localhost') != -1 || 1 == 1) { //   Many email clients do not accept the default Inline HTML Emails here, so to force an HTML Attachment Email that emailee downloads, append space(s) at the end.
  attachment='';
  tois=prompt('Who do you want to email to?  Optionally hashtag (#) separate your own personal subject line to the email (eg. theemail@theemailplace.com#Hello there, it is moi.)  Many email clients do not accept the default Inline HTML Emails here, so to force an HTML Attachment Email that emailee downloads, append space(s) at the end.', '');
  } else {
  attachment='';
  tois=prompt('Who do you want to email to?  Optionally hashtag (#) separate your own personal subject line to the email (eg. theemail@theemailplace.com#Hello there, it is moi.)', '');
  }
  }
  var tlxs=[], xtlsx=[], iuy=0, xiuy=0, wasnewres='';
  if (tois == null) { tois=''; }
  if (tois.indexOf('@') != -1) {
  if ((tois + '~!$').indexOf(' ~!$') != -1) { attachment='&attachment=true'; tois=tois.trim(); }
  var alts=tois.split('#');
  if (alts.length > 1) { altsubject=alts[1]; tois=alts[0]; } 
  if (document.getElementById('topleftx')) {
  //alert('9 ' + preurl);
  if (preurl != '') {
  //alert('8 ' + lastasaved.substring(0,150) + ' ');
  //alert('i ' + prevlastisaved.slice(-120));
  //alert('a ' + lastasaved.slice(-120));
  //alert('v ' + lastvsaved.slice(-120));
  newres='';
  if (prevlastisaved.indexOf('data:') >= 0 && lastisaved.indexOf('data:') == -1) {  listenforwh();   }  
  newres='';
  tlx=document.getElementById('topleftx').innerHTML;
  if (prevlastisaved.indexOf('data:') >= 0) { 
     //tlx=tlx.replace(\"url('')\", \"url('#$%')\");
     newres+='data:' + prevlastisaved.split('data:')[1].split('\"')[0].split(\"'\")[0].split(' ')[0];
     //document.title+=' i:' + newres.slice(-20); 
     tlx=tlx.replace('data:' + prevlastisaved.split('data:')[1].split('\"')[0].split(\"'\")[0].split(' ')[0],'#$%');  
  }
  if (lastasaved.indexOf('data:') >= 0) { 
     //alert(lastasaved.slice(-200));
     newres+='data:' + lastasaved.split('data:')[1].split('\"')[0].split(\"'\")[0].split(' ')[0]; 
     //document.title+=' a:' + newres.slice(-20); 
     tlx=tlx.replace('data:' + lastasaved.split('data:')[1].split('\"')[0].split(\"'\")[0].split(' ')[0],'#$%');  
  }
  if (lastvsaved.indexOf('data:') >= 0) { 
     if (lastasaved.indexOf('data:') != 0) {  
       newres+='data:' + lastvsaved.split('data:')[1].split('\"')[0].split(\"'\")[0].split(' ')[0];   
       //document.title+=' v:' + newres.slice(-20); 
     } 
     tlx=tlx.replace('data:' + lastvsaved.split('data:')[1].split('\"')[0].split(\"'\")[0].split(' ')[0],'#$%');  
  }
  if (lastasaved.indexOf('data:') >= 0) {
  var tlxs=tlx.split('data:');
  //alert('newres.split(data:).length=' + newres.split('data:').length + ' tlxs.length=' + tlxs.length + ' document.getElementById(topleft).innerHTML.split(data:).length=' + document.getElementById('topleft').innerHTML.split('data:').length);
  for (iuy=1; iuy<tlxs.length; iuy++) {
    //alert('data:' + tlxs[iuy].split('\"')[0].split(\"'\")[0].split(' ')[0].substring(0,200));
    tlx=tlx.replace('data:' + tlxs[iuy].split('\"')[0].split(\"'\")[0].split(' ')[0], '#$%');
    if (tlxs[iuy].substring(0,6) == 'image/') {
    wasnewres=newres;
    newres='data:' + tlxs[iuy].split('\"')[0].split(\"'\")[0].split(' ')[0] + wasnewres;
       //document.title+=' iiuy:' + newres.slice(-20); 
    } else {
    newres+='data:' + tlxs[iuy].split('\"')[0].split(\"'\")[0].split(' ')[0];
       //document.title+=' iuy:' + newres.slice(-20); 
    }
  }
  tlxs=tlx.split(\"url('')\");
  //alert('newres.split(data:).length=' + newres.split('data:').length + ' tlxs.length=' + tlxs.length + ' document.getElementById(topleft).innerHTML.split(data:).length=' + document.getElementById('topleft').innerHTML.split('data:').length);
  for (iuy=1; iuy<tlxs.length; iuy++) {
    if (newres.indexOf(':image/') == -1 && prevlastisaved.indexOf('data:') >= 0) {
    wasnewres=newres;
    newres='data:' + prevlastisaved.split('data:')[1].split('\"')[0].split(\"'\")[0].split(' ')[0] + wasnewres;
       //document.title+=' jiuy:' + newres.slice(-20); 
    }
    tlx=tlx.replace(\"url('')\", \"url('#$%')\");
  }
  //alert(tlx.slice(-120));
  if (newres.indexOf(':image/') == -1 && prevlastisaved.indexOf('data:') >= 0 && tlx.indexOf(\"url('#$%')\") != -1) {
    wasnewres=newres;
    newres='data:' + prevlastisaved.split('data:')[1].split('\"')[0].split(\"'\")[0].split(' ')[0] + wasnewres;
       //document.title+=' ziuy:' + newres.slice(-20); 
  }
  //alert(tlx + ' ... ' + newres.split('data:').length + ' ... ' + newres.slice(-60) + ' ... ' + document.title);
  //ewo=window.open('//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php?to=' + encodeURIComponent(tois) + '&attachment=y&smallh=' +  encodeURIComponent(vsattach(tlx, attachment, '<img width=' + imgw + ' height=' + imgh + ' src=\"#$%\"></img>')) + '&subj=' + thisencodeURIComponent(mms + ' ... ' + document.getElementById('slangcode').options[document.getElementById('slangcode').selectedIndex].text + ' ' + document.getElementById('svoicecode').value.replace(' ',' voice ') + ' saying ' + document.getElementById('thewords').value.split(String.fromCharCode(10))[0].replace(/\'/g,String.fromCharCode(39)) + ' ... ') + '&sliceminusten=' + encodeURIComponent(newres.slice(-10)) + attachment + '','_blank','top=50,left=50,height=600,width=500');
  document.getElementById('result').innerHTML=newres;
  document.getElementById('result').focus();
  var text=document.getElementById('result').innerHTML;
  // Now copy whatever inside the textarea to clipboard ... vs copy_to_clipboard('result'); 
  if (navigator.clipboard != undefined) { //Chrome
        navigator.clipboard.writeText(text).then(function () {
            console.log('Async: Copying to clipboard was successful!');
        }, function (err) {
  selector = document.querySelector('#result');
  selector.select();
  document.execCommand('copy');
        });
    }
    else if (window.clipboardData) { // Internet Explorer
        window.clipboardData.setData('Text', text);
    } else {
  selector = document.querySelector('#result');
  selector.select();
  document.execCommand('copy');
    }
  ewo=window.open('//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php?to=' + encodeURIComponent(tois) + attachment + '&smallh=' +  encodeURIComponent(vsattach(tlx, attachment, '<img width=' + imgw + ' height=' + imgh + ' src=\"#$%\"></img>')) + '&subj=' + thisencodeURIComponent(mms + ' ... ' + document.getElementById('slangcode').options[document.getElementById('slangcode').selectedIndex].text + ' ' + document.getElementById('svoicecode').value.replace(' ',' voice ') + ' saying ' + document.getElementById('thewords').value.split(String.fromCharCode(10))[0].replace(/\'/g,String.fromCharCode(39)) + ' ... ') + '&sliceminusten=' + encodeURIComponent(newres.slice(-10)) + attachment + '','_blank','top=50,left=50,height=600,width=500');
  } else if (lastvsaved.indexOf('data:') == 0) {
  xtlxs=tlx.split('data:');
  //alert('newres.split(data:).length=' + newres.split('data:').length + ' xtlxs.length=' + xtlxs.length + ' document.getElementById(topleft).innerHTML.split(data:).length=' + document.getElementById('topleft').innerHTML.split('data:').length);
  for (xiuy=1; xiuy<tlxs.length; xiuy++) {
    tlx=tlx.replace('data:' + xtlxs[xiuy].split('\"')[0].split(\"'\")[0].split(' ')[0], '#$%');
    if (xtlxs[xiuy].substring(0,6) == 'image/') {
    wasnewres=newres;
    newres='data:' + xtlxs[xiuy].split('\"')[0].split(\"'\")[0].split(' ')[0] + wasnewres;
    } else {
    newres+='data:' + xtlxs[xiuy].split('\"')[0].split(\"'\")[0].split(' ')[0];
    }
  }
  tlxs=tlx.split(\"url('')\");
  for (iuy=1; iuy<tlxs.length; iuy++) {
    if (newres.indexOf(':image/') == -1 && prevlastisaved.indexOf('data:') >= 0) {
    wasnewres=newres;
    newres='data:' + 'data:' + prevlastisaved.split('data:')[1].split('\"')[0].split(\"'\")[0].split(' ')[0] + wasnewres;
    }
    tlx=tlx.replace(\"url('')\", \"url('#$%')\");
  }
  if (newres.indexOf(':image/') == -1 && prevlastisaved.indexOf('data:') >= 0 && tlx.indexOf(\"url('#$%')\") != -1) {
    wasnewres=newres;
    newres='data:' + prevlastisaved.split('data:')[1].split('\"')[0].split(\"'\")[0].split(' ')[0] + wasnewres;
  }
  //alert(tlx + ' ... ' + newres.split('data:').length);
  //ewo=window.open('//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php?to=' + encodeURIComponent(tois) + attachment + '&smallh=' +  encodeURIComponent(vsattach(tlx, attachment, '<img width=' + imgw + ' height=' + imgh + ' src=\"#$%\"></img>')) + '&subj=' + thisencodeURIComponent(mms + ' ... ' + document.getElementById('slangcode').options[document.getElementById('slangcode').selectedIndex].text + ' ' + document.getElementById('svoicecode').value.replace(' ',' voice ') + ' saying ' + document.getElementById('thewords').value.split(String.fromCharCode(10))[0].replace(/\'/g,String.fromCharCode(39)) + ' ... ') + '&sliceminusten=' + encodeURIComponent(newres.slice(-10)) + attachment + '','_blank','top=50,left=50,height=600,width=500');
  document.getElementById('result').innerHTML=newres;
  document.getElementById('result').focus();
  var text=document.getElementById('result').innerHTML;
  // Now copy whatever inside the textarea to clipboard ... vs copy_to_clipboard('result'); 
  if (navigator.clipboard != undefined) { //Chrome
        navigator.clipboard.writeText(text).then(function () {
            console.log('Async: Copying to clipboard was successful!');
        }, function (err) {
  selector = document.querySelector('#result');
  selector.select();
  document.execCommand('copy');
        });
    }
    else if (window.clipboardData) { // Internet Explorer
        window.clipboardData.setData('Text', text);
    } else {
  selector = document.querySelector('#result');
  selector.select();
  document.execCommand('copy');
    }
    ewo=window.open('//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php?to=' + encodeURIComponent(tois) + attachment + '&smallh=' +  encodeURIComponent(vsattach(tlx, attachment, '<img width=' + imgw + ' height=' + imgh + ' src=\"#$%\"></img>')) + '&subj=' + thisencodeURIComponent(mms + ' ... ' + document.getElementById('slangcode').options[document.getElementById('slangcode').selectedIndex].text + ' ' + document.getElementById('svoicecode').value.replace(' ',' voice ') + ' saying ' + document.getElementById('thewords').value.split(String.fromCharCode(10))[0].replace(/\'/g,String.fromCharCode(39)) + ' ... ') + '&sliceminusten=' + encodeURIComponent(newres.slice(-10)) + attachment + '','_blank','top=50,left=50,height=600,width=500');

  } //else {
  //ewo=window.open('//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php?to=' + encodeURIComponent(tois) + attachment + '&smallh=' +  encodeURIComponent(vsattach(tlx, attachment, '<img width=' + imgw + ' height=' + imgh + ' src=\"#$%\"></img>')) + '&subj=' + thisencodeURIComponent(mms + ' ... ' + document.getElementById('slangcode').options[document.getElementById('slangcode').selectedIndex].text + ' ' + document.getElementById('svoicecode').value.replace(' ',' voice ') + ' saying ' + document.getElementById('thewords').value.split(String.fromCharCode(10))[0].replace(/\'/g,String.fromCharCode(39)) + ' ... ') + '&sliceminusten=' + encodeURIComponent(text.slice(-10)) + attachment + '','_blank','top=50,left=50,height=600,width=500');
  //}
  } else {
  zhr = new XMLHttpRequest();
  zform=new FormData();
  if (attachment == '') {
  zform.append('inline', '');
  }
  zform.append('to', tois);
  if (altsubject != '') {
  zform.append('subj', altsubject);
  } else {
  zform.append('subj', 'My Media Mix ... at [date] ...');
  }
  zform.append('tdhuhta', encodeURIComponent('<html><body>' + document.getElementById('topleftx').outerHTML + '</body></html>'));
  zhr.open('post', '//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php', true);
  //zhr.setRequestHeader('Access-Control-Allow-Origin', '*');
  //zhr.setRequestHeader('Access-Control-Allow-Methods', 'POST');
  zhr.onreadystatechange = showStuff;
  zhr.send(zform);
  }
  } else {
  document.getElementById('result').focus();
  var text=document.getElementById('result').innerHTML;
  // Now copy whatever inside the textarea to clipboard ... vs copy_to_clipboard('result'); 
  if (navigator.clipboard != undefined) { //Chrome
        navigator.clipboard.writeText(text).then(function () {
            console.log('Async: Copying to clipboard was successful!');
        }, function (err) {
  selector = document.querySelector('#result');
  selector.select();
  document.execCommand('copy');
        });
    }
    else if (window.clipboardData) { // Internet Explorer
        window.clipboardData.setData('Text', text);
    } else {
  selector = document.querySelector('#result');
  selector.select();
  document.execCommand('copy');
    }
    var mms='" . $mms . "';
  //zhr = new XMLHttpRequest();
  //zform=new FormData();
  //zform.append('to', tois);
  //zform.append('subj', 'My macOS say ... ');
  //zform.append('tdhuhta', encodeURIComponent(audios[iu].outerHTML));
  //if (1 == 1) {
  if (document.getElementById('audioname').value.indexOf('audio') == 0 && (document.getElementById('audioname').value.indexOf('.wav') == -1 && document.getElementById('thewords').innerHTML.indexOf(('" . explode("'",explode("\n",$xtastuff)[0])[0] . "').trim()) == 0 && document.getElementById('slangcode').value != '' && document.getElementById('svoicecode').value != '')) {
  //ewo=window.open('//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php?to=' + encodeURIComponent(tois) + '&subj=' + thatencodeURIComponent('My macOS say ... ' + document.getElementById('slangcode').options[document.getElementById('slangcode').selectedIndex].text + ' ' + document.getElementById('svoicecode').value.replace(' ',' voice ') + ' saying ' + document.getElementById('thewords').value.split(String.fromCharCode(10))[0].replace(/\'/g,String.fromCharCode(39)) + ' ... ') + '&sliceminusten=' + encodeURIComponent(text.slice(-10)) + '&whatweneed7=qmpg6789' + attachment,'_blank','top=50,left=50,height=600,width=500');
  if (document.URL.indexOf('rjmprogramming.com.au/') != -1) {
  document.getElementById('ifem').innerHTML=\"<iframe onload=checkz(this); src='//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php?to=\" + encodeURIComponent(tois) + '&subj=' + thisencodeURIComponent(mms + ' ... ' + document.getElementById('slangcode').options[document.getElementById('slangcode').selectedIndex].text + ' ' + document.getElementById('svoicecode').value.replace(' ',' voice ') + ' saying ' + document.getElementById('thewords').value.split(String.fromCharCode(10))[0].replace(/\'/g,String.fromCharCode(39)) + ' ... ') + '&sliceminusten=' + encodeURIComponent(text.slice(-10)) + attachment + \"' style=width:500px;height:600px;></iframe>\"; 
  } else {
  ewo=window.open('//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php?to=' + encodeURIComponent(tois) + '&subj=' + thisencodeURIComponent(mms + ' ... ' + document.getElementById('slangcode').options[document.getElementById('slangcode').selectedIndex].text + ' ' + document.getElementById('svoicecode').value.replace(' ',' voice ') + ' saying ' + document.getElementById('thewords').value.split(String.fromCharCode(10))[0].replace(/\'/g,String.fromCharCode(39)) + ' ... ') + '&sliceminusten=' + encodeURIComponent(text.slice(-10)) + attachment + '','_blank','top=50,left=50,height=600,width=500');
  }
  } else {
  if (document.URL.indexOf('rjmprogramming.com.au/') != -1) {
  document.getElementById('ifem').innerHTML=\"<iframe onload=checkz(this); src='//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php?to=\" + encodeURIComponent(tois) + '&subj=' + thisencodeURIComponent(mms + ' ... ') + '&sliceminusten=' + encodeURIComponent(text.slice(-10)) + attachment + \"' style=width:500px;height:600px;></iframe>\"; 
  } else {
  ewo=window.open('//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php?to=' + encodeURIComponent(tois) + '&subj=' + thisencodeURIComponent(mms + ' ... ') + '&sliceminusten=' + encodeURIComponent(text.slice(-10)) + attachment,'_blank','top=50,left=50,height=580,width=500');
  }
  }
  //} //else {
  //zhr.open('post', '//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php', true);
  //zhr.setRequestHeader('Access-Control-Allow-Origin', '*');
  //zhr.setRequestHeader('Access-Control-Allow-Methods', 'POST');
  //zhr.send(zform);
  //}
  }
  }
  }
  }
  altsubject='';
  }  

  function thenreload() {
    //alert('twotwo=' + twotwo);
    if (twotwo != 2) {
    //alert(4);
    document.getElementById('thewords').name='xsaythisx';
    document.getElementById('dtemp').innerHTML='<form onsubmit=\"return subperhaps();\" target=_self style=display:none; action=./macos_say_record.php?rand=' + Math.floor(Math.random() * 198765432) + ' method=POST>" . $tc . "<input type=hidden name=mediais value=\"' + document.getElementById('result').innerHTML + '\"></input><input type=hidden name=audioname value=\"' + document.getElementById('audioname').value + '\"></input><input type=submit style=display:none; value=Submit id=mysb></input></form>';
    //alert(44);
    document.getElementById('mysb').click();
    //alert(444);
    } else {
    location.href=document.URL.split('?')[0].split('#')[0] + '?" . $langsuffix . "audioname=' + encodeURIComponent(document.getElementById('audioname').value) + '&dummysaythis=' + encodeURIComponent(document.getElementById('thewords').value) + '&rand=' + Math.floor(Math.random() * 198764764);
    }
  }
  
  function resultchange() {
    " . $aname . " 
    if (document.getElementById('result').innerHTML == '') {
    setTimeout(resultchange, 2000);
    } else if (firstgo) {
    document.getElementById('saysub').visibility='visible';
    firstgo=false;
    setTimeout(resultchange, 6000);
    } else if (window.opener) {
    haikusuffix='&haiku=y';
    document.getElementById('saysub').visibility='visible';
    if (document.getElementById('avideo')) { if (document.getElementById('result').innerHTML.indexOf('data:video/') == 0) {  if (lastvsaved != '') { prevlastvsaved=lastvsaved; }  lastvsaved='<video' + cvis + ' id=thataudio style=width:100%; controls loop><source id=vsource type=' + document.getElementById('result').innerHTML.split('ata:')[1].split(';')[0] + ' src=\"data:' + document.getElementById('result').innerHTML.split('#')[0].split('data:')[1].split(\"'\")[0].split('\"')[0].split(' ')[0] + '\"></source></video>'; document.getElementById('avideo').style.display='inline-block';  } else if (document.getElementById('result').innerHTML.indexOf('data:audio/') == 0) { document.getElementById('myasp').style.display='inline-block'; if (lastasaved != '') { prevlastasaved=lastasaved; } lastasaved=topchat('<audio style=width:100%; controls loop><source type=' + document.getElementById('result').innerHTML.split('ata:')[1].split(';')[0] + ' src=\"data:' + document.getElementById('result').innerHTML.split('data:')[1].split(\"'\")[0].split('\"')[0].split(' ')[0].split('#')[0] + '\"></source></audio>'); if (lastasaved.indexOf('/source/') != -1) { console.log('why?'); } document.getElementById('avideo').style.display='inline-block';  } else if (document.getElementById('result').innerHTML.indexOf('data:image/') == 0) { backgroundit();   } }
    if (document.getElementById('result').innerHTML.indexOf(':video/') != -1) {
    if (newres == '') { window.opener.document.getElementById('vurl').value=document.getElementById('result').innerHTML; }
    } else {
    if (newres == '') { window.opener.document.getElementById('aurl').value=document.getElementById('result').innerHTML; }
    }
    window.opener.document.getElementById('daudio').innerHTML='" . $daudio . "'; 
    window.opener.atab(window.opener.document.getElementById('aurl'));
    } else {
    if (document.getElementById('avideo')) { if (document.getElementById('result').innerHTML.indexOf('data:video/') == 0) {  if (lastvsaved != '') { prevlastvsaved=lastvsaved; }   lastvsaved='<video' + cvis + ' id=thataudio style=width:100%; controls loop><source id=vsource type=' + document.getElementById('result').innerHTML.split('ata:')[1].split(';')[0] + ' src=\"data:' + document.getElementById('result').innerHTML.split('#')[0].split('data:')[1].split(\"'\")[0].split('\"')[0].split(' ')[0] + '\"></source></video>'; document.getElementById('avideo').style.display='inline-block'; } else if (document.getElementById('result').innerHTML.indexOf('data:audio/') == 0) { document.getElementById('myasp').style.display='inline-block';  if (lastasaved != '') { prevlastasaved=lastasaved; } lastasaved=topchat('<audio style=width:100%; controls loop><source type=' + document.getElementById('result').innerHTML.split('ata:')[1].split(';')[0] + ' src=\"data:' + document.getElementById('result').innerHTML.split('data:')[1].split(\"'\")[0].split('\"')[0].split(' ')[0].split('#')[0] + '\"></source></audio>'); if (lastasaved.indexOf('/source/') != -1) { console.log('Why?'); }  document.getElementById('avideo').style.display='inline-block';  } else if (document.getElementById('result').innerHTML.indexOf('data:image/') == 0) { backgroundit();   } }
    }
  }
  
  function saysubv() {
    //document.title='0';
    if (('' + document.getElementById('saysub').style.visibility).toLowerCase().indexOf('visible') == -1) {
    //document.title+='1';
      if (document.getElementById('result').innerHTML != '') {
    //document.title+='2';
      document.getElementById('saysub').style.visibility='visible';
      if (document.getElementById('avideo')) { if (document.getElementById('result').innerHTML.indexOf('data:video/') == 0) {  if (lastvsaved != '') { prevlastvsaved=lastvsaved; }   lastvsaved='<video' + cvis + ' id=thataudio style=width:100%; controls loop><source id=vsource type=' + document.getElementById('result').innerHTML.split('ata:')[1].split(';')[0] + ' src=\"data:' + document.getElementById('result').innerHTML.split('#')[0].split('data:')[1].split(\"'\")[0].split('\"')[0].split(' ')[0] + '\"></source></video>'; document.getElementById('avideo').style.display='inline-block'; } else if (document.getElementById('result').innerHTML.indexOf('data:audio/') == 0) { document.getElementById('myasp').style.display='inline-block';  if (lastasaved != '') { prevlastasaved=lastasaved; }  lastasaved=topchat('<audio style=width:100%; controls loop><source type=' + document.getElementById('result').innerHTML.split('ata:')[1].split(';')[0] + ' src=\"data:' + document.getElementById('result').innerHTML.split('data:')[1].split(\"'\")[0].split('\"')[0].split(' ')[0].split('#')[0] + '\"></source></audio>'); if (lastasaved.indexOf('/source/') != -1) { console.log('whY?'); }  document.getElementById('avideo').style.display='inline-block';  } else if (document.getElementById('result').innerHTML.indexOf('data:image/') == 0) { backgroundit();   } }
      twotwo=31;
      } else {
    //document.title+='3';
      setTimeout(saysubv, 2000);
      }
    }
  }
  
  function repeatit() {
      if (document.getElementById('result').innerHTML != '') {
        twotwo=31;
    if (document.getElementById('result').innerHTML != lastresult) {
    if (newres == '' && document.getElementById('result').innerHTML.indexOf('data:image/gif;base64,') == 0 && document.getElementById('result').innerHTML != 'data:image/gif;base64,') { prevlastisaved='data:' + document.getElementById('result').innerHTML.split('data:')[1];  }
     if (document.getElementById('avideo')) { if (document.getElementById('result').innerHTML.indexOf('data:video/') == 0) {  if (lastvsaved != '') { prevlastvsaved=lastvsaved; }   lastvsaved='<video' + cvis + ' id=thataudio style=width:100%; controls loop><source id=vsource type=' + document.getElementById('result').innerHTML.split('ata:')[1].split(';')[0] + ' src=\"data:' + document.getElementById('result').innerHTML.split('#')[0].split('data:')[1].split(\"'\")[0].split('\"')[0].split(' ')[0] + '\"></source></video>'; document.getElementById('avideo').style.display='inline-block';  } else if (document.getElementById('result').innerHTML.indexOf('data:audio/') == 0) { document.getElementById('myasp').style.display='inline-block';  if (lastasaved != '') { prevlastasaved=lastasaved; }  lastasaved=topchat('<audio style=width:100%; controls loop><source type=' + document.getElementById('result').innerHTML.split('ata:')[1].split(';')[0] + ' src=\"data:' + document.getElementById('result').innerHTML.split('data:')[1].split(\"'\")[0].split('\"')[0].split(' ')[0].split('#')[0] + '\"></source></audio>'); if (lastasaved.indexOf('/source/') != -1) { console.log('wHy?'); }  document.getElementById('avideo').style.display='inline-block';  } else if (document.getElementById('result').innerHTML.indexOf('data:image/') == 0) { backgroundit();   } }
     if (document.getElementById('result').innerHTML.indexOf(':image/') != -1) {
        backgroundit();
      } else {
        lastresult='data:' + document.getElementById('result').innerHTML.split('data:')[1];
        lastaudioname=document.getElementById('audioname').value;
      }
    }
      }
      if (document.getElementById('inum').innerHTML != '1') {
        document.getElementById('result').style.cursor='progress';
      }
      if (document.getElementById('fmsel')) {
       if (('' + document.getElementById('fmsel').style.display.toLowerCase()).indexOf('none') != -1) {
         if (lastasaved != '' && lastvsaved != '') {
           document.getElementById('fmsel').style.display='inline-block';
         } else if (lastasaved != '' && prevlastasaved != '') {
           document.getElementById('fmsel').style.display='inline-block';
         } else if (lastvsaved != '' && prevlastvsaved != '') {
           document.getElementById('fmsel').style.display='inline-block';
         }
       }
      }
      if (newres == '' && haikusuffix != '' && lastu != document.getElementById('result').innerHTML && ('' + document.getElementById('result').innerHTML) == ('' + document.getElementById('result').innerHTML).trim() && (document.getElementById('result').innerHTML + 'data:').indexOf('data:') != 0) {
        //alert('2:' + document.URL.split('#')[0].split('?')[0] + '?getme=' + encodeURIComponent(document.getElementById('result').innerHTML) + haikusuffix);
    if (newres == '' && document.getElementById('result').innerHTML.indexOf('data:image/gif;base64,') == 0 && document.getElementById('result').innerHTML != 'data:image/gif;base64,') { prevlastisaved='data:' + document.getElementById('result').innerHTML.split('data:')[1];  }
        lastu=document.getElementById('result').innerHTML;
        document.getElementById('result').innerHTML=document.getElementById('result').innerHTML + ' ';
        document.getElementById('checkgif').src=document.URL.split('#')[0].split('?')[0] + '?getme=' + encodeURIComponent(document.getElementById('result').innerHTML.trim()) + haikusuffix;
      } 
      setTimeout(repeatit, 5000);
  }
  
  function anotherlook() {
      document.getElementById('checkflash').src=document.getElementById('checkflash').src.split('#')[0].split('?')[0] + '?audiosize=y&rand=' + Math.floor(Math.random() * 198765432);
      //anotherlook();
  }
  
  function openflash() {
    ewf=window.open('//www.rjmprogramming.com.au/MarkItUp/html/index.htm?interested=y','_blank','top=250,left=100,height=250,width=300');
  }
  
  function checkz(iois) {
  if (iois != null) {
    var aconto = (iois.contentWindow || iois.contentDocument);
    if (aconto != null) {
     if (aconto.document) { aconto = aconto.document; }
     if (aconto.body != null) {
      aconto.getElementById('status').innerHTML='Copy and Paste Done Below ...';
      aconto.getElementById('taready').value=document.getElementById('result').innerHTML;
      aconto.getElementById('sub').click();
     }
    }
  }
  }
  
  function checkgifx(iois) {
  //alert(1);
  if (iois != null) {
  //alert(11);
    var aconto = (iois.contentWindow || iois.contentDocument);
  //alert(111);
    if (aconto != null) {
  //alert(1111);
     if (aconto.document) { aconto = aconto.document; }
  //alert(11111);
     if (aconto.body != null) {
  //alert(aconto.body.innerHTML.length);
       if (aconto.body.innerHTML.length != 0) {
         document.getElementById('iturl').innerHTML='';
         document.getElementById('result').innerHTML=aconto.body.innerHTML.replace('<p>','').replace('</p>','');
       }
     }
    }
  }
  }
  
  function checkff(iois) {
  if (iois != null) {
    var aconto = (iois.contentWindow || iois.contentDocument);
    if (aconto != null) {
     if (aconto.document) { aconto = aconto.document; }
     if (aconto.body != null) {
      if (iois.src.indexOf('getmecontent=') != -1) {
      document.getElementById('result').innerHTML=aconto.body.innerHTML.split('</div>')[0].split('>')[eval(-1 + aconto.body.innerHTML.split('</div>')[0].split('>').length)];
      if (ewf) { ewf.close(); ewf=null; } 
      } else if (eval('' + prevffs) < -1) {
      prevffs=eval('' + aconto.body.innerHTML.split('</p>')[0].split('>')[eval(-1 + aconto.body.innerHTML.split('</p>')[0].split('>').length)]);
      ffs=prevffs;
      //alert(ffs);
      //document.title='' + ffs;
      setTimeout(anotherlook, 5000);
      } else {
      ffs=eval('' + aconto.body.innerHTML.split('</p>')[0].split('>')[eval(-1 + aconto.body.innerHTML.split('</p>')[0].split('>').length)]);
      if (eval('' + ffs) != eval('' + prevffs)) {
      //document.title='' + ffs;
      iois.src=iois.src.split('#')[0].split('?')[0] + '?audiosize=y&getmecontent=y';
      } else {
      setTimeout(anotherlook, 5000);
      }
      }
     }
    }
  }
  }
  
  function voiceoverit() {
    var spare='', waswords='', waswordsih='', audioarr=[];
    if (lastisaved != '' && (lastasaved != '' || lastvsaved != '')) { //document.getElementById('result').innerHTML.indexOf(':image/') != -1) {
    backgroundit();
    } else if (lastasaved != '') {
    if (lastvsaved != '') {
    document.getElementById('aemailo').style.display='inline-block';
    document.getElementById('topleftx').innerHTML='<br><div id=after>' + topchat(lastvsaved.replace('<video ','<video autoplay ') + '<br>' + lastasaved.replace('<audio ','<audio autoplay ')) + '</div>';
    } else if (document.getElementById('after')) {
    spare=document.getElementById('after').innerHTML.replace(/\>\<source\ /g,' autoplay><source ');
    document.getElementById('aemailo').style.display='inline-block';
    document.getElementById('topleftx').innerHTML='<br><div id=after><div id=dvaudio>' + topchat(lastasaved.replace('<audio ','<audio autoplay ')) + '</div><br>' + spare + '</div>';
    audioarr=eval(-1 + eval('' + document.getElementById('topleftx').innerHTML.split('<audio ').length));
    if (audioarr > lastacnt) {
    nextfiftyfive='' + eval(eval('' + origfiftyfive.replace('px','')) * eval('' + audioarr)) + 'px';
    noncontain=noncontain.replace(fiftyfive, nextfiftyfive);
    fiftyfive=nextfiftyfive;
    lastacnt=audioarr; //alert(noncontain);
    }
    } else {
    document.getElementById('aemailo').style.display='inline-block';
    waswordsih=document.getElementById('thewords').innerHTML;
    waswords=document.getElementById('thewords').value;
    document.getElementById('topleft').innerHTML+='<div id=topleftx><br><div id=after><div id=dvaudio>' + lastasaved + '</div></div></div>';
    document.getElementById('thewords').innerHTML=waswordsih;
    document.getElementById('thewords').value=waswords;
    }
    } else if (lastvsaved != '') {
    if (document.getElementById('after')) {
    spare=document.getElementById('after').innerHTML.replace(/\>\<source\ /g,' autoplay><source ');
    document.getElementById('aemailo').style.display='inline-block';
    document.getElementById('topleftx').innerHTML='<br><div id=after>' + topchat(lastvsaved.replace('<video ','<video autoplay ')) + '<br>' + spare + '</div>';
    } else {
    document.getElementById('aemailo').style.display='inline-block';
    waswordsih=document.getElementById('thewords').innerHTML;
    waswords=document.getElementById('thewords').value;
    document.getElementById('topleft').innerHTML+='<div id=topleftx><br><div id=after>' + lastvsaved + '</div></div>';
    document.getElementById('thewords').innerHTML=waswordsih;
    document.getElementById('thewords').value=waswords;
    }
    }
  }
  
  function slc(inq) {
    if (document.getElementById('saymode').value == 'mm') {
      return '?mym=y&' + inq.substring(1);
    }
    return inq;
  }
  
  function setvwidth() {
    var tarect=document.getElementById('thewords').getBoundingClientRect();
    document.getElementById('dstyle').innerHTML='<style> #dvoiceover video { max-width: ' + tarect.width + 'px;  width: ' + tarect.width + 'px; } </style>';
  }
  
  function listenforwh() {
    var ourmime='', isok=true;
    if (lastisaved.indexOf('data:image/gif') == 0) {  ourmime=ourmime;  } else if (lastisaved.indexOf('data:') == 0) { altimgw=imgw;   altimgh=imgh; if (!document.getElementById('after')) {  if (lastasaved != '') {
    document.getElementById('topleft').innerHTML+='<br><div id=after>' + lastasaved + '</div>';
    } else if (lastvsaved != '') {
    document.getElementById('topleft').innerHTML+='<br><div id=after>' + lastvsaved + '</div>';
    }  }       }
    if (imgw >= 0 && imgh >= 0) {
    //if (lastisaved.indexOf('data:image/gif') == 0) {  alert('1:' + isok);  }
      if (imgw > 0 && imgh > 0 && (lastasaved != '' || lastvsaved != '') && !document.getElementById('after')) {
         if (lastasaved != '') {
    document.getElementById('topleft').innerHTML+='<br><div id=after>' + lastasaved + '</div>';
    } else if (lastvsaved != '') {
    document.getElementById('topleft').innerHTML+='<br><div id=after>' + lastvsaved + '</div>';
    }
      }
      if (imgw > 0 && imgh > 0 && (lastasaved != '' || lastvsaved != '')) {
   // if (lastisaved.indexOf('data:image/gif') == 0) {  alert('2:' + isok);  }
       var xrect=document.getElementById('after').getBoundingClientRect();
       var zrect=document.getElementById('thewords').getBoundingClientRect();
       if (lastasaved != '' && lastvsaved != '') {
        ourmime=lastvsaved.split('ata:')[1].split(';')[0];
        if (document.getElementById('inum').innerHTML != '1') { if (lastisaved.indexOf('data:image/gif') != 0) { isok=false;   }  } 
        if (isok) {
        //document.getElementById('after').innerHTML='<video' + cvis + ' style=\"left:' + xrect.left + 'px;top:' + xrect.top + 'px;width:' + xrect.width + 'px;height:' + xrect.height + 'px;background:transparent url(' + \"'\" + lastisaved.split('#')[0] + \"'\" + ') no-repeat 0 0;-webkit-background-size:contain; -moz-background-size:contain; -o-background-size:contain; background-size:contain;\" id=myvideo controls loop autoplay poster=\"transparent.png\"><source id=vsource src=\"data:' + lastvsaved.split('data:')[1].split('\"')[0].split('#')[0] + '\" type=\"' + ourmime + '\"></video>';
        //document.getElementById('after').innerHTML='';
        if (document.getElementById('iturl').innerHTML != '') { lastisaved=document.getElementById('iturl').innerHTML.replace('https://','//').replace('http://','//');  }
        document.getElementById('after').innerHTML='<video' + cvis + ' style=\"left:' + xrect.left + 'px;top:' + xrect.top + 'px;width:' + zrect.width + 'px;height: calc(100vh - ' + eval(20 + xrect.top) + 'px);background:transparent url(' + \"'\" + lastisaved.split('#')[0] + \"'\" + ') no-repeat 0 0;-webkit-background-size:contain; -moz-background-size:contain; -o-background-size:contain; background-size:contain;\" id=myvideo controls loop autoplay poster=\"transparent.png\"><source id=vsource src=\"data:' + lastvsaved.split('data:')[1].split('\"')[0].split('#')[0] + '\" type=\"' + ourmime + '\"></video><br>' + lastasaved;
        }
        if (prevlastisaved.indexOf('data:') == -1) { prevlastisaved=lastisaved; }
        lastisaved='';
       } else if (lastasaved != '') {
   // if (lastisaved.indexOf('data:image/gif') == 0) {  alert('3:' + isok);  }
        ourmime=lastasaved.split('ata:')[1].split(';')[0];
        if (document.getElementById('inum').innerHTML != '1') { if (lastisaved.indexOf('data:image/gif') != 0) { isok=false;   }  } 
   // if (lastisaved.indexOf('data:image/gif') == 0) {  alert('4:' + isok);  }
        if (isok) {
        //document.getElementById('after').innerHTML=topchat('<audio style=\"left:' + xrect.left + 'px;top:' + xrect.top + 'px;width:' + zrect.width + 'px;height:' + zrect.height + 'px;background:transparent url(' + \"'\" + lastisaved.split('#')[0] + \"'\" + ') no-repeat 0 0;-webkit-background-size:contain; -moz-background-size:contain; -o-background-size:contain; background-size:contain;\" id=myaudio controls loop autoplay poster=\"transparent.png\"><source src=\"data:' + lastasaved.split('data:')[1].split('\"')[0].split('#')[0] + '\" type=\"' + ourmime + '\"></audio>');
      //  if (lastisaved.indexOf('data:image/gif') == 0) {  alert(lastisaved.split('#')[0].substring(0,50) + ' ... ' + lastisaved.split('#')[0].slice(-120)); }
        //document.getElementById('after').innerHTML='';
        if (document.getElementById('iturl').innerHTML != '') { lastisaved=document.getElementById('iturl').innerHTML.replace('https://','//').replace('http://','//');  }
        document.getElementById('after').innerHTML=topchat('<audio style=\"left:' + xrect.left + 'px;top:' + xrect.top + 'px;width:' + zrect.width + 'px;height: calc(100vh - ' + eval(20 + xrect.top) + 'px);background:transparent url(' + \"'\" + lastisaved.split('#')[0] + \"'\" + ') no-repeat 0 0;-webkit-background-size:' + document.getElementById('myasp').value + '; -moz-background-size:' + document.getElementById('myasp').value + '; -o-background-size:' + document.getElementById('myasp').value + '; background-size:' + document.getElementById('myasp').value + ';\" id=myaudio controls loop autoplay poster=\"transparent.png\"><source src=\"data:' + lastasaved.split('data:')[1].split('\"')[0].split('#')[0] + '\" type=\"' + ourmime + '\"></audio>');
        }
    //if (lastisaved.indexOf('data:image/gif') == 0) {  alert('5:' + isok);  }
        if (prevlastisaved.indexOf('data:') == -1) { prevlastisaved=lastisaved; }
        lastisaved='';
       } else if (lastvsaved != '') {
        ourmime=lastvsaved.split('ata:')[1].split(';')[0];
        if (document.getElementById('inum').innerHTML != '1') { if (lastisaved.indexOf('data:image/gif') != 0) { isok=false;   }  } 
        if (isok) {
        //document.getElementById('after').innerHTML='<video' + cvis + ' style=\"left:' + xrect.left + 'px;top:' + xrect.top + 'px;width:' + xrect.width + 'px;height:' + xrect.height + 'px;background:transparent url(' + \"'\" + lastisaved.split('#')[0] + \"'\" + ') no-repeat 0 0;-webkit-background-size:contain; -moz-background-size:contain; -o-background-size:contain; background-size:contain;\" id=myvideo controls loop autoplay poster=\"transparent.png\"><source id=vsource src=\"data:' + lastvsaved.split('data:')[1].split('\"')[0].split('#')[0] + '\" type=\"' + ourmime + '\"></video>';
        //document.getElementById('after').innerHTML='';
        if (document.getElementById('iturl').innerHTML != '') { lastisaved=document.getElementById('iturl').innerHTML.replace('https://','//').replace('http://','//');  }
        document.getElementById('after').innerHTML='<video' + cvis + ' style=\"left:' + xrect.left + 'px;top:' + xrect.top + 'px;width:' + zrect.width + 'px;height: calc(100vh - ' + eval(20 + xrect.top) + 'px);background:transparent url(' + \"'\" + lastisaved.split('#')[0] + \"'\" + ') no-repeat 0 0;-webkit-background-size:contain; -moz-background-size:contain; -o-background-size:contain; background-size:contain;\" id=myvideo controls loop autoplay poster=\"transparent.png\"><source id=vsource src=\"data:' + lastvsaved.split('data:')[1].split('\"')[0].split('#')[0] + '\" type=\"' + ourmime + '\"></video>';
        }
        if (prevlastisaved.indexOf('data:') == -1) { prevlastisaved=lastisaved; }
        lastisaved='';
       }
      }
    } else {
      setTimeout(listenforwh, 1000);
    }
  }   
  
  function backgroundit() {
    var la=lastaudioname;
    if (newres == '' && document.getElementById('result').innerHTML.indexOf('data:image/gif;base64,') == 0 && document.getElementById('result').innerHTML != 'data:image/gif;base64,') { prevlastisaved='data:' + document.getElementById('result').innerHTML.split('data:')[1];  }
    if (document.getElementById('result').innerHTML == 'data:image/gif;base64,' && document.getElementById('iturl').innerHTML != '') {
    //alert('act here RE ' + document.getElementById('iturl').innerHTML);
    document.getElementById('checkgif').src=document.URL.split('#')[0].split('?')[0] + '?getme=' + encodeURIComponent(document.getElementById('iturl').innerHTML) + haikusuffix;
    //} else if (haikusuffix != '' && (document.getElementById('result').innerHTML + 'data:').indexOf('data:') != 0) {
    //alert(document.URL.split('#')[0].split('?')[0] + '?getme=' + encodeURIComponent('data:' + document.getElementById('result').innerHTML.split('data:')[1]) + haikusuffix);
    //document.getElementById('checkgif').src=document.URL.split('#')[0].split('?')[0] + '?getme=' + encodeURIComponent('data:' + document.getElementById('result').innerHTML.split('data:')[1]) + haikusuffix;
    } else {
    if (document.getElementById('result').innerHTML.indexOf(':image/') != -1) { lastisaved='data:' + document.getElementById('result').innerHTML.split('data:')[1]; }
    //alert(lastisaved);
    if (lastasaved != '' || lastvsaved != '') {
    if (newres == '') { document.getElementById('result').innerHTML=lastresult; }
    lastaudioname=document.getElementById('audioname').value;
    document.getElementById('audioname').value=la;
    lastresult=lastisaved;
    imgd = new Image();
    imgh=altimgh; //-1;
    imgw=altimgw; //-1;
    setTimeout(listenforwh, 1000);
    
    imgd.onload = function() {
             if (eval('0' + this.height) > 0 && eval('0' + this.width) > 0) {
             imgh=eval('' + this.height);
             imgw=eval('' + this.width);
             altimgh=-1;
             altimgw=-1;
             }
    };

    imgd.src=lastisaved.split('#')[0];
    } else {
    if (newres == '') { document.getElementById('result').innerHTML=lastresult; }
    lastaudioname=document.getElementById('audioname').value;
    document.getElementById('audioname').value=la;
    lastresult=lastisaved;
    }
    }
    document.getElementById('avideo').style.display='inline-block';
  }

function dolhsh(force) {
  var hlines=[], hsuff='', ihsuff=0;
  if (force == 0) {
    document.getElementById('urli').placeholder=document.getElementById('urli').placeholder.replace('Media URL','Media ' + String.fromCodePoint(128279) + ' URL');
  }
  if (document.getElementById('thewords').value != '' && force != 0) {
    hlines=document.getElementById('thewords').value.split(String.fromCharCode(10));
    hsuff='';
    for (ihsuff=0; ihsuff<hlines.length; ihsuff++) {
      hsuff+='#' + encodeURIComponent(hlines[ihsuff]);
    }
    if (hsuff != '') { document.getElementById('cbi').src=document.getElementById('cbi').src.split('#')[0].replace('gfn=','gfXXn=').replace('?','?gfn=" . $giffilename . "&') + '0' + hsuff; } 
  } else if (('' + window.location.hash).replace('#','') != '') {
    document.getElementById('lhsh').innerHTML=window.location.hash.substring(1);
    document.getElementById('cbi').src=document.getElementById('cbi').src + '0' + window.location.hash.replace(/\ /g,'%20');
  } else if (document.getElementById('thewords').value != '' && (force != 0 || document.getElementById('cbi').src.indexOf('#') == -1)) {
    hlines=document.getElementById('thewords').value.split(String.fromCharCode(10));
    hsuff='';
    for (ihsuff=0; ihsuff<hlines.length; ihsuff++) {
      hsuff+='#' + encodeURIComponent(hlines[ihsuff]);
    }
    if (hsuff != '') { document.getElementById('cbi').src=document.getElementById('cbi').src.split('#')[0].replace('?','?gfn=" . $giffilename . "&') + '0' + hsuff; } 
  }
}

function lookfvsres() {
  fvsres('pointer');
}

function fvsres(inv) {
  if (newres == '') {
  if (inv == 'progress') {
    vsres=document.getElementById('result').innerHTML;
    setTimeout(lookfvsres, 2000);
    return inv;
  } else if (inv == 'pointer') {
    if (vsres != document.getElementById('result').innerHTML) {
      document.getElementById('inum').innerHTML='1';
      document.getElementById('result').style.cursor=inv;
      vsres=document.getElementById('result').innerHTML;
    } else {
      setTimeout(lookfvsres, 2000);
    }
  } 
  }
  return inv;
}

function urlit(tv) {
    document.getElementById('checkgif').src=document.URL.split('#')[0].split('?')[0] + '?getme=' + encodeURIComponent(tv) + haikusuffix;
}

function taincon(tv) {
  var waswords='', waswordsih='';
  waswordsih=document.getElementById('thewords').innerHTML;
  waswords=document.getElementById('thewords').value;
  if (document.getElementById('topleft')) {
    if (tv == '" . $contain . "') {
      while (document.getElementById('topleft').innerHTML.indexOf(('" . $noncontain . "').split('-')[0]) != -1) {
        document.getElementById('topleft').innerHTML=document.getElementById('topleft').innerHTML.replace(" . $noncontainregex . ",contain);
      }
    } else {
      while (document.getElementById('topleft').innerHTML.indexOf(contain) != -1) {
        document.getElementById('topleft').innerHTML=document.getElementById('topleft').innerHTML.replace(contain,noncontain);
      }
    }
  }
  document.getElementById('thewords').innerHTML=waswordsih;
  document.getElementById('thewords').value=waswords;
}

 function throbbingspans() {
   var isps, jsps;
   if (tgsps.length == 0) {
     var sps=document.getElementsByTagName('span');
     for (isps=0; isps<sps.length; isps++) {
        if (('' + sps[isps].style.opacity) != '') {
          if (eval('' + sps[isps].style.opacity) < 1.0) {
            tgsps.push(sps[isps]);
            tgspsop.push(eval('' + sps[isps].style.opacity));
            tgspsopwhat.push(eval('0.10'));
          }
        }
     }
   } 
   if (tgsps.length != 0) {
     for (jsps=0; jsps<tgsps.length; jsps+=2) {
       if (tgspsop[jsps] > 0.12 && tgspsop[jsps] < 0.88 && tgspsop[1 + jsps] > 0.12 && tgspsop[1 + jsps] < 0.88) { // && tgspsop[jsps] >= tgspsop[1 + jsps]) {
         tgspsop[jsps]+=tgspsopwhat[jsps];
         tgspsop[1 + jsps]-=tgspsopwhat[1 + jsps];
         tgsps[jsps].style.opacity='' + tgspsop[jsps];
         tgsps[1 + jsps].style.opacity='' + tgspsop[1 + jsps];
       } else if (tgspsop[jsps] > 0.12 && tgspsop[jsps] < 0.88 && tgspsop[1 + jsps] > 0.12 && tgspsop[1 + jsps] < 0.88) { // && tgspsop[jsps] <= tgspsop[1 + jsps]) {
         tgspsop[jsps]-=tgspsopwhat[jsps];
         tgspsop[1 + jsps]+=tgspsopwhat[1 + jsps];
         tgsps[jsps].style.opacity='' + tgspsop[jsps];
         tgsps[1 + jsps].style.opacity='' + tgspsop[1 + jsps];
       } else if (tgspsop[jsps] > 0.88) {
         tgspsop[jsps]-=0.1;
         tgspsop[1 + jsps]+=0.1;
         tgsps[jsps].style.opacity='' + tgspsop[jsps];
         tgsps[1 + jsps].style.opacity='' + tgspsop[1 + jsps];
         tgspsopwhat[jsps]=-tgspsopwhat[jsps];
         tgspsopwhat[1 + jsps]=-tgspsopwhat[1 + jsps];
       } else if (tgspsop[1 + jsps] > 0.88) {
         tgspsop[jsps]+=0.1;
         tgspsop[1 + jsps]-=0.1;
         tgsps[jsps].style.opacity='' + tgspsop[jsps];
         tgsps[1 + jsps].style.opacity='' + tgspsop[1 + jsps];
         tgspsopwhat[jsps]=-tgspsopwhat[jsps];
         tgspsopwhat[1 + jsps]=-tgspsopwhat[1 + jsps];
       } else if (tgspsop[1 + jsps] < 0.12) {
         tgspsop[jsps]-=0.1;
         tgspsop[1 + jsps]+=0.1;
         tgsps[jsps].style.opacity='' + tgspsop[jsps];
         tgsps[1 + jsps].style.opacity='' + tgspsop[1 + jsps];
         tgspsopwhat[jsps]=-tgspsopwhat[jsps];
         tgspsopwhat[1 + jsps]=-tgspsopwhat[1 + jsps];
       } else if (tgspsop[jsps] < 0.12) {
         tgspsop[jsps]+=0.1;
         tgspsop[1 + jsps]-=0.1;
         tgsps[jsps].style.opacity='' + tgspsop[jsps];
         tgsps[1 + jsps].style.opacity='' + tgspsop[1 + jsps];
         tgspsopwhat[jsps]=-tgspsopwhat[jsps];
         tgspsopwhat[1 + jsps]=-tgspsopwhat[1 + jsps];
      }
     }
     setTimeout(throbbingspans, 900);
   }
 }
 
 " . str_replace(explode("\n",$preposttc)[0] . "\n","",$preposttc) . "
 
</script>
</head>
<body onload=\" if (document.URL.indexOf('?mym=') != -1) { smimm(1); } " . explode(" ",$preposttc)[0] . "  if (1 == 1) { " . $posttc . " dolhsh(0); } lastaudioname=document.getElementById('audioname').value; if (document.getElementById('result').innerHTML.indexOf('data:') == 0) { lastresult='data:' + document.getElementById('result').innerHTML.split('data:')[1]; }  setvwidth(); saysubv(); resultchange(); throbbingspans();  setTimeout(repeatit, 5000);\">
<h1>Voiceover <span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#127909;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128483;</span> Ideas</h1>
<h2 style='background-color:#f0f0f0;'>" . $sosw . "<a style='padding-left:3px;padding-right:3px;border:1px dotted orange;text-decoration:underline;text-decoration-color:transparent;cursor:pointer;color:blue;background:linear-gradient(rgba(255,255,255,0.3),rgba(255,255,255,0.3)),url(//www.rjmprogramming.com.au/MarkItUp/html/images/record.png) repeat, linear-gradient(rgba(255,255,255,0.3),rgba(255,255,255,0.3)),url(//www.rjmprogramming.com.au/MarkItUp/html/images/upload.png) repeat;' onclick=openflash();>Flash Player Record</a> or <input id=urli onblur=urlit(this.value); type=text placeholder='Media URL goes here ...' value='' style=display:inline-block;></input> or <span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#128452;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#128250;</span> <div style='display:inline-block;width:96px;height:30px;overflow:hidden;vertical-align:text-bottom;'><iframe frameborder=0 id=cbi data-style='border-top:1px solid black;border-bottom:1px solid black;border-left:2px solid yellow;border-right:1px solid yellow;' style='width:173px;height:228px;margin-top:-194px;' onmouseover=\"vsres=document.getElementById('result').innerHTML; document.getElementById('result').style.cursor=fvsres('progress');\" src='HTMLCSS/client_browsing.htm?d=" . rand(0,18765432) . "'></iframe></div>&nbsp;<select onchange=taincon(this.value); id=myasp style='display:none;vertical-align:text-bottom;height:30px;width:140px;'><option value='" . $noncontain . "'>Audio Separated &#11015;</option><option value='" . $contain . "'>Background Aspect Ratio &#11036; Preserved</option></select>&nbsp;<a style=display:none;text-decoration:none;cursor:pointer;font-size:34px; onclick=voiceoverit(); title=Play id=avideo><span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#128250;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#9654;</span></a>&nbsp;<a style=display:none;text-decoration:none;cursor:pointer;font-size:34px; onclick=emailit(); id=aemailo title=Email>&#128231;</a>" . $ffmpegselect . "</h2>
<h3>RJM Programming - July, 2020</h3>
<div id=daudiolater>" . $audiois . "</div>
<form onsubmit=\"return subperhaps();\" id=myform onsubmit=\"" . $precursor . " document.getElementById('myform').style.cursor='progress'; document.body.style.cursor='progress'; if (twotwo != 2) { thenreload(); } else { setTimeout(thenreload,twentythousand); } return vtrue;\" target=dothework action=./macos_say_record.php method=POST>" . $tc . "
<input type=hidden name=thelang id=ilangcode value='" . $langcode . "'></input><input type=hidden name=thevoice id=ivoicecode value='" . $voicecode . "'></input>
<select style=display:inline-block;height:30px;margin-bottom:4px; onchange=\"document.getElementById('ilangcode').value=this.value; if (document.getElementById('ivoicecode').value.indexOf(this.value) == 0) {  location.href=document.URL.split('?')[0].split('#')[0] + slc('?thelang=') + encodeURIComponent(this.value) + pretc + '" . $gtc . "&thevoice=' + encodeURIComponent(document.getElementById('ivoicecode').value);   } else { location.href=document.URL.split('?')[0].split('#')[0] + slc('?thelang=') + encodeURIComponent(this.value) + '" . $gtc . "' + pretc; }\" id=slangcode value='" . $langcode . "'><option value=''>Optionally select language code to match a voice to ...</option>
" . $langrest . "
</select>
<select style=display:inline-block;height:30px;margin-bottom:4px; onchange=\"document.getElementById('ivoicecode').value=this.value; if (this.value.trim() != '') { location.href=document.URL.split('?')[0].split('#')[0] + slc('?thelang=') + encodeURIComponent(this.value.split('_')[0]) + pretc + '" . $gtc . "&thevoice=' + encodeURIComponent(this.value); } else {   document.getElementById('thewords').innerHTML='  ';  document.getElementById('thewords').value='  '; document.getElementById('lhsh').innerHTML='  '; document.getElementById('cbi').src=document.getElementById('cbi').src.split('#')[0] + '0#%20%20';  }\" id=svoicecode value='" . $voicecode . "'><option value=' '>Optionally select voice name to suit ...</option>
" . $voicesrest . "
<option value='  '>No words</option>
</select><table border=20>
<tr><th>" . $thwords . "</th><th>Record to <input type=text name=audioname id=audioname value='audiocapture." . $bestext . "'></input></th></tr>
<tr><td style=vertical-align:top; id=topleft><textarea onblur=\"dolhsh(1); document.getElementById('result').innerHTML='';\" placeholder=\"" . $dcv . "\" id=thewords name=saythis cols=80 rows=10 value=''>" . $tastuff . "</textarea><div id=dvoiceover style=display:inline-block;></div></td><td style=vertical-align:top;><input style='width:100%;height:100px;background-color:yellow;visibility:" . $hidden . ";' id=saysub type=submit value='" . $rtw . "'></input><br><br><textarea style='width:98%;background-color:lightgreen;' id=result cols=80 rows=10>" . $thecontent . "</textarea></td></tr>
</table>
</form>
<iframe name=dothework id=dothework style=display:none; src=macos_say_record.php></iframe>
<iframe onload=checkff(this); name=checkflash id=checkflash style=display:none; src='./macos_say_record.php?audiosize=y'></iframe>
<iframe onload=checkgifx(this); name=checkgif id=checkgif style=display:none; src=''></iframe>
<div id=dtemp></div>
<div id=dstyle></div>
<div id=iturl style=display:none;></div>
<div id=inum style=display:none;>1</div>
<div id=pemail style=display:none;></div>
<input type=hidden value='' id=x></input>
<div id=lhsh style=display:none;></div>" . $ffmpegform . "
<select id='select_source_mm' style='display:none;'><option value='Autodetect'>Autodetect</option><option value='------' disabled='disabled'>------</option><option value='af-ZA'>Afrikaans</option><option value='sq-AL'>Albanian</option><option value='am-ET'>Amharic</option><option value='ar-SA'>Arabic</option><option value='hy-AM'>Armenian</option><option value='az-AZ'>Azerbaijani</option><option value='bjs-BB'>Bajan</option><option value='rm-RO'>Balkan Gipsy</option><option value='eu-ES'>Basque</option><option value='bem-ZM'>Bemba</option><option value='bn-IN'>Bengali</option><option value='be-BY'>Bielarus</option><option value='bi-VU'>Bislama</option><option value='bs-BA'>Bosnian</option><option value='br-FR'>Breton</option><option value='bg-BG'>Bulgarian</option><option value='my-MM'>Burmese</option><option value='ca-ES'>Catalan</option><option value='cb-PH'>Cebuano</option><option value='cha-GU'>Chamorro</option><option value='zh-CN'>Chinese (Simplified)</option><option value='zh-TW'>Chinese Traditional</option><option value='zdj-KM'>Comorian (Ngazidja)</option><option value='cop-EG'>Coptic</option><option value='aig-AG'>Creole English (Antigua and Barbuda)</option><option value='bah-BS'>Creole English (Bahamas)</option><option value='gcl-GD'>Creole English (Grenadian)</option><option value='gyn-GY'>Creole English (Guyanese)</option><option value='jam-JM'>Creole English (Jamaican)</option><option value='svc-VC'>Creole English (Vincentian)</option><option value='vic-US'>Creole English (Virgin Islands)</option><option value='ht-HT'>Creole French (Haitian)</option><option value='acf-LC'>Creole French (Saint Lucian)</option><option value='crs-SC'>Creole French (Seselwa)</option><option value='pov-GW'>Creole Portuguese (Upper Guinea)</option><option value='hr-HR'>Croatian</option><option value='cs-CZ'>Czech</option><option value='da-DK'>Danish</option><option value='nl-NL'>Dutch</option><option value='dzo-BT'>Dzongkha</option><option value='en-GB'>English</option><option value='eo-EU'>Esperanto</option><option value='et-EE'>Estonian</option><option value='fn-FNG'>Fanagalo</option><option value='fo-FO'>Faroese</option><option value='fi-FI'>Finnish</option><option value='fr-FR'>French</option><option value='gl-ES'>Galician</option><option value='ka-GE'>Georgian</option><option value='de-DE'>German</option><option value='el-GR'>Greek</option><option value='grc-GR'>Greek (Classical)</option><option value='gu-IN'>Gujarati</option><option value='ha-NE'>Hausa</option><option value='haw-US'>Hawaiian</option><option value='he-IL'>Hebrew</option><option value='hi-IN'>Hindi</option><option value='hu-HU'>Hungarian</option><option value='is-IS'>Icelandic</option><option value='id-ID'>Indonesian</option><option value='kal-GL'>Inuktitut (Greenlandic)</option><option value='ga-IE'>Irish Gaelic</option><option value='it-IT'>Italian</option><option value='ja-JA'>Japanese</option><option value='jv-ID'>Javanese</option><option value='kea-CV'>Kabuverdianu</option><option value='kab-DZ'>Kabylian</option><option value='kn-IN'>Kannada</option><option value='kk-KZ'>Kazakh</option><option value='km-KM'>Khmer</option><option value='rw-RW'>Kinyarwanda</option><option value='run-RN'>Kirundi</option><option value='ko-KR'>Korean</option><option value='ku-TR'>Kurdish</option><option value='ku-CKB'>Kurdish Sorani</option><option value='ky-KG'>Kyrgyz</option><option value='lo-LA'>Lao</option><option value='la-VA'>Latin</option><option value='lv-LV'>Latvian</option><option value='lt-LT'>Lithuanian</option><option value='lb-LU'>Luxembourgish</option><option value='mk-MK'>Macedonian</option><option value='mg-MG'>Malagasy</option><option value='ms-MY'>Malay</option><option value='div-MV'>Maldivian</option><option value='mt-MT'>Maltese</option><option value='gv-IM'>Manx Gaelic</option><option value='mi-NZ'>Maori</option><option value='mh-MH'>Marshallese</option><option value='men-SL'>Mende</option><option value='mn-MN'>Mongolian</option><option value='mfe-MU'>Morisyen</option><option value='ne-NP'>Nepali</option><option value='niu-NU'>Niuean</option><option value='no-NO'>Norwegian</option><option value='ny-MW'>Nyanja</option><option value='ur-PK'>Pakistani</option><option value='pau-PW'>Palauan</option><option value='pa-IN'>Panjabi</option><option value='pap-CW'>Papiamentu</option><option value='ps-PK'>Pashto</option><option value='fa-IR'>Persian</option><option value='pis-SB'>Pijin</option><option value='pl-PL'>Polish</option><option selected='selected' value='pt-PT'>Portuguese</option><option value='pot-US'>Potawatomi</option><option value='qu-PE'>Quechua</option><option value='ro-RO'>Romanian</option><option value='ru-RU'>Russian</option><option value='smo-WS'>Samoan</option><option value='sg-CF'>Sango</option><option value='gd-GB'>Scots Gaelic</option><option value='sr-RS'>Serbian</option><option value='sna-ZW'>Shona</option><option value='si-LK'>Sinhala</option><option value='sk-SK'>Slovak</option><option value='sl-SI'>Slovenian</option><option value='so-SO'>Somali</option><option value='nso-ZA'>Sotho, Southern</option><option value='es-ES'>Spanish</option><option value='srn-SR'>Sranan Tongo</option><option value='sw-SZ'>Swahili</option><option value='sv-SE'>Swedish</option><option value='de-CH'>Swiss German</option><option value='syc-TR'>Syriac (Aramaic)</option><option value='tl-PH'>Tagalog</option><option value='tg-TJ'>Tajik</option><option value='tmh-DZ'>Tamashek (Tuareg)</option><option value='ta-LK'>Tamil</option><option value='te-IN'>Telugu</option><option value='tet-TL'>Tetum</option><option value='th-TH'>Thai</option><option value='bod-CN'>Tibetan</option><option value='ti-TI'>Tigrinya</option><option value='tpi-PG'>Tok Pisin</option><option value='tkl-TK'>Tokelauan</option><option value='ton-TO'>Tongan</option><option value='tn-BW'>Tswana</option><option value='tr-TR'>Turkish</option><option value='tk-TM'>Turkmen</option><option value='tvl-TV'>Tuvaluan</option><option value='uk-UA'>Ukrainian</option><option value='ppk-ID'>Uma</option><option value='uz-UZ'>Uzbek</option><option value='vi-VN'>Vietnamese</option><option value='wls-WF'>Wallisian</option><option value='cy-GB'>Welsh</option><option value='wo-SN'>Wolof</option><option value='xh-ZA'>Xhosa</option><option value='yi-YD'>Yiddish</option><option value='zu-ZA'>Zulu</option>                                </select>
</body>
</html>";
} 
} else {
 echo "<html><body><p>This PHP web application only works with macOS and its 'say [words]' command line Text to Speech and/or Audio functionality.</p></body><html>";
 exit;
}
?>
