// this is a simple script to place a feature box on to the the index page: 
// city features:

var cityfeature = new Array();

cityfeature[0]='<a href="accommodation/search_results_super.php?location=Z1"><h2>Sydney</h2> <img src="images/features/sydneyharbour.jpg" alt="Beautiful Sydney Harbour" width="180" height="118" border="0" /> <p><strong>Check out</strong> all the hottest deals in Sydney, one of the worlds most beautiful cities: sophisticated, friendly and more ... </p></a> ';
cityfeature[1]='<a href="accommodation/search_results.php?location=R71"><h2>Melbourne</h2> <img src="images/features/melbourne.jpg" alt="Strange Fruit - a unique performance that combines dance, circus and spectacular costumes" width="180" height="118" border="0"   /> <p><strong>Check out</strong>  all the hottest deals in Melbourne where the atmosphere is electric as fashion and festival fever take over ... </p></a>';
cityfeature[2]=' <a href="accommodation/search_results.php?location=Z5"><h2>Brisbane</h2><img src="images/features/brisbane.jpg" alt="Brisbane" width="180" height="118" border="0"   /> <p><strong>Check out</strong>  all the hottest deals in Brisbane famous for its great weather, exciting events and cultural scene ... </p></a>';
cityfeature[3]=' <a href="accommodation/search_results.php?location=Z3"><h2>Perth</h2><img src="images/features/perth.jpg" alt="Perth" width="180" height="118" border="0"   /><p><strong>Check out</strong>  all the hottest deals in Perth one of the most beautiful cities in the world with a </b> charming and relaxed atmosphere ... </p></a>';
cityfeature[4]='<a href="accommodation/search_results.php?location=R43"><h2>Cairns</h2><img src="images/features/cairns.jpg" alt="Cairns" width="180" height="118" border="0"   /><p><strong>Check out</strong>  all the hottest deals in Cairns a gateway to the Tropical North close to the Great Barrier Reef and dense rainforests ... </p></a> ';
cityfeature[5]='<a href="accommodation/search_results.php?location=T413"><h2>Darwin</h2><img src="images/features/darwin.jpg" alt="The famous Darwin Markets" width="180" height="118" border="0"   /><p><strong>Check out</strong>  all the hottest deals in Darwin with its relaxed tropical lifestyle,  culture and great base for visits to amazing Kakadu National Park... </p></a>';
cityfeature[6]='<a href="accommodation/search_results.php?location=T619"><h2>Hobart</h2><img src="images/features/hobart.jpg" alt="The port of Hobart" width="180" height="118" border="0"   />  <p><strong>Check out</strong>  all the hottest deals in Hobart  nestling between majestic Mt Wellington and the Derwent Estuary ... </p></a>';
cityfeature[7]='<a href="accommodation/search_results.php?location=Z4"><h2>Adelaide</h2><img src="images/features/adelaide.jpg" alt="Adelaide" width="180" height="118" border="0"   /><p><strong>Check out</strong>  all the hottest deals in Adelaide a city of churches, festivals, food and wine... </p></a>';
cityfeature[8]=' <a href="accommodation/search_results.php?location=R108"><h2>Canberra</h2><img src="images/features/canberra.jpg" alt="Canberras Floriade an awesome festival of flora" width="180" height="118" border="0"   />  <p><strong>Check out</strong>  all the hottest deals in Canberra the national capital and home to galleries museums and architecture ... </p></a>';

var pickArr = new Array(); // The array that will be formed
var count=0;
var doFlag=false;
var iterations=0;

function pickNums(nums)
{
 iterations+=1;
 var currNum = Math.round((cityfeature.length-1)*Math.random());
 if(count!=0)
 {
  for(var i=0; i<pickArr.length; i++)
  {
   if(cityfeature[currNum]==pickArr[i])
   {
    doFlag=true;
    break;
   }
  }
 }
 if(!doFlag)
 {
  pickArr[count]=cityfeature[currNum];
  document.write(cityfeature[currNum]);
  //document.write('<b>' + numArr[currNum] + '</b> <font color="#808080">|</font> ');
  count+=1;
 }
 if(iterations<(cityfeature.length*3)) // Compare for max iterations you want
 {
  if((count<nums))
  {
   pickNums(nums);
  }
 }
 else
 {
  location.reload();
 }
}

pickNums(1);
/*
var bum = 0;
var bum2 = 0;


var max = cityfeature.length - 1 ;
bum = Math.floor((Math.random() * max));
bum2 =  Math.floor((Math.random() * max));
if (bum == bum2) {
	while (bum2 == bum1) { 	bum2 =  Math.floor((Math.random() * max)); }
}
document.write(cityfeature[bum]);
document.write(cityfeature[bum2]);
*/



