Se lo fai così ti cambia qualcosa ?

text = text + "<tr color='#000000' bgcolor='#C0C0C0' onclick=\"openlink(" + link + ")\">";