﻿var current;
var currentimg;


function squishy(d)
{
    var p;
    var p2;
    var s;
    var r;
    p = document.getElementById('C' + d);
    if (p) 
	{
        p2 = document.getElementById('P' + d);
        if (p.style.display == 'none') 
		{
            if (current) 
			{
                current.style.display = 'none';
                //currentimg.src = '/images/tick.gif'
            }
            current = p;
            currentimg = p2;
            
            p.style.display = 'inline';
            //p2.src = '/images/downtick.gif';
            
        }
        else 
		{
            p.style.display = 'none';
            //p2.src = '/images/tick.gif';
        }
    }
}

function catselect(storecat, subcat)
{
    var p;
    var r;
    squishy(storecat);
    p = document.getElementById('S' + subcat);
    if (subcat)
    {}
    else
    {r=new RegExp("landings/"+storecat+".html$");
            if (document.URL.match(r))
            {}
            else
            {
             location.href='/store/landings/'+storecat+'.html'
            }
    }
    if (p) 
	{
        if (p.className == 'catlink') 
		{
            p.className = "catlink current";
        }
        else 
		{
            p.className = "subcatlink current";
        }
    }
}

function gocart()
{
    c = new String;
    c = document.cookie;
    c = c.substr(5);
    location.href = '/cgi/showcart.pl?cmd=VIEW&category=store&cookie=' + c;
}

function setitem(i, p, d)
{
    document.info.item.value = document.info.itemselect[i].value;
    document.info.price.value = p;
    document.info.desc.value = d;
}

function setstyle(i)
{
    document.info.style.value = document.info.styleselect[i].value;
}


function do_submit()
{
    document.info.cookie.value = document.cookie;
    document.info.qty.value = "1";
    document.info.submit();
}
