var current = 0;
function next() {
    if (document.productDetailsForm.slide[current + 1]) {
        document.images.show.src = document.productDetailsForm.slide[current + 1].value;
        document.images.show.alt = document.productDetailsForm.slide[current + 1].text;
        document.images.show.title = document.productDetailsForm.slide[current + 1].text;
        document.productDetailsForm.slide.selectedIndex = ++current;
    }
    else first();
}
function previous() {
    if (current - 1 >= 0) {
        document.images.show.src = document.productDetailsForm.slide[current - 1].value;
        document.images.show.alt = document.productDetailsForm.slide[current - 1].text;
        document.images.show.title = document.productDetailsForm.slide[current - 1].text;
        document.productDetailsForm.slide.selectedIndex = --current;
    }
    else last();
}
function first() {
    current = 0;
    document.images.show.src = document.productDetailsForm.slide[0].value;
    document.images.show.alt = document.productDetailsForm.slide[0].text;
    document.images.show.title = document.productDetailsForm.slide[0].text;
    document.productDetailsForm.slide.selectedIndex = 0;
}
function last() {
    current = document.productDetailsForm.slide.length - 1;
    document.images.show.src = document.productDetailsForm.slide[current].value;
    document.images.show.alt = document.productDetailsForm.slide[current].text;
    document.images.show.title = document.productDetailsForm.slide[current].text;
    document.productDetailsForm.slide.selectedIndex = current;
}

function addItemToSessionAll(prodId, skuId, actionUrl) {
    document.productsListForm.productId.value = prodId;
    document.productsListForm.skuId.value = skuId;
    document.productsListForm.action = actionUrl;
    document.productsListForm.submit();
}

function sendToFriend(prodId, prodTypeId, skuId, productName, actionUrl) {
    document.productsListForm.productId.value = prodId;
    document.productsListForm.prodTypeId.value = prodTypeId;
    document.productsListForm.skuId.value = skuId;
    document.productsListForm.productName.value = productName;
    document.productsListForm.action = actionUrl;
    document.productsListForm.submit();
}
function Is () {
    var agt=navigator.userAgent.toLowerCase();

    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);


    this.nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
            && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
            && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    this.nav2 = (this.nav && (this.major == 2));
    this.nav3 = (this.nav && (this.major == 3));
    this.nav4 = (this.nav && (this.major == 4));
    this.nav4up = (this.nav && (this.major >= 4));
    this.navonly      = (this.nav && ((agt.indexOf(";nav") != -1) ||
                          (agt.indexOf("; nav") != -1)) );
    this.nav6 = (this.nav && (this.major == 5));
    this.nav6up = (this.nav && (this.major >= 5));
    this.gecko = (agt.indexOf('gecko') != -1);


    this.ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    this.ie3    = (this.ie && (this.major < 4));
    this.ie4    = (this.ie && (this.major == 4) && (agt.indexOf("msie 4")!=-1) );
    this.ie4up  = (this.ie && (this.major >= 4));
    this.ie5    = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    this.ie5_5  = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.5") !=-1));
    this.ie5up  = (this.ie && !this.ie3 && !this.ie4);
    this.ie5_5up =(this.ie && !this.ie3 && !this.ie4 && !this.ie5);
    this.ie6    = (this.ie && (this.major == 4) && (agt.indexOf("msie 6.")!=-1) );
    this.ie6up  = (this.ie && !this.ie3 && !this.ie4 && !this.ie5 && !this.ie5_5);

    // KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
    // or if this is the first browser window opened.  Thus the
    // variables this.aol, this.aol3, and this.aol4 aren't 100% reliable.
    this.aol   = (agt.indexOf("aol") != -1);
    this.aol3  = (this.aol && this.ie3);
    this.aol4  = (this.aol && this.ie4);
    this.aol5  = (agt.indexOf("aol 5") != -1);
    this.aol6  = (agt.indexOf("aol 6") != -1);

    this.opera = (agt.indexOf("opera") != -1);
    this.opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
    this.opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
    this.opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
    this.opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
    this.opera5up = (this.opera && !this.opera2 && !this.opera3 && !this.opera4);
}