
var proWindow

function setType()
{
	tempIndex=document.forms[0].ProcurCat.selectedIndex;
	//alert(tempIndex)
	if (tempIndex==1)
	{
	document.forms[0].Type.value="G";
	}
	else 
	if (tempIndex>3)
	{
	document.forms[0].Type.value="S";
	}
	else
	{
	document.forms[0].Type.value="";
	}
}

function changeAgency()
{
	if (typeof(proWindow)=="object")
	{	if (!(proWindow.closed))
		proWindow.close();
	}

	{
	ASPName="requestAgency.asp";

	specification = "statusbar=yes;menubar=no,scrollbars=yes,resizable=yes,width=710,height=450,left=50,top=50";
	proWindow = window.open(ASPName, "proWindow", specification);
	//proWindow = window.open(ASPName, "proWindow");

	}
}

function my_Codes(strSelected)
{
	document.forms[0].ComCode.value=unescape(strSelected);
}

function SelectComCode()
{
	//ASPName="CommodityClasses.asp?ComCode="+escape(document.forms[0].ComCode.value)+"&Type="+document.forms[0].Type.value;
	//window.location.href=ASPName
	document.formReport1.action="CommodityClasses.asp";
	document.formReport1.submit();
}

function ClearAll()
	{		
		document.formReport1.TON.selectedIndex=0;
		document.formReport1.ProcurCat.selectedIndex=0;
		document.formReport1.ComCode.value="";
		document.formReport1.PIN.value="";
		document.formReport1.Keyword.value="";
		document.formReport1.AC.selectedIndex=0;
		document.formReport1.DateStart.value="";
		if (typeof(document.formReport1.DateCutOff)=="object")
		{
			document.formReport1.DateCutOff.value="";
		}
		document.formReport1.Type.value="";
		document.formReport1.searchDescriptions[0].checked=false;
		document.formReport1.searchDescriptions[1].checked=true;
		document.formReport1.qryType[1].checked=false;
		document.formReport1.qryType[0].checked=true;
		if (typeof(document.formReport1.byDueDate)=="object")
		{
			document.formReport1.byDueDate.checked=false;
		}		
		document.formReport1.byPublishDate.checked=true;
		document.formReport1.byAgency.checked=false;
		document.formReport1.Alpha.checked=false;
	}
	
	function showCalendar(ControlNumber)
	
{	
	ASPName="SelectDate.asp?ControlNumber="+ControlNumber
	
	ASPName=ASPName+"&seldate="+document.forms[0].elements[ControlNumber].value;
	
	specification = "menubar=no,scrollbars=no,resizable=yes,width=275,height=270,left=50,top=50";
	//alert(ASPName);
	proWindow = window.open(ASPName, "proWindow", specification);
	
}
