function openLargerImage(id, width, height)
{
  window.open('/imagePopup.php?id=' + id, 'richmondImage', 'width=' + width + ',height=' + height + ',scrollbars=no, status');
}

function decrementItem(prodId)
{
    document.getElementById('quantityStore' + prodId).value = parseInt(document.getElementById('quantityStore' + prodId).value) - 1;
    document.getElementById('override' + prodId).value = document.getElementById('quantityStore' + prodId).value;
    document.getElementById('formChange' + prodId).submit();
}

function incrementItem(prodId)
{
    document.getElementById('quantityStore' + prodId).value = parseInt(document.getElementById('quantityStore' + prodId).value) + 1;
    document.getElementById('override' + prodId).value = document.getElementById('quantityStore' + prodId).value;
    document.getElementById('formChange' + prodId).submit();
}

function overrideItem(prodId)
{
    document.getElementById('override' + prodId).value = document.getElementById('quantityStore' + prodId).value;
}

// init vars
var noSearch = false;

function swapSearch(element)
{
    if (!noSearch)
        element.value = '';
}

function fullsize(id)
{
    prv=window.open('/popup.php?id='+id,'Details','location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,width=700,height=400');
    prv.focus();    
}

// clear the search box
if (document.getElementById('search').value != '')
    noSearch = true;
else
    document.getElementById('search').value = 'Search';

// add to bookmark cross-browser
function addBookmark(title,url) 
{
    if (window.sidebar) 
    { 
        window.sidebar.addPanel(title, url,""); 
    } 
    else if( document.all ) 
    {
        window.external.AddFavorite( url, title);
    } 
    else if( window.opera && window.print ) 
    {
        return true;
    }
}