<!doctype html>
<html>
<head>
<title>Emoji Border and/or Background Image to Body/Canvas - RJM Programming - August, 2018</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style>

body { position:absolute; width: calc(100% - 180px); height: calc(100vh - 180px); display: block; text-align: bottom; border: 80px solid red; border-image: url("//twemoji.maxcdn.com/2/72x72/1f44d.png") 100% round; border-image-repeat: repeat; background-image-repeat: repeat; }

</style>

<script type='text/javascript'>

var elem=null, context=null, oborder=null, obackground=null;
var pw=900, ph=900, iw=0, ih=0;
var bmode='border';
var cmode='body';
var wasa='';
var lasttvi='1f44d';
var whereto="'ifb'"; // '_blank';
var threethousand=3000;
var spoiler='';
if (document.URL.indexOf('iammobile=y') != -1 || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
threethousand=13000;
spoiler='JUNK';
whereto="'_top'";
} else {
whereto="'_blank'";
}

function analyze(tvi) {
if (tvi.textContent != '') {
if (tvi.textContent.length <= 2) {
if (bmode == 'border') {
lasttvi=tvi.textContent.codePointAt(0).toString(16);
document.getElementById('myb').style.borderImage='url("//twemoji.maxcdn.com/2/72x72/' + tvi.textContent.codePointAt(0).toString(16) + '.png")';
} else {
document.getElementById('myb').style.backgroundImage='url("//twemoji.maxcdn.com/2/72x72/' + tvi.textContent.codePointAt(0).toString(16) + '.png")';
}
} else {
if (bmode == 'border') {
lasttvi=tvi.innerHTML.toLowerCase().replace(/\&/g,'').replace(/\#/g,'');
document.getElementById('myb').style.borderImage='url("//twemoji.maxcdn.com/2/72x72/' + tvi.innerHTML.toLowerCase().replace(/\&/g,'').replace(/\#/g,'') + '.png")';
} else {
document.getElementById('myb').style.backgroundImage='url("//twemoji.maxcdn.com/2/72x72/' + tvi.innerHTML.toLowerCase().replace(/\&/g,'').replace(/\#/g,'') + '.png")';
}
}
}
}

function doct(inww) {
// border: 80px solid red; border-image: url('//twemoji.maxcdn.com/2/72x72/1f44d.png') 100% round; border-image-repeat: repeat; background-image-repeat: repeat;
if (inww.toLowerCase() == 'canvas') {
var boh=document.body.outerHTML;
boh=document.getElementById('myb').outerHTML;
if (boh.split('>')[0].indexOf('border-image') == -1) {
boh=boh.replace(' style="', ' style="border: 80px solid red; border-image: url(//twemoji.maxcdn.com/2/72x72/1f44d.png) 100% round; border-image-repeat: repeat; background-image-repeat: repeat;'.replace('1f44d',lasttvi));
}
if (!document.getElementById('mycanvas')) {
var myw=eval(window.getComputedStyle(document.body, null).getPropertyValue('width').replace('px',''));
myw+=160;
var myh=eval(window.getComputedStyle(document.body, null).getPropertyValue('height').replace('px',''));
myh+=160;
//alert(boh.split('>')[0].replace('<body','<canvas width=' + myw + ' height=' + myh).replace('myb','mycanvas').replace(' onload=',' data-onload=').replace('left:','data-left:').replace('top:','data-top:').replace('width:','data-width:').replace('height:','data-height:').replace(' style="',' style="top:0px;left:0px;position:absolute;z-index:7;') + '></canvas>');
//document.body.innerHTML=boh.split('>')[0].replace('<body','<canvas width=' + myw + ' height=' + myh).replace('myb','mycanvas').replace(' onload=',' data-onload=').replace('left:','data-left:').replace('top:','data-top:').replace('width:','data-width:').replace('height:','data-height:').replace(' style="',' style="top:0px;left:0px;position:absolute;z-index:7;') + '></canvas>';
//alert(boh.split('>')[0].replace('<body','<canvas width=' + myw + ' height=' + myh).replace('myb','mycanvas').replace(' onload="onl();"',' ').replace(' style="',' style="top:0px;left:0px;position:absolute;z-index:7;').replace(/\"\;/g,'').replace('"//','"http://').replace('"//','"http://').replace('"//','"http://').replace('(//','(http://').replace('(//','(http://') + '></canvas>');
var cis=boh.split('>')[0].replace('<body','<canvas width=' + myw + ' height=' + myh).replace('myb','mycanvas').replace(' onl' + spoiler + 'oad="onl();"',' ').replace(' style="',' style="top:0px;left:0px;position:absolute;z-index:7; ').replace(/\"\;/g,'').replace('"//','"http://').replace('"//','"http://').replace("'//","'http://").replace("'//","'http://").replace('"//','"http://').replace('(//','(http://').replace('(//','(http://') + '></canvas>';
cis=boh.split('>')[0].replace('<body','<canvas').replace('myb','mycanvas').replace(' onload="onl();"',' ').replace(' style="',' style="top:0px;left:0px;position:absolute;z-index:7; width:' + myw + 'px; height:' + myh + 'px;').replace(/\"\;/g,'').replace('"//','"http://').replace('"//','"http://').replace("'//","'http://").replace("'//","'http://").replace('"//','"http://').replace('(//','(http://').replace('(//','(http://') + '></canvas>';
if (1 == 2) {
//cis=boh.split('>')[0].replace('<body','<canvas').replace('myb','mycanvas').replace(' onload="onl();"',' ').replace(' style="',' style="top:0px;left:0px;position:absolute;z-index:7; width:' + myw + 'px; height:' + myh + 'px;').replace(/\"\;/g,'').replace('"//','"http://').replace('"//','"http://').replace("'//","'http://").replace("'//","'http://").replace('"//','"http://').replace('(//','(http://').replace('(//','(http://') + '></canvas>';
//alert(cis);
var wo=window.open('','_blank','top=0,left=0,height=800,width=800');
wo.document.write(cis); //.replace(/canvas/g,'body'));
wo.document.write("<scr" + "ipt type='text/javascript'> document.body.style.borderImage=\"url('http://twemoji.maxcdn.com/2/72x72/1f44d.png')\"; </scr" + "ipt>");
} else if (3 == 4) {
location.href=document.URL.split('#')[0].split('?')[0] + '?canvas=' + encodeURIComponent(cis);
} else {
//alert(cis);
document.getElementById('aemail').href=wasa + encodeURIComponent(encodeURIComponent(cis));
//alert(document.getElementById('aemail').href);
if (document.URL.indexOf('iammobile=y') != -1 || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
document.getElementById('aemail').click();
if (1 == 1) {
location.href=document.URL.split('#')[0].split('?')[0] + '?iammobile=y&canvas=' + encodeURIComponent(cis);
} else {
document.getElementById('ifbx').src=document.URL.split('#')[0].split('?')[0] + '?iammobile=y&canvas=' + encodeURIComponent(cis);
document.getElementById('ifbx').style.zIndex='7';
document.getElementById('ifbx').style.display='block';
}
} else {
document.getElementById('ifbx').src=document.URL.split('#')[0].split('?')[0] + '?canvas=' + encodeURIComponent(cis);
setTimeout(aem,threethousand); //document.getElementById('aemail').click();
}
}
}
}
return inww;
}

function aem() {
document.getElementById('aemail').click();
}

function blat() {
if (document.getElementById('mycanvas')) { elem=document.getElementById('mycanvas'); context=elem.getContext('2d');
if (document.getElementById('iborder')) { oborder=document.getElementById('iborder'); }
if (document.getElementById('ibackground')) { obackground=document.getElementById('ibackground'); }
// try { context.drawImage(obackground,0,0); } catch(ee) { } try { context.drawImage(obackground,0,80); } catch(ee) { } try { context.drawImage(obackground,0,160); } catch(ee) { } try { context.drawImage(obackground,0,240); } catch(ee) { } try { context.drawImage(obackground,0,320); } catch(ee) { } try { context.drawImage(obackground,0,400); } catch(ee) { } try { context.drawImage(obackground,0,480); } catch(ee) { } try { context.drawImage(obackground,0,560); } catch(ee) { } try { context.drawImage(obackground,0,640); } catch(ee) { } try { context.drawImage(obackground,0,720); } catch(ee) { } try { context.drawImage(obackground,0,800); } catch(ee) { } try { context.drawImage(obackground,0,880); } catch(ee) { } try { context.drawImage(obackground,0,960); } catch(ee) { } try { context.drawImage(obackground,0,1040); } catch(ee) { } try { context.drawImage(obackground,0,1120); } catch(ee) { } try { context.drawImage(obackground,0,1200); } catch(ee) { } try { context.drawImage(obackground,0,1280); } catch(ee) { } try { context.drawImage(obackground,0,1360); } catch(ee) { } try { context.drawImage(obackground,0,1440); } catch(ee) { } try { context.drawImage(obackground,0,1520); } catch(ee) { } try { context.drawImage(obackground,80,0); } catch(ee) { } try { context.drawImage(obackground,80,80); } catch(ee) { } try { context.drawImage(obackground,80,160); } catch(ee) { } try { context.drawImage(obackground,80,240); } catch(ee) { } try { context.drawImage(obackground,80,320); } catch(ee) { } try { context.drawImage(obackground,80,400); } catch(ee) { } try { context.drawImage(obackground,80,480); } catch(ee) { } try { context.drawImage(obackground,80,560); } catch(ee) { } try { context.drawImage(obackground,80,640); } catch(ee) { } try { context.drawImage(obackground,80,720); } catch(ee) { } try { context.drawImage(obackground,80,800); } catch(ee) { } try { context.drawImage(obackground,80,880); } catch(ee) { } try { context.drawImage(obackground,80,960); } catch(ee) { } try { context.drawImage(obackground,80,1040); } catch(ee) { } try { context.drawImage(obackground,80,1120); } catch(ee) { } try { context.drawImage(obackground,80,1200); } catch(ee) { } try { context.drawImage(obackground,80,1280); } catch(ee) { } try { context.drawImage(obackground,80,1360); } catch(ee) { } try { context.drawImage(obackground,80,1440); } catch(ee) { } try { context.drawImage(obackground,80,1520); } catch(ee) { } try { context.drawImage(obackground,160,0); } catch(ee) { } try { context.drawImage(obackground,160,80); } catch(ee) { } try { context.drawImage(obackground,160,160); } catch(ee) { } try { context.drawImage(obackground,160,240); } catch(ee) { } try { context.drawImage(obackground,160,320); } catch(ee) { } try { context.drawImage(obackground,160,400); } catch(ee) { } try { context.drawImage(obackground,160,480); } catch(ee) { } try { context.drawImage(obackground,160,560); } catch(ee) { } try { context.drawImage(obackground,160,640); } catch(ee) { } try { context.drawImage(obackground,160,720); } catch(ee) { } try { context.drawImage(obackground,160,800); } catch(ee) { } try { context.drawImage(obackground,160,880); } catch(ee) { } try { context.drawImage(obackground,160,960); } catch(ee) { } try { context.drawImage(obackground,160,1040); } catch(ee) { } try { context.drawImage(obackground,160,1120); } catch(ee) { } try { context.drawImage(obackground,160,1200); } catch(ee) { } try { context.drawImage(obackground,160,1280); } catch(ee) { } try { context.drawImage(obackground,160,1360); } catch(ee) { } try { context.drawImage(obackground,160,1440); } catch(ee) { } try { context.drawImage(obackground,160,1520); } catch(ee) { } try { context.drawImage(obackground,240,0); } catch(ee) { } try { context.drawImage(obackground,240,80); } catch(ee) { } try { context.drawImage(obackground,240,160); } catch(ee) { } try { context.drawImage(obackground,240,240); } catch(ee) { } try { context.drawImage(obackground,240,320); } catch(ee) { } try { context.drawImage(obackground,240,400); } catch(ee) { } try { context.drawImage(obackground,240,480); } catch(ee) { } try { context.drawImage(obackground,240,560); } catch(ee) { } try { context.drawImage(obackground,240,640); } catch(ee) { } try { context.drawImage(obackground,240,720); } catch(ee) { } try { context.drawImage(obackground,240,800); } catch(ee) { } try { context.drawImage(obackground,240,880); } catch(ee) { } try { context.drawImage(obackground,240,960); } catch(ee) { } try { context.drawImage(obackground,240,1040); } catch(ee) { } try { context.drawImage(obackground,240,1120); } catch(ee) { } try { context.drawImage(obackground,240,1200); } catch(ee) { } try { context.drawImage(obackground,240,1280); } catch(ee) { } try { context.drawImage(obackground,240,1360); } catch(ee) { } try { context.drawImage(obackground,240,1440); } catch(ee) { } try { context.drawImage(obackground,240,1520); } catch(ee) { } try { context.drawImage(obackground,320,0); } catch(ee) { } try { context.drawImage(obackground,320,80); } catch(ee) { } try { context.drawImage(obackground,320,160); } catch(ee) { } try { context.drawImage(obackground,320,240); } catch(ee) { } try { context.drawImage(obackground,320,320); } catch(ee) { } try { context.drawImage(obackground,320,400); } catch(ee) { } try { context.drawImage(obackground,320,480); } catch(ee) { } try { context.drawImage(obackground,320,560); } catch(ee) { } try { context.drawImage(obackground,320,640); } catch(ee) { } try { context.drawImage(obackground,320,720); } catch(ee) { } try { context.drawImage(obackground,320,800); } catch(ee) { } try { context.drawImage(obackground,320,880); } catch(ee) { } try { context.drawImage(obackground,320,960); } catch(ee) { } try { context.drawImage(obackground,320,1040); } catch(ee) { } try { context.drawImage(obackground,320,1120); } catch(ee) { } try { context.drawImage(obackground,320,1200); } catch(ee) { } try { context.drawImage(obackground,320,1280); } catch(ee) { } try { context.drawImage(obackground,320,1360); } catch(ee) { } try { context.drawImage(obackground,320,1440); } catch(ee) { } try { context.drawImage(obackground,320,1520); } catch(ee) { } try { context.drawImage(obackground,400,0); } catch(ee) { } try { context.drawImage(obackground,400,80); } catch(ee) { } try { context.drawImage(obackground,400,160); } catch(ee) { } try { context.drawImage(obackground,400,240); } catch(ee) { } try { context.drawImage(obackground,400,320); } catch(ee) { } try { context.drawImage(obackground,400,400); } catch(ee) { } try { context.drawImage(obackground,400,480); } catch(ee) { } try { context.drawImage(obackground,400,560); } catch(ee) { } try { context.drawImage(obackground,400,640); } catch(ee) { } try { context.drawImage(obackground,400,720); } catch(ee) { } try { context.drawImage(obackground,400,800); } catch(ee) { } try { context.drawImage(obackground,400,880); } catch(ee) { } try { context.drawImage(obackground,400,960); } catch(ee) { } try { context.drawImage(obackground,400,1040); } catch(ee) { } try { context.drawImage(obackground,400,1120); } catch(ee) { } try { context.drawImage(obackground,400,1200); } catch(ee) { } try { context.drawImage(obackground,400,1280); } catch(ee) { } try { context.drawImage(obackground,400,1360); } catch(ee) { } try { context.drawImage(obackground,400,1440); } catch(ee) { } try { context.drawImage(obackground,400,1520); } catch(ee) { } try { context.drawImage(obackground,480,0); } catch(ee) { } try { context.drawImage(obackground,480,80); } catch(ee) { } try { context.drawImage(obackground,480,160); } catch(ee) { } try { context.drawImage(obackground,480,240); } catch(ee) { } try { context.drawImage(obackground,480,320); } catch(ee) { } try { context.drawImage(obackground,480,400); } catch(ee) { } try { context.drawImage(obackground,480,480); } catch(ee) { } try { context.drawImage(obackground,480,560); } catch(ee) { } try { context.drawImage(obackground,480,640); } catch(ee) { } try { context.drawImage(obackground,480,720); } catch(ee) { } try { context.drawImage(obackground,480,800); } catch(ee) { } try { context.drawImage(obackground,480,880); } catch(ee) { } try { context.drawImage(obackground,480,960); } catch(ee) { } try { context.drawImage(obackground,480,1040); } catch(ee) { } try { context.drawImage(obackground,480,1120); } catch(ee) { } try { context.drawImage(obackground,480,1200); } catch(ee) { } try { context.drawImage(obackground,480,1280); } catch(ee) { } try { context.drawImage(obackground,480,1360); } catch(ee) { } try { context.drawImage(obackground,480,1440); } catch(ee) { } try { context.drawImage(obackground,480,1520); } catch(ee) { } try { context.drawImage(obackground,560,0); } catch(ee) { } try { context.drawImage(obackground,560,80); } catch(ee) { } try { context.drawImage(obackground,560,160); } catch(ee) { } try { context.drawImage(obackground,560,240); } catch(ee) { } try { context.drawImage(obackground,560,320); } catch(ee) { } try { context.drawImage(obackground,560,400); } catch(ee) { } try { context.drawImage(obackground,560,480); } catch(ee) { } try { context.drawImage(obackground,560,560); } catch(ee) { } try { context.drawImage(obackground,560,640); } catch(ee) { } try { context.drawImage(obackground,560,720); } catch(ee) { } try { context.drawImage(obackground,560,800); } catch(ee) { } try { context.drawImage(obackground,560,880); } catch(ee) { } try { context.drawImage(obackground,560,960); } catch(ee) { } try { context.drawImage(obackground,560,1040); } catch(ee) { } try { context.drawImage(obackground,560,1120); } catch(ee) { } try { context.drawImage(obackground,560,1200); } catch(ee) { } try { context.drawImage(obackground,560,1280); } catch(ee) { } try { context.drawImage(obackground,560,1360); } catch(ee) { } try { context.drawImage(obackground,560,1440); } catch(ee) { } try { context.drawImage(obackground,560,1520); } catch(ee) { } try { context.drawImage(obackground,640,0); } catch(ee) { } try { context.drawImage(obackground,640,80); } catch(ee) { } try { context.drawImage(obackground,640,160); } catch(ee) { } try { context.drawImage(obackground,640,240); } catch(ee) { } try { context.drawImage(obackground,640,320); } catch(ee) { } try { context.drawImage(obackground,640,400); } catch(ee) { } try { context.drawImage(obackground,640,480); } catch(ee) { } try { context.drawImage(obackground,640,560); } catch(ee) { } try { context.drawImage(obackground,640,640); } catch(ee) { } try { context.drawImage(obackground,640,720); } catch(ee) { } try { context.drawImage(obackground,640,800); } catch(ee) { } try { context.drawImage(obackground,640,880); } catch(ee) { } try { context.drawImage(obackground,640,960); } catch(ee) { } try { context.drawImage(obackground,640,1040); } catch(ee) { } try { context.drawImage(obackground,640,1120); } catch(ee) { } try { context.drawImage(obackground,640,1200); } catch(ee) { } try { context.drawImage(obackground,640,1280); } catch(ee) { } try { context.drawImage(obackground,640,1360); } catch(ee) { } try { context.drawImage(obackground,640,1440); } catch(ee) { } try { context.drawImage(obackground,640,1520); } catch(ee) { } try { context.drawImage(obackground,720,0); } catch(ee) { } try { context.drawImage(obackground,720,80); } catch(ee) { } try { context.drawImage(obackground,720,160); } catch(ee) { } try { context.drawImage(obackground,720,240); } catch(ee) { } try { context.drawImage(obackground,720,320); } catch(ee) { } try { context.drawImage(obackground,720,400); } catch(ee) { } try { context.drawImage(obackground,720,480); } catch(ee) { } try { context.drawImage(obackground,720,560); } catch(ee) { } try { context.drawImage(obackground,720,640); } catch(ee) { } try { context.drawImage(obackground,720,720); } catch(ee) { } try { context.drawImage(obackground,720,800); } catch(ee) { } try { context.drawImage(obackground,720,880); } catch(ee) { } try { context.drawImage(obackground,720,960); } catch(ee) { } try { context.drawImage(obackground,720,1040); } catch(ee) { } try { context.drawImage(obackground,720,1120); } catch(ee) { } try { context.drawImage(obackground,720,1200); } catch(ee) { } try { context.drawImage(obackground,720,1280); } catch(ee) { } try { context.drawImage(obackground,720,1360); } catch(ee) { } try { context.drawImage(obackground,720,1440); } catch(ee) { } try { context.drawImage(obackground,720,1520); } catch(ee) { } try { context.drawImage(obackground,800,0); } catch(ee) { } try { context.drawImage(obackground,800,80); } catch(ee) { } try { context.drawImage(obackground,800,160); } catch(ee) { } try { context.drawImage(obackground,800,240); } catch(ee) { } try { context.drawImage(obackground,800,320); } catch(ee) { } try { context.drawImage(obackground,800,400); } catch(ee) { } try { context.drawImage(obackground,800,480); } catch(ee) { } try { context.drawImage(obackground,800,560); } catch(ee) { } try { context.drawImage(obackground,800,640); } catch(ee) { } try { context.drawImage(obackground,800,720); } catch(ee) { } try { context.drawImage(obackground,800,800); } catch(ee) { } try { context.drawImage(obackground,800,880); } catch(ee) { } try { context.drawImage(obackground,800,960); } catch(ee) { } try { context.drawImage(obackground,800,1040); } catch(ee) { } try { context.drawImage(obackground,800,1120); } catch(ee) { } try { context.drawImage(obackground,800,1200); } catch(ee) { } try { context.drawImage(obackground,800,1280); } catch(ee) { } try { context.drawImage(obackground,800,1360); } catch(ee) { } try { context.drawImage(obackground,800,1440); } catch(ee) { } try { context.drawImage(obackground,800,1520); } catch(ee) { } try { context.drawImage(obackground,880,0); } catch(ee) { } try { context.drawImage(obackground,880,80); } catch(ee) { } try { context.drawImage(obackground,880,160); } catch(ee) { } try { context.drawImage(obackground,880,240); } catch(ee) { } try { context.drawImage(obackground,880,320); } catch(ee) { } try { context.drawImage(obackground,880,400); } catch(ee) { } try { context.drawImage(obackground,880,480); } catch(ee) { } try { context.drawImage(obackground,880,560); } catch(ee) { } try { context.drawImage(obackground,880,640); } catch(ee) { } try { context.drawImage(obackground,880,720); } catch(ee) { } try { context.drawImage(obackground,880,800); } catch(ee) { } try { context.drawImage(obackground,880,880); } catch(ee) { } try { context.drawImage(obackground,880,960); } catch(ee) { } try { context.drawImage(obackground,880,1040); } catch(ee) { } try { context.drawImage(obackground,880,1120); } catch(ee) { } try { context.drawImage(obackground,880,1200); } catch(ee) { } try { context.drawImage(obackground,880,1280); } catch(ee) { } try { context.drawImage(obackground,880,1360); } catch(ee) { } try { context.drawImage(obackground,880,1440); } catch(ee) { } try { context.drawImage(obackground,880,1520); } catch(ee) { } try { context.drawImage(obackground,960,0); } catch(ee) { } try { context.drawImage(obackground,960,80); } catch(ee) { } try { context.drawImage(obackground,960,160); } catch(ee) { } try { context.drawImage(obackground,960,240); } catch(ee) { } try { context.drawImage(obackground,960,320); } catch(ee) { } try { context.drawImage(obackground,960,400); } catch(ee) { } try { context.drawImage(obackground,960,480); } catch(ee) { } try { context.drawImage(obackground,960,560); } catch(ee) { } try { context.drawImage(obackground,960,640); } catch(ee) { } try { context.drawImage(obackground,960,720); } catch(ee) { } try { context.drawImage(obackground,960,800); } catch(ee) { } try { context.drawImage(obackground,960,880); } catch(ee) { } try { context.drawImage(obackground,960,960); } catch(ee) { } try { context.drawImage(obackground,960,1040); } catch(ee) { } try { context.drawImage(obackground,960,1120); } catch(ee) { } try { context.drawImage(obackground,960,1200); } catch(ee) { } try { context.drawImage(obackground,960,1280); } catch(ee) { } try { context.drawImage(obackground,960,1360); } catch(ee) { } try { context.drawImage(obackground,960,1440); } catch(ee) { } try { context.drawImage(obackground,960,1520); } catch(ee) { } try { context.drawImage(oborder,0,0); } catch(ee) { } try { context.drawImage(oborder,0,1508); } catch(ee) { } try { context.drawImage(oborder,880,0); } catch(ee) { } try { context.drawImage(oborder,880,1508); } catch(ee) { } document.getElementById('myimage').src=elem.toDataURL(); } setTimeout(alat,6000);
for (iw=0; iw<=pw; iw+=80) {
for (ih=0; ih<=ph; ih+=80) {
context.drawImage(obackground,iw,ih);
}
}
for (iw=0; iw<=eval(-80 + pw); iw+=eval(-80 + pw)) {
for (ih=0; ih<=eval(-80 + ph); ih+=eval(-80 + ph)) {
context.drawImage(oborder,iw,ih);
}
}
if (document.getElementById('myimage')) { try { document.getElementById('myimage').src=elem.toDataURL(); } catch(eee) { document.getElementById('myimage').style.zIndex='0'; document.getElementById('myimage').style.display='none'; } }
}
}

function onl() {
var isuff='';
pw=900;
ph=900;
iw=0;
ih=0;
document.getElementById('aemail').href+=encodeURIComponent(document.URL.split('#')[0].split('?')[0] + '?canvas=');
wasa=document.getElementById('aemail').href;
var iammobile=location.search.split('iammobile=')[1] ? decodeURIComponent(location.search.split('iammobile=')[1].split('&')[0]) : '';
var canvis=location.search.split('canvas=')[1] ? decodeURIComponent(location.search.split('canvas=')[1].split('&')[0]) : '';
if (canvis != '') {
if (canvis.indexOf('width:') != -1) {
pw=eval(canvis.split('width:')[1].split('px')[0]);
}
if (canvis.indexOf('height:') != -1) {
ph=eval(canvis.split('height:')[1].split('px')[0]);
}
var huhs=canvis.replace(/\-image-source\:/g,'-image:').replace(/\-image\:\ url/g,'-image:url').split('background-image:');
var huhstwo=canvis.replace(/\-image-source\:/g,'-image:').replace(/\-image\:\ url/g,'-image:url').split('border-image:');
//alert('' + canvis.replace(/canvas/g,'body').indexOf('border-image:') + ' ... ' + canvis.replace(/canvas/g,'body'));
if (('' + document.referrer).indexOf('/right') != -1 && iammobile == '') {
var woo=null;
if (whereto.indexOf('ifb') != -1) {
canvis=canvis.replace('<canvas ','<canvas width=' + pw + ' height=' + ph + ' ').replace('<body ','<body width=' + pw + ' height=' + ph + ' ');
//document.getElementById('dfoot').innerHTML='<hr>';
//document.getElementById('ifb').style.top='' + ph + 'px';
document.getElementById('ifbx').style.zIndex='9';
document.getElementById('ifb').style.display='block';
location.href='#ifb';
woo=window.open('','ifb');
} else {
canvis=canvis.replace('<canvas ','<canvas width=' + pw + ' height=' + ph + ' ').replace('<body ','<body width=' + pw + ' height=' + ph + ' ');
woo=eval("window.open(''," + whereto + ")"); // '_blank','top=0,left=0,width=900,height=900');
}
canvis+="<scr" + "ipt type='text/javascript'> function alat() { elem=document.getElementById('mycanvas'); context=elem.getContext('2d'); if (document.getElementById('iborder')) { oborder=document.getElementById('iborder'); } if (document.getElementById('ibackground')) { obackground=document.getElementById('ibackground'); } } setTimeout(alat,2000); </scr" + "ipt>";
if (huhs.length > 1) {
for (iw=0; iw<=pw; iw+=80) {
for (ih=0; ih<=ph; ih+=80) {
canvis=canvis.replace(" } setTimeout(", " context.drawImage(obackground," + iw + "," + ih + "); } setTimeout(");
}
}
}
if (huhstwo.length > 1) {
for (iw=0; iw<=eval(-80 + pw); iw+=eval(-80 + pw)) {
for (ih=0; ih<=eval(-80 + ph); ih+=eval(-80 + ph)) {
canvis=canvis.replace(" } setTimeout(", " context.drawImage(oborder," + iw + "," + ih + "); } setTimeout(");
}
}
}
if (huhs.length > 1) {
isuff+="<iframe style='display:none;' src='right_bottom.php?parenti=ibackground&image=" + encodeURIComponent(huhs[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'').replace('https:','').replace('http:','')) + "'></iframe>";
}
if (huhstwo.length > 1) {
isuff+="<iframe style='display:none;' src='right_bottom.php?parenti=iborder&image=" + encodeURIComponent(huhstwo[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'').replace('https:','').replace('http:','')) + "'></iframe>";
}
woo.document.write(canvis); //.replace(/canvas/g,'body');
//alert(document.body.innerHTML);
if (huhs.length > 1) {
woo.document.body.innerHTML+="<img style='display:none;' id=ibackground src='" + huhs[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'').replace('https:','').replace('http:','') + "'></img>";
}
if (huhstwo.length > 1) {
woo.document.body.innerHTML+="<img style='display:none;' id=iborder src='" + huhstwo[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'').replace('https:','').replace('http:','') + "'></img>";
}
if (isuff != "") { woo.document.body.innerHTML+=isuff; }
return '';
} else if ((iammobile + ' ').toLowerCase().substring(0,1) == 'y') {
if (huhs.length > 1) {
isuff+="<iframe style='display:none;' src='right_bottom.php?parenti=ibackground&image=" + encodeURIComponent(huhs[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'').replace('https:','').replace('http:','')) + "'></iframe>";
}
if (huhstwo.length > 1) {
isuff+="<iframe style='display:none;' src='right_bottom.php?parenti=iborder&image=" + encodeURIComponent(huhstwo[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'').replace('https:','').replace('http:','')) + "'></iframe>";
}
var huhst="border:" + canvis.split("border:")[1].split('"')[0];
canvis=canvis.replace(huhst,'').replace('<canvas ','<canvas width=' + pw + ' height=' + ph + ' ').replace('<body ','<body width=' + pw + ' height=' + ph + ' ');
var icanvas=canvis.replace('<canvas','<img').replace('></canvas>',' src=""></img>').replace('mycanvas','myimage').replace('z-index:','z-index:9');
if (1 == 2) {
canvis+="<scr" + "ipt type='text/javascript'> var elem=null, context=null, oborder=null, obackground=null; function alat() { elem=document.getElementById('mycanvas'); context=elem.getContext('2d'); if (document.getElementById('iborder')) { oborder=document.getElementById('iborder'); } if (document.getElementById('ibackground')) { obackground=document.getElementById('ibackground'); } } setTimeout(alat,6000); </scr" + "ipt>";
if (huhs.length > 1) {
for (iw=0; iw<=pw; iw+=80) {
for (ih=0; ih<=ph; ih+=80) {
canvis=canvis.replace(" } setTimeout(", " try { context.drawImage(obackground," + iw + "," + ih + "); } catch(ee) { } } setTimeout(");
}
}
}
if (huhstwo.length > 1) {
for (iw=0; iw<=eval(-80 + pw); iw+=eval(-80 + pw)) {
for (ih=0; ih<=eval(-80 + ph); ih+=eval(-80 + ph)) {
canvis=canvis.replace(" } setTimeout(", " try { context.drawImage(oborder," + iw + "," + ih + "); } catch(ee) { } } setTimeout(");
}
}
}
canvis=canvis.replace(" } setTimeout(", " document.getElementById('myimage').src=elem.toDataURL(); } setTimeout(");
}
if (huhs.length > 1) {
//alert("url(" + huhs[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'') + ")");
//document.body.style.backgroundImage="url('" + huhs[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'').replace('https:','').replace('http:','') + "')";
if (!document.getElementById('ibackground') || 1 == 1) {
icanvas+="<img style='display:none;' id=ibackground src='" + huhs[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'').replace('https:','').replace('http:','') + "'></img>";
} else {
document.getElementById('ibackground').src=huhs[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'').replace('https:','').replace('http:','');
}
}
if (huhstwo.length > 1) {
//document.body.style.borderImage="url('" + huhstwo[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'').replace('https:','').replace('http:','') + "')";
if (!document.getElementById('iborder') || 1 == 1) {
icanvas+="<img style='display:none;' id=iborder src='" + huhstwo[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'').replace('https:','').replace('http:','') + "'></img>";
} else {
document.getElementById('iborder').src=huhstwo[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'').replace('https:','').replace('http:','');
}
//document.body.innerHTML+=("<style> body { border-image:url('" + huhstwo[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'') + "') 100% round; border-image-repeat: repeat; </style>");
//alert("URL(" + huhstwo[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'') + ")");
}
document.body.innerHTML=icanvas.replace(' style="',' style="position:absolute;top:0px;left:0px;') + canvis.replace(' style="',' style="position:absolute;top:0px;left:0px;') + isuff; //.replace(/canvas/g,'body');
//alert(document.body.innerHTML);
huhs=[];
huhstwo=[];
setTimeout(blat,6000);
} else {
document.body.innerHTML=canvis.replace(/canvas/g,'body');
}
// document.write(canvis.replace(/canvas/g,'body'));
if (huhs.length > 1) {
//alert("url(" + huhs[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'') + ")");
document.body.style.backgroundImage="url('" + huhs[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'').replace('https:','').replace('http:','') + "')";
if (!document.getElementById('ibackground')) {
document.body.innerHTML+="<img style='display:none;' id=ibackground src='" + huhs[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'').replace('https:','').replace('http:','') + "'></img>";
} else {
document.getElementById('ibackground').src=huhs[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'').replace('https:','').replace('http:','');
}
}
if (huhstwo.length > 1) {
document.body.style.borderImage="url('" + huhstwo[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'').replace('https:','').replace('http:','') + "')";
if (!document.getElementById('iborder')) {
document.body.innerHTML+="<img style='display:none;' id=iborder src='" + huhstwo[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'').replace('https:','').replace('http:','') + "'></img>";
} else {
document.getElementById('iborder').src=huhstwo[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'').replace('https:','').replace('http:','');
}
//document.body.innerHTML+=("<style> body { border-image:url('" + huhstwo[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'') + "') 100% round; border-image-repeat: repeat; </style>");
//alert("URL(" + huhstwo[1].trim().replace('url(','').split(')')[0].replace('"','').replace('"','').replace("'",'').replace("'",'') + ")");
}
if (document.getElementById('iborder') || document.getElementById('ibackground')) {

//alert(canvis);
//alert(document.referrer + ' ... ' + canvis);
}

}
}
</script>
</head>
<body onload='onl();' id='myb' style=" display: block; text-align: bottom; ">
<div id=dhead style='background-color: yellow;'>
<h1>Emoji Border and/or Background Image to <a id=tc title='Toggle between body and canvas' style='text-decoration:underline;cursor:pointer;' onclick=" if (cmode == 'body') { this.innerHTML='Body'; cmode=doct('canvas'); } else { this.innerHTML='Email and Canvas'; cmode=doct('body'); } ">Email and Canvas</a></h1>
<h3>RJM Programming <a title='Toggle between border and background' style='text-decoration:underline;cursor:pointer;' onclick=" if (bmode == 'border') { bmode='background'; } else { bmode='border'; } ">-</a> August, 2018</h4>
<h4>Emoji <a target="_blank" title="Other ways to paste Emojis" href="https://www.google.com.au/search?q=emoji+keyboard+shortcuts&ie=utf-8&oe=utf-8&client=firefox-b-ab&gfe_rd=cr&dcr=0&ei=x7JKWsrFGcHN8gfBy5rABw">placement</a> advice, in field below, for border or background image, thanks to <a target=_blank title='Emoji CSS' href='https://afeld.github.io/emoji-css/'>Emoji CSS</a>.</h4>
<div placeholder='Ideally enter HTML Entity (Hex) lowercase but can place an Emoji from an Emoji placement menu also' id='myr' contenteditable='true' onblur='analyze(this);' style='border: 1px solid blue;' title='Ideally enter HTML Entity (Hex) lowercase but can place an Emoji from an Emoji placement menu also'>1f44d</div>
</div>
<iframe frameborder=0 id=ifb name=ifb src='' style='display:none;z-index:-7;width:100px;height:900px;'></iframe>
<iframe frameborder=1 id=ifbx name=ifbx src='' style='display:none;z-index:-7;width:100px;height:900px;'></iframe>
<a href='mailto:?subject=Emoji%20Creation&body=' style='display:none;' id='aemail'>Email</a>
<img id=iborder src='' style='display:none;'></img>
<img id=ibackground src='' style='display:none;'></img>
</body>
</html>