var specData = new Array();

$(document).ready(function() {
	$(".specIcon").mouseover (
		function() {
			var obj = $(this);
			var tmp = $(obj).attr("id").split("_");
			var productId = tmp[1];
			var torrentId = tmp[2];
			var offerTypeId = tmp[3];
			//alert(productId);

			var ids = new Array(productId, torrentId, offerTypeId);
			loadSpec(obj,ids);
		}
	);
});

function loadSpec(obj, ids) {
	if (specData[ids] != undefined) {
		$(".specDataText").html(specData[ids]);
	} else {
		$.ajax({
			type: "post",
			url: "/ajaxProductSpec.php",
			data: "productId=" + ids[0] + "&torrentId=" + ids[1] + "&offerTypeId=" + ids[2],
			success: function(d){
				specData[ids] = d;
				$(".specDataText").html(d);
			}
		});
	}
}

