
/* --== Hybrid Listings Late Deals : Generated 23/02/2012 11:28:06 ==-- */

var aso = [];  // Array for holding the search results
// Special Offer Property object definition:
function soCottage(
	id,ref,name,summary,location,
	sleeps,
	currency,price,priceWas,
	url,img,
	isEasyBook,
	startDate,duration
){
	this.id = id;
	this.ref = ref;
	this.name = name;
	this.summary = summary;
	this.location = location;
	this.sleeps = sleeps;
	this.currency = currency;
	this.price = price;
	this.priceWas = priceWas;
	this.url = url;
	this.img = img;
	this.isEasyBook = isEasyBook;
	this.startDate = startDate;
	this.duration = duration;
}

/* --== PROPERTY DATA ==-- */
aso.length = 0;
aso[0]=new soCottage(17642,'227642','Clover Close Barn','Comfortable two bedroom property, sleeps four. Private courtyard area','Wells, Somerset',4,'£',280,330,'/227642/clover-close-barn-somerset.aspx','/238210-clover-close-barn-thumb.jpg','true','27/02/2012',7);
aso[1]=new soCottage(13087,'701039/1','Craigower Lodge','This timber lined lodge is the ideal location for a family break','Pitlochry, Perth and Kinross',4,'£',599,615,'/701039-1/craigower-lodge-perth-and-kinross.aspx','/174718-craigower-lodge-thumb.jpg','true','27/02/2012',7);
aso[2]=new soCottage(15067,'3050447/1','Barn Cottage','Sleeps 2/3, quiet, stunning views, wi-fi, pets, walking/cycling/wildlife at door','newtonmore, Inverness',3,'£',265,299,'/3050447-1/barn-cottage-inverness.aspx','/192057-barn-cottage-thumb.jpg','true','27/02/2012',7);


/* --== Display the data ==-- */
if(aso.length > 0)
{
	var divLateDeals = document.getElementById("divLateDeals");
	if(!divLateDeals){ // If the placeholder div doesn't already exist, create it!
		document.write("<div id='divLateDeals'></div>");
		divLateDeals = document.getElementById("divLateDeals");
	}

	divLateDeals.innerHTML += '<h2>Late Deals and Special Offers</h2>';
	for(i=0;i<aso.length;i++)
	{
		oddEven = i % 2 ? "odd":"even";
		var p = aso[i];
		var price = p.duration + ' nights starting '+ p.startDate +' was '+ p.currency + String(p.priceWas) +' <span class=\"attention\">Now '+ p.currency + String(p.price) +'</span>';
		divLateDeals.innerHTML += '<table cellspacing="0" cellpadding="0" class="search_result '+ oddEven +'"><tr class="search_result_row1"><td rowspan="4" class="search_result_col1 propImage"><a href="'+ p.url +'"><img src="'+ p.img +'" alt="'+ p.name +'" /></a></td><td class="search_result_col2 strong propName" valign="top">'+ p.name +'</td><td></td></tr><tr><td class="search_result_col2 strong">'+ p.location +' - Sleeps: '+ p.sleeps +'</td><td></td></tr><tr><td class="search_result_col2" colspan="2">'+ p.summary +'</td></tr><tr class="btmRow"><td class="search_result_col2 theOffer">'+ price +'</td><td valign="bottom" class="search_result_col4 moreDetails"><a href="'+ p.url +'">More details</a></td></tr></table>';
	}
	divLateDeals.innerHTML += '<div class="moreSO"><a  href="/SpecialOffers.aspx">Search for more special offers</a></div>';
}






