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.blnHasFeature116;
			}
		}
	}
	
	if(blnShowButton){	
		strHTML+=m_objMqButton.GetTextButtonHTML("cmdAddNewLoc", g_MqRef.RESX['ADD_NEW_RECORD'], "AddNewRole(7)", "", 65, "", "", 150);
	}	
	document.write(strHTML);
}

function AddNewRole(lngType)
{
	var strType="";
	var ROLE_TYPE_FIELD="808";
	if(lngType){
		strType="&txtPostData=" + g_MqRef.MqStr.MqEncodeURIComponent(ROLE_TYPE_FIELD + "=" + lngType);
	}
	parent.OpenModalWindow(GetVDURL(parent.g_VWS.URL().BaseVDName(), "View=Roles%2FAddLoc" + strType), 1440, 900, true);
}

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

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

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;
}