// JavaScript Document

function UpdateQty(itemNo){
	var qty;
	qty = $('#Qty_'+itemNo).val();
	$.ajax({type:"POST", url:"/cart/update/", data:"&ItemNo="+itemNo+"&Qty="+qty, success: function(msg){ }});
}

function closeTBEditor(){
	parent.tb_remove();
}

var bighandle;
function showdetail(id,iname){
	$('#bighandle').attr({src: '/images/jpeg274/' + iname });
	$('#selectedid').attr({value: id });
}


function AddProdToCart(id, price, sku, desc)
{
	document.getElementById("sku").value = sku;
	document.getElementById("price").value = price;
	document.getElementById("desc").value = desc;
	document.getElementById("qty").value = document.getElementById("qty_"+id).value;

	document.getElementById("ctl00_MainContent_AddToCart").click();
}

function showSWDetail(id, iname, color, price, sku, Type)
{
	if(bighandle!=null)
	{
		bighandle.src = '/images/studiowilliam/' + iname;
	}

	var hidden = document.getElementById("selectedid");
	if(hidden != null)
	{
		hidden.value = id;
	}

	if(Type == 20){
		document.getElementById("ItemCopy").innerHTML = '<span id="ItemHeader" style=" font-weight: bold;">20 pc set includes:</span><br><span id="ItemCopyText">4 Salad Forks, 4 Dinner Forks, 4 Dinner Knives, 4 Dinner Spoons &amp; 4 Teaspoons';
	}

	if(Type == 45){
		document.getElementById("ItemCopy").innerHTML = '<span id="ItemHeader" style=" font-weight: bold;">45 pc set includes:</span><br><span id="ItemCopyText">8 Salad Forks, 8 Dinner Forks, 8 Dinner Knives, 8 Dinner Spoons, 8 Teaspoons, 1 Serving Fork, 1 Slotted Serving Spoon, 1 Serving Spoon, 1 Butter Knife  &amp; 1 Sugar Spoon</span>';
	}

	document.getElementById("Color").innerHTML = color;
	document.getElementById("DispPrice").innerHTML = price;

	document.getElementById("sku").value = sku;
	document.getElementById("price").value = price;
	document.getElementById("desc").value = color;
}

function showFiestaDetail(id, iname, color, price, sku){
	if(bighandle!=null){
		bighandle.src = '/images/jpeg274/' + iname;
	}

	var hidden = document.getElementById("selectedid");
	if(hidden != null){
		hidden.value = id;
	}
	
	document.getElementById("Color").innerHTML = color;
	document.getElementById("DispPrice").innerHTML = price;

	document.getElementById("sku").value = sku;
	document.getElementById("price").value = price;
	document.getElementById("desc").value = 'Fiesta - 5pc set - ' + color;
}

function zoom(){
	if(lastimg != null){
		newwindow=window.open('/zoomas.html','name','height=275,width=525');
		if (window.focus) {newwindow.focus()}
		return false;
	}
}

function zoomimg(img){
	newwindow=window.open('/zoomas.html','name','height=275,width=525');
	if (window.focus) {newwindow.focus()}
	return false;
}

function privacy(){
	newwindow=window.open('/privacy.html','name','height=400,width=400');
	if (window.focus) {newwindow.focus()}
	return false;
}

function FormatShopViewCart(Price){
	document.getElementById('FiestaShopViewCart').style.width = "210px";
	document.getElementById('FiestaShopViewCart').style.height = "489px";

	document.getElementById('Color').innerHTML = "Multi-Color";
	document.getElementById('DispPrice').innerHTML = Price;

	document.getElementById('sku').value = "237415FSTA17";
	document.getElementById('price').value = Price;
	document.getElementById('desc').value = "Fiesta - Hostess 5pc set";

	document.getElementById('FiestaHeaderImage').src = "/images/fiesta/title_accessories.gif";

	document.getElementById('ItemCopy').innerHTML = "5 pc hostess set includes:";
	document.getElementById('ItemCopyText').innerHTML = "1 Slotted Serve Spoon, 1 Butter Knife, 1 Serving Fork, 1 Sugar Shell &amp; 1 Serve Spoon";
}

function ToggleDiv(divId){
	if(document.getElementById(divId).style.display == "none"){
		document.getElementById(divId).style.display = "block";
	}else{
		document.getElementById(divId).style.display = "none";
	}
}