// <div id="productAfbeelding">...<img attrs />...</div> wordt:
// <div id="productAfbeelding">
//   <div id="topRight"></div>
//   <img attrs />
//   <div id="bottomLeft"></div>
// </div>

function addshadow() {
    var shadowDiv = document.getElementById("productAfbeelding");
    if(!shadowDiv) return;
	
    var imgArr = shadowDiv.getElementsByTagName("img");
    var img = imgArr[0];
    if(!img) return;

    shadowDiv.style.width = (img.width + 10) + "px";

    var divTopRight = document.createElement("div");
	divTopRight.setAttribute('id', 'topRight');
	divTopRight.style.width = (img.width + 10) + "px";

	var divBottomLeft = document.createElement("div");
	divBottomLeft.setAttribute('id', 'bottomLeft');
	
	var parent = img.parentNode;
	parent.insertBefore(divTopRight, img);
	parent.insertBefore(divBottomLeft, img.nextSibling);
}

if(window.addEventListener) {
	window.addEventListener("load", addshadow, false);
} else {
	window.attachEvent('onload', addshadow);
}