function enlargeThis(path)
{
  document.images["highlightphoto"].src = path;
}

var current = 0;

// Change the color of an element identified by 'id'.
function changeColor(id)
{
    //var element = document.getElementById(id);
    //element.style.color = "green";
}

function highlight()
{
    var url = window.location.href;
    var index = url.indexOf("cid=");
    if (-1 != index) {
        var id = url.substr(index + 4, 3);
        var element = document.getElementById(id);
        element.style.backgroundColor="#c7d6e9";
    }
}

function pageChanged(selectCtl)
{
    var index = selectCtl.selectedIndex + 1;
    gotoPage(index);
}

function gotoPage(index) {
	var cid = location.search;
    cid = cid.substring(cid.indexOf('&') + 5, cid.lastIndexOf('&'));
    location.href = "viewProducts.do?method=viewProducts&cid=" + cid + "&pgid=" + index;
}

function viewImage(url)
{
    childWindow = window.open(url, "_blank", "toolbar=yes, menubar=yes, scrollbars=yes, resizable=yes, location=no, status=yes"); 
}

function initMenu()
{ 
    var index = document.cookie.indexOf("active=")
    var current = parseInt(document.cookie.substring(index + 7, index + 8))
    divColl = document.all.tags("ul");
    for (i=0; i<divColl.length; i++) {
        whichEl = divColl[i];
        if (i != current) {
            whichEl.style.display = "none";
        } else {
            whichEl.style.display = '';
        } 
    }
}

function expand(id)
{
    document.cookie = "active=" + id;

    for (var i=0; i<contents.length; i++) {
        if (i == id) {
            contents[i].style.display = '';
        } else {
            contents[i].style.display = 'none';
        }
    }
}