var refreshTime = 3000; // 3 seconds
var numAds = 8;

function makeAd() {
 this.width = ''
 this.height = ''
 this.src = ''
 this.href = ''
 this.mouseover = ''
 this.textval = ''
}

var ads = new Array()

for(var i = 1; i <= numAds; i++) { ads[i] = new makeAd() }

i = 1;

ads[i].width = "345"
ads[i].height = "185"
ads[i].src = "http://destinpalmsselect.com/gfx/rotate/pods1.jpg"
ads[i].href = "#"
ads[i].mouseover = "Palms of Destin Select"
ads[i].textval = "textval" 
i++

ads[i].width = "345"
ads[i].height = "185"
ads[i].src = "http://destinpalmsselect.com/gfx/rotate/pods2.jpg"
ads[i].href = "#"
ads[i].mouseover = "Palms of Destin Select"
ads[i].textval = "textval" 
i++

ads[i].width = "345"
ads[i].height = "185"
ads[i].src = "http://destinpalmsselect.com/gfx/rotate/pods3.jpg"
ads[i].href = "#"
ads[i].mouseover = "Palms of Destin Select"
ads[i].textval = "textval" 
i++

ads[i].width = "345"
ads[i].height = "185"
ads[i].src = "http://destinpalmsselect.com/gfx/rotate/pods4.jpg"
ads[i].href = "#"
ads[i].mouseover = "Palms of Destin Select"
ads[i].textval = "textval" 
i++

ads[i].width = "345"
ads[i].height = "185"
ads[i].src = "http://destinpalmsselect.com/gfx/rotate/pods5.jpg"
ads[i].href = "#"
ads[i].mouseover = "Palms of Destin Select"
ads[i].textval = "textval" 
i++

ads[i].width = "345"
ads[i].height = "185"
ads[i].src = "http://destinpalmsselect.com/gfx/rotate/pods6.jpg"
ads[i].href = "#"
ads[i].mouseover = "Palms of Destin Select"
ads[i].textval = "textval" 
i++

ads[i].width = "345"
ads[i].height = "185"
ads[i].src = "http://destinpalmsselect.com/gfx/rotate/pods7.jpg"
ads[i].href = "#"
ads[i].mouseover = "Palms of Destin Select"
ads[i].textval = "textval" 
i++

ads[i].width = "345"
ads[i].height = "185"
ads[i].src = "http://destinpalmsselect.com/gfx/rotate/pods8.jpg"
ads[i].href = "#"
ads[i].mouseover = "Palms of Destin Select"
ads[i].textval = "textval" 
i++

var myCode = '';
do {
 var n= Math.floor(Math.random() * (numAds + 1) + 1);
} while(n > numAds);
var current_ad = n;
myCode = getCode(n);

function getCode(adNumber){
 var tempCode = ""
 tempCode += ('<a href="'+ ads[adNumber].href +'" \n')
 tempCode += ('onMouseOver="status=\''+ ads[adNumber].mouseover +'\';return true" \n')
 tempCode += ('onMouseOut="status=\'\'"> \n')
 tempCode += ('<img src="' + ads[adNumber].src + '" width=' + ads[adNumber].width)
 tempCode += (' onLoad="setTimeout(\'newAd();\',' + refreshTime + ');"')
 tempCode += ('\n height=' + ads[adNumber].height + ' border=1 >')
//	tempCode += ('<br><b>' + ads[adNumber].textval + '</b>') 
 tempCode += ('</a>')

 return tempCode;
}

function newAd(){
 current_ad++;
 if (current_ad > numAds) {
  current_ad = 1;
 }
  write(getCode(current_ad));
}

function write(text){
 if (document.all) {
  document.all.AdRotator.innerHTML = text;
 }
 else if (document.layers) {
  document.AdRotator.document.write(text);
  document.AdRotator.document.close();
 }
 else if (document.getElementById) {  document.getElementById('AdRotator').innerHTML = text;
 }
 else {
//  alert('browser not supported!');
 }
}