function processCart(mode)
{
	document.frmcart.mode.value = mode;
	document.frmcart.submit();
}

function addtocart(mode,id)
{
	qty=document.getElementById("qty"+id).value;
	if(qty!='')
	{
	document.frmmerch.mode.value = mode;
	document.frmmerch.id.value = id;
	document.frmmerch.qty.value=qty;
	document.frmmerch.submit();
	}
	else
	{
		 alert("Please enter quantity");
	}
}


function hideTable(val)
{
	if(val==true)
	{
		document.getElementById('Ship_Address').style.display = "none";
	}
	else
	{
		document.getElementById('Ship_Address').style.display="";
	}
}

function fillInfo(control,basefield,selectedfield)
{
	control.options.length = 0;
	flag = 0;
	for(i=0,j=0; i<fillArr.length; i++)
	{
		if(fillArr[i][0] == basefield)
		{
			if(selectedfield == fillArr[i][1])
			{
				control.options[j] = new Option(fillArr[i][1]+" "+fillArr[i][2]);
				control.options[j].value = fillArr[i][1];
				control.options[j].selected = true;
				flag = 1;
				
			}
			else
			{
				control.options[j] = new Option(fillArr[i][1]+" "+fillArr[i][2]);
				control.options[j].value = fillArr[i][1];
			}				
			j++;
		}
	}
}
function checkNumber(textBox)
{
	
	while (textBox.value.length > 0 && isNaN(textBox.value)) {
		textBox.value = textBox.value.substring(0, textBox.value.length - 1)
	}
	
	textBox.value = textBox.value;
}

