// multipurpose_buttons.js // Help out multipurpose_buttons.html // January, 2021 var vsres=""; var newres=""; var wois=null; var gnewcl=''; var docwrite1=''; var docwrite2=''; var docwrite3=''; var xzhr=null; //new XMLHttpRequest(); var xform=null; //new FormData(); var etois=''; var gevent=null; var gval=''; var ourclicks=location.search.split('cclick=')[1] ? decodeURIComponent(location.search.split('cclick=')[1].split('&')[0]).replace(/\+/g,' ') : ""; var ouremail=location.search.split('cemail=')[1] ? decodeURIComponent(location.search.split('cemail=')[1].split('&')[0]).replace(/\+/g,' ') : ""; var ourcii=location.search.split('cii=')[1] ? decodeURIComponent(location.search.split('cii=')[1].split('&')[0]).replace(/\+/g,' ') : ""; var ourct=location.search.split('ct=')[1] ? decodeURIComponent(location.search.split('ct=')[1].split('&')[0]).replace(/\+/g,' ') : ""; var cmedianame=location.search.split('imedia=')[1] ? decodeURIComponent(location.search.split('imedia=')[1].split('&')[0]).replace(/\+/g,' ') : ""; var cmediacontent=''; var cnum=location.search.split('content=')[1] ? decodeURIComponent(location.search.split('content=')[1].split('&')[0]).replace(/\+/g,' ') : "1 2 3 " + String.fromCharCode(10) + "4 5 6 " + String.fromCharCode(10) + "7 8 9 "; while (cnum.indexOf(' ' + String.fromCharCode(13) + String.fromCharCode(10)) != -1) { cnum=cnum.replace(' ' + String.fromCharCode(13) + String.fromCharCode(10), ' [13][10]'); } while (cnum.indexOf(' ' + String.fromCharCode(10) + String.fromCharCode(13)) != -1) { cnum=cnum.replace(' ' + String.fromCharCode(10) + String.fromCharCode(13), ' [10][13]'); } while (cnum.indexOf(' ' + String.fromCharCode(10)) != -1) { cnum=cnum.replace(' ' + String.fromCharCode(10), ' [10]'); } while (cnum.indexOf(' ' + String.fromCharCode(13)) != -1) { cnum=cnum.replace(' ' + String.fromCharCode(13), ' [13]'); } while (cnum.indexOf(String.fromCharCode(13) + String.fromCharCode(10)) != -1) { cnum=cnum.replace(String.fromCharCode(13) + String.fromCharCode(10), ' [13][10]'); } while (cnum.indexOf(String.fromCharCode(10) + String.fromCharCode(13)) != -1) { cnum=cnum.replace(String.fromCharCode(10) + String.fromCharCode(13), ' [10][13]'); } while (cnum.indexOf(String.fromCharCode(10)) != -1) { cnum=cnum.replace(String.fromCharCode(10), ' [10]'); } while (cnum.indexOf(String.fromCharCode(13)) != -1) { cnum=cnum.replace(String.fromCharCode(13), ' [13]'); } cnum=cnum.replace(/\[13\]\[10\]/g, String.fromCharCode(13) + String.fromCharCode(10)); cnum=cnum.replace(/\[10\]\[13\]/g, String.fromCharCode(10) + String.fromCharCode(13)); cnum=cnum.replace(/\[13\]/g, String.fromCharCode(13)); cnum=cnum.replace(/\[10\]/g, String.fromCharCode(10)); var origcnumx=cnum; //.trim(); var cnumx=cnum; //.trim(); var x=0, y=0, lastx=0,lasty=0; var propx=0.0, propy=0.0; var ifstr=" gval=gval; "; var ifstrone=" gval=gval; "; var maxlh=0; var rectis=null; var dci=false; var fbr=null; var reso=null, lastreso=''; var detailscount=1; var scriptstuff=''; var preso=''; var defname=''; var xname=''; var eventtargets=[]; 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=''; //cnum="Cge return separators"; while (cnumx.indexOf(' ' + String.fromCharCode(13) + String.fromCharCode(10)) != -1) { cnumx=cnumx.replace(' ' + String.fromCharCode(13) + String.fromCharCode(10), ' '); } while (cnumx.indexOf(' ' + String.fromCharCode(10) + String.fromCharCode(13)) != -1) { cnumx=cnumx.replace(' ' + String.fromCharCode(10) + String.fromCharCode(13), ' '); } while (cnumx.indexOf(' ' + String.fromCharCode(10)) != -1) { cnumx=cnumx.replace(' ' + String.fromCharCode(10), ' '); } while (cnumx.indexOf(' ' + String.fromCharCode(13)) != -1) { cnumx=cnumx.replace(' ' + String.fromCharCode(13), ' '); } while (cnumx.indexOf(String.fromCharCode(13) + String.fromCharCode(10)) != -1) { cnumx=cnumx.replace(String.fromCharCode(13) + String.fromCharCode(10), ' '); } while (cnumx.indexOf(String.fromCharCode(10) + String.fromCharCode(13)) != -1) { cnumx=cnumx.replace(String.fromCharCode(10) + String.fromCharCode(13), ' '); } while (cnumx.indexOf(String.fromCharCode(10)) != -1) { cnumx=cnumx.replace(String.fromCharCode(10), ' '); } while (cnumx.indexOf(String.fromCharCode(13)) != -1) { cnumx=cnumx.replace(String.fromCharCode(13), ' '); } var cnums=cnumx.replace(/\ /g,'').split(''); function makeDelayedHandler(f, time){ // Delay execution of event handler function "f" by "time" ms, thanks to https://stackoverflow.com/questions/3048005/document-onclick-settimeout-function-javascript-help setTimeout(iclicked, time); return true; } function makeGvalDelayedHandler(fih, time){ // Delay execution of event handler function "f" by "time" ms, thanks to https://stackoverflow.com/questions/3048005/document-onclick-settimeout-function-javascript-help gval=fih; console.log(event.target.className + ' ' + gval); if (event) { gevent=event; //console.log(event.target.className); if (('' + event.target.className) != '') { eventtargets.push(document.getElementById(event.target.className)); } } else if (window.event) { gevent=window.event; //console.log(window.event.target.className); if (('' + event.target.className) != '') { eventtargets.push(document.getElementById(window.event.target.className)); } } return false; } 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 laterfbr() { if (fbr) { console.log(11); fbr.accept='.pdf,audio/*,video/*,image/*'; console.log(12); } } function notwotwo() { twotwo=33; vtrue=false; twentythousand=200; } function selch(thisvalue) { if (lastvalue != '.*') { while (document.getElementById('outputname').value.indexOf(lastvalue) != -1) { document.getElementById('outputname').value=document.getElementById('outputname').value.replace(lastvalue, '.*'); } } document.getElementById('outputname').value=document.getElementById('outputname').value.replace(/\.\*/g,'.' + thisvalue); lastvalue='.' + thisvalue; document.getElementById('cbi').src=document.getElementById('cbi').src.split('#')[0].split('?')[0] + '?totype=' + encodeURIComponent(thisvalue.replace('*','html')) + '&d=' + Math.floor(Math.random() * 19876543); } function checkmedia(iois) { if (iois != null) { var aconto = (iois.contentWindow || iois.contentDocument); if (aconto != null) { if (aconto.document) { aconto = aconto.document; } if (aconto.body != null) { var hs=aconto.getElementsByTagName('h1'); hs[0].style.display='none'; hs=aconto.getElementsByTagName('h3'); hs[0].style.display='none'; console.log(1); fbr=aconto.getElementById('files'); setTimeout(laterfbr,3000); aconto.getElementById('files').accept='.pdf,audio/*,video/*,image/*'; aconto.getElementById('files').style.fontSize='8px'; aconto.getElementById('files').title='Select media file.'; console.log(2); } } } } function defineclick(ois) { gval=''; var spanbs, aspan; var inw=0, jnw=0; var newcl=''; var huhg=[]; var oiso=''; if (ois) { oiso=ois.outerHTML; } if (1 == 11 || (('' + oiso).indexOf('')[0].split(''; if (wois) { wois.close(); wois=null; } if (!wois) { wois=window.open('', '_blank', 'left=50,top=50,width=600,height=600'); wois.document.write('' + document.getElementById(eventtarget).outerHTML + styleis + ''); } document.getElementById('cii').value+=',' + eventtarget; } function iclicked(event) { var isok=true, styleis='')[0].split(''; rectis=null; if (eventtargets.length > 0) { if (!event) { event=gevent; } event.target=eventtargets[eval(-1 + eventtargets.length)]; eventtargets.shift(); if (eventtargets.length > 0) { defineclick(event.target); return true; } } var allok=true; try { if (typeof event.target !== 'undefined') { allok=true; } } catch(enbfhg) { allok=false; } if (allok) { if (('' + event.target.id) == 'bxandy') { if (gval == '') { if (1 == 1) { clickidin('' + event.target.id); } else { if (wois) { wois.close(); wois=null; } if (!wois) { wois=window.open('', '_blank', 'left=50,top=50,width=600,height=600'); wois.document.write('' + event.target.outerHTML + styleis + ''); } } } else { if (('' + event.target.getAttribute('data-onclick')) == '') { setTimeout(agval, 1000); } else { event.target.onclick=function(event){ eval(event.target.getAttribute('data-onclick')); } eval(event.target.getAttribute('data-onclick')); } } } else if (('' + event.target.className) == 'bxandy') { if (gval == '') { if (1 == 11) { clickidin('' + event.target.id); } else if (('' + event.target.getAttribute('data-onclick')) == '') { if (wois) { wois.close(); wois=null; } if (!wois) { wois=window.open('', '_blank', 'left=50,top=50,width=600,height=600'); wois.document.write('' + event.target.outerHTML + styleis + ''); } } } else { setTimeout(agval, 1000); } } else if (('' + event.target.id) == 'bx') { if (gval == '') { if (1 == 1) { clickidin('' + event.target.id); } else { if (wois) { wois.close(); wois=null; } if (!wois) { wois=window.open('', '_blank', 'left=50,top=50,width=600,height=600'); wois.document.write('' + event.target.outerHTML + styleis + ''); } } } else { if (('' + event.target.getAttribute('data-onclick')) == '') { setTimeout(agval, 1000); } else { event.target.onclick=function(event){ eval(event.target.getAttribute('data-onclick')); } eval(event.target.getAttribute('data-onclick')); } } } else if (('' + event.target.className) == 'bx') { if (gval == '') { if (1 == 11) { clickidin('' + event.target.id); } else if (('' + event.target.getAttribute('data-onclick')) == '') { if (wois) { wois.close(); wois=null; } if (!wois) { wois=window.open('', '_blank', 'left=50,top=50,width=600,height=600'); wois.document.write('' + event.target.outerHTML + styleis + ''); } } } else { setTimeout(agval, 1000); } } else if (('' + event.target.id) == 'ixandy' && ('' + event.target.getAttribute('data-onclick')).replace('null','') != '') { event.target.onclick=function(event){ eval(event.target.getAttribute('data-onclick')); } eval(event.target.getAttribute('data-onclick')); } else if (('' + event.target.id) == 'ixandy') { rectis=event.target.getBoundingClientRect(); if (event.touches) { // thanks to https://stackoverflow.com/questions/24567441/how-do-i-detect-two-fingers-at-touchstart-in-javascript if (event.touches.length > 1) { isok=false; } } if (isok) { if (event.touches) { var touches1 = event.changedTouches; var first1 = touches1[0]; x = first1.clientX; y = first1.clientY; } else if (event.clientX || event.clientY) { x = event.clientX; // - elemLeft; y = event.clientY; // - elemTop; } else { x = event.pageX; // - elemLeft; y = event.pageY; // - elemTop; } lastx=x; lasty=y; propx=eval(eval(x - rectis.x) / rectis.width); propy=eval(eval(y - rectis.y) / rectis.height); if (cnum != ("1 2 3 " + String.fromCharCode(10) + "4 5 6 " + String.fromCharCode(10) + "7 8 9 ")) { gval=''; eval(ifstr); if (gval != '') { setTimeout(agval, 1000); } } else { if (eval(propx) <= 0.333 && eval(propy) <= 0.333) { gval='1'; setTimeout(agval, 1000); } else if (eval(propx) >= 0.666 && eval(propy) <= 0.333) { gval='3'; setTimeout(agval, 1000); } else if (eval(propy) <= 0.333) { gval='2'; setTimeout(agval, 1000); } else if (eval(propx) <= 0.333 && eval(propy) <= 0.666) { gval='4'; setTimeout(agval, 1000); } else if (eval(propx) >= 0.666 && eval(propy) <= 0.666) { gval='6'; setTimeout(agval, 1000); } else if (eval(propy) <= 0.666) { gval='5'; setTimeout(agval, 1000); } else if (eval(propx) <= 0.333) { gval='7'; setTimeout(agval, 1000); } else if (eval(propx) >= 0.666) { gval='9'; setTimeout(agval, 1000); } else { gval='8'; setTimeout(agval, 1000); } } //alert('propx=' + propx + ' and propy=' + propy + ' and x=' + x + ' and y=' + y + ' rectis.x=' + rectis.x + ' rectis.left=' + rectis.left + ' rectis.width=' + rectis.width); } } else if (('' + event.target.id) == 'ix') { rectis=event.target.getBoundingClientRect(); if (event.touches) { // thanks to https://stackoverflow.com/questions/24567441/how-do-i-detect-two-fingers-at-touchstart-in-javascript if (event.touches.length > 1) { isok=false; } } if (isok) { if (event.touches) { var touches1 = event.changedTouches; var first1 = touches1[0]; x = first1.clientX; y = first1.clientY; } else if (event.clientX || event.clientY) { x = event.clientX; // - elemLeft; y = event.clientY; // - elemTop; } else { x = event.pageX; // - elemLeft; y = event.pageY; // - elemTop; } lastx=x; lasty=y; propx=eval(eval(x - rectis.x) / rectis.width); propy=eval(eval(y - rectis.y) / rectis.height); if (cnum != ("1 2 3 " + String.fromCharCode(10) + "4 5 6 " + String.fromCharCode(10) + "7 8 9 ")) { gval=''; eval(ifstrone); if (gval != '') { setTimeout(agval, 1000); } } else { if (eval(propx) <= 0.111) { gval='1'; setTimeout(agval, 1000); } else if (eval(propx) <= 0.222) { gval='2'; setTimeout(agval, 1000); } else if (eval(propx) <= 0.333) { gval='3'; setTimeout(agval, 1000); } else if (eval(propx) <= 0.444) { gval='4'; setTimeout(agval, 1000); } else if (eval(propx) <= 0.555) { gval='5'; setTimeout(agval, 1000); } else if (eval(propx) <= 0.666) { gval='6'; setTimeout(agval, 1000); } else if (eval(propx) <= 0.777) { gval='7'; setTimeout(agval, 1000); } else if (eval(propx) <= 0.888) { gval='8'; setTimeout(agval, 1000); } else { gval='9'; setTimeout(agval, 1000); } } //alert('propx=' + propx + ' and propy=' + propy + ' and x=' + x + ' and y=' + y + ' rectis.x=' + rectis.x + ' rectis.left=' + rectis.left + ' rectis.width=' + rectis.width); } } } } function preagval(mediao) { agval(); } function agval() { if (gval != '') { if (gval.length == 2) { if (gval.substring(0,1) == ' ') { alert('You clicked ' + gval); } else { alert('You clicked ' + gval.substring(0,1)); } } else { alert('You clicked ' + gval); } gval=''; } } function boxit(cm) { var ourdelim=String.fromCharCode(10), blanks=''; if (cnum != ("1 2 3 " + String.fromCharCode(10) + "4 5 6 " + String.fromCharCode(10) + "7 8 9 ")) { var ih='', jh=0, kh=0, lh=0, onelh=0, zero=0, eight=8; maxlh=0; if (cnum != ("1 2 3 " + String.fromCharCode(10) + "4 5 6 " + String.fromCharCode(10) + "7 8 9 ")) { var ccnums=[]; if (cm.indexOf(String.fromCharCode(13) + String.fromCharCode(10)) != -1) { ccnums=cm.split(String.fromCharCode(13) + String.fromCharCode(10)); ourdelim=String.fromCharCode(13) + String.fromCharCode(10); } else if (cm.indexOf(String.fromCharCode(10) + String.fromCharCode(13)) != -1) { ccnums=cm.split(String.fromCharCode(10) + String.fromCharCode(13)); ourdelim=String.fromCharCode(10) + String.fromCharCode(13); } else if (cm.indexOf(String.fromCharCode(13)) != -1) { ccnums=cm.split(String.fromCharCode(13)); ourdelim=String.fromCharCode(13) + String.fromCharCode(13); } else if (cm.indexOf(String.fromCharCode(10)) != -1) { ccnums=cm.split(String.fromCharCode(10)); ourdelim=String.fromCharCode(13) + String.fromCharCode(10); } else { ourdelim=''; } //alert(ccnums.length); for (jh=1; jh<=ccnums.length; jh++) { if (eval('' + ccnums[eval(-1 + jh)].length) > eval('' + maxlh)) { maxlh=ccnums[eval(-1 + jh)].length; } } for (jh=1; jh<=ccnums.length; jh++) { if (eval('' + ccnums[eval(-1 + jh)].length) < eval('' + maxlh)) { blanks=''; while (eval('' + (ccnums[eval(-1 + jh)] + blanks).length) < eval('' + maxlh)) { blanks+=' '; } if (cm.indexOf(ccnums[eval(-1 + jh)] + ourdelim) != -1) { cm=cm.replace(ccnums[eval(-1 + jh)] + ourdelim, ccnums[eval(-1 + jh)] + blanks.replace(/\ /g,' ') + ourdelim); } else { cm=cm.replace(ccnums[eval(-1 + jh)], ccnums[eval(-1 + jh)] + blanks.replace(/\ /g,' ')); } } } } } //alert('' + maxlh + ' ' + cm.replace(/\ /g,'.')); maxlh=0; // 7.8.9....... // a.b.c.d.e return cm.replace(/\ /g,' '); } function onl() { var ih='', jh=0, kh=0, lh=0, onelh=0, zero=0, eight=0; maxlh=0; if (cmedianame != '') { if (window.sessionStorage) { cmediacontent=decodeURIComponent(window.sessionStorage.getItem(cmedianame)); window.sessionStorage.removeItem(cmedianame); } else { cmedianame=''; } } if (cnum != ("1 2 3 " + String.fromCharCode(10) + "4 5 6 " + String.fromCharCode(10) + "7 8 9 ")) { var ccnums=[]; if (origcnumx.indexOf(String.fromCharCode(13) + String.fromCharCode(10)) != -1) { ccnums=origcnumx.split(String.fromCharCode(13) + String.fromCharCode(10)); document.getElementById('content').rows='' + ccnums.length; } else if (origcnumx.indexOf(String.fromCharCode(10) + String.fromCharCode(13)) != -1) { ccnums=origcnumx.split(String.fromCharCode(10) + String.fromCharCode(13)); document.getElementById('content').rows='' + ccnums.length; } else if (origcnumx.indexOf(String.fromCharCode(13)) != -1) { ccnums=origcnumx.split(String.fromCharCode(13)); document.getElementById('content').rows='' + ccnums.length; } else { ccnums=origcnumx.split(String.fromCharCode(10)); document.getElementById('content').rows='' + ccnums.length; } //alert(ccnums.length); for (jh=1; jh<=ccnums.length; jh++) { if (eval('' + ccnums[eval(-1 + jh)].length) > eval('' + maxlh)) { maxlh=ccnums[eval(-1 + jh)].length; } } for (jh=1; jh<=cnumx.length; jh++) { ih+="" + cnumx.substring(eval(-1 + jh)).substring(0,1) + ""; //if (lh == 0) { alert(cnumx.substring(eval(-1 + jh)).substring(0,1)); } if ((cnumx + ' ').substring(eval(0 + jh)).substring(0,1)) { zero=eight; if (eight > 0) { eight--; } } else { zero=0; } if (ifstrone.indexOf('if ') == -1) { ifstrone+=" if (eval(propx) <= eval(" + eval(1 + onelh) + "." + zero + " / " + cnumx.length + ")) { gval='" + cnumx.substring(eval(-1 + jh)).substring(0,2) + "'; } "; } else { ifstrone+=" else if (eval(propx) <= eval(" + eval(1 + onelh) + "." + zero + " / " + cnumx.length + ")) { gval='" + cnumx.substring(eval(-1 + jh)).substring(0,2) + "'; } "; } if (ccnums.length == 1) { if (ifstr.indexOf('if ') == -1) { ifstr+=" if (eval(propx) <= eval(" + eval(1 + lh) + "." + zero + " / " + maxlh + ")) { gval='" + cnumx.substring(eval(-1 + jh)).substring(0,2) + "'; } "; } else { ifstr+=" else if (eval(propx) <= eval(" + eval(1 + lh) + "." + zero + " / " + maxlh + ")) { gval='" + cnumx.substring(eval(-1 + jh)).substring(0,2) + "'; } "; } } else { if (ifstr.indexOf('if ') == -1) { ifstr+=" if (eval(propx) <= eval(" + eval(1 + lh) + "." + zero + " / " + maxlh + ") && eval(propy) <= eval(" + eval(1 + kh) + ".0 / " + ccnums.length + ")) { gval='" + cnumx.substring(eval(-1 + jh)).substring(0,2) + "'; } "; } else { ifstr+=" else if (eval(propx) <= eval(" + eval(1 + lh) + "." + zero + " / " + maxlh + ") && eval(propy) <= eval(" + eval(1 + kh) + ".0 / " + ccnums.length + ")) { gval='" + cnumx.substring(eval(-1 + jh)).substring(0,2) + "'; } "; } } lh++; onelh++; if (lh == ccnums[kh].length && kh < ccnums.length) { if (lh < maxlh) { while (lh < maxlh) { ih+=" "; if (ccnums.length == 1) { if (ifstr.indexOf('if ') == -1) { ifstr+=" if (eval(propx) <= eval(" + eval(1 + lh) + ".0 / " + maxlh + ")) { gval=' '; } "; } else { ifstr+=" else if (eval(propx) <= eval(" + eval(1 + lh) + ".0 / " + maxlh + ")) { gval=' '; } "; } } else { if (ifstr.indexOf('if ') == -1) { ifstr+=" if (eval(propx) <= eval(" + eval(1 + lh) + ".0 / " + maxlh + ") && eval(propy) <= eval(" + eval(1 + kh) + ".0 / " + ccnums.length + ")) { gval=' '; } "; } else { ifstr+=" else if (eval(propx) <= eval(" + eval(1 + lh) + ".0 / " + maxlh + ") && eval(propy) <= eval(" + eval(1 + kh) + ".0 / " + ccnums.length + ")) { gval=' '; } "; } } lh++; } } ih+="
"; kh++; lh=0; } } if (maxlh == 0) { maxlh=lh; } //alert(ifstrone); document.getElementById('ix').style.marginLeft='1px'; document.getElementById('ix').style.marginRight='3px'; if (/chrome/i.test( navigator.userAgent )) { document.getElementById('ix').style.width='' + Math.round(eval(0 + cnumx.length) * 8.0) + 'px'; document.getElementById('ixandy').style.width='' + Math.round(eval(0 + maxlh) * 7.5) + 'px'; } else { document.getElementById('ix').style.width='' + Math.round(eval(0 + cnumx.length) * 6.75) + 'px'; document.getElementById('ixandy').style.width='' + Math.round(eval(0 + maxlh) * 7.5) + 'px'; // 8.0 } document.getElementById('ixandy').style.height='' + Math.floor(eval(eval('' + ccnums.length) * 14) + 4) + 'px'; document.getElementById('bxandy').innerHTML=ih.replace(/\>\ \<\/span\>/g, '> '); document.getElementById('bx').innerHTML=ih.replace(/\/g,'').replace(/bxandy/g,'bx'); document.getElementById('ix').title='Please click a character or double click (or two clicks quickly in a row) to define onclick logic.'; document.getElementById('ixandy').title='Please click a character or double click (or two clicks quickly in a row) to define onclick logic.'; document.getElementById('n1').innerHTML='character'; document.getElementById('n2').innerHTML='character'; } else { document.getElementById('ix').style.marginLeft='1px'; document.getElementById('ix').style.marginRight='3px'; if (/chrome/i.test( navigator.userAgent )) { document.getElementById('ix').style.width='' + Math.round(eval(0 + cnumx.length) * 8.0) + 'px'; document.getElementById('ixandy').style.width='' + Math.round(eval(0 + 6) * 7.5) + 'px'; } else { document.getElementById('ix').style.width='' + Math.round(eval(0 + cnumx.length) * 6.75) + 'px'; document.getElementById('ixandy').style.width='' + Math.round(eval(0 + 6) * 7.5) + 'px'; // 8.0 } document.getElementById('ixandy').style.height='' + Math.floor(eval(eval('' + '3') * 14) + 4) + 'px'; } if (cmediacontent.indexOf('divbxandy">') != -1) { document.getElementById('bxandy').innerHTML+='
' + cmediacontent.split('divbxandy">')[1].split('
')[0] + ''; } else if (cmediacontent.indexOf("divbxandy'>") != -1) { document.getElementById('bxandy').innerHTML+='
' + cmediacontent.split("divbxandy'>")[1].split('
')[0] + ''; } else if (cmediacontent.indexOf('divbxandy>') != -1) { document.getElementById('bxandy').innerHTML+='
' + cmediacontent.split('divbxandy>')[1].split('
')[0] + ''; } if (cmediacontent.indexOf('divbx">') != -1) { document.getElementById('bx').innerHTML+='
' + cmediacontent.split('divbx">')[1].split('
')[0] + ''; } else if (cmediacontent.indexOf("divbx'>") != -1) { document.getElementById('bx').innerHTML+='
' + cmediacontent.split("divbx'>")[1].split('
')[0] + ''; } else if (cmediacontent.indexOf('divbx>') != -1) { document.getElementById('bx').innerHTML+='
' + cmediacontent.split('divbx>')[1].split('
')[0] + ''; } if (ourct != '') { var ourcts=ourct.split(','); for (var iourc=0; iourc'; } else { buts[ii].innerHTML+='

'; //document.body.style.backgroundImage='linear-gradient(rgba(255,255,255,0.8),rgba(255,255,255,0.8)),URL(data:image/' + dres.split('data:image/')[1].split('"')[0].split("'")[0].split('>')[0] + ')'; //document.body.style.backgoundRepeat='no-repeat'; //document.body.style.backgoundSize='contain'; } } else if (dres.indexOf('data:audio/') != -1) { if (document.getElementById('div' + buts[ii].id)) { document.getElementById('div' + buts[ii].id).innerHTML+='
'; } else { buts[ii].innerHTML+='

'; } } else if (dres.indexOf('data:video/') != -1) { if (document.getElementById('div' + buts[ii].id)) { document.getElementById('div' + buts[ii].id).innerHTML+='
'; } else { buts[ii].innerHTML+='

'; } } document.getElementById('imedia').innerHTML+=encodeURIComponent(document.getElementById('div' + buts[ii].id).outerHTML); } } else if (document.getElementById('resultav').innerHTML != '') { dres=document.getElementById('resultav').innerHTML; document.getElementById('resultav').innerHTML=''; buts=document.getElementsByTagName('button'); document.getElementById('imedia').innerHTML=''; for (ii=0; ii'; } else { buts[ii].innerHTML+='
'; //document.body.style.backgroundImage='linear-gradient(rgba(255,255,255,0.8),rgba(255,255,255,0.8)),URL(data:image/' + dres.split('data:image/')[1].split('"')[0].split("'")[0].split('>')[0] + ')'; //document.body.style.backgoundRepeat='no-repeat'; //document.body.style.backgoundSize='contain'; } } else if (dres.indexOf('data:audio/') != -1) { if (document.getElementById('div' + buts[ii].id)) { document.getElementById('div' + buts[ii].id).innerHTML+='
'; } else { buts[ii].innerHTML+='

'; } } else if (dres.indexOf('data:video/') != -1) { if (document.getElementById('div' + buts[ii].id)) { document.getElementById('div' + buts[ii].id).innerHTML+='
'; } else { buts[ii].innerHTML+='

'; } } document.getElementById('imedia').innerHTML+=encodeURIComponent(document.getElementById('div' + buts[ii].id).outerHTML); } } setTimeout(dotimeaway, 2000); } function ssit() { var ourssname='media' + Math.floor(Math.random() * 19876543); //document.getElementById('bx').value=document.getElementById('bx').innerHTML; //alert(document.getElementById('bx').value); if (document.getElementById('imedia') && document.getElementById('divmedia')) { if (document.getElementById('imedia').value != '') { if (window.sessionStorage) { window.sessionStorage.setItem(ourssname, document.getElementById('imedia').innerHTML); document.getElementById('imedia').innerHTML=''; document.getElementById('divmedia').innerHTML=""; } } } return true; } function dodivstyle() { document.getElementById('ct').value+=',1'; document.getElementById('divstyle').innerHTML+=' '; } function doglow(isbutton) { if (isbutton) { document.getElementById('ct').value+=',2'; document.getElementById('bx').className='' + document.getElementById('bx').className + ' glow'; document.getElementById('bxandy').className='' + document.getElementById('bxandy').className + ' glow'; } else { document.getElementById('ct').value+=',3'; document.getElementById('ix').className='' + document.getElementById('ix').className + ' glow'; document.getElementById('ixandy').className='' + document.getElementById('ixandy').className + ' glow'; } } function xshowStuff(evt) { if (xzhr.readyState == 4) { if (xzhr.status == 200) { //alert('Email sent'); document.getElementById('spanh3').innerHTML=' - Email downloadable HTML attachment sent to ' + etois + ' ... ' + (new Date()); } } } function doemail(eto) { var htmlis='', vhones=[], honeis='', argstuff='', iarg=0; etois=eto; document.getElementById('spanh3').innerHTML=''; if (eto.indexOf('@') != -1) { document.getElementById('cemail').value=eto; xzhr=null; //new XMLHttpRequest(); xform=null; //new FormData(); xzhr=new XMLHttpRequest(); xform=new FormData(); xform.append('to', eto); xform.append('subject', 'My Buttons'); htmlis='' + document.head.outerHTML.replace(/\.\/multipurpose_buttons\.html/g, document.URL.split('#')[0].split('?')[0]).replace(/\ \+\ /g, ' ' + encodeURIComponent('+') + ' ').replace(/\/\/www\.rjmprogramming\.com\.au/g, 'HT' + 'TP://www.rjmprogramming.com.au') + document.body.outerHTML.replace(/\.\/multipurpose_buttons\.html/g, document.URL.split('#')[0].split('?')[0]).replace('/g, '').replace(/\/\/www\.rjmprogramming\.com\.au/g, 'HT' + 'TP://www.rjmprogramming.com.au').replace(/\ data\-ondblclick\=/g,' data-ondblclick=').replace(/\ data\-ontJUNKouchend\=/g,' ontouchend=').replace(/\ data\-ondJUNKblclick\=/g,' ondblclick=').replace(/onclick\=\'makeGvalDelayedHandler\(this\.innerHTML\,2000\)\;\'/g, "onclick='gval=this.innerHTML;'") + ''; vhones=htmlis.split(''); if (vhones.length > 2) { honeis='')[0] + ''; htmlis=htmlis.replace(honeis + vhones[2], vhones[2]); } vhones=htmlis.split(' 2 && 1 == 1) { honeis='')[0] + ''; htmlis=htmlis.replace(honeis, ''); } vhones=htmlis.split(' 2 && 1 == 1) { honeis='')[0] + ''; htmlis=htmlis.replace(honeis, ''); } vhones=htmlis.split(' name="'); if (vhones.length > 1) { for (iarg=1; iarg")[0])); } } } } vhones=htmlis.split(" name='"); if (vhones.length > 1) { for (iarg=1; iarg")[0])); } } } } vhones=htmlis.split(" name="); if (vhones.length > 1) { for (iarg=1; iarg")[0].substring(0,1) != '"' && vhones[iarg].split(" ")[0].split(">")[0].substring(0,1) != "'") { if (argstuff == '') { argstuff='?'; } else { argstuff+='&'; } argstuff+=vhones[iarg].split(" ")[0].split(">")[0] + '='; if (document.getElementById(vhones[iarg].split(" ")[0].split(">")[0])) { if (vhones[iarg].split(" ")[0].split(">")[0] == "content") { if (document.URL.indexOf('&content=') != -1) { argstuff+=encodeURIComponent(document.URL.split('&content=')[1].split('&')[0].split('#')[0].replace(/\+/g,'%20')); } else { argstuff+=encodeURIComponent(encodeURIComponent(origcnumx.replace(/\+/g,'%20'))); } } else { argstuff+=encodeURIComponent(encodeURIComponent(document.getElementById(vhones[iarg].split(" ")[0].split(">")[0]).value)); } console.log(argstuff); } else { argstuff+=vhones[iarg].split(" ")[0].split(">")[0] + '='; if (vhones[iarg].indexOf(' value="') != -1) { argstuff+=encodeURIComponent(encodeURIComponent(vhones[iarg].split(' value="')[1].split('"')[0])); } else if (vhones[iarg].indexOf(" value='") != -1) { argstuff+=encodeURIComponent(encodeURIComponent(vhones[iarg].split(" value='")[1].split("'")[0])); } else if (vhones[iarg].indexOf(" value=") != -1) { argstuff+=encodeURIComponent(encodeURIComponent(vhones[iarg].split(" value=")[1].split(" ")[0].split(">")[0])); } } } } } if (htmlis.indexOf('www.rjmprogramming.com.au/HTMLCSS/multipurpose_buttons.html"') != -1 && htmlis.indexOf('disp' + 'lay:NONE;') != -1 && argstuff != '') { htmlis=htmlis.replace('www.rjmprogramming.com.au/HTMLCSS/multipurpose_buttons.html"', 'www.rjmprogramming.com.au/HTMLCSS/multipurpose_buttons.html' + argstuff + '"').replace('disp' + 'lay:NONE;', 'display:inline-block;'); } xform.append('body', htmlis); xzhr.open('post', '//www.rjmprogramming.com.au/PHP/emailhtml.php', true); xzhr.onreadystatechange = xshowStuff; xzhr.send(xform); document.getElementById('cemail').value=''; document.getElementById('iemail').value=''; } } setTimeout(dotimeaway, 3000); docwrite1=("

Multipurpose Buttons for
  

"); docwrite2=("
"); docwrite3=("
");