function WriteSidePanel()
{
	var strHTML='';
		
	strHTML+=m_objMqButton.GetTextButtonHTML("cmdAllowImport", g_MqRef.RESX["INSTALLED_SW_CAT.BUTTON_SW_ALLOW_IMPORT"], "FlagForImport()", "", 65, "", "", 150);
	strHTML+=m_objMqButton.GetTextButtonHTML("cmdAddAssetType", g_MqRef.RESX["INSTALLED_SW_CAT.BUTTON_ADD_SW_ASSET"], "AddAssetType();", "", 65, "", "", 150);
	strHTML+=m_objMqButton.GetTextButtonHTML("cmdSetAssetType", g_MqRef.RESX["INSTALLED_SW_CAT.BUTTON_SET_SW_ASSET"], "OpenBatchUpdateWindow(1000,500, '804,805','1')", "", 65, "padding-bottom:50px;", "", 150);

	if(parent.UserHasAccessToView(67, parent.m_strValidViewIDs)){
		strHTML+=m_objMqButton.GetTextButtonHTML("cmdDiscInstalls", g_MqRef.RESX["INSTALLED_SW.BUTTON_SW_INSTALLATIONS"], "parent.LoadView('View=Installations%2FLibrary')", "", 65, "", g_MqRef.RESX["INSTALLED_SW.BUTTON_TOOLTIP_SW_INSTALLATIONS"], 150, "HTMLTextButtonNavLink", "TextButtonNavLink");
	}
		
	document.write(strHTML);
	
	SetButtonVisibleOnCheck("cmdAllowImport");
	SetButtonVisibleOnCheck("cmdSetAssetType");
	SetButtonVisibleOnCheck("cmdAddAssetType", true);
}

function AddNewRec()
{
	parent.m_objLoadDataMgr.SetOnAfterLoad("objTabsMgr.OnTabClick(0);", true);
	parent.onClickControls('AddNew');
}

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

function CopyRec(lngID)
{
	parent.m_objLoadDataMgr.SetOnAfterLoad("objTabsMgr.OnTabClick(0);", true);
	parent.onClickControls('Copy', lngID);
}

function PrintRec(lngID)
{
	parent.objControls.Print(lngID);
}

function FlagForImport()
{
	var strReturn="";
	
	//set busy state
	if (parent){
		parent.objRecord.ShowLoadingUI(true);
		
		var strDataForSave="804=1";

		var objRequest=parent.objRequest;
		if(objRequest){
			
			var strUrlPath=parent.mstrCurrentLocation+"wcCmdBar.asp?wci=wciCommand&Command=Batch";
				strPostData ="nId="+GetSelectedIssueIDs();
				strPostData+="&bQueryString="+escape(strDataForSave);
				
			var co=objRequest.Post(strUrlPath,strPostData);
			
			if (co!=objRequest.CANCEL_PROCESS){					
				var objResponse=objRequest.Response(co);
				if (objResponse.HasErrors()){
					objResponse.ProcessErrors("",true);
				}else{
					if (co!=""){
						alert(co);
					}else{
						parent.LoadData.RegenerateSumList(true, -1, true);
					}				
				}
			}	
		}
		parent.objRecord.ShowLoadingUI(false);
	}	
	return strReturn;
}

function AddAssetType()
{
	var lngSelectedSW=GetSelectedIssueIDs();
	if(lngSelectedSW!=""){
		if(parent){
			if(parent.g_VWS.SummaryList()){
		
				var strAppName=parent.g_VWS.SummaryList().GetCellValue(lngSelectedSW, "Product Name");
				var strVendor=parent.g_VWS.SummaryList().GetCellValue(lngSelectedSW, "Publisher");
				var strPostData="886=3&798=10&806=2&900=321&30="+strAppName+"&954="+strVendor;
				var objMacros=new parent.CMqMacros();
				if(objMacros){	
					strPostData=objMacros.ResolveFieldMacros(strPostData,parent.m_objLoadDataMgr,false,false);
				}
				strPostData="&txtPostData=" + g_MqRef.MqStr.MqEncodeURIComponent(strPostData);		
				
				parent.OpenModalWindow(parent.GetVDURL(parent.g_VWS.URL().BaseVDName(), "View=Resources%2FAdd%20Software" + strPostData), 1000, 500, false);
			}
		}
	}
}