function _round(objid,radius,border,backcolor,bordercolor){
 	if(typeof(objid)=='string'){
		obj=document.getElementById(objid);
	}else{
		obj=objid;
	}
  
  	var r=(radius) ? radius : 20;
	var b=(border) ? border : 3;
	parent=obj.parentNode;

	if(parent.currentStyle){ // correct for background color ie --runtimeStyle
		while(parent.currentStyle.backgroundColor=='transparent' ) {
			parent=parent.parentNode;
		}
		pbackcolor=parent.currentStyle.backgroundColor;

		pbordercolor = obj.currentStyle.backgroundColor;
	}else{
		
		while(document.defaultView.getComputedStyle(parent,null).backgroundColor=='transparent' ||
			document.defaultView.getComputedStyle(parent,null).backgroundColor=='rgba(0, 0, 0, 0)') {
			parent=parent.parentNode;
		}
		pbackcolor=document.defaultView.getComputedStyle(parent,null).backgroundColor;

		pbordercolor=document.defaultView.getComputedStyle(obj,null).backgroundColor;

		//pbordercolor = getComputedStyle(obj,'').getPropertyValue('background-color');
	}
	


	var bg=(backcolor) ? backcolor :pbackcolor;
	var bc=(bordercolor) ? bordercolor : pbordercolor;
	var parent=obj.parentNode || obj.parent;
	var objHeight = obj.offsetHeight;

	// top border
	var elm=document.createElement('div');
	elm.style.position='absolute';
	elm.style.width=(obj.offsetWidth-parseInt((r-b)*2))+"px";
	elm.style.height=b+"px";
	elm.style.backgroundColor=bc;
	elm.style.top="0px";
	elm.style.borderWidth ="0px "+(r-b)+"px 0px "+(r-b)+"px";
	elm.style.borderStyle = 'solid';
	elm.style.borderColor=bg;
	elm.style.left="0px";
    obj.appendChild(elm);

	// bottom border
	var elmb=elm.cloneNode(true);
	elmb.style.top = (objHeight-b)+"px";
    obj.appendChild(elmb);//
    
	// left borders
	var elml=elmb.cloneNode(true);
	elml.style.width=b+"px";
	elml.style.height = (objHeight-(r*2))+2+"px";
	elml.style.borderWidth='0px';
	elml.style.top =r-1+"px";
    obj.appendChild(elml);//
    
    //right border
	var elmr=elml.cloneNode(true);
	elmr.style.left=(obj.offsetWidth-b)+"px";
    obj.appendChild(elmr);//
    
  var matrix = new Array();
   matrix[20] = new Array(20, 14, 11, 9, 8, 7, 6, 5, 4, 3, 3, 2, 2, 1, 1, 1, 0, 0, 0, 0, 0); 
   matrix[19] = new Array(19, 13, 11, 9, 7, 6, 5, 4, 4, 3, 2, 2, 1, 1, 1, 0, 0, 0, 0, 0);
   matrix[18] = new Array(18, 12, 10, 8, 7, 6, 5, 4, 3, 2, 2, 1, 1, 1, 0, 0, 0, 0, 0);
   matrix[17] = new Array(17, 11,  9, 7, 6, 5, 4, 3, 3, 2, 2, 1, 1, 0, 0, 0, 0, 0);
   matrix[16] = new Array(16, 10,  8, 7, 5, 4, 4, 3, 2, 2, 1, 1, 1, 0, 0, 0, 0);
   matrix[15] = new Array(15, 10,  8, 6, 5, 4, 3, 2, 2, 1, 1, 1, 0, 0, 0, 0);
   matrix[14] = new Array(14,  9,  7, 5, 4, 3, 3, 2, 2, 1, 1, 0, 0, 0, 0);
   matrix[13] = new Array(13,  8,  6, 5, 4, 3, 2, 1, 1, 1, 0, 0, 0, 0);
   matrix[12] = new Array(12,  7,  5, 4, 3, 2, 2, 1, 1, 0, 0, 0, 0);
   matrix[11] = new Array(11,  7,  5, 3, 2, 2, 1, 1, 0, 0, 0, 0);
   matrix[10] = new Array(10,  6,  4, 3, 2, 1, 1, 0, 0, 0, 0);
   matrix[9]  = new Array( 9,  5,  3, 2, 2, 1, 1, 0, 0, 0);
   matrix[8]  = new Array( 8,  4,  3, 2, 1, 1, 0, 0, 0);
   matrix[7]  = new Array( 7,  3,  2, 1, 1, 0, 0, 0);
   matrix[6]  = new Array( 6,  3,  2, 1, 0, 0, 0);
   matrix[5]  = new Array( 5,  2,  1, 0, 0, 0);
   matrix[4]  = new Array( 4,  1,  1, 0, 0);
   matrix[3]  = new Array( 3,  1,  0, 0);
   matrix[2]  = new Array( 2,  0,  0);
   matrix[1]  = new Array();
	// corners
var debug='';

	var start=matrix[r];
	var end=matrix[r-b];
	var trigger=0;
	for (c=0 ; c < r-1 ; c++){
		bw=start[c+1];// the width of the background
		if(c < b-1){
			w=start[0]-bw;//width of the border
		}else{
			w=end[c-(b-1)]+b-bw;
		}
		//w = Math.round(r*(1-Math.cos(Math.asin(c/r))));
debug+=" - "+bw+" "+w;

		//top left
		var bgelm=document.createElement('div');
		bgelm.style.position='absolute';
		bgelm.style.width=bw+"px";
		bgelm.style.height="1px";
		bgelm.style.top=c+"px";
		bgelm.style.left="0px";
		bgelm.style.backgroundColor=bg;
   		obj.appendChild(bgelm);
		var boelm=bgelm.cloneNode(true);
		boelm.style.left=bw+"px";
		boelm.style.width=w+"px";
		boelm.style.backgroundColor=bc;
	   	obj.appendChild(boelm);

		// bottom left
		var blgelm=bgelm.cloneNode(true);
		blgelm.style.top = (objHeight-(c+1))+"px";
    	obj.appendChild(blgelm);
    	var bloelm=boelm.cloneNode(true);
		bloelm.style.top = (objHeight-(c+1))+"px";


    	obj.appendChild(bloelm);

		// top right
		var trelm=bgelm.cloneNode(true);
		trelm.style.left=(obj.offsetWidth-bw)+"px";
    	obj.appendChild(trelm);
		var troelm=boelm.cloneNode(true);
		troelm.style.left=(obj.offsetWidth-(w+bw))+"px";
    	obj.appendChild(troelm);
  
    	//bottom right
		var brgelm=trelm.cloneNode(true);
		brgelm.style.top = (objHeight-(c+1))+"px";
    	obj.appendChild(brgelm);
		var broelm=troelm.cloneNode(true);
		broelm.style.top = (objHeight-(c+1))+"px";
    	obj.appendChild(broelm);

	}
//alert(debug)
}
function pset(x,y,wi,he)
{
  document.write ("<img src='1x1.gif' style='z-index:-10; position:absolute; left:"+x+";top:"+y+";width:"+wi+";height:"+he+";background:rgb("+r+","+g+","+b+")'>") 
}



