﻿function HotProduct(name, description, imageUrl, buyUrl)
{
    this.name = name;
    this.description = description;
    this.imageUrl = imageUrl;
    this.buyUrl = buyUrl;
    this.getEl = function(name)
    {
        return document.getElementById("hotProduct1_" + name);
    };
    this.display = function()
    {
        var el = this.getEl("imgLink");
        el.href = this.buyUrl;
        el = this.getEl("imgProduct");
        el.src = this.imageUrl;
        el.alt = this.name;
        el = this.getEl("name");
        el.innerHTML = this.name;
        el.href = this.buyUrl;
        el = this.getEl("description");
        el.innerHTML = this.description;
    };
}

var index = -1;
function ProductShow()
{
    ++index;
    if (index >= pArray.length)
        index = 0;
    pArray[index].display();
    setTimeout(ProductShow, 10000);
}



