//all functions for chelseatextiles.com
var currentImg;

function fabImg(code, desc) {
//swap image
	bigImg.src = '../384/' + code + '.jpg';
// replace code and desc text
	// strip image reference off code
	realCode = code.replace("-D", "");
	realCode = realCode.replace("-B", "");
	document.getElementById('code').innerHTML = realCode; 
	document.getElementById('desc').innerHTML = desc;

// highlight the right link
	if (currentImg == null) {
		//alert('currentImg == null');
		document.getElementById(code).style.fontWeight ='bold';
		currentImg = code;
	}
	else {
		//alert('currentImg != null');
		document.getElementById(currentImg).style.fontWeight ='normal';
		document.getElementById(code).style.fontWeight ='bold';
		currentImg = code;
	}
}


function email(usr, domain) { // spambot protection 4 mailto urls
	menolikeyspam = 'mailto:' + usr + '@' + domain;
	document.location.href = menolikeyspam;
}

function thumbOver(what) {
what.style.backgroundColor='#B5B98A';
what.style.borderColor='#8C6239';
}

function thumbOut(what) {
what.style.backgroundColor='#D6D2BC';
what.style.borderColor='#C69C6D';
}

