function addListener(el, act, func) {
	if (window.addEventListener) {el.addEventListener(act,func,false);}
	else if (window.attachEvent) {el.attachEvent ("on"+act,func);}
	else { eval("el.on"+act+" = func;");}
}
var El={
	get:function(id){
		if(typeof id=="string"){return document.getElementById(id);}
		if(id.style) return id;
		return false;
	},
	create:function(tag,attrs){
		var el=attrs?document.createElement(tag):document.createTextNode(tag);
		for(var i in attrs) { el[i]=attrs[i]; }
		return el;
	},
	place:function(el,pos,point){
		var P=point.parentNode;
		if(!P) return;
		switch(pos){
			case "after":P.insertBefore(el,point.nextSibling);break;
			case "before":P.insertBefore(el,point);break;
			case "wrap":P.insertBefore(el,point);el.appendChild(point);break;
			case "in":point.appendChild(el);break;
		}
	},
	replace:function(el1,el2){
		this.place(el2,"before",el1);
		this.erase(el1);
	},
	erase:function(el){ el.parentNode.removeChild(el);},
	style:function(el,attrs){ for(var i in attrs){ el.style[i]=attrs[i]; }}
}
addListener(window, "load", function(e) {
	var img;
        var i = document.images.length-1; do {
		img = document.images[i];
		if (/fkphotos/.test(img.src)) {
			if (img.width == 100 && img.height == 100) {
				img.className = "shadow100x100";
// 				img.style.padding = "8px 10px 12px 10px";
// 				img.style.background = "transparent url(\''.site_url().'/border100x100b.gif\') no-repeat scroll top left";
			} else if (img.width > 0 && img.height > 0) {
				var el = img;
				var l=El.create("div",{className:"shadowBlock"});
				El.style(l, {width: (img.width+20)+"px", height: (img.height+20)+"px"});
				El.place(l,"wrap", el);

				El.place(El.create("div",{className:"shadowBlockTopLeft"}),"before", el);
				var l=El.create("div",{className:"shadowBlockTopCenter"})
				El.style(l, {width: (img.width)+"px"});
				El.place(l,"before", el);
				El.place(El.create("div",{className:"shadowBlockTopRight"}),"before", el);

				var l=El.create("div",{className:"shadowBlockMiddleLeft"})
				El.style(l, {height: (img.height)+"px"});
				El.place(l,"before", el);
				el.className = "shadowBlockMiddleCenter";
				var l=El.create("div",{className:"shadowBlockMiddleRight"})
				El.style(l, {height: (img.height)+"px"});
				El.place(l,"after", el);

				El.place(El.create("div",{className:"shadowBlockBottomLeft"}),"after", el);
				var l=El.create("div",{className:"shadowBlockBottomCenter"})
				El.style(l, {width: (img.width)+"px"});
				El.place(l, "after", el);
				El.place(El.create("div",{className:"shadowBlockBottomRight"}),"after", el);
			}
		}
        } while (i--);

});