/**
* Fix rounded corners on images...
*/
function roundedImages(){
	img = document.getElementsByTagName('img');
	for(i=0;i<img.length;i++){
        if(img[i].border == 1){
        	img[i].style.border = 'none';

        	nid = document.createElement('div');
			nid.className = 'imgRounded_IMAGE';

			stl = "";
			if(img[i].getAttribute("align")){
				nid.style.styleFloat = img[i].getAttribute("align");
				stl+= "float:" + img[i].getAttribute("align") + ";";
            }
			if(img[i].getAttribute("hspace")){
				if(img[i].getAttribute("align") == 'left')
					stl+= "margin-right:" + img[i].getAttribute("hspace") + "px;";
				else if(img[i].getAttribute("align") == 'right')
					stl+= "margin-left:" + img[i].getAttribute("hspace") + "px;";
				else
					stl+= "margin-left:" + img[i].getAttribute("hspace") + "px;margin-right:" + img[i].getAttribute("hspace") + "px;";
			}
			if(img[i].getAttribute("vspace"))
				stl+= "margin-bottom:" + img[i].getAttribute("vspace") + "px;";
			nid.setAttribute("style",stl);

        	nid.style.width = (Math.floor(parseInt(img[i].width) / 2) * 2) + 'px';
        	nid.style.height = (Math.floor(parseInt(img[i].height) / 2) * 2) + 'px';
        	nid.style.backgroundImage = "url(" + img[i].src + ")";

        	w = Math.floor(parseInt(img[i].width) / 2) + 'px';
        	h = Math.floor(parseInt(img[i].height) / 2) + 'px';

        	ntl = document.createElement('div');
			ntl.className = 'imgRounded_TL';

        	ntr = document.createElement('div');
			ntr.className = 'imgRounded_TR';

        	nbl = document.createElement('div');
			nbl.className = 'imgRounded_BL';

        	nbr = document.createElement('div');
			nbr.className = 'imgRounded_BR';

        	nbr.style.width = nbl.style.width = ntl.style.width = ntr.style.width = w;
        	nbr.style.height = nbl.style.height = ntl.style.height = ntr.style.height = h;

            nid.appendChild(ntr);
            nid.appendChild(ntl);
            nid.appendChild(nbr);
            nid.appendChild(nbl);

       		img[i].style.display = 'none';
       		img[i].parentNode.appendChild(nid,img[i]);
		}
	}
}