function sendreq(act,id,pg)
{
	var loc=pg+"?action="+act;
	var idval="";
	if (act=="updateaddress")
	{
		var len=eval("document.myaccount.addrmanage.length");
		for (var i=0; i < len; i++)
	   {
			if (eval("document.myaccount.addrmanage[i].checked"))
			{
				idval = eval("document.myaccount.addrmanage[i].value");
			}
		}
		if (idval=="")
		{
			alert("Please select among Modify Billing Address, Modify Shipping Address, or Create New Shipping Address.");
		}
		else
		{
			loc+="&actiontype="+idval;
			loc+="&modaddress="+document.getElementById("modaddress").value;
			loc+="&modcity="+document.getElementById("modcity").value;
			loc+="&modstate="+document.getElementById("modstate").value;
			loc+="&modcountry="+document.getElementById("modcountry").value;
			loc+="&modzipcode="+document.getElementById("modzipcode").value;
			if (idval=="modship")
			{
				loc+="&addrid="+document.getElementById("modship").value;
			}
			document.location=loc;
		}
	}
	else if (act=="orderdetail")
	{
		loc+="&orderid="+id;
		document.location=loc;
	}
	else if (act=="orderconfirm" || act=="submitorder" || act=="pending")
	{
		loc+="&placedby="+document.getElementById("placedby").value+"&shipmethod="+document.getElementById("shipmethod").value+"&shipaddrid="+document.getElementById("selship").value+
			"&notes="+document.getElementById("notes").value+"&ponumber="+document.getElementById("ponumber").value;
		document.location=loc;
	}
	else if (act=="cancelall")
	{
		var conf= confirm("Are you sure you want to remove all items from the shopping cart?");
		if (conf)
		{
			document.location=loc;
		}
		
	}
	else if (act=="orderupdate")
	{
		loc+="&orderid="+id;
		document.location=loc;
	}
	else if (act=="setdefault")
	{
		loc+="&shipaddrid="+document.getElementById("shipsel").value;
		document.location=loc;
	}
	else if (act=="addnewitem")
	{
		if(document.getElementById("newitemno").value=="")
		{
			alert("Please select an item");
			document.getElementById("newitemno").focus();
		}
		else if (document.getElementById("newqty").value=="")
		{
			alert("Please enter a quantity");
			document.getElementById("newqty").focus();
			document.getElementById("newqty").style.background=paleRed;
		}
		else
		{
			var itm=document.getElementById("newitemno").value.split("!");
			loc+="&newitemno="+itm[0]+"&newqty="+document.getElementById("newqty").value+"&newunt="+document.getElementById("newunt").value+"&unitprice="+document.getElementById("unitprice").value;
			loc+="&placedby="+document.getElementById("placedby").value+"&shipmethod="+document.getElementById("shipmethod").value+"&selship="+document.getElementById("selship").value;
			loc+="&ponumber="+document.getElementById("ponumber").value;
			document.location=loc;
		}
	}
	else if (act=="addordnewitem")
	{
		if(document.getElementById("ordnewitemno").value=="")
		{
			alert("Please select an item");
			document.getElementById("ordnewitemno").focus();
		}
		else if (document.getElementById("ordnewqty").value=="")
		{
			alert("Please enter a quantity");
			document.getElementById("ordnewqty").focus();
			document.getElementById("ordnewqty").style.background=paleRed;
		}
		else
		{
			var itm=document.getElementById("ordnewitemno").value.split("!");
			loc+="&ordnewitemno="+itm[0]+"&ordnewqty="+document.getElementById("ordnewqty").value+"&ordnewunt="+document.getElementById("ordnewunt").value+"&ordunitprice="+document.getElementById("ordunitprice").value;
			loc+="&ordplacedby="+document.getElementById("ordplacedby").value+"&ordshipmethod="+document.getElementById("ordshipmethod").value+"&selordr="+document.getElementById("selordr").value;
			loc+="&orderid="+id;
			document.location=loc;
		}
	}
}
