
var blnRightCellFixed=false;var fixingRowHeights=false;function jtguiOnLoad(){var PrimaryContent=document.getElementById('idPrimaryContent');if(bad(PrimaryContent)){return null;}
PrimaryContent.style.visibility="hidden";try{var MainTable=document.getElementById('idMainTable');if(!bad(MainTable)){fncPositionMainTables();fixRowHeights();}}
finally{PrimaryContent.style.visibility="visible";}}
function fncDestroyLoadWaitNotice(){var LoadingWaitNotice=document.getElementById('idLoadingWaitNotice');if(!bad(LoadingWaitNotice)){var itsParent=LoadingWaitNotice.parentNode;itsParent.removeChild(LoadingWaitNotice);}}
function switchToDay()
{if(document.persist_form.periodtype)
{if(document.persist_form.periodtype.value!='day')
{document.persist_form.periodtype.value='switch';document.persist_form.submit();return;}
return;}}
function switchToPeriod()
{if(document.persist_form.periodtype)
{if(document.persist_form.periodtype.value!='period')
{document.persist_form.periodtype.value='switch';document.persist_form.submit();return;}
return;}}
function fixRows(id){var lhsrow=document.getElementById('lhsrow'+id);var rhsrow=document.getElementById('rhsrow'+id);var totalrow=document.getElementById('totalrow'+id);var leftrow=document.getElementById('leftrow'+id);if(!lhsrow||!rhsrow||!totalrow||!leftrow){return false;}
var lhsrowH=fncGetHeight(lhsrow);var rhsrowH=fncGetHeight(rhsrow);var totalrowH=fncGetHeight(totalrow);var leftrowH=fncGetHeight(leftrow);var m1=Math.max(lhsrowH,rhsrowH);var m2=Math.max(totalrowH,leftrowH);var biggestheight=Math.max(m1,m2);var biggestheightpx=biggestheight+'px';lhsrow.style.height=biggestheightpx;rhsrow.style.height=biggestheightpx;totalrow.style.height=biggestheightpx;leftrow.style.height=biggestheightpx;}
function fixRowHeights()
{fixingRowHeights=true;try{fixRows('head');}catch(e){}
for(loopx=0;loopx<numrowids;loopx++){fixRows(loopx);}
for(loopx=0;loopx<numfooters;loopx++){fixRows('foot'+loopx);}
fixoverallHeights();fixingRowHeights=false;}
function fixoverallHeights(){totalheight=fncGetHeight('idMainTableRight')+20+"px";document.getElementById('idMainTableLeftContainer').style.height=totalheight;document.getElementById('idMainTableRightContainer').style.height=totalheight;document.getElementById('idTotalColsContainer').style.height=totalheight;document.getElementById('idMainTableFarLeftContainer').style.height=totalheight;}
function fncPositionMainTables(){var MainTable=document.getElementById('idMainTable');var MainTableLeftCell=document.getElementById('idMainTableLeftCell');var MainTableLeftContainer=document.getElementById('idMainTableLeftContainer');var MainTableRightContainer=document.getElementById('idMainTableRightContainer');if(MainTable===null||MainTableLeftContainer===null||MainTableLeftCell===null){return false;}
if(!bad(USE_INNER_SCROLLBARS)&&USE_INNER_SCROLLBARS){MainTableLeftContainer.style.overflow="auto";MainTableRightContainer.style.overflow="auto";MainTableLeftContainer.style.width="1px";MainTableRightContainer.style.width="1px";}else{USE_INNER_SCROLLBARS=false;}
MainTable.style.width="100%";staticwidth=fncGetWidth('idTotalCols')+fncGetWidth('idMainTableFarLeft');contentwidth=2+fncGetWidth('idPrimaryContent')-staticwidth;leftelementwidth=fncGetWidth('idMainTableLeft');rightelementwidth=fncGetWidth('idMainTableRight');leftelementscroll=0;rightelementscroll=0;if(((leftelementwidth+rightelementwidth)<contentwidth)||(!USE_INNER_SCROLLBARS)){leftelementwidth=leftelementwidth+(contentwidth-leftelementwidth-rightelementwidth-15);leftelementscroll=0;rightelementscroll=0;}
else{if(rightelementwidth>150){rightelementscroll=rightelementwidth-150;rightelementwidth=150;}
if((leftelementwidth+rightelementwidth)<contentwidth){rightelementwidth=contentwidth-leftelementwidth;leftelementscroll=0;}
else{leftelementscroll=(leftelementwidth+rightelementwidth)-contentwidth;leftelementwidth=leftelementwidth-leftelementscroll;}}
lscreenpad=0;rscreenpad=0;if(leftelementscroll){lscreenpad=15;}
else{if(rightelementscroll){rscreenpad=15;}}
if(USE_INNER_SCROLLBARS){MainTableLeftContainer.style.width=(leftelementwidth-lscreenpad)+'px';MainTableRightContainer.style.width=(rightelementwidth-rscreenpad)+'px';if(leftelementscroll>0){if(!(is.ie)){MainTableLeftContainer.style.overflow="-moz-scrollbars-horizontal";}}
else{MainTableLeftContainer.style.overflow="hidden";}
if(rightelementscroll>0){if(!(is.ie)){MainTableRightContainer.style.overflow="-moz-scrollbars-horizontal";}}
else{MainTableRightContainer.style.overflow="hidden";}}
return true;}
function fncGetToggleColumnCookieName(strSection){var cookie_name=window.location.pathname+strSection;return cookie_name;}
function fncToggleColumn_getCurrentState(strSection,col_state){if(bad(col_state)){var col_state_name='toggle_column'+strSection;col_state=window[col_state_name];}
if(bad(col_state)){return null;}
if(col_state=='on'){return'on';}
else{return'off';}}
function fncMainTableToggleColumn(strSection,usecookies){var col_state_name='toggle_column'+strSection;var col_state=window[col_state_name];if(bad(col_state)){return null;}
var cookie_name=fncGetToggleColumnCookieName(strSection);var currenttoggle=fncToggleColumn_getCurrentState(strSection,col_state);if(bad(currenttoggle)){return null;}
column_elem_name='column'+strSection;columntocollapse=window[column_elem_name];thtocollapse=document.getElementById(strSection);if(currenttoggle=='on'){thtocollapse.childNodes[0].style.display='none';thtocollapse.childNodes[1].innerHTML='<a href="#" '+'onClick="fncMainTableToggleColumn(\''+
strSection+'\');return false;">'+'<img HEIGHT=7 WIDTH=7 src="../jtime/image/plus.gif" title="Show Column">'+'</a>';thtocollapse.style.whiteSpace='nowrap';}
else{thtocollapse.style.whiteSpace='nowrap';thtocollapse.childNodes[0].style.display='block';thtocollapse.childNodes[1].innerHTML='';}
for(i=0;i<columntocollapse.length;i++){tdtocollapse=document.getElementById(columntocollapse[i]);if(currenttoggle=='on'){tdtocollapse.childNodes[0].style.display='none';tdtocollapse.style.width='10px';tdtocollapse.style.whiteSpace='nowrap';}
else{tdtocollapse.childNodes[0].style.display='block';tdtocollapse.style.whiteSpace='nowrap';}}
cookie_state='0';if(currenttoggle=='on'){col_state='off';}
else{col_state='on';cookie_state='1';}
window[col_state_name]=col_state;if(bad(usecookies)){usecookies=1;}
if(usecookies){setCookie(cookie_name,cookie_state,'never');}
fncPositionMainTables();fixRowHeights();return true;}
function fncMainTableToggleSection(strSection,usecookies){if(eval('toggle_'+strSection)=='on'){currenttoggle='on';}else{currenttoggle='off';}
rowstocollapse=eval('rows'+strSection);imagetochange=document.getElementById(strSection+'image');var collapsible_row=imagetochange;collapsible_row=collapsible_row.parentNode;var collapsible_span=collapsible_row;collapsible_row=collapsible_row.parentNode;collapsible_row=collapsible_row.parentNode;if(collapsible_row.tagName.toUpperCase()=="TR"){if(currenttoggle=='on'){collapsible_row.className='togglerowCollapsed';collapsible_span.title='Click to Show This Section';}
else{collapsible_row.className='togglerow';collapsible_span.title='Click to Hide This Section';}}
if(imagetochange){if(currenttoggle=='on'){imagetochange.src="../jtime/image/plus.gif";}else{imagetochange.src="../jtime/image/minus.gif";}}
for(i=0;i<rowstocollapse.length;i++){rowtocollapse=document.getElementById(rowstocollapse[i]);if(currenttoggle=='on'){rowtocollapse.style.display="none";}else{rowtocollapse.style.display="";}}
if(currenttoggle=='on'){if(usecookies==1){setCookie(strSection,'0','never','/');}
eval('toggle_'+strSection+" = 'off'");}else{eval('toggle_'+strSection+" = 'on'");if(usecookies==1){setCookie(strSection,'1','never','/');}}}
function isIn(a,b){for(xx=0;xx<b.length;xx++){if(a==b[xx]){return 1;}}
return 0;}
sortcolumn=0;sortdir='down';function fncMainTableSortColumn(columnNumber,tblName,sortheader)
{var scell=document.getElementById(sortheader);if(scell.getAttribute("sortdir")=='down')
{sortdir='up';scell.setAttribute('sortdir','up');scell.innerHTML='<div style="white-space: nowrap">'+scell.originalvalue+'<big>&nbsp;&nbsp;&uarr;</big></div>';}
else{if(scell.getAttribute("sortdir")=='up')
{sortdir='down';scell.setAttribute('sortdir','down');scell.innerHTML='<div style="white-space: nowrap">'+scell.originalvalue+'<big>&nbsp;&nbsp;&darr;</big></div>';}
else
{sortdir='down';scell.setAttribute('sortdir','down');scell.originalvalue=scell.innerHTML;scell.innerHTML='<div style="white-space: nowrap">'+scell.originalvalue+'<big>&nbsp;&nbsp;&darr;</big></div>';}}
tblBodyObj=document.getElementById(tblName);if(tblName=='idMainTableLeftbody')
{OtherTblBodyObjs=[document.getElementById('idMainTableFarLeftbody'),document.getElementById('idMainTableRightbody'),document.getElementById('idTotalColsbody')];}
else
{OtherTblBodyObjs='notjtgui';}
sortcolumn=columnNumber;var allRows=[];var newRows=[];for(j=0;j<tblBodyObj.rows.length;j++)
{if(tblBodyObj.rows[j].className=='togglerow')
{if(OtherTblBodyObjs!='notjtgui')
{newRows.sort(blahSort2);newRows[newRows.length]=[tblBodyObj.rows[j],OtherTblBodyObjs[0].rows[j],OtherTblBodyObjs[1].rows[j],OtherTblBodyObjs[2].rows[j]];for(i=0;i<newRows.length;i++)
{allRows[allRows.length]=newRows[i];}
newRows=[];}
else
{newRows.sort(blahSort);newRows[newRows.length]=tblBodyObj.rows[j];for(i=0;i<newRows.length;i++){allRows[allRows.length]=newRows[i];}
newRows=[];}}
else
{if(OtherTblBodyObjs!='notjtgui')
{newRows[newRows.length]=[tblBodyObj.rows[j],OtherTblBodyObjs[0].rows[j],OtherTblBodyObjs[1].rows[j],OtherTblBodyObjs[2].rows[j]];}
else
{newRows[newRows.length]=tblBodyObj.rows[j];}}}
if(OtherTblBodyObjs!='notjtgui')
{newRows.sort(blahSort2);}
else
{newRows.sort(blahSort);}
for(i=0;i<newRows.length;i++){allRows[allRows.length]=newRows[i];}
if(OtherTblBodyObjs!='notjtgui')
{for(i=0;i<allRows.length;i++){tblBodyObj.appendChild(allRows[i][0]);OtherTblBodyObjs[0].appendChild(allRows[i][1]);OtherTblBodyObjs[1].appendChild(allRows[i][2]);OtherTblBodyObjs[2].appendChild(allRows[i][3]);}}
else
{for(i=0;i<allRows.length;i++){tblBodyObj.appendChild(allRows[i]);}}}
function blahSort(robj1,robj2)
{var x=getInnerText(robj1.cells[sortcolumn]).toLowerCase();var y=getInnerText(robj2.cells[sortcolumn]).toLowerCase();if(sortdir=='down'){return((x<y)?-1:((x>y)?1:0));}
else
{return((x>y)?-1:((x<y)?1:0));}}
function blahSort2(robj1,robj2)
{var x=getInnerText(robj1[0].cells[sortcolumn]).toLowerCase();var y=getInnerText(robj2[0].cells[sortcolumn]).toLowerCase();if(sortdir=='down'){return((x<y)?-1:((x>y)?1:0));}
else
{return((x>y)?-1:((x<y)?1:0));}}
function getInnerText(obj)
{if(typeof obj=="string"){return obj;}
if(typeof obj=="undefined"){return obj;}
if(obj.innerText){return obj.innerText;}
var str="";var cs=obj.childNodes;var l=cs.length;for(var i=0;i<l;i++)
{switch(cs[i].nodeType){case 1:str+=getInnerText(cs[i]);break;case 3:str+=cs[i].nodeValue;break;}}
return str;}