﻿//<script language="javascript">
//<!--
//<!-- Original:  Robert Bui (astrogate@hotmail.com) -->
//<!-- Adaptation Martin Mc Arthur (martin@rmweb.co.za -->

//<!-- Re-coding by Netlive KZN (support@netlive.co.za -->

//<!-- Begin
var interval = 6; // delay between changing quotes (in seconds)
var random_display = 1; // 0 = no, 1 = yes
interval *= 1000;

var spec_index = 0;
spec_list = new Array();
spec_list[spec_index++] = '<a class="s" href="Special.html" target="_blank"><font color="red"><strong>Romantic rooms during the<br>“Month of Love”</strong></font><br>Every room booked in the month of February will receive a complimentary picnic basket for 2 to be enjoyed at our Rickety Bridge “Restaurant in the Vines”,on our tranquil lawns or at the private pool, complimented with a free wine  tasting<br><br>Contact Nicolene on 021 876 2994 or<br>email nicky@ricketybridge.com</a>';
var number_of_specs = spec_list.length;

function generate(x, y) {
var range = y - x + 1;
return Math.floor(Math.random() * range) + x;
}

function getNextSpec() {
	if (random_display) {
		spec_index = generate(0, number_of_specs-1);
	}
	else {
		spec_index = (spec_index+1) % number_of_specs;
	}
	var new_spec = spec_list[spec_index];
	return(new_spec);
}

function changeSpec(div_id) {

	_findObj(div_id).innerHTML = getNextSpec();
	var recur_call = "changeSpec('"+div_id+"')";
	setTimeout(recur_call, interval);
}
//  End -->

function _findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
//</script>