var gPrevRow=new Array();var gPrevIndex=new Array();var gCurrRow=new Array();var gCurrGridView;var gResizeClientID=new Array();var gResizeMRBWidth=new Array();var gUMC=new Array();function mrbGridViewClick(strRowId,strGridId,strUnique,intRowIndex,intPageIndex,intPageSize,blnShowNavigation,strJSRowClick){strJSRowClick='mrbGridViewFieldM("'+strRowId+'");'+strJSRowClick;gCurrGridView=strGridId;var currRow=$get(strRowId);var prevRow=null;if(typeof(gPrevRow[strGridId])!="undefined")
prevRow=$get(gPrevRow[strGridId]);var strClass;currRow.className="mrbS";gCurrRow[strGridId]=(intRowIndex+1)+(intPageIndex*intPageSize);if(blnShowNavigation)
{$get(strGridId+"_lblCurrRow").innerHTML=(intRowIndex+1)+(intPageIndex*intPageSize);}
setCookie("cookieSel_"+strGridId+strUnique,(intRowIndex)+(intPageIndex*intPageSize),1);var strOnMRBJSRowClick=$get(strRowId).getAttribute("onMRBJSRowClick");if(strOnMRBJSRowClick!=null&&strOnMRBJSRowClick!="")
{eval($get(strRowId).getAttribute("onMRBJSRowClick"));}
if(strJSRowClick!=null&&strJSRowClick!="")
{eval("setTimeout('"+strJSRowClick+"',1);");}
try{OnClickonGrv(false);}catch(onerror){null;}
if(typeof(gPrevRow[strGridId])!="undefined"&&gPrevRow[strGridId]!=strRowId)
{if(gPrevIndex[strGridId]%2)
{strClass="mrbE";}
else
{strClass="mrbO";}
if(prevRow!=null)
{prevRow.className=strClass;}}
gPrevRow[strGridId]=strRowId;gPrevIndex[strGridId]=intRowIndex;}
function mrbGridViewNav(strGridId,strUnique,strNav,intPageIndex,intPageSize,intPageCnt,blnInContainer,blnShowNavigation,strJSRowClick)
{gCurrGridView=strGridId;if(intPageCnt!=0)
{setCookie("cookieNav_"+strGridId,strNav,1);var rows=$get(strGridId).getElementsByTagName("tr");var rowIdArray=new Array();var rowIdCnt=0;for(r=0;r<rows.length;r++)
{if(rows[r].id!="")
{rowIdArray[rowIdCnt]=rows[r].id;rowIdCnt++;}}
switch(strNav)
{case"first":if(intPageIndex==0)
{mrbGridViewClick(rowIdArray[0],strGridId,strUnique,0,intPageIndex,intPageSize,blnShowNavigation,strJSRowClick);}
else
{if(blnInContainer)strGridId=strGridId.replace(/_/g,"$");__doPostBack(strGridId,"Page$1");}
break;case"prev":if(gPrevIndex[strGridId]-1>-1)
{mrbGridViewClick(rowIdArray[gPrevIndex[strGridId]-1],strGridId,strUnique,gPrevIndex[strGridId]-1,intPageIndex,intPageSize,blnShowNavigation,strJSRowClick);}
else
{if(intPageIndex!=0&&gPrevIndex[strGridId]!=-1)
{if(blnInContainer)strGridId=strGridId.replace(/_/g,"$");__doPostBack(strGridId,"Page$"+(intPageIndex));}}
break;case"next":if(typeof(gPrevIndex[strGridId])=="undefined")
{gPrevIndex[strGridId]=-1;}
if(intPageSize>gPrevIndex[strGridId]+1)
{if(typeof(rowIdArray[gPrevIndex[strGridId]+1])!="undefined")
{mrbGridViewClick(rowIdArray[gPrevIndex[strGridId]+1],strGridId,strUnique,gPrevIndex[strGridId]+1,intPageIndex,intPageSize,blnShowNavigation,strJSRowClick);}}
else
{if(intPageIndex+1!=intPageCnt)
{if(blnInContainer)strGridId=strGridId.replace(/_/g,"$");__doPostBack(strGridId,"Page$"+(intPageIndex+2));}}
break;case"last":if(blnInContainer)strGridId=strGridId.replace(/_/g,"$");__doPostBack(strGridId,"Page$"+intPageCnt);break;}}}
function mrbGridViewPage(strGridId,strNav,intPageIndex,intPageSize,intPageCnt,blnInContainer)
{gCurrGridView=strGridId;setCookie("cookieNav_"+strGridId,strNav,-1);switch(strNav)
{case"firstPage":if(intPageIndex>0)
{if(blnInContainer)strGridId=strGridId.replace(/_/g,"$");__doPostBack(strGridId,"Page$First");}
break;case"prevPage":if(intPageIndex>0)
{if(blnInContainer)strGridId=strGridId.replace(/_/g,"$");__doPostBack(strGridId,"Page$Prev");}
break;case"nextPage":if(intPageIndex<intPageCnt-1)
{if(blnInContainer)strGridId=strGridId.replace(/_/g,"$");__doPostBack(strGridId,"Page$Next");}
break;case"lastPage":if(intPageIndex<intPageCnt-1)
{if(blnInContainer)strGridId=strGridId.replace(/_/g,"$");__doPostBack(strGridId,"Page$Last");}
break;default:try{var intSelIndex=$get(strGridId+"_ddlPager").selectedIndex+1;}
catch(onerror){var intSelIndex=$get(strGridId+"_edlPager").selectedIndex+1;}
if(blnInContainer)strGridId=strGridId.replace(/_/g,"$");__doPostBack(strGridId,"Page$"+intSelIndex);break;}
gPrevIndex[strGridId]=-1;gCurrRow[strGridId]=-1;}
function mrbStaySelected(strRowId,strGridId,rowIdx,pageRows){var strClass;var selRow=gCurrRow[strGridId];selRow=selRow-pageRows;if(rowIdx==selRow&&selRow>0){$get(strRowId).className='mrbS';}
else{if(rowIdx%2){strClass="mrbO";}
else{strClass="mrbE";}
$get(strRowId).className=strClass;}}
function setCookie(c_name,value,expiredays)
{var exdate=new Date()
exdate.setDate(exdate.getDate()+expiredays);document.cookie=c_name+"="+escape(value)+";path=/; expires="+exdate;}
function calcMRBWidth(strId,strMRBWidth,blnShowNavigation)
{strDivId=strId+"_div";strPagerId=strId+"_tblPager";var strParentWidth="";var strContentWidth=document.body.clientWidth;var intContainerWidth;var intMRBWidth;var strOffSetParent="";do{strOffSetParent+="offsetParent.";eval("if(typeof(document.getElementById('"+strDivId+"')."+strOffSetParent+"width)!='undefined'){strParentWidth=document.getElementById('"+strDivId+"')."+strOffSetParent+"width;}");}while(strParentWidth=="")
if(strParentWidth.indexOf("%")!=-1)
{strParentWidth=strParentWidth.replace("%","");intContainerWidth=(strParentWidth/100)*strContentWidth;}
else
{strParentWidth=strParentWidth.replace("px","");intContainerWidth=strParentWidth;}
if(strMRBWidth.indexOf("%")!=-1)
{strMRBWidth=strMRBWidth.replace("%","");intMRBWidth=(strMRBWidth/100)*intContainerWidth;}
else
{strMRBWidth=strMRBWidth.replace("px","");intMRBWidth=strMRBWidth;}
document.getElementById(strDivId).style.width=intMRBWidth;if(blnShowNavigation)
{document.getElementById(strPagerId).style.width=intMRBWidth;}}
function FindOn(strGridId,intIndex,blnChk,strVal,blnInContainer)
{strSelCol=$get(strGridId+"_ddlFindOn")[$get(strGridId+"_ddlFindOn").selectedIndex].value;setCookie("cookieFindddl_"+strGridId,strSelCol,1);if(blnChk){setCookie("cookieFindchk_"+strGridId,"true",1);}
else{setCookie("cookieFindchk_"+strGridId,"false",1);}
setCookie("cookieFindtxt_"+strGridId,strVal,1);if(strVal.length!=0)
{if(blnInContainer)strGridId=strGridId.replace(/_/g,"$");__doPostBack(strGridId,"FindOn");}
else
{alertMessage("Error","Please enter a Search Criteria","OK","","","250px","100px");}}
function FindOnEnhanced(strGridId,intIndex,blnChk,strVal,blnInContainer)
{strSelCol=$get(strGridId+"_edlFindOn")[$get(strGridId+"_edlFindOn").selectedIndex].value;setCookie("cookieFindedl_"+strGridId,strSelCol,1);if(blnChk){setCookie("cookieFindecb_"+strGridId,"true",1);}
else{setCookie("cookieFindecb_"+strGridId,"false",1);}
setCookie("cookieFindetb_"+strGridId,strVal,1);if(strVal.length!=0)
{if(blnInContainer)strGridId=strGridId.replace(/_/g,"$");__doPostBack(strGridId,"FindOn");}
else
{alertMessage("Error","Please enter a Search Criteria","OK","","","250px","100px");}}
function mrbGridViewFindUMC(strRowId){var ret=-1;if(gUMC!=null&&gUMC.length>0){var i=0;for(i=0;i<gUMC.length;i++){if(gUMC[i][0]==strRowId){ret=i;break;}}}
return ret;}
function mrbGridViewAddUMC(strRowId,strUMC){var ret=mrbGridViewFindUMC(strRowId);if(ret!=-1){gUMC[ret][1]=strUMC;}
else{gUMC.push([strRowId,strUMC]);}}
function mrbGridViewFieldM(strRowId){var ret=mrbGridViewFindUMC(strRowId);if(ret!=-1){mrbGridViewUMC(gUMC[ret][1]);}}
function mrbGridViewUMC(strValues){if(strValues!=null&&strValues.length>0){var i;var j;var values;var fieldid="";var fieldvalue="";var data=strValues.split(";");for(i=0;i<data.length;i++){if(data[i]!=null&&data[i].length>0){values=data[i].split(",");if(values.length>0&&values[0]!=null&&values[0].length>0){fieldid=fixText(values[0]);fieldvalue="";if(values[1]!=null){fieldvalue=fixText(values[1]);}
byIdSet(window,values[0],fieldvalue);}}}}}
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();