

function showHideReviews(objToHide, ImgElID) {
    if (document.getElementById(objToHide)) {
        if (document.getElementById(objToHide).style.display != 'none') {
            document.getElementById(objToHide).style.display = 'none';
            document.getElementById(ImgElID).src = '/images/plus.gif';
        }
        else {
            document.getElementById(objToHide).style.display = '';
            document.getElementById(ImgElID).src = '/images/minus.gif';
        }

    }
}

function changeImage(newImg, elID) {
    document.getElementById(elID).src = newImg;

}

function ShowTooltip(parentControlId, message) {
    // This is the control to which error image is attached (e.g. SPAN in this case)
    var parentControl = document.getElementById(parentControlId);
    parentControl.style.position = "relative";
    parentControl.style.fontSize = "10pt";

    // This is the main "DIV" element which has callout image and tooltip "DIV"
    var mainDiv = document.createElement("div");
    mainDiv.style.position = "absolute";
    mainDiv.style.left = -20;
    mainDiv.style.top = 15;
    mainDiv.style.zIndex = "100";

    // This is the callout image element
    var imgStem = document.createElement("img");
    imgStem.style.position = "absolute";
    imgStem.border = 0;
    imgStem.style.zIndex = "150";

    //This is the tooltip div having the text to show
    var div = document.createElement("div");
    div.style.position = "absolute";
    div.style.border = "1px solid #000000";
    div.style.padding = "15px";
    div.style.zIndex = "100";
    div.style.backgroundColor = "#FFFFEF";
    div.style.width = "400px";
    div.innerHTML = '<FONT COLOR="BLACK">' +message + '</font>' ; //Add tooltip message to show
    div.style.top = 14;

    browsername = navigator.appName;
    if (browsername.indexOf("Netscape") != -1) { browsername = "NS" }
    else {
        if (browsername.indexOf("Microsoft") != -1) { browsername = "MSIE" }
        else { browsername = "N/A" } 
    };


    //Calculate position of tooltip and align tooltip to left or right. Add appropriate callout images
    if ((parentControl.offsetLeft + 150) > parentControl.offsetParent.clientWidth) {
        imgStem.src = "/images/StemTopRight.gif";
        imgStem.style.left = 10;
        div.style.left = -110;
    }
    else {
        imgStem.src = "/images/StemTopLeft.gif";
        imgStem.style.left = 30;
        div.style.left = 0;
    }

    //Add callout image to main DIV
    if (browsername == "MSIE") {
        mainDiv.appendChild(imgStem);

    }
    else {
    }

    //Add tooltip "DIV" to main DIV element
    mainDiv.appendChild(div);

    //Add main DIV containing callout image and tooltip to SPAN element
    parentControl.appendChild(mainDiv);
}

function HideTooltip(parentControlId) {
    // This is the control to which error image is attached (e.g. SPAN in this case)
    var parentControl = document.getElementById(parentControlId);
    for (i = 0; i < parentControl.childNodes.length; i++) {
        if (parentControl.childNodes[i].tagName == "DIV") {
            //Remove main DIV containing callout image and tooltip from SPAN element
            var mainDiv = parentControl.childNodes[i];
            parentControl.removeChild(mainDiv);
            parentControl.style.position = "static";
        }
    }
}


function mouseOverProdIMG(newImg, elID) {
    pausecomp(500);
    //half a second - if the prodimg was not moused over intentionally, nothing will happen
    document.getElementById(elID).src = newImg;
    document.getElementById(elID).width = "300";
    document.getElementById(elID).height = "300";
    document.getElementById(elID).colspan = "2";
    
}

function ChangeMerchant(NumberClicked) {

    switch (NumberClicked)
    {
        case 1:
            document.getElementById("OverdriveFeaturedProducts").style.display = 'none';
            document.getElementById("OneStopFanShopFeaturedProducts").style.display = 'none';             
            document.getElementById("DesignerAthleticFeaturedProducts").style.display = '';            
            break;
        case 2:
            document.getElementById("OneStopFanShopFeaturedProducts").style.display = 'none';                     
            document.getElementById("OverdriveFeaturedProducts").style.display = '';
            document.getElementById("DesignerAthleticFeaturedProducts").style.display = 'none'; 
            break;
        case 3:
            document.getElementById("OneStopFanShopFeaturedProducts").style.display = '';
            document.getElementById("OverdriveFeaturedProducts").style.display = 'none';
            document.getElementById("DesignerAthleticFeaturedProducts").style.display = 'none';
            break;

    }




}


function pausecomp(millis) {
    var date = new Date();
    var curDate = null;

    do { curDate = new Date(); }
    while (curDate - date < millis);
} 


function mouseOutProdIMG(newImg, elID) {
    document.getElementById(elID).src = newImg;
    document.getElementById(elID).width = "100";
    document.getElementById(elID).height = "100";

}

