/*||               ROUNDED CORNERS            V2.0 ||*/
/*|||||||||||||||||||||||||||||||||||||||||||||||||||*/
/*||                                               ||*/
/*|| IMPLIMENTATION:                               ||*/
/*||    Simply add this to the element you wish to ||*/
/*||    create add corners to:                     ||*/
/*||         csscorners="tl,tr,bl,br"              ||*/
/*||    Where tl,tr,bl,br are the corners to be    ||*/
/*||    rounded. tl is top left, etc...            ||*/
/*||                                               ||*/
/*||    Then simply include the CSS shown below    ||*/
/*||    with the last line edited to match the     ||*/
/*||    div you are rounding, and the colors you   ||*/
/*||    wish to use!                               ||*/
/*||                                               ||*/
/*|||||||||||||||||||||||||||||||||||||||||||||||||||*/
/*||                                               ||*/
/*|| EXAMPLE:                                      ||*/
/*||       A red div on a black background         ||*/
/*||          with top corners rounded:            ||*/
/*||                                               ||*/
/*||  <div id="ex" csscorners="tl,tr">             ||*/
/*||       This will be rounded!                   ||*/
/*||   </div>                                      ||*/
/*||                                               ||*/
/*||               IN THE STYLESHEET:              ||*/
/*
       div.corner {
                  display:block; position:absolute;
                  padding:0px; margin:0px;
                  z-index:inherit;
                  width:2px; height:2px;
                  font-size:0px;
                  border-width:1px; border-style:solid;
                  }

      div.round_tl { top:0px; left:0px; border-right-width:0px; border-bottom-width:0px; }
      div.round_tr { top:0px; right:0px; border-left-width:0px; border-bottom-width:0px; }
      div.round_bl { bottom:0.99px; margin-bottom:-1px; left:0px; border-right-width:0px; border-top-width:0px; }
      div.round_br { bottom:0.99px; margin-bottom:-1px; border-left-width:0px; border-top-width:0px; }

      div#ex div.corner	{ background:red; border-color:black; }
*/
/*|| NOTE THE LAST LINE IS THE ONLY EDITABLE LINE! ||*/
/*||                                               ||*/
/*|||||||||||||||||||||||||||||||||||||||||||||||||||*/
/*|||                                             |||*/
/*||     copyright 2007, Jason Miller Design       ||*/
/*|||                                             |||*/
/*|||||||||||||||||||||||||||||||||||||||||||||||||||*/

window.onload = csscorners;

function csscorners() {
    var elements = new Array();
	var divs = new Array();
    divs = document.getElementsByTagName('div');
    for(var t=0; t<divs.length; t++)
        if(divs[t].getAttribute('csscorners') != null)
            elements[elements.length] = divs[t];
	//here we go:
	if(elements.length > 0) {
		for(i in elements) {
			var div = elements[i];
			var toRound = new Array("tl","tr","bl","br");
			if(div.getAttribute('csscorners').indexOf(";") > -1)
				toRound = div.getAttribute('csscorners').split(';')[1].split(',');
			for(w in toRound)
				elements[i].innerHTML += "<div class=\"corner round_"+toRound[w]+"\"></div>";
		}
		return true;
	}
	else { return false; }
}