
ProductPage.prototype.setupPage = ProductPage_setupPage;

ProductPage.prototype.getDetailId = ProductPage_getDetailId;
ProductPage.prototype.setDetailId = ProductPage_setDetailId;

ProductPage.prototype.getDetailImageId = ProductPage_getDetailImageId;
ProductPage.prototype.setDetailImageId = ProductPage_setDetailImageId;

ProductPage.prototype.getDetail = ProductPage_getDetail;
ProductPage.prototype.getSelectedDetail = ProductPage_getSelectedDetail;

ProductPage.prototype.getProduct = ProductPage_getProduct;

ProductPage.prototype.showDetailView = ProductPage_showDetailView;
ProductPage.prototype.hideDetailView = ProductPage_hideDetailView;
ProductPage.prototype.setDetailView = ProductPage_setDetailView;

ProductPage.prototype.hasZoom = ProductPage_hasZoom;
ProductPage.prototype.zoom = ProductPage_zoom;

ProductPage.prototype.availability = ProductPage_availability;
ProductPage.prototype.billMeLater = ProductPage_billMeLater;
ProductPage.prototype.promoDetails = ProductPage_promoDetails;
ProductPage.prototype.emailAFriend = ProductPage_emailAFriend;
ProductPage.prototype.technology = ProductPage_technology;
ProductPage.prototype.showSizeChart = ProductPage_showSizeChart;
ProductPage.prototype.showMVM = ProductPage_showMVM;

function ProductPage()
{
}

function ProductPage_setupPage()
{
    this.currentDetailId = "detail0";
    this.currentDetailImageId = "detail0";
}

function ProductPage_getDetailId()
{
    return this.currentDetailId;
}

function ProductPage_setDetailId(detailId)
{
    this.currentDetailId = detailId;
}

function ProductPage_getDetailImageId()
{
    return this.currentDetailImageId;
}

function ProductPage_setDetailImageId(detailImageId)
{
    this.currentDetailImageId = detailImageId;
}

function ProductPage_getProduct(pid)
{
    return productMap[pid];
}

function ProductPage_getDetail(detailId)
{
    return detailData[detailId];
}

function ProductPage_getSelectedDetail()
{
    return this.getDetail(this.currentDetailId);
}

function ProductPage_showDetailView(id)
{
    swapElements(
            this.getDetailImageId() + "Main", 
            id + "Main"
        );
}

function ProductPage_hideDetailView(id)
{
    swapElements(
            id + "Main",
            this.getDetailImageId() + "Main" 
        );
}

function ProductPage_setDetailView(id)
{
}

function ProductPage_hasZoom(detail)
{
    if(detail && detail.zoomUrl)
    {
        return true;
    }
    return false;
}

function ProductPage_zoom(detail)
{
    if(detail && detail.zoomUrl)
    {
        if(detail.zoomIsScene7)
        {
            window.open(detail.zoomUrl, "Scene7", "width=450,height=500,left=0,top=0,scrollbars=yes");
        }
        else
        {
            window.open(detail.zoomUrl, "largeImage", "width=630,height=545,left=0,top=0,scrollbars=yes");
        }
    }
}

function ProductPage_availability(url)
{
    window.open(url, "availability", "width=460,height=560,top=0,left=0,resizable=no,scrollbars=yes");
}

function ProductPage_billMeLater(url)
{
    window.open(url, "billMeLater", "width=536,height=560,top=0,left=0,resizable=no,scrollbars=yes");
}

function ProductPage_promoDetails(url)
{
    window.open(url, "details", "width=460,height=560,top=0,left=0,resizable=no,scrollbars=no");
}

function ProductPage_emailAFriend(url)
{
    window.open(url, "emailFriend", "width=480,height=578,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=yes");
}

function ProductPage_technology(url)
{
    window.open(url, "technology", "width=800,height=600,left=0,top=0,scrollbars=yes");
}

function ProductPage_showSizeChart(url)
{
    window.open(url, "size", "width=705,height=300,left=0,top=0,scrollbars=yes");
}

function ProductPage_showMVM(url)
{
    mvmWinFocus(url, 'height=550,width=725,location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no,status=yes');
}

