You could generate a random int number in [1,3], with the following way:
var rndIndex = Math.floor(Math.random()*3);
Then you can use the generated index to get the css you want:
onclick="test(cssName[rndIndex])";
Note In the cssName table it would be better you place only the corresponding href's. I am saying this, because as I noticed in the declaration of your function you set the value for the href attribute.
Update I would suggest, as you will see in the fiddle here to declare a parameterless function for your purpose. I have declared the setCss function and then there select the pagestyele element and set it's attribute called 'href' to one of your css randomnly.