function popup(url) {
	var w = 600;
	var h = 576;
	window.open(url, 'newwin', 'toolbar=no,width='+ w +',height= ' + h + ',directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no');
}
function retractValue(e) {
	if(e.value == 'Enter a keyword') { e.value = ''; }
}
function restoreValue(e) {
	if(e.value == '') { e.value = 'Enter a keyword'; }
}
function writeCookie(name, value, hours) {
	var expire = '';
	if(hours != null) {
		expire = new Date((new Date()).getTime() + hours * 3600000);
		expire = '; expires=' + expire.toGMTString();
	}
	document.cookie = name + '=' + escape(value) + expire;
}
function setSwatch(img, col) {
	document.getElementById('color_label').innerHTML = col;
	document.getElementById('main_img').src='/images/styles/' + img;
}
var imageCache = [];
function cacheImages(imgArray) {
	var imgObj, imgSrc;
	for(imgSrc in imgArray) {
		imgObj = new Image();
		imgObj.src = imgArray[imgSrc];
		imageCache.push(imgObj);
	}
}
