function showColors(id) {
	obj = document.getElementById(id);
	if (obj)	
		obj.style.display = '';
}

function hideColors(id) {
	setTimeout("thide('"+id+"')", 500);
}

function thide(id) {
	obj = document.getElementById(id);
	if (obj)
		obj.style.display = 'none';
}

function change_swatch(swatchid, cat, mod, details) {

	var redirect = '';
	if (mod == 'color')
		_swatch = color_swatches[swatchid];

	if (cat > 0 && !details){
		if (mod == 'lprice') 
			document.fakeswatchesform.lprice.value = swatchid;
		else if (mod == 'color')
			document.fakeswatchesform.category_swatch.value = swatchid;
		else if (mod == 'type')
			document.fakeswatchesform.type_.value = swatchid;
		document.fakeswatchesform.submit();
	} else if (_swatch) {
		document.getElementById('product_thumbnail_main').src = 'image.php?type=B&id=' + swatchid;
		document.getElementById('product_thumbnail_main').title = _swatch;
		document.getElementById('current_swatch').style.backgroundImage = 'url(' + _swatches_images[swatchid].src + ')';
		document.getElementById('current_swatch').innerHTML = _swatch;
	} else {
		document.getElementById('product_thumbnail_main').src = tmbn_url;
		document.getElementById('product_thumbnail_main').title = '';
		document.getElementById('current_swatch').style.backgroundImage = '';
		document.getElementById('current_swatch').innerHTML = '';
	}
}
