
function doRequestStates(countryId, statesElm)
{
	$.ajax({
		type: 'POST',
		url: '/utils/getstates/'+countryId.toString(),
		success:
			function(html)
			{
				statesElm.html(html);
				if (html == '')
				{
					document.getElementById('liStates').style.display = 'none';
					document.getElementById('liProvince').style.display = 'block';
				}
				else
				{
					document.getElementById('liStates').style.display = 'block';
					document.getElementById('liProvince').style.display = 'none';
				}
			}
	});
}

function doRequestBillStates(countryId, statesElm)
{
	$.ajax({
		type: 'POST',
		url: '/utils/getstates/'+countryId.toString(),
		success:
			function(html)
			{
				statesElm.html(html);
				if (html == '')
				{
					document.getElementById('liBillStates').style.display = 'none';
					document.getElementById('liBillProvince').style.display = 'block';
				}
				else
				{
					document.getElementById('liBillStates').style.display = 'block';
					document.getElementById('liBillProvince').style.display = 'none';
				}
			}
	});
}

function doRequestAdminStates(countryId, statesElm)
{
	$.ajax({
		type: 'POST',
		url: '/utils/getstates/'+countryId.toString(),
		success:
			function(html)
			{
				statesElm.html(html);
				if (html == '')
				{
					document.getElementById('state').style.display = 'none';
					document.getElementById('province').style.display = 'block';
				}
				else
				{
					document.getElementById('state').style.display = 'block';
					document.getElementById('province').style.display = 'none';
				}
			}
	});
}


function doRequestAdminStatesShip(countryId, statesElm)
{
	$.ajax({
		type: 'POST',
		url: '/utils/getstates/'+countryId.toString(),
		success:
			function(html)
			{
				statesElm.html(html);
				if (html == '')
				{
					document.getElementById('ship_state').style.display = 'none';
					document.getElementById('ship_province').style.display = 'block';
				}
				else
				{
					document.getElementById('ship_state').style.display = 'block';
					document.getElementById('ship_province').style.display = 'none';
				}
			}
	});
}


function doRequestAdminStatesBill(countryId, statesElm)
{
	$.ajax({
		type: 'POST',
		url: '/utils/getstates/'+countryId.toString(),
		success:
			function(html)
			{
				statesElm.html(html);
				if (html == '')
				{
					document.getElementById('bill_state').style.display = 'none';
					document.getElementById('bill_province').style.display = 'block';
				}
				else
				{
					document.getElementById('bill_state').style.display = 'block';
					document.getElementById('bill_province').style.display = 'none';
				}
			}
	});
}


function doRequestDeliveryMethods(countryId, zip, oDropDown1, oDropDown2, oDropDown3)
{
	$.ajax({
		type: 'POST',
		url: '/utils/getDeliveryMethods/'+countryId.toString()+'/'+zip.toString(),
		success:
			function(html)
			{
				oDropDown1.html('<option value="">-- select --</option>'+html);
				oDropDown2.html('<option value="">-- select --</option>'+html);
				oDropDown3.html('<option value="">-- select --</option>'+html);
			}
	});
}

function doRequestProdItems(catId, oDropDown1)
{
	$.ajax({
		type: 'POST',
		url: '/utils/getProdItems/'+catId.toString(),
		success:
			function(html)
			{
				oDropDown1.html(html);
			}
	});
}

function doRequestProdStock(prodId, oDropDown1)
{
	$.ajax({
		type: 'POST',
		url: '/utils/getProdStock/'+prodId.toString(),
		success:
			function(html)
			{
				oDropDown1.html(html);
			}
	});
}


