var View_ns4=(document.layers)?true:false;var View_ns6=(!document.all && document.getElementById)?true:false;var View_ns7= false;if (View_ns6){var cStr;cStr = new String(navigator.userAgent);if (cStr.indexOf("/7") != -1){View_ns7 = true; View_ns6 = false;}}var View_opera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;var View_ie=(document.all)?true:false;var View_mozilla = false;if (View_ns6 || View_ns7){View_mozilla = (navigator.userAgent.indexOf("Netscape")==-1)?true:false;}var View_Win = true;var View_Mac = (navigator.appVersion.toLowerCase().indexOf("mac")!=-1)?true:false;if(View_Mac){ View_Win = false;}if (View_opera){ View_ns4 = false;View_ns6 = false;  View_ns7 = false; View_ie = false;View_mozilla = false;}if (View_mozilla) { View_ns4 = false;View_ns6 = false;  View_ns7 = false; View_ie = false;View_opera = false;}var g_cSeparator = '#_#';var g_cSeparator2= '#//#';var g_cConstEmpty= '_%-EMPTY-%_';var g_cIDName = 'ViewCateg_';var g_cBaseURL= '/FFER/EWCM/';var g_cNotesField= 'Field';var g_cWaitingTag= 'Waiting';var g_oWaitingElem  = null;var g_bEmptyCateg  = true; var g_cEmptyCategText = '&lt;no value&gt;';var g_cURLSuffix = '';var View_FMT_TXT = 1;var View_FMT_DATE= 2;var View_FMT_TIME= 3;var View_FMT_DTTM= 4;var View_FMT_NBR = 5;var View_FMT_IMAGE  = 6; var View_FMT_FREE= 7; var View_FMT_CHK = 8; var View_LNK_URL = 1;var View_LNK_UID = 2;var View_LNK_NEW = 4;var g_nCategSpSize = 30;var g_cStyleTitle  = 'Title';var g_cStyleData= 'Data';var g_cStyleDataLnk = 'DataLnk';var g_cStyleCateg  = 'Cat';var g_cImgAsc= './Asc.gif';var g_cImgDesc  = './Desc.gif';var g_cImgCat= './Cat.gif';var g_cImgUncat = './Uncat.gif';var g_cImgExp= './Exp.gif';var g_cImgColl  = './Coll.gif';var g_bHeaderShow = true;var g_nHeaderBeforeSize = 0;var g_nHeaderAfterSize  = 0;var g_cPrintField = 'PrintField';var g_bPrintViewSort = true;var g_cLastCHKSel = '';var g_nKeyPressed = 0;var g_cExternalTools = '';var g_cCheckBoxHelp  = '';var g_bScrollHeader  = false;var g_bDEBUG = false;var g_bBestPerformance = false;var g_bDetectKeyPress  = false;var oView = new clTable();function clTable(){ this.bInit  = true;this.nCol= 0;this.Columns= new Array();this.nLine  = 0;this.Lines  = new Array();this.nLastSort = 0;this.ColOrder  = new Array();this.Order  = new Array();this.SubOrder  = new Array();this.Category  = new Array();this.nChecked  = 0;this.Checked= new Array();this.bSyntaxGenerated = false;this.nScrollStartPos  = -1;this.AddColumn = _AddColumn;this.AddLine= _AddLine;this.Generate  = _Generate;this.SortColumn= _SortColumn;this.SwitchCol = _SwitchCol;this.SwitchCol2= _SwitchCol2;this.Categorize= _Categorize;this.SetSyntaxLine= _SetSyntaxLine;this.OpenCloseCategory  = _OpenCloseCategory;this.GetCategoryStatus  = _GetCategoryStatus;this.SortCatView  = _SortCatView;this.GetLastCategCol = _GetLastCategCol;this.ShowHideCategory= _ShowHideCategory;this.ExpandList= _ExpandList;this.ExpandAll = _ExpandAll;this.CollapseAll  = _CollapseAll;this.CopyColumn= _CopyColumn;this.Check  = _Check;this.CheckGroup= _CheckGroup;this.CheckAffect  = _CheckAffect;this.CheckSubGroup= _CheckSubGroup;this.UnCheckPrevious = _UnCheckPrevious;this.OpenLink  = _OpenLink;this.SaveSettings = _SaveSettings;this.RestoreSettings = _RestoreSettings;this.ScrollTitle  = _ScrollTitle;function _AddColumn( _cTitle , _nDataType , _bDisplay , _bLink , _nSize , _bDisplayTools, _nAlignRight){this.SubOrder[this.nCol] = new Array();this.ColOrder[this.nCol] = this.nCol;this.Columns[this.nCol]  = new clColumn( _cTitle , _nDataType , _bDisplay  , _bLink , _nSize , _bDisplayTools, _nAlignRight);this.nCol ++;}function _AddLine(){var nIndex = 0;var cValue = '';this.Order[this.nLine] = this.nLine + g_cSeparator + this.nLine;this.Lines[this.nLine] = new clLine( this.nLine , arguments[0] , arguments[1]);for(nIndex=0 ; nIndex < this.nCol ; nIndex++){cValue = '';if( nIndex <= arguments.length ){cValue = arguments[nIndex+2];}this.SubOrder[nIndex][this.nLine] = cValue + g_cSeparator + this.nLine + g_cSeparator + nIndex;this.Lines[this.nLine].AddValue( cValue );}this.nLine ++;}function _SaveSettings(_aList){ var nIndex= 0;  var nIndex2  = 0;  var nBoolean = 0;    for(nIndex=0 ; nIndex < _aList.length ; nIndex++)  {_aList[nIndex] = ''; }    for(nIndex=0 ; nIndex < this.nCol ; nIndex++)  {if (this.Columns[this.ColOrder[nIndex]].bCategorised){_aList[nIndex2] = 'CAT' + g_cSeparator + this.ColOrder[nIndex];nIndex2 ++;} }    for(nIndex=0 ; nIndex < this.nCol ; nIndex++)  {if (this.Columns[this.ColOrder[nIndex]].bCategorised){nBoolean = 0;if(this.Columns[this.ColOrder[nIndex]].bSortAsc) nBoolean = 1;_aList[nIndex2] = 'SORT' + g_cSeparator + this.ColOrder[nIndex] + g_cSeparator + nBoolean;nIndex2 ++;} }    nBoolean = 0;  if(this.Columns[this.nLastSort].bSortAsc) nBoolean = 1;  _aList[nIndex2] = 'SORT' + g_cSeparator + this.nLastSort + g_cSeparator + nBoolean;}function _RestoreSettings(_aList){ var nIndex= 0;  var cType = '';  var nColumn  = 0;  var bSortAsc = true;    if(this.Columns[this.ColOrder[0]].bCategorised)  { this.Categorize(this.ColOrder[0]); }    for(nIndex=0 ; nIndex < _aList.length ; nIndex++)  {cType = ViewExtractString(_aList[nIndex] , 0 , g_cSeparator);  nColumn  = parseInt(ViewExtractString(_aList[nIndex] , 1 , g_cSeparator));  bSortAsc = parseInt(ViewExtractString(_aList[nIndex] , 2 , g_cSeparator));    if( cType == 'CAT' )  {this.Categorize(nColumn); }  else if( cType == 'SORT' )  {this.SortColumn(nColumn , bSortAsc); } }}function _SortColumn(_nCol , _bAsc){ var nIndex = 0;  var nIndex2 = 0;  var bCategorized = false;  var nLastCateg = -1;  var cHTMLSyntax = '';  Wait(true);    nLastCateg = -1;  for(nIndex=0 ; nIndex < this.nCol ; nIndex++)  {if (this.Columns[this.ColOrder[nIndex]].bCategorised){ nLastCateg = nIndex;} }    for(nIndex=0 ; nIndex < this.nLine ; nIndex++)  {this.Order[nIndex] = '';  for( nIndex2=0 ; nIndex2 <= nLastCateg ; nIndex2++)  {if(g_bBestPerformance){this.Order[nIndex] += ViewComplete(ViewExtractString(this.SubOrder[this.ColOrder[nIndex2]][nIndex],0,g_cSeparator)) + g_cSeparator2 ;}else {this.Order[nIndex] += this.SubOrder[this.ColOrder[nIndex2]][nIndex] + g_cSeparator2 ; } }  this.Order[nIndex] += this.SubOrder[_nCol][nIndex]; }    this.nLastSort = _nCol;  this.Columns[_nCol].bSortAsc = _bAsc;  this.Order = this.Order.sort( this.SortCatView );    if( ! this.bInit) setTimeout('ViewGenerate();' , 1);}function _Categorize(_nCol){ var nIndex= 0;  var bSubCat  = false;  var nLastPos = 0;  var ArrayFrom = new Array();  var ArrayTo= new Array();  var nArray = 0;  Wait(true);  if (! this.Columns[_nCol].bCategorised)  {this.Columns[_nCol].bCategorised = true;  this.Columns[_nCol].bSortAsc  = true;  nIndex = this.GetLastCategCol(_nCol);  this.SwitchCol(_nCol,nIndex); }  else {bSubCat = false;  for(nIndex=0 ; nIndex < this.nCol ; nIndex ++)  {   if (this.ColOrder[nIndex] == _nCol)  { bSubCat = true; }  if (bSubCat)  { if( this.Columns[this.ColOrder[nIndex]].bCategorised ){   this.Columns[this.ColOrder[nIndex]].bCategorised = false;    nLastPos = this.Columns[this.ColOrder[nIndex]].PullLastPos();  if( nLastPos != -1 )  {ArrayFrom[nArray] = this.ColOrder[nIndex];ArrayTo[nArray]= nLastPos;nArray ++ }} } }    for(nIndex=(nArray - 1) ; nIndex >= 0 ; nIndex --)  {this.SwitchCol( ArrayFrom[nIndex] , ArrayTo[nIndex] ); }  this.SetSyntaxLine();}    this.SortColumn(0 , true);}function _Check(_cIDInput , _bUnChkPrev){var oField; var oTmpField; var nIndex  = 0; var nIndex2 = 0; var nFrom= 0; var nTo  = 0; var nColumn = 0; oField = ViewGetElement(_cIDInput); if( oField ) {   if(g_bDetectKeyPress)  {if(g_nKeyPressed == 16 && g_cLastCHKSel != '')   {   nFrom= parseInt(ViewExtractString(g_cLastCHKSel , 2 , '_'));  nTo  = parseInt(ViewExtractString(_cIDInput , 2 , '_'));  nColumn = parseInt(ViewExtractString(_cIDInput , 3 , '_'));  nFrom= this.Lines[nFrom].nOrderNbr  nTo  = this.Lines[nTo].nOrderNbr  if(nFrom > nTo)  {nIndex = nFrom;nFrom  = nTo;nTo = nIndex; }  for(nIndex=nFrom ; nIndex <= nTo ; nIndex++)  { nIndex2 = parseInt( ViewExtractString(this.Order[nIndex] , 1 , g_cSeparator) );  oTmpField = ViewGetElement('CHK_' + g_cIDName + nIndex2 +'_'+nColumn);  if( oTmpField )  {oTmpField.checked = oField.checked  this.CheckAffect(oTmpField , 'CHK_' + g_cIDName + nIndex2 +'_'+nColumn , _bUnChkPrev , nIndex2); } }  g_cLastCHKSel = _cIDInput; }  else { this.CheckAffect(oField , _cIDInput , _bUnChkPrev , -1);} }  else { this.CheckAffect(oField , _cIDInput , _bUnChkPrev , -1);}}}function _CheckAffect(_oField , _cIDInput , _bUnChkPrev , _nColID){ var nIndex = 0;  if( _oField.checked )  {this.Checked[this.nChecked] = _cIDInput;this.nChecked ++; }  else {   for(nIndex=0 ; nIndex < this.nChecked ; nIndex++)  {if( this.Checked[nIndex] == _cIDInput ){this.Checked[nIndex] = '';} }  if( ! _oField.checked && _bUnChkPrev)  {if( _nColID != -1)  {nIndex = _nColID; }  else { nIndex = parseInt(ViewExtractString(_cIDInput , 2 , '_'));}  this.UnCheckPrevious(this.Lines[nIndex].cLineDynID); }} if(_nColID == -1) {g_cLastCHKSel = _cIDInput;}}function _CheckGroup(_cIDInput){var oFld1;var oFld2;var nIndex  = 0;var nIndex2 = 0;var nIndex3 = 0;var cID = '';var nColChk = -1;var aColChk = new Array();oFld1 = ViewGetElement(_cIDInput + '_Chk');if (oFld1){ this.CheckSubGroup(_cIDInput , oFld1.checked);for(nIndex2 = 0 ; nIndex2 < this.nCol ; nIndex2 ++){if( this.Columns[this.ColOrder[nIndex2]].nDataType == View_FMT_CHK ){nColChk ++; aColChk[nColChk] = this.ColOrder[nIndex2];}}for(nIndex = 0 ; nIndex < this.nLine ; nIndex ++){ nIndex3 = parseInt( ViewExtractString(this.Order[nIndex] , 1 , g_cSeparator) );if (this.Lines[nIndex3].cLineDynID.indexOf(_cIDInput+'_') != -1){for(nIndex2 = 0 ; nIndex2 <= nColChk ; nIndex2 ++) {cID = 'CHK_' + g_cIDName + nIndex3 + '_' + aColChk[nIndex2]; oFld2 = ViewGetElement(cID); if (oFld2) {oFld2.checked = oFld1.checked; this.Check(cID , false);}}}}if( ! oFld1.checked){this.UnCheckPrevious(_cIDInput);}}}function _CheckSubGroup(_cIDInput , _bChecked){var oFld1;var nIndex  = 0;do{nIndex ++;oFld1 = ViewGetElement(_cIDInput+'_'+nIndex+'_Chk');if (oFld1){oFld1.checked = _bChecked; this.CheckSubGroup(_cIDInput+'_'+nIndex , _bChecked)}else { oFld1 = ViewGetElement(_cIDInput+'_'+nIndex);   }}while(oFld1);}function _UnCheckPrevious(_cIDInput){var arrayOfString;var nIndex = 0;var cID = '';var oFld;var cTmpString = new String(_cIDInput);arrayOfString = cTmpString.split('_');for(nIndex = 0 ; nIndex < (arrayOfString.length - 1) ; nIndex ++){if(cID != '') { cID += '_';} cID += arrayOfString[nIndex]; oFld = ViewGetElement(cID + '_Chk'); if (oFld) {oFld.checked = false;}}}function _GetLastCategCol(_nCol){var bCateg = false;var nIndex = 0;do{ if( this.ColOrder[nIndex] == _nCol ){ return nIndex;}bCateg = this.Columns[this.ColOrder[nIndex]].bCategorised;if (bCateg){nIndex ++;if (nIndex > this.nCol) {bCateg = false;}}}while (bCateg);return nIndex;}function _SortCatView( _a , _b ){var a = '';var b = '';var nIndex  = 0;var nColIndex  = 0;var bAsc = true;var nColType= 0;var nNbrResult = 0;var cTemp= '';if( g_bBestPerformance ){ /*  a= ViewExtractString( _a , nIndex , g_cSeparator2); nColIndex = parseInt(ViewExtractString( a , 2 , g_cSeparator)); bAsc= oView.Columns[nColIndex].bSortAsc;*/ bAsc= true; if(_a > _b) {if (bAsc) { return 1;} else { return -1;}} else if(_a < _b) {if (bAsc) { return -1;} else { return 1;}}}else { do{a = ViewExtractString( _a , nIndex , g_cSeparator2);if (a != null){b = ViewExtractString( _b , nIndex , g_cSeparator2);nColIndex = parseInt(ViewExtractString( a , 2 , g_cSeparator));a = ViewExtractString( a , 0 , g_cSeparator);b = ViewExtractString( b , 0 , g_cSeparator);bAsc  = oView.Columns[nColIndex].bSortAsc;nColType = oView.Columns[nColIndex].nDataType;switch (nColType){case View_FMT_DATE :a = ViewExtractString( a , 2 , '/') + ViewExtractString( a , 1 , '/') + ViewExtractString( a , 0 , '/');b = ViewExtractString( b , 2 , '/') + ViewExtractString( b , 1 , '/') + ViewExtractString( b , 0 , '/');break;case View_FMT_TIME :a = ViewReplaceStr( a , ':' , '');b = ViewReplaceStr( b , ':' , '');break;case View_FMT_DTTM :cTemp = ViewExtractString( a , 1 , ' ');a = ViewExtractString( a , 2 , '/') + ViewExtractString( a , 1 , '/') + ViewExtractString( a , 0 , '/') + ViewReplaceStr( cTemp , ':' , '');cTemp = ViewExtractString( b , 1 , ' ');b = ViewExtractString( b , 2 , '/') + ViewExtractString( b , 1 , '/') + ViewExtractString( b , 0 , '/') + ViewReplaceStr( cTemp , ':' , '');break;}switch (nColType){case View_FMT_NBR :nNbrResult = parseInt(a) - parseInt(b);if (nNbrResult != 0){if (bAsc) { return nNbrResult;}else { return (nNbrResult * -1);}}break;default : if(a > b){if (bAsc) { return 1;}else { return -1;}}else if(a < b){if (bAsc) { return -1;}else { return 1;}}}}nIndex ++;}while(a != null);}return 0;}function _OpenLink(_nLineNbr){var cSyntax = '';cSyntax = ViewGetLinkSyntax(this.Lines[_nLineNbr].UniqueID , this.Lines[_nLineNbr].nLinkType);setTimeout(cSyntax,1);}function _OpenCloseCategory(_cIDName){var doc;var cStatus = '';doc = ViewGetElementStyle(_cIDName+'_Coll');if (doc){ cStatus = doc.display;  if(cStatus == 'none') { doc.display = 'inline';}  else { doc.display = 'none';}}doc = ViewGetElementStyle(_cIDName+'_Exp');if (doc){ if(cStatus == 'none') { doc.display = 'none';}  else { doc.display = 'inline';}}if (cStatus == 'inline') { cStatus = 'hide';}else { cStatus = 'show';}this.ShowHideCategory(_cIDName , cStatus);}function _ShowHideCategory(_cIDName ,_cStatus){var doc;var doc2;var nIndex  = 0;var cStatus = '';if(_cStatus == 'show') { cStatus = '';}else { cStatus = 'none';}do{nIndex ++;doc = ViewGetElementStyle(_cIDName+'_'+nIndex);if (doc){ doc.display = cStatus;  if(_cStatus == 'hide')   {   doc2 = ViewGetElementStyle(_cIDName+'_'+nIndex+'_Coll');  if (doc2) { doc2.display = 'none';}  doc2 = ViewGetElementStyle(_cIDName+'_'+nIndex+'_Exp');  if (doc2) { doc2.display = 'inline';}  doc2 = ViewGetElementStyle(_cIDName+'_'+nIndex+'_1');  if (doc2)  {this.ShowHideCategory(_cIDName+'_'+nIndex , _cStatus); } }}}while(doc);}function _CopyColumn(_nFrom , _nTo){var nIndex  = 0;var cValue  = '';var nCurCol = 0;var cTitle  = (arguments[2] == null) ? this.Columns[_nFrom].cTitle : arguments[2];var nDataType  = this.Columns[_nFrom].nDataType;var bDisplayed = (arguments[3] == null) ? this.Columns[_nFrom].bDisplayed : arguments[3];var bLink= (arguments[4] == null) ? this.Columns[_nFrom].bLink : arguments[4];var nSize= (arguments[5] == null) ? this.Columns[_nFrom].nSize : arguments[5];var bDisplayTools = (arguments[6] == null) ? this.Columns[_nFrom].bDisplayTools : arguments[6];nCurCol = this.nCol;this.AddColumn(cTitle , nDataType , bDisplayed , bLink , nSize , bDisplayTools);for(nIndex=0 ; nIndex < this.nLine ; nIndex++){ cValue = this.Lines[nIndex].Values[_nFrom];this.SubOrder[_nFrom][nIndex] = cValue + g_cSeparator + nIndex + g_cSeparator + _nFrom;this.Lines[nIndex].AddValue( cValue );}this.SwitchCol(nCurCol , _nTo);}function _ExpandAll(){var nIndex = 0;var doc;for(nIndex=0 ; nIndex < this.Category.length ; nIndex++){doc = ViewGetElementStyle(this.Category[nIndex]+'_Coll');if (doc){ doc.display = 'inline';}doc = ViewGetElementStyle(this.Category[nIndex]+'_Exp');if (doc){ doc.display = 'none';}this.ShowHideCategory(this.Category[nIndex] , 'show');}}function _CollapseAll(){var nIndex = 0;var doc;for(nIndex=0 ; nIndex < this.Category.length ; nIndex++){doc = ViewGetElementStyle(this.Category[nIndex]+'_Coll');if (doc){ doc.display = 'none';}doc = ViewGetElementStyle(this.Category[nIndex]+'_Exp');if (doc){ doc.display = 'inline';}this.ShowHideCategory(this.Category[nIndex] , 'hideAlone');}}function _ExpandList( _cList ){ var arrayOfString;var nIndex = 0;var doc;var cTmpString = new String(_cList);arrayOfString = cTmpString.split( ',' );for( nIndex = 0 ; nIndex < arrayOfString.length ; nIndex++ ){doc = ViewGetElementStyle(g_cIDName + arrayOfString[nIndex] + '_Coll');if (doc){ doc.display = 'inline';}doc = ViewGetElementStyle(g_cIDName + arrayOfString[nIndex] + '_Exp');if (doc){ doc.display = 'none';}this.ShowHideCategory(g_cIDName + arrayOfString[nIndex] , 'show');}}function _GetCategoryStatus(_cIDName){var doc;doc = ViewGetElementStyle(_cIDName);if (doc){ return doc.display;}return 'none';}function _SwitchCol(_nCol , _nNewCol){ var nIndex = 0;var nSourceIndex = -1;var nTemp  = 0;var nTemp2 = 0;for(nIndex=0 ; nIndex < this.nCol ; nIndex++){if (this.ColOrder[nIndex] == _nCol) {nSourceIndex = nIndex;}}if ((nSourceIndex != -1) && (nSourceIndex != _nNewCol)){ nTemp = _nCol;if ( _nNewCol < nSourceIndex ){for(nIndex = _nNewCol ; nIndex <= nSourceIndex ; nIndex++){nTemp2 = this.ColOrder[nIndex]; this.ColOrder[nIndex] = nTemp; nTemp  = nTemp2;}}else { for(nIndex = _nNewCol ; nIndex >= nSourceIndex ; nIndex--){nTemp2 = this.ColOrder[nIndex]; this.ColOrder[nIndex] = nTemp; nTemp  = nTemp2;} }this.Columns[_nCol].PushLastPos(nSourceIndex);}this.SetSyntaxLine();}function _SwitchCol2(_nCol , _nNewCol){ this.SwitchCol((_nCol - 1) , (_nNewCol - 1));}function _SetSyntaxLine(){var cHTMLSyntax  = ''; var nIndex = 0; var nIndex2= 0; var cData  = ''; var cListCheck= new String(''); var cID = ''; var cAlign = ''; var cLink_1= ''; var cLink_2= ''; var bUncateg  = false; var nColspan  = 0; var nRightIndex  = 0; var cTmp= ''; if(this.bInit) return;  cListCheck = '%'; for(nIndex=0 ; nIndex < oView.nChecked ; nIndex++) {cListCheck += oView.Checked[nIndex] + '%';}  for(nIndex = 0 ; nIndex < this.nLine ; nIndex ++) {cHTMLSyntax = ''; bUncateg = false; nColspan = 0; this.Lines[nIndex].cCheckNames = ''; for(nIndex2 = 0 ; nIndex2 < this.nCol ; nIndex2 ++) {nRightIndex = this.ColOrder[nIndex2]; cData = this.Lines[nIndex].Values[nRightIndex]; if( this.Columns[nRightIndex].bDisplayed ) {  cAlign = ''; if( this.Columns[nRightIndex].nAlignRight == 1) {cAlign = ' align="right" ';} else if( this.Columns[nRightIndex].nAlignRight == 2) {cAlign = ' align="center" ';} nColspan = nColspan + 1; if( this.Columns[nRightIndex].bCategorised) {  if( !g_bEmptyCateg && cData=='' ) {bUncateg = true;} else { cHTMLSyntax = cHTMLSyntax.concat('<TD width="'+g_nCategSpSize+'"></TD>');}} else {  cLink_1 = ''; cLink_2 = ''; cTmp = ''; if( this.Columns[nRightIndex].nDataType == View_FMT_CHK ) {cID = 'CHK_' + g_cIDName + nIndex + '_' + nRightIndex; if( cListCheck.indexOf( '%'+ cID +'%' )!= -1) cTmp = ' checked '; cData = '<input type="checkbox" id="'+ cID +'" value="'+ cData +'" onClick="oView.Check(\''+ cID +'\',true);" '+ cTmp +' title="'+g_cCheckBoxHelp+'">'; if(g_bDEBUG) {cData += '<A href="#" title="' + cID +'">?</A>';}} else {  if (this.Columns[nRightIndex].bLink) { cLink_1 = '<A href="javascript:oView.OpenLink('+ nIndex +');" onMouseOver="return HideMsg();" class="'+ g_cStyleDataLnk +'">';cLink_2 = '</A>';}} cHTMLSyntax = cHTMLSyntax.concat('<TD class="' + g_cStyleData + '" width="' + this.Columns[nRightIndex].nSize + '"'+cAlign+'>' + cLink_1 + cData + cLink_2 + '</TD>');}}} if (bUncateg) {cHTMLSyntax = '<TD colspan="' + nColspan + '"><TABLE><TR>' + cHTMLSyntax + '</TR></TABLE></TD>';}  this.Lines[nIndex].cSyntax = cHTMLSyntax; }}function _Generate(){var cHTMLSyntax = '';var nIndex= 0;var nIndex2  = 0;var nIndex3  = 0;var cJSScript= '';var cCatStatus  = '';var cLineStatus  = '';var cExpStatus  = '';var cCollStatus  = '';var cCategory  = new Array();var cSaveCategory = new Array();var nIndexCategory= new Array();var nIDLine = 0;var nCatNbr = '';var nIndexCat  = 0;var nIndexCatCur  = 0 ;var cCurCatID  = '';var cTempCateg = '';var bCheckFlag = false;if (g_bScrollHeader && View_ie){EventAttach(window , 'scroll' , ViewOnScroll)}if (g_bDetectKeyPress){EventAttach(document , 'keydown' , ViewOnKeyDown);EventAttach(document , 'keyup', ViewOnKeyUp);}if (this.bInit) return;if ( ! this.bSyntaxGenerated){this.bSyntaxGenerated = true; this.SetSyntaxLine();}cHTMLSyntax = '';cHTMLSyntax = cHTMLSyntax.concat('<TABLE border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse;">');if( g_bHeaderShow ){ if( g_nHeaderBeforeSize > 0 ){cHTMLSyntax = cHTMLSyntax.concat('<TR><TD colspan="'+ this.nCol +'" height="'+g_nHeaderBeforeSize+'" ></TD></TR>');}cHTMLSyntax = cHTMLSyntax.concat('<TR id="'+g_cIDName+'_Title" style="z-index:5;">');if(g_bDEBUG) {cHTMLSyntax = cHTMLSyntax.concat('<TD></TD>');}for(nIndex=0 ; nIndex < this.nCol ; nIndex++){if( this.Columns[this.ColOrder[nIndex]].bDisplayed ){ if (this.Columns[this.ColOrder[nIndex]].bCategorised){ cHTMLSyntax = cHTMLSyntax.concat('<TD nowrap class="'+ g_cStyleTitle +'" width="'+ g_nCategSpSize +'">');if( this.Columns[this.ColOrder[nIndex]].bDisplayTools ){cHTMLSyntax = cHTMLSyntax.concat('<TABLE border="0" height="100%" cellpadding="0" cellspacing="0" style="border-collapse: collapse;"><TR valign="top">');if(g_cExternalTools != '' ){cHTMLSyntax = cHTMLSyntax.concat('<TD><SPAN style="width:3px;"></SPAN></TD><TD><A id="'+g_cIDName+'_'+this.ColOrder[nIndex]+'_DspTools" href="#" onmouseover="ViewDisplayTools(\''+g_cIDName+'_'+this.ColOrder[nIndex]+'_DspTools\','+ this.ColOrder[nIndex] +' , '+this.Columns[this.ColOrder[nIndex]].bCategorised+' , '+this.Columns[this.ColOrder[nIndex]].bSortAsc+');" onMouseOver="return HideMsg();">'+ g_cExternalTools +'</A></TD></TR></TABLE>');}else{ if (! this.Columns[this.ColOrder[nIndex]].bSortAsc) { cHTMLSyntax = cHTMLSyntax.concat('<TD><A href="javascript:oView.SortColumn('+ this.ColOrder[nIndex] +',true);" onMouseOver="return HideMsg();"><IMG src="'+ g_cImgDesc +'" style="border:0px solid;"></A></TD>');}else { cHTMLSyntax = cHTMLSyntax.concat('<TD><A href="javascript:oView.SortColumn('+ this.ColOrder[nIndex] +',false);" onMouseOver="return HideMsg();"><IMG src="'+ g_cImgAsc +'" style="border:0px solid;"></A></TD>');}cHTMLSyntax = cHTMLSyntax.concat('<TD><SPAN style="width:3px;"></SPAN></TD><TD><A id="'+g_cIDName+'_'+this.ColOrder[nIndex]+'" href="javascript:oView.Categorize('+ this.ColOrder[nIndex] +');" onMouseOver="return HideMsg();"><IMG src="'+ g_cImgUncat +'" style="border:0px solid;"></A></TD></TR></TABLE>');}}cHTMLSyntax = cHTMLSyntax.concat('</TD>');}else { cHTMLSyntax = cHTMLSyntax.concat('<TD nowrap class="'+ g_cStyleTitle +'" width="' + this.Columns[this.ColOrder[nIndex]].nSize + '" style="width:'+ this.Columns[this.ColOrder[nIndex]].nSize +'px;">');cHTMLSyntax = cHTMLSyntax.concat('<TABLE border="0" height="100%" cellpadding="0" cellspacing="0" style="border-collapse: collapse;"><TR valign="top"><TD class="'+ g_cStyleTitle +'" style="border:0px solid;background-image: none;">' + this.Columns[this.ColOrder[nIndex]].cTitle + '</TD>');if( this.Columns[this.ColOrder[nIndex]].bDisplayTools  && this.Columns[this.ColOrder[nIndex]].nDataType != View_FMT_IMAGE && this.Columns[this.ColOrder[nIndex]].nDataType != View_FMT_FREE && this.Columns[this.ColOrder[nIndex]].nDataType != View_FMT_CHK ){ if(g_cExternalTools != '' ){cHTMLSyntax = cHTMLSyntax.concat('<TD><SPAN style="width:3px;"></SPAN></TD><TD><A id="'+g_cIDName+'_'+this.ColOrder[nIndex]+'_DspTools" href="#" onmouseover="ViewDisplayTools(\''+g_cIDName+'_'+this.ColOrder[nIndex]+'_DspTools\','+ this.ColOrder[nIndex] +' , '+this.Columns[this.ColOrder[nIndex]].bCategorised+' , '+this.Columns[this.ColOrder[nIndex]].bSortAsc+');" onMouseOver="return HideMsg();">'+ g_cExternalTools +'</A></TD>');}else{ if (! this.Columns[this.ColOrder[nIndex]].bSortAsc) { cHTMLSyntax = cHTMLSyntax.concat('<TD><SPAN style="width:3px;"></SPAN></TD><TD><A href="javascript:oView.SortColumn('+ this.ColOrder[nIndex] +',true);" onMouseOver="return HideMsg();"><IMG src="'+ g_cImgDesc +'" style="border:0px solid;"></A></TD>');}else { cHTMLSyntax = cHTMLSyntax.concat('<TD><SPAN style="width:3px;"></SPAN></TD><TD><A href="javascript:oView.SortColumn('+ this.ColOrder[nIndex] +',false);" onMouseOver="return HideMsg();"><IMG src="'+ g_cImgAsc +'" style="border:0px solid;"></A></TD>');}cHTMLSyntax = cHTMLSyntax.concat('<TD><SPAN style="width:3px;"></SPAN></TD><TD><A href="javascript:oView.Categorize('+ this.ColOrder[nIndex] +');" onMouseOver="return HideMsg();"><IMG src="'+ g_cImgCat +'" style="border:0px solid;"></A></TD>');}}cHTMLSyntax = cHTMLSyntax.concat('</TR></TABLE></TD>'); }}}cHTMLSyntax = cHTMLSyntax.concat('</TR>');if( g_nHeaderAfterSize > 0 ){cHTMLSyntax = cHTMLSyntax.concat('<TR><TD height="'+g_nHeaderAfterSize+'" colspan="'+ this.nCol +'" ></TD></TR>');}}for(nIndex=0 ; nIndex < this.nCol ; nIndex++){if( this.Columns[this.ColOrder[nIndex]].nDataType == View_FMT_CHK && this.Columns[this.ColOrder[nIndex]].bDisplayed ){bCheckFlag = true;}}cCatStatus = 'inline';nCatNbr = this.GetLastCategCol(this.nCol);for(nIndexCat = 0 ; nIndexCat < nCatNbr ; nIndexCat++){cCategory[nIndexCat]= '';cSaveCategory[nIndexCat]  = g_cConstEmpty;nIndexCategory[nIndexCat] = 0;}this.Category = new Array(); this.CatID = new Array(); for(nIndex2=0 ; nIndex2 < this.nLine ; nIndex2++){ nIndex3 = parseInt( ViewExtractString(this.Order[nIndex2] , 1 , g_cSeparator) );for(nIndexCat = 0 ; nIndexCat < nCatNbr ; nIndexCat++){cCategory[nIndexCat] = this.Lines[nIndex3].Values[this.ColOrder[nIndexCat]]; if (cSaveCategory[nIndexCat] != cCategory[nIndexCat]) { nIndexCatCur = nIndexCat;nIndexCategory[nIndexCat] ++;nIDLine = 0;cTempCateg = cCategory[nIndexCat];if (cTempCateg != '' || (cTempCateg == '' && g_bEmptyCateg) ){ cCurCatID = '';for(nIndex=0 ; nIndex <= nIndexCat ; nIndex++){if( !g_bEmptyCateg ){if(cCategory[nIndex] != ''){if (cCurCatID != '') { cCurCatID += '_';}cCurCatID += nIndexCategory[nIndex];}}else {if (cCurCatID != '') { cCurCatID += '_';}  cCurCatID += nIndexCategory[nIndex]; }}cCatStatus = this.GetCategoryStatus(g_cIDName+ cCurCatID);if (cCatStatus == 'none'){cExpStatus  = 'inline'; cCollStatus = 'none'; cLineStatus = ' style="display:none;" '; }else { cExpStatus  = 'none'; cCollStatus = 'inline'; cLineStatus = '';  }this.Category[this.Category.length] = g_cIDName + cCurCatID;cJSScript = 'javascript:oView.OpenCloseCategory(\''+ g_cIDName + cCurCatID +'\');';cHTMLSyntax = cHTMLSyntax.concat('<TR ID="'+ g_cIDName + cCurCatID +'">');if(g_bDEBUG) {cHTMLSyntax = cHTMLSyntax.concat('<TD><A href="#" title="'+g_cIDName + cCurCatID+'">?</A></TD>');}for(nIndex=0 ; nIndex < nIndexCat ; nIndex++){if (cCategory[nIndex] == '' && !g_bEmptyCateg){ cHTMLSyntax = cHTMLSyntax.concat('');}else {cHTMLSyntax = cHTMLSyntax.concat('<TD>&nbsp;</TD>'); }}cHTMLSyntax = cHTMLSyntax.concat('<TD colspan="'+ (this.nCol-nIndexCat) +'" class="'+ g_cStyleData +'">');cHTMLSyntax = cHTMLSyntax.concat('<A id="'+ g_cIDName + cCurCatID +'_Exp" href="'+cJSScript+'" Style="display:'+ cExpStatus +';" onMouseOver="return HideMsg();"><IMG src="'+ g_cImgExp +'" style="border:0px solid;"></A>');cHTMLSyntax = cHTMLSyntax.concat('<A id="'+ g_cIDName + cCurCatID +'_Coll" href="'+cJSScript+'" Style="display:'+ cCollStatus +';" onMouseOver="return HideMsg();"><IMG src="'+ g_cImgColl +'" style="border:0px solid;"></A>');if (cTempCateg == ''){cTempCateg = g_cEmptyCategText;}if (bCheckFlag){cHTMLSyntax = cHTMLSyntax.concat('<input type="checkbox" id="'+ g_cIDName + cCurCatID +'_Chk" value="Y" onClick="oView.CheckGroup(\''+ g_cIDName + cCurCatID +'\');"  title="'+g_cCheckBoxHelp+'">'); if(g_bDEBUG) {cHTMLSyntax = cHTMLSyntax.concat('<A href="#" title="' + g_cIDName + cCurCatID +'_Chk">?</A>');}}cHTMLSyntax = cHTMLSyntax.concat('&nbsp;<A href="'+cJSScript+'" class="'+ g_cStyleCateg +'" onMouseOver="return HideMsg();">' + cTempCateg + '</A></TD></TR>');}    cSaveCategory[nIndexCat] = cCategory[nIndexCat];  for(nIndex=(nIndexCat+1) ; nIndex < nCatNbr ; nIndex++)  {cSaveCategory[nIndex] = g_cConstEmpty;  nIndexCategory[nIndex] = 0; }}}nIDLine ++;if(g_bDEBUG) {cHTMLSyntax = cHTMLSyntax.concat('<TR><TD colspan="'+this.nCol+'"><A href="#" title="' + g_cIDName + cCurCatID +'_'+ nIDLine +'">?</A></td></tr>');}cHTMLSyntax = cHTMLSyntax.concat('<TR ID="'+ g_cIDName + cCurCatID +'_'+ nIDLine +'" '+ cLineStatus +' valign="TOP">' + this.Lines[nIndex3].cSyntax + '</TR>');for(nIndexCat = nIndexCatCur ; nIndexCat >=0 ; nIndexCat--){if (cSaveCategory[nIndexCat] == '' && !g_bEmptyCateg){ nIndexCategory[nIndexCat] = nIDLine;}}this.Lines[nIndex3].cLineDynID = g_cIDName + cCurCatID +'_'+ nIDLine;this.Lines[nIndex3].nOrderNbr  = nIndex2;}cHTMLSyntax = cHTMLSyntax.concat('</TABLE>');return cHTMLSyntax;}function _ScrollTitle(_oEvent){var oFld; var nStartPos; oFld = ViewGetElement(g_cIDName+'_Title'); if(oFld) {     if(this.nScrollStartPos == -1)  {nStartPos = ViewGetElementPosY(oFld);  this.nScrollStartPos = nStartPos; }    if (window.innerHeight)  {nStartPos = window.pageYOffset; }  else  {nStartPos = document.body.scrollTop; }  oFld = ViewGetElementStyle(g_cIDName+'_Title');  if(nStartPos <= (this.nScrollStartPos+10))  {   oFld.position = 'static';  oFld.top= this.nScrollStartPos; }  else { oFld.position = 'absolute';oFld.top= nStartPos;}}}}function clColumn( _cTitle , _nDataType , _bDisplay , _bLink , _nSize , _bDisplayTools, _nAlignRight){ this.cTitle  = _cTitle;this.nDataType  = _nDataType;this.bDisplayed = _bDisplay;this.bLink= _bLink;this.nSize= _nSize;this.bDisplayTools = _bDisplayTools;this.bSortAsc= false;this.bCategorised  = false;this.nAlignRight= _nAlignRight;this.PrevPos = new Array(); this.nPrevPos= 0;this.PushLastPos= _PushLastPos;this.PullLastPos= _PullLastPos;function _PushLastPos( _nColNbr ){this.PrevPos[this.nPrevPos] = _nColNbr; this.nPrevPos ++;}function _PullLastPos(){var nColNbr = -1;if( this.nPrevPos > 0 ){this.nPrevPos --; nColNbr = this.PrevPos[this.nPrevPos];}return nColNbr;}}function clLine( _nLineID , _cUniqueID , _nLinkType){ this.ID= _nLineID;this.UniqueID= _cUniqueIDthis.nLinkType  = _nLinkType;this.nVal = 0;this.Values  = new Array();this.cSyntax = '';this.cLineDynID = '';this.nOrderNbr  = 0;this.AddValue  = _AddValue;function _AddValue( _cValue ){this.Values[this.nVal] = _cValue; this.nVal ++;}}function ViewExtractString(_cStringSource,_nIndexElement,_cSeparator){ var arrayOfString;var cTmpString = new String(_cStringSource);arrayOfString = cTmpString.split(_cSeparator);if (_nIndexElement > (arrayOfString.length - 1)){return null;}else {return arrayOfString[_nIndexElement];}}function ViewComplete(_cStringSource){ var cEmpty = new String('--------------------------------------------------'); cEmpty = _cStringSource.concat(cEmpty);return  cEmpty.substring(0,50);}function ViewGetElement(_cID){var doc;try{ if (View_ns4){eval('doc = document.' + _cID);if (! doc){eval('doc = document.layers["'+_cID+'"]');}}if (View_ns6 || View_ns7 || View_opera || View_mozilla){doc = document.getElementById(_cID);}if (View_ie){doc = document.all[_cID];}if( !doc){eval('doc = document.forms[0].' + _cID);}}catch(Err){ return null;}return doc;}function ViewGetElementStyle(_cID){var doc;var doc2;if (View_ns4){eval('doc = document.' + _cID);}if (View_ns6 || View_ns7 || View_opera || View_mozilla){doc2 = document.getElementById(_cID);if(doc2){ doc = doc2.style;}}if (View_ie){doc2 = document.all[_cID]if (doc2){doc = doc2.style;}}return doc;}function ViewGetElementPosX(obj){ var curleft = 0;if(obj){ if (obj.offsetParent){ while (obj.offsetParent){ curleft += obj.offsetLeftobj = obj.offsetParent;}}else if (obj.x){curleft += obj.x;}}return curleft;}function ViewGetElementPosY(obj){ var curtop = 0;if(obj){ if (obj.offsetParent){ while (obj.offsetParent){ curtop += obj.offsetTopobj = obj.offsetParent;}}else if (obj.y){curtop += obj.y;}}return curtop;}function ViewGenerate(_bExpand){var oFld; oFld = ViewGetElement(g_cNotesField); if (oFld) { oFld.innerHTML = oView.Generate();if( _bExpand || _bExpand == null ){oView.ExpandAll();}else {oView.CollapseAll(); }} Wait(false);}function Wait(_bDisplay){var oFld; if (View_Mac) return; if( g_oWaitingElem ) { oFld = g_oWaitingElem;} else { oFld = ViewGetElementStyle(g_cWaitingTag);} if (oFld) {if (_bDisplay) {oFld.visibility = 'visible';} else { oFld.visibility = 'hidden';}}}function HideMsg(){window.status=''; return true;}function ViewGetLinkSyntax(_cURL , _nType){var cURL = '';if( _nType & View_LNK_UID ) { cURL = g_cBaseURL + _cURL + '?OpenDocument' + g_cURLSuffix;}if( _nType & View_LNK_URL ) { cURL = _cURL;}if(cURL == '') { cURL = _cURL;}if( _nType & View_LNK_NEW ) { cURL = 'window.open(\''+ cURL + '\');';}else { cURL = 'document.location = \''+ cURL + '\';';}if(cURL.indexOf('%BASEURL%') != -1){cURL = ViewReplaceStr( cURL , '%BASEURL%' , g_cBaseURL);}return cURL;}function ViewReplaceStr( _cString , _cSeek , _cReplace ){ var nPos = 0;var nFound = _cString.indexOf(_cSeek);var cString2 = new String();while(nFound!=-1){ cString2 += _cString.substring(nPos,nFound);cString2 += _cReplace;nPos = nFound + _cSeek.length;nFound = _cString.indexOf(_cSeek,nPos);}cString2 += _cString.substring(nPos,_cString.length);return cString2;}function ViewExpandAll(){oView.ExpandAll();}function ViewCollapseAll(){oView.CollapseAll();}function ViewExpandList( _cList ){oView.ExpandList( _cList );}function ViewGetSelection(_nColumn){var cListCheck= ''; var oData  = new Array(); var nData  = -1; var oField2; var nFieldColumn = 0; var nIndex = 0; var nIndex2= 0; if( g_bPrintViewSort ) {  cListCheck = '%'; for(nIndex=0 ; nIndex < oView.nChecked ; nIndex++) {nFieldColumn = parseInt( ViewGetColumnInID( oView.Checked[nIndex] ) ); cListCheck += ViewExtractString( oView.Checked[nIndex] , 2 , '_') +'_'+ nFieldColumn +'%';} for(nIndex=0 ; nIndex < oView.nLine ; nIndex++) {  nIndex2 = parseInt( ViewExtractString(oView.Order[nIndex] , 1 , g_cSeparator) ); if( cListCheck.indexOf( '%'+ nIndex2 +'_'+ _nColumn +'%' )!=-1 ) {nData ++; oData[nData] = 'CHK_' + g_cIDName + nIndex2 + '_' + _nColumn;}}} else {  for(nIndex=0 ; nIndex < oView.nChecked ; nIndex++) {nFieldColumn = parseInt( ViewGetColumnInID( oView.Checked[nIndex] ) );  if( nFieldColumn == _nColumn )  {nData ++;  oData[nData] = oView.Checked[nIndex]; }}}  return oData;}function ViewPrintSelected( _nPrintColumn  , _cTargetURL){var oField; var oField2; var oPrintWin; var cData  = ''; var oData; var nIndex = 0; oField = ViewGetElement( g_cPrintField );  if( oField ) {  oData = ViewGetSelection(_nPrintColumn); for(nIndex=0 ; nIndex < oData.length ; nIndex++) {oField2 = ViewGetElement( oData[nIndex] );  if( oField2 )  {cData += oField2.value + '#'; }} if( cData != "") {  oField.value = cData; oPrintWin = window.open( _cTargetURL ,'Print','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes, width=600, height=360'); oPrintWin.focus();}}}function ViewSelectList(_cList){ var cID = '';var nIndex = 0;cID = ViewExtractString(_cList , nIndex , '#');while( cID != '' ){oView.Checked[oView.nChecked] = cID; oView.nChecked ++; nIndex ++; cID = ViewExtractString(_cList , nIndex , '#');}}function ViewUncheckALL(){var oField; var nIndex = 0; for(nIndex=0 ; nIndex < oView.nChecked ; nIndex++) {oField = ViewGetElement( oView.Checked[nIndex] );  if( oField )  {oField.checked = false;oView.Check(oView.Checked[nIndex] , true) }} oView.nChecked  = 0; oView.Checked= new Array();}function ViewGetColumnInID( _cID ){var arrayOfString;var cTmpString = new String(_cID);arrayOfString = cTmpString.split('_');return arrayOfString[(arrayOfString.length - 1)];}function EventAttach(_oElement , _cEventType , _oCallBackFunction){var cEventSyntax = '';_cEventType = _cEventType.toLowerCase();if(_oElement.addEventListener){_oElement.addEventListener(_cEventType , _oCallBackFunction , false);}else if(_oElement.attachEvent){_oElement.attachEvent('on'+_cEventType , _oCallBackFunction);}else{cEventSyntax = '_oElement.on' + _cEventType + '=_oCallBackFunction';eval(cEventSyntax);}}function EventDetach(_oElement , _cEventType , _oCallBackFunction){var cEventSyntax = '';_cEventType = _cEventType.toLowerCase();if(_oElement.removeEventListener){_oElement.removeEventListener(_cEventType , _oCallBackFunction , false);}else if(_oElement.detachEvent){_oElement.detachEvent('on'+_cEventType , _oCallBackFunction);}else{cEventSyntax = '_oElement.on' + _cEventType + '=null';eval(cEventSyntax);}}function ViewOnKeyDown(_oEvent){ if (_oEvent.keyCode) g_nKeyPressed = _oEvent.keyCode;else if (_oEvent.which) g_nKeyPressed = _oEvent.which;return true;}function ViewOnKeyUp(){g_nKeyPressed = 0; return true;}function ViewOnScroll(_oEvent){oView.ScrollTitle(_oEvent);}
