function WriteSidePanel()
{
var blnShowButton=false;
	var strHTML='';
	
	if(parent){
		if(parent.objFrames){
			var winTopTB=parent.objFrames.GetFrameWindow(parent.TOPTOOLBAR_FRAME_ID);
			if (winTopTB){
				blnShowButton=winTopTB.blnHasFeature117;
			}
		}
	}
	
	if(blnShowButton){
		strHTML+=m_objMqButton.GetTextButtonHTML("MassUpdate", g_MqRef.RESX['SL.MASS_UPDATE_SELECTED_ISSUES'], "OpenBatchUpdateWindow()", "", 65, "padding-bottom:50px;", "", 150);

	}
	
	if(parent.UserHasAccessToView(20, parent.m_strValidViewIDs)){
		strHTML+=m_objMqButton.GetTextButtonHTML("AssetTypes", g_MqRef.RESX['BUTTON_MANAGE_ASSET_DEFS'], "parent.LoadView('View=Resources%2FManage')", "", 65, "", "", 150, "HTMLTextButtonNavLink", "TextButtonNavLink");
	}
	
	document.write(strHTML);
}

function AddNewRes(lngLevel)
{
	var strLevel="";
	var ITEM_LEVEL_FIELD="886";
	if(lngLevel){
		strLevel="&txtPostData=" + g_MqRef.MqStr.MqEncodeURIComponent(ITEM_LEVEL_FIELD + "=" + lngLevel);
	}
	parent.OpenModalWindow(GetVDURL(parent.g_VWS.URL().BaseVDName(), "View=Resources%2FAdd" + strLevel), 970, 730, true);
}

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


function GetVDURL(strBaseVD, strAddRedirQS)
{
	var co = parent.objRequest.Get(parent.mstrCurrentLocation + "wcProdInv.asp?WCI=wciGetDiffVDURL&Base=" + strBaseVD + 
										"&AddQS=" + g_MqRef.MqStr.MqEncodeURIComponent(strAddRedirQS));
	if (co!=parent.objRequest.CANCEL_PROCESS){

		var objResponse=parent.objRequest.Response(co);
									
		if (objResponse){
			if (objResponse.HasErrors()){
				objResponse.ProcessErrors("",true,window);
			}else{
				return co;
			}
		}
	}
				
	return true;
}
