Code: Java
color = get_current_style(v[i],"background-color","transparent");
bk = get_current_style(v[i].parentNode,"background-color","transparent");

So, the code detects the background-color of the element v[i] and sets it as fore-color.
Further it detects the background-color of the parent of v[i] and sets it as background color.

So, you might try changing those 2 lines.