// JavaScript Document

var frames; 
var images=new Array();
var arrPropIds=new Array();
var arrImgs=new Array();
var arrAddresses=new Array();
var arrPrices=new Array();

var addressdiv;
var pricediv;
var imganddetailslink;
var morelink;

function setControls() {
	try{
        addressdiv = document.getElementById("divPropAddress");
        pricediv = document.getElementById("divCost");
        imganddetailslink = document.getElementById("imganddetails");
        morelink= document.getElementById("buymoredetails");
    }
	catch(e) {}
}

frames=0; 
function animateImages() 
{

var proptype="2";
	try{
	if(arrPropIds.length > 0)
	{
	   imganddetailslink.innerHTML = '<img alt="Featured Property" onload="javascript:setImage(this);" width="150" height="150" border="0" src="'+arrImgs[frames]+'" style="FILTER: progid:DXImageTransform.Microsoft.Fade(); padding-top:3px; padding-right:3px; padding-bottom:3px; padding-left:3px; border:2px outset #999999;" />';
	  ///// morelink.href = "propertydetails.aspx?id="+arrPropIds[frames];
 morelink.href = "propertydetails.aspx?id="+arrPropIds[frames] +"&proptype="+proptype;
	   pricediv.innerHTML = arrPrices[frames];
	   addressdiv.innerHTML = arrAddresses[frames]
	   frames=(frames+1)%arrPropIds.length;
	   timeout_id=setTimeout("animateImages()",10000); 
	}
	else
	{
		imganddetailslink.innerHTML = '<img src="images/image_soon-copy.jpg" alt="Featured Property" width="120" height="120" />';
		morelink.style.visibility = 'hidden';
	}
	}
	catch(e) {}
}

window.onload = function() {
	setControls();
	animateImages();
};


