function swapImage(whichPic, withThis, subTitle) {
if(document.getElementById) {
document.getElementById(whichPic).src = withThis;

if(subTitle != null) {
document.getElementById('imageCaption').innerHTML = subTitle;
}
}


}

function updateImage (product, newColor) {
		newColor = newColor.replace("+", "-");
                if(newColor != "" && newColor != null && newColor != "select a color" && newColor !="chrome" && product!="clocky" && product!="chrome")
                {
                    ajaxpage('/products/content.php?product='+product+'&color='+newColor, 'productWrapper');
		}
                else if(newColor != "" && newColor != null && newColor != "select a color" && newColor =="chrome" && (product=="clocky" || product=="chrome"))
                {
                   // window.location="/products/chrome/index.php?color=chrome";
                    ajaxpage('/products/content.php?product=chrome&color=chrome', 'productWrapper');
                }
                else if(newColor != "" && newColor != null && newColor != "select a color" && newColor !="chrome" && (product=="clocky" || product=="chrome"))
                {
                    //window.location="/products/clocky/index.php?color="+newColor;
                    ajaxpage('/products/content.php?product=clocky&color='+newColor, 'productWrapper');
                }
	}
//function for Add quantity value 0 when no skin is selected.
function updateSkinQuantity(skin)
{
   var skinColor = skin.options[skin.selectedIndex].value;
   var quantity =  document.getElementById("skinQuantity");
    if(skinColor !="")
    {      
      quantity.value= 1;
    }
    else
     {
         quantity.value=0;
     }
}
	
function showZoom(whichItem) {
	zoomImage = document.getElementById(whichItem);
	zoomImage.style.display = 'block';
}

function hideZoom(whichItem) {
	zoomImage = document.getElementById(whichItem);
	zoomImage.style.display = 'none';
}