Rotating html pages

Alright, so this is what I’m trying to do, but I’m not sure how. I’m trying to have rotating html pages. Let’s say I visit the said page, and then I click refresh it would refresh to the 2nd page. I figured it would work similar to random background images, but it doesn’t seem that way. This is what I figured the code would look like.
pages = new Array (“index1.html”, “index2.html”);
random content (){
randomNumber = random(content.length);

and that’s where I’m stuck. I’m not sure where to go with it after here, nor do I know if that’s right. I’m sure it’s not. I want to use javascript, but don’t know much about it. I’ve heard it’s similar to actionscript, but I wasn’t sure how true it was or wasn’t. Any help is appreciated. Thanks!