/* STORE SCRIPTS */
var stainType = new Array("unfinished","cognac","cappuccino","sierra","satin");
var clickedStain = stainType[1];

function stainOn(stainId)
	{
		document.getElementById(stainType[stainId]).src = 'images/store-'+stainType[stainId]+'-on.gif';
	}
	
function stainOff(stainId)
	{
	if (stainType[stainId] != clickedStain)
	{
		document.getElementById(stainType[stainId]).src = 'images/store-'+stainType[stainId]+'-off.gif';
	}
	}
	
function stainClick(stainId)
	{
		clickedStain = stainType[stainId];
		document.getElementById('staintypename').innerHTML = clickedStain;
		document.getElementById('c2eimg').src = 'images/store-'+stainType[stainId]+'-c2e.gif';
		document.getElementById('smimg').src = 'images/store-'+stainType[stainId]+'-sm.gif';
		document.getElementById('c2elink').href = 'images/store-'+stainType[stainId]+'-xlg.gif';
		document.getElementById(stainType[stainId]).src = 'images/store-'+stainType[stainId]+'-on.gif';
		for (x in stainType)
		{
			if (x != 0 && clickedStain != stainType[x])
			{
				document.getElementById(stainType[x]).src = 'images/store-'+stainType[x]+'-off.gif';
			}
		}
	}

function toggle_shipping_address(same_as_billing) {
	if (same_as_billing.checked == true) {
		document.getElementById('shipaddress').disabled = true;
		document.getElementById('shipcity').disabled = true;
		document.getElementById('shipprovince').disabled = true;
		document.getElementById('ship_country_select').disabled = true;
		document.getElementById('shippostalcode').disabled = true;
	} else {
		document.getElementById('shipaddress').disabled = false;
		document.getElementById('shipcity').disabled = false;
		document.getElementById('shipprovince').disabled = false;
		document.getElementById('ship_country_select').disabled = false;
		document.getElementById('shippostalcode').disabled = false;
		
	}
}

/* AUTOSCROLLER SCRIPTS */
i = 0
speed = .5
wait = false;

function toggleWait() {
    if (wait == false) {
        wait = true;
    } else {
        wait = false;
    }
}

function scroll() {
    if (wait == false) {
        i = i + speed
        var div = document.getElementById("specialScroll")
        div.scrollTop = i
        if (i > div.scrollHeight - 100) {i = 0}
        t1=setTimeout("scroll()",75)
    }
}

function fakeNode() {
	obj1 = document.getElementById('special_1').cloneNode(true);
        obj1.id = 'special_loop';
        document.getElementById('appendMe').appendChild(obj1);
}