/**
 * @author Aava5
 */

function setShape(_shapeId,_productName,_productId,_customerId) {
	document.getElementById("img"+_productId).src = "images/products/"+_productName+"-2~"+_shapeId+"_125.jpg";
	document.getElementById("imgZoom"+_productId).onclick=function(){window.open(productLink+"&productId="+_productId+"&diamondShapeId="+_shapeId+(_customerId==null?"":("&customerId="+_customerId)),"_self")}
	document.getElementById("img"+_productId).onclick=function(){window.open(productLink+"&productId="+_productId+"&diamondShapeId="+_shapeId+(_customerId==null?"":("&customerId="+_customerId)),"_self")}
	document.getElementById("imgAdd"+_productId).onclick=function(){window.open(productLink+"&productId="+_productId+"&diamondShapeId="+_shapeId+(_customerId==null?"":("&customerId="+_customerId)),"_self")}
}

function changeShape(_productName,_shapeId,_len,_listValues) {
	if(_shapeId!=0){
		for(var i=0;i<_listValues.length;i++){
			document.getElementById("imgShape"+_listValues[i]).className = "shapeimg clear smallborderdark";
		}
		document.getElementById("imgShape"+_shapeId).className = "shapeimg shine smallborderdark";
	}
	else{
		for(var i=0;i<_listValues.length;i++){
			document.getElementById("imgShape"+_listValues[i]).className = "shapeimg clear smallborderdark";
		}
	}
	document.body.onload = null;
	clearTimeout(timeout);
	playIt(_productName,_shapeId,_len);
}

var selectDiamondData = [];
function readSelectData()
{
	for(var io=0;io<document.getElementById("shapeSelectbox").options.length;io++)
	{
		selectDiamondData = document.getElementById("shapeSelectbox").options.length;
	}
}

function changeSelectValue(_newValue)
{
	var shapeSelectbox = document.getElementById("shapeSelectbox");
	shapeSelectbox.value = _newValue;
	shapeSelectbox.onchange();
	readSelectData();
}
