
		function addLoadEvent(f){var ono=window.onload;if(typeof window.onload!='function'){window.onload=f}else{window.onload=function(){ono();f()}}}

		/* Featured property object */
		function FeaturedPropertyModel(details_url, image_url, address, price, description) 
		{
			this.details_url = details_url;
			this.image_url = image_url;
			this.address = address;
			this.price = price.replace("£", String.fromCharCode(163));
			this.description = description;
		};

    function FeaturedProperty(sp,db,err) {
        this.speed = sp;
        this.dbtype = db;
        this.featuredProperties = new Array();
        this.currentIndex = 0;
        this.featureDiv = null;
        this.error = err;
        if (document.getElementById("featureprops")) {
       this.featureDiv = document.getElementById("featureprops");
    } else if  (document.getElementById("featureprops" + this.dbtype)) {
       this.featureDiv = document.getElementById("featureprops"+ this.dbtype);
    }

    }
    
    FeaturedProperty.prototype.ShowNextSlide = ShowNextSlide;
    FeaturedProperty.prototype.AppendFeature = AppendFeature;
    FeaturedProperty.prototype.AddFeature = AddFeature;
    FeaturedProperty.prototype.CreateTextDiv = CreateTextDiv;
    FeaturedProperty.prototype.FeatureLoad = FeatureLoad;      
    FeaturedProperty.prototype.AddFeatureProperty = AddFeatureProperty;  
         

		function ShowNextSlide(me) {
		    if ( me.featuredProperties.length ==0 ) return;
		    if (me.currentIndex >= me.featuredProperties.length) {
			    me.currentIndex = 0;
			}
		    if (me.currentIndex == 0 && me.featuredProperties.length == 1) {
		        me.AddFeature(0);
		    } else if (me.speed == 0 ) {
		        var ul = document.createElement("ul");
		        me.featureDiv.appendChild(ul);
		        for(var i=0; i<me.featuredProperties.length; i++)
		        {
		            var li = document.createElement("li");
		            me.AppendFeature(li, me.featuredProperties[i]);
		            ul.appendChild(li);
		        }
		    } else {
		        var timeout = function () {
		            ShowNextSlide(me);
		        };
	
		        me.AddFeature(me.currentIndex++);
		        window.setTimeout(timeout, me.speed);
		    }

		};
		
		function AppendFeature(targetDiv, fpModel) {
		    var imageDiv = document.createElement("div");
		    imageDiv.className ="fpImage";
		    var imageLink = document.createElement("a");
		    imageLink.setAttribute("href", fpModel.details_url);
		    imageLink.setAttribute("title", "View property details for property in " + fpModel.address + ", " + fpModel.price);
		    var imageTag = document.createElement("img");
		    imageTag.setAttribute("src", fpModel.image_url);
		    imageTag.setAttribute("alt", "Image for property in " + fpModel.address);
		    imageLink.appendChild(imageTag);
		    imageDiv.appendChild(imageLink);
		    var addressDiv = CreateTextDiv("fpAddress", fpModel.address);
		    var priceDiv = CreateTextDiv("fpPrice", fpModel.price);
		    targetDiv.appendChild(imageDiv);
		    targetDiv.appendChild(addressDiv);
		    targetDiv.appendChild(priceDiv);
		};

		function AddFeature(index) {
		    var fpModel = this.featuredProperties[index];
		    var l = this.featureDiv.childNodes.length;
		    for (var i=0; i < l; i++) {
		        var ch = this.featureDiv.firstChild;
		        this.featureDiv.removeChild(ch);
		    }
		    AppendFeature(this.featureDiv, fpModel);
		};
		
	   function AddFeatureProperty(fpModel) {
		    this.featuredProperties[this.featuredProperties.length] = fpModel;
		};

		function CreateTextDiv(id, text) {
		    var textDiv = document.createElement("div");
		    textDiv.className= id;
		    var paraElement = document.createElement("p");
		    textDiv.appendChild(paraElement);
		    var textElement = document.createTextNode(text);
		    paraElement.appendChild(textElement);
		    textDiv.appendChild(paraElement);
		    return textDiv;
		};

		function FeatureLoad() {
     	    if (this.error == null && this.featureDiv != null) {
	        this.ShowNextSlide(this);
	    } else if (this.error != null && this.featureDiv != null) {
	        var p = document.createElement("p");
	        p.appendChild(document.createTextNode(error));
	        this.featureDiv.appendChild(p);
	    }
    };
        
		
		
		
		

      // this variable name needs to be unique
      var featuredObj1;

      function initFeaturedProp() {
        featuredObj1 = new FeaturedProperty(0,1, null);
        
      featuredObj1.AddFeatureProperty(  new FeaturedPropertyModel(
      "http://search.thinkproperty.com/johnshepherd/property/21281388",
      "http://images.vebra.com/images/1150/007/type1/95mhl.jpg",
      "95, Meeting House Lane, CV7 7GD",
      "£475,000",
      ""));
    
      featuredObj1.AddFeatureProperty(  new FeaturedPropertyModel(
      "http://search.thinkproperty.com/johnshepherd/property/21281341",
      "http://images.vebra.com/images/1150/005/type1/10ccfv.jpg",
      "10, Corbetts Close, Solihull, B92 0BU",
      "£419,950",
      ""));
    
      featuredObj1.AddFeatureProperty(  new FeaturedPropertyModel(
      "http://search.thinkproperty.com/johnshepherd/property/21280415",
      "http://images.vebra.com/images/1150/006/type1/515schfv.jpg",
      "5, School Road, Solihull, West Midlands, B94 6QT",
      "£319,950",
      ""));
    
      featuredObj1.AddFeatureProperty(  new FeaturedPropertyModel(
      "http://search.thinkproperty.com/johnshepherd/property/21276249",
      "http://images.vebra.com/images/1150/008/type1/6adfrt.jpg",
      "6, Ashborough Drive, Solihull, West Midlands, B91 3XN",
      "£555,000",
      ""));
    
      featuredObj1.AddFeatureProperty(  new FeaturedPropertyModel(
      "http://search.thinkproperty.com/johnshepherd/property/21276250",
      "http://images.vebra.com/images/1150/009/type1/3brixfv.jpg",
      "3, Brixfield Way, Dickens Heath, B90 1RQ",
      "£155,000",
      ""));
    
      featuredObj1.AddFeatureProperty(  new FeaturedPropertyModel(
      "http://search.thinkproperty.com/johnshepherd/property/21274999",
      "http://images.vebra.com/images/1150/008/type1/27ccfrt.jpg",
      "27, Chipstone Close, Solihull, West Midlands, B91 3YS",
      "£323,950",
      ""));
    
      featuredObj1.AddFeatureProperty(  new FeaturedPropertyModel(
      "http://search.thinkproperty.com/johnshepherd/property/21269465",
      "http://images.vebra.com/images/1150/003/type1/hollyc~1.jpg",
      "Holly Cottage, Church Road, Stratford Upon Avon, Warwickshire, CV37 0LE",
      "£497,500",
      ""));
    
      featuredObj1.AddFeatureProperty(  new FeaturedPropertyModel(
      "http://search.thinkproperty.com/johnshepherd/property/21266501",
      "http://images.vebra.com/images/1150/008/type1/45hamff.jpg",
      "45, Hampton Lane, Solihull, West Midlands, B91 2QD",
      "£749,950",
      ""));
    
      featuredObj1.AddFeatureProperty(  new FeaturedPropertyModel(
      "http://search.thinkproperty.com/johnshepherd/property/21264654",
      "http://images.vebra.com/images/1150/009/type1/5claylfv.jpg",
      "5, Clay Pit Lane, Solihull, B90 1SH",
      "£249,950",
      ""));
    
      featuredObj1.AddFeatureProperty(  new FeaturedPropertyModel(
      "http://search.thinkproperty.com/johnshepherd/property/21264015",
      "http://images.vebra.com/images/1150/003/type1/229595~1.jpg",
      "22, Amis Way, Stratford Upon Avon, Warwickshire, CV37 7JF",
      "£189,950",
      ""));
    
      featuredObj1.AddFeatureProperty(  new FeaturedPropertyModel(
      "http://search.thinkproperty.com/johnshepherd/property/21260482",
      "http://images.vebra.com/images/1150/008/type1/frafvf~1.jpg",
      "27, Framefield Drive, Solihull, West Midlands, B91 2SR",
      "£299,950",
      ""));
    
      featuredObj1.AddFeatureProperty(  new FeaturedPropertyModel(
      "http://search.thinkproperty.com/johnshepherd/property/21260483",
      "http://images.vebra.com/images/1150/008/type1/70mrfr.jpg",
      "70, Marcot Road, Solihull, West Midlands, B92 7PR",
      "£139,950",
      ""));
    
      featuredObj1.AddFeatureProperty(  new FeaturedPropertyModel(
      "http://search.thinkproperty.com/johnshepherd/property/21260484",
      "http://images.vebra.com/images/1150/008/type1/whitef~1.jpg",
      "14, Whitefriars, Solihull, West Midlands, B91 2QQ",
      "£325,000",
      ""));
    
      featuredObj1.AddFeatureProperty(  new FeaturedPropertyModel(
      "http://search.thinkproperty.com/johnshepherd/property/21260479",
      "http://images.vebra.com/images/1150/006/type1/2nurfv.jpg",
      "2 Nursery Cottages, Old Warwick Road, Solihull, West Midlands, B94 6LX",
      "£315,000",
      ""));
    
      featuredObj1.AddFeatureProperty(  new FeaturedPropertyModel(
      "http://search.thinkproperty.com/johnshepherd/property/21260481",
      "http://images.vebra.com/images/1150/007/type1/76gc.jpg",
      "76, Grovefield Crescent, CV7 7RE",
      "£409,950",
      ""));
    
      featuredObj1.AddFeatureProperty(  new FeaturedPropertyModel(
      "http://search.thinkproperty.com/johnshepherd/property/21252274",
      "http://images.vebra.com/images/1150/008/type1/a4adofv1.jpg",
      "Apt. 4 Arden Oak,581, Warwick Road, Solihull, West Midlands, B91 1AW",
      "£535,000",
      ""));
    
      featuredObj1.AddFeatureProperty(  new FeaturedPropertyModel(
      "http://search.thinkproperty.com/johnshepherd/property/21251332",
      "http://images.vebra.com/images/1150/008/type1/49qcfrt.jpg",
      "49, Queens Court, Solihull, West Midlands, B91 2PR",
      "£210,000",
      ""));
    
      featuredObj1.AddFeatureProperty(  new FeaturedPropertyModel(
      "http://search.thinkproperty.com/johnshepherd/property/21249053",
      "http://images.vebra.com/images/1150/008/type1/7sprfrt.jpg",
      "7, Stonor Park Road, Solihull, West Midlands, B91 1EH",
      "£565,000",
      ""));
    

      featuredObj1.FeatureLoad();
      }
      addLoadEvent(initFeaturedProp);

    