function WriteSidePanel()
{
	var strHTML='';
	strHTML+=m_objMqButton.GetTextButtonHTML("cmdAddNewInv", g_MqRef.RESX['BUTTON_ADD_NEW_AGREEMENT'], 
			"AddNewInvoice(2)", "", 65, "", "", 150);
	
	strHTML+=m_objMqButton.GetTextButtonHTML("cmdAddNewInv", g_MqRef.RESX['BUTTON_ADD_NEW_PURCHASE'], 
			"AddNewInvoice(1)", "", 65, "", "", 150);
			
	document.write(strHTML);
}

function AddNewInvoice(lngType)
{
	var strType="";
	var INV_TYPE_FIELD="912";
	if(lngType){
		strType="&txtPostData=" + g_MqRef.MqStr.MqEncodeURIComponent(INV_TYPE_FIELD + "=" + lngType);
	}
	parent.OpenModalWindow(parent.GetVDURL(parent.g_VWS.URL().BaseVDName(), "View=Purchases%26Agreements%2FAdd" + strType), 870, 740, true);
}

function EditInvInfo(lngID)
{
	parent.LoadRecord(lngID, -1, false);
}


function PrintInvoice(lngID)
{
	var lngReportID=5;
	var REPORT_WC_ASP_PATH = "../../Reports/WCMqWebReport.ASP";
	
	if(parent.m_objReportViewer){
		parent.m_objReportViewer.OpenReport(lngReportID + ".10",true,null,"",
										REPORT_WC_ASP_PATH, parent.objRequest,
										parent.mstrCurrentLocation, parent.FEATURE_NORMAL_REPORT_VIEWER, null, null, null, 
										"&param8=" + lngID + "&prmsapplied=1");
	}
}

