var currentdate = 0;
var core = 0;

function initArray() {

this.length = initArray.arguments.length;
  for (var i = 0; i < this.length; i++) {
  this[i] = initArray.arguments[i];
  }
}

link = new initArray(
"#",
"#",
"#",
"#",
"#",
"#"
);


image = new initArray(
"http://www.vocalynx.com/images/mainpic1.jpg",
"http://www.vocalynx.com/images/mainpic2.jpg",
"http://www.vocalynx.com/images/mainpic3.jpg",
"http://www.vocalynx.com/images/mainpic1.jpg",
"http://www.vocalynx.com/images/mainpic2.jpg",
"http://www.vocalynx.com/images/mainpic3.jpg"
);

text = new initArray(
"Vocalynx",
"Vocalynx",
"Vocalynx",
"Vocalynx",
"Vocalynx",
"Vocalynx"
);

var currentdate = new Date();
var core = currentdate.getSeconds() % image.length;
var ranlink  = link[core];
var ranimage = image[core];
var rantext  = text[core];
pos = ranimage.lastIndexOf('.');
pos++;
ext = ranimage.substring(pos);

switch(ext)
{
	// Display image banners
	case "gif"	:
	case "jpg"	:
	case "jpeg"	:
	case "bmp"	:
	case "png"	:
		document.write('<a href=\"' +ranlink+ '\" target=\"_self\"><img src=\"'+ranimage+'\" border="0" alt=\"'+rantext+'\"></a>');
		break;
	// Display Flash banners
	case "swf"	:
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
						+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"  width="580" height="80">'
  						+ '<param name="movie" value="' +ranimage+ '" />'
  						+ '<param name="quality" value="high" />'
  						+' <embed src="' +ranimage+ '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="590" height="15"></embed>'
  						+ '</object>');
  		break;
}