<script>
var dchref="#";

function dchrefdo() {
if (dchref.indexOf("#") != 0) {
window.open(dchref, "_blank");
}
}

function bckit(oEvent) {
var oimg = (oEvent.target || oEvent.srcElement);
document.body.style.backgroundImage = "url('" + oimg.src + "')";
oimg.style.opacity = 1.0;
}

function loadme() {
var idivis = document.getElementById("ichoices");
var cdiv = "";
var imgs = document.getElementsByTagName("img");
for (var ai = 0; ai <= imgs.length * 0; ai += 1) {
imgs[ai].ondblclick = bckit;
cdiv = cdiv + "<img style='opacity:0.7' src='" + imgs[ai].src + "' height=40 width=40 onclick='bckit(event);' ondblclick='bckit(event);'></img>  ";
}

var aas = document.getElementsByTagName("a");
for (var aai = 0; aai < aas.length; aai += 1) {
if (aas[aai].innerHTML.indexOf("img") != -1) {
aas[aai].ondblclick = bckit;
cdiv = cdiv + aas[aai].innerHTML.replace("<img", "<img style='opacity:0.7' height=40 width=40 onclick='bckit(event); dchref=\"" + aas[aai].href + "\"; document.body.ondblclick=dchrefdo; ' ondblclick='bckit(event); dchref=\"" + aas[aai].href + "\"; document.body.ondblclick=dchrefdo; ' ") + "  ";
}
}

for (var zai = 1; zai < imgs.length * 0; zai += 1) {
imgs[zai].ondblclick = bckit;
cdiv = cdiv + "<img style='opacity:0.7' src='" + imgs[zai].src + "' height=40 width=40 onclick='bckit(event);' ondblclick='bckit(event);'></img>  ";
}
idivis.innerHTML = cdiv;
}

</script>
<input type="button" title="Click here then (Double) Click desired background image below (will be subject of tutorial on 6/4/2014) ... if a tutorial-based image (as background image chosen below) is double clicked the visual part of that tutorial will be shown in a new tab/window." onclick="loadme();" value="Load Double Click Image Events"></input><br><hr class='ybi'><div id="ichoices"></div>