// JavaScript Document
function showProductPic(path){
	pictureField = document.getElementById('productPic');
	pictureField.src='images/loading.gif';
	pictureField.src=path;
}

function funcionCallback(){
	if( ajax.readyState == 4 ){
		if( ajax.status == 200 ){
			result = ajax.responseText;
			//alert(result);
			opts = result.split(",");
			weightShowField = document.getElementById("weightShowField")
			weightShowField.value = opts[1];
			weightField = document.getElementById("weightField")
			weightField.value = opts[1];
			priceShowField = document.getElementById("priceShowField")
			priceShowField.value = opts[0];
			priceField = document.getElementById("priceField")
			priceField.value = opts[0];
		}
	}
}


function changeFeature(feature, value){
	
	if( window.XMLHttpRequest )
		ajax = new XMLHttpRequest();
	else
		ajax = new ActiveXObject("Microsoft.XMLHTTP");

	ajax.onreadystatechange = funcionCallback;
	ajax.open( "GET", "Change-Feature.php?featureId="+feature+"&valueIndex="+value, true );
	ajax.send( "" );
}
