﻿function tx_mhomsqlio_block(_id){tx_mhomsqlio_fw(_id,'style.display','none',0);if(BrowserDetect.browser=='Explorer'&&BrowserDetect.version==6)tx_mhomsqlio_fw(_id+'-iframe','style.display','none',0)}function tx_mhomsqlio_display(_id,_bIframe){tx_mhomsqlio_fw(_id,'style.display','block',0);if(_bIframe==1&&BrowserDetect.browser=='Explorer'&&BrowserDetect.version==6){if(tx_mhomsqlio_fw(_id+'-iframe','name',_id+'-iframe',1)){tx_mhomsqlio_fw(_id+'-iframe','style.top',tx_mhomsqlio_fw(_id,'style.top','',2),0);tx_mhomsqlio_fw(_id+'-iframe','style.left',tx_mhomsqlio_fw(_id,'style.left','',2),0);tx_mhomsqlio_fw(_id+'-iframe','style.width',tx_mhomsqlio_fw(_id,'offsetWidth','',2),0);tx_mhomsqlio_fw(_id+'-iframe','style.height',tx_mhomsqlio_fw(_id,'offsetHeight','',2),0);tx_mhomsqlio_fw(_id+'-iframe','style.margin',tx_mhomsqlio_fw(_id,'style.margin','',2),0);tx_mhomsqlio_fw(_id+'-iframe','style.display','inline',0)}else{var sHtml='<iframe style="top: '+tx_mhomsqlio_fw(_id,'style.top','',2)+'; left: '+tx_mhomsqlio_fw(_id,'style.left','',2);sHtml+='; position: absolute; z-index: 9; margin: '+tx_mhomsqlio_fw(_id,'style.margin','',2)+';" id="'+_id+'-iframe" name="'+_id+'-iframe" width="';sHtml+=tx_mhomsqlio_fw(_id,'offsetWidth','',2)+'" height="'+tx_mhomsqlio_fw(_id,'offsetHeight','',2);sHtml+='" src="javascript: document.write(\'ignore\');"></iframe>';document.body.insertAdjacentHTML('BeforeEnd',sHtml);tx_mhomsqlio_fw(_id,'style.zIndex',10,0)}}}function tx_mhomsqlio_toggle(_id){if(tx_mhomsqlio_fw(_id,'style.display','none',1))tx_mhomsqlio_display(_id);else tx_mhomsqlio_block(_id)}var tx_mhomsqlio_loadtimer='';function tx_mhomsqlio_showLoad_init(_sContElem){tx_mhomsqlio_loadtimer=window.setTimeout('tx_mhomsqlio_showLoad(\''+_sContElem+'\')',tx_mhomsqlio_loadingdelay)}function tx_mhomsqlio_showLoad(_sContElem){window.clearTimeout(tx_mhomsqlio_loadtimer);if(document.getElementById){var sTable='mh_omsqlio-table-'+_sContElem;var sLoad='tx_mhomsqlio_load-'+_sContElem;var oTable=document.getElementById(sTable);if(oTable){tx_mhomsqlio_fw(sLoad,'style.width',tx_mhomsqlio_fw(sTable,'offsetWidth','',2),0);tx_mhomsqlio_fw(sLoad,'style.height',tx_mhomsqlio_fw(sTable,'offsetHeight','',2),0);tx_mhomsqlio_fw(sLoad,'style.top',getAbsoluteOffsetTop(oTable)+'px',0);tx_mhomsqlio_fw(sLoad,'style.left',getAbsoluteOffsetLeft(oTable)+'px',0);tx_mhomsqlio_display(sLoad,0)}}}function tx_mhomsqlio_hideLoad(_sContElem){window.clearTimeout(tx_mhomsqlio_loadtimer);tx_mhomsqlio_block('tx_mhomsqlio_load-'+_sContElem)}function getAbsoluteOffsetTop(obj){if(typeof obj!="object")return 0;var top=obj.offsetTop;var parent=obj.offsetParent;while(parent!=document.body){top+=parent.offsetTop;parent=parent.offsetParent}return top}function getAbsoluteOffsetLeft(obj){if(typeof obj!="object")return 0;var left=obj.offsetLeft;var parent=obj.offsetParent;while(parent!=document.body){left+=parent.offsetLeft;parent=parent.offsetParent}return left}function tx_mhomsqlio_getParent(o,a){if(o!==null&&o.nodeName){if(o.nodeName==a)return o;while(o=o.parentNode){if(o.nodeName&&o.nodeName==a)return o}}return null}function tx_mhomsqlio_del(_sContElem,_sId,_sMsg){var bQ=confirm(_sMsg);if(bQ){tx_mhomsqlio_pre(_sContElem);tx_mhomsqlio_pi1Del(_sId)}else return false}function tx_mhomsqlio_edit(_sContElem,_oCell){var oTr=tx_mhomsqlio_getParent(_oCell,'TR');tx_mhomsqlio_pre(_sContElem);tx_mhomsqlio_pi1ShowEdit(oTr.id.substring((5+_sContElem.length)),_oCell.cellIndex)}function tx_mhomsqlio_hide(_sId){if(document.getElementById){var oTr=document.getElementById(_sId);if(oTr){var oTable=tx_mhomsqlio_getParent(oTr,'TABLE');oTable.removeChild(oTr)}}}function tx_mhomsqlio_insertRow(_sContElem,_nIndex,_sId,_sClass,_aCells){if(document.getElementById){try{var oTable=document.getElementById('mh_omsqlio-table-'+_sContElem);var oRow=oTable.insertRow(_nIndex);oRow.id=_sId;oRow.className=_sClass;for(var i=0;i<_aCells.length;i++){var oCell=oRow.insertCell(i);oCell.innerHTML=_aCells[i]}}catch(sEx){alert(sEx)}}}function tx_mhomsqlio_removeRow(_sContElem,_sId){if(document.getElementById){try{var oTable=document.getElementById('mh_omsqlio-table-'+_sContElem);var oRow=document.getElementById(_sId);oTable.deleteRow(oRow.rowIndex)}catch(sEx){alert(sEx)}}}function tx_mhomsqlio_replaceRow(_sContElem,_sId,_aCells){if(document.getElementById){try{var oTable=document.getElementById('mh_omsqlio-table-'+_sContElem);for(var i=0;i<oTable.rows.length;i++){if(oTable.rows[i].id==_sId){var sClass=oTable.rows[i].className;tx_mhomsqlio_removeRow(_sContElem,_sId);tx_mhomsqlio_insertRow(_sContElem,i,_sId,sClass,_aCells);break}}}catch(sEx){alert(sEx)}}}function tx_mhomsqlio_hover(_oRow){if(_oRow){var sColor=_oRow.style.backgroundColor;var sChkId=_oRow.id+'-mark';_oRow.onmouseout=function(){this.style.backgroundColor=sColor;if(!tx_mhomsqlio_fw(sChkId,'checked',true,1))tx_mhomsqlio_fw(sChkId,'style.visibility','hidden',0)};_oRow.style.backgroundColor='#979aff';tx_mhomsqlio_fw(sChkId,'style.visibility','visible',0)}}function tx_mhomsqlio_multiple(_sContElem,_oElem){aId=new Array();var aInput=document.getElementsByTagName('INPUT');var sCeCheck='row-'+_sContElem;var nCeCheckLength=sCeCheck.length;tx_mhomsqlio_pre(_sContElem);for(var i=0;i<aInput.length;i++)if(aInput[i].name.substring(0,21)=='tx_mhomsqlio_checked-'&&aInput[i].id.substring(0,nCeCheckLength)==sCeCheck)if(aInput[i].checked)aId.push(aInput[i].name.substring(21));if(_oElem.value=='csv-all')tx_mhomsqlio_pi1Download(-1);else if(aId.length<=0)alert(tx_mhomsqlio_getLang('no-entries'));else{switch(_oElem.value){case'del':var q=confirm(tx_mhomsqlio_getLang('msg.del').replace(/###/i,aId.length));if(q)tx_mhomsqlio_pi1MultipleDel(aId);break;case'edit':tx_mhomsqlio_pi1MultipleEdit(aId);break;case'csv-part':tx_mhomsqlio_pi1Download(aId);break}}var oSelect=tx_mhomsqlio_getParent(_oElem,'SELECT');oSelect.selectedIndex=0}function tx_mhomsqlio_check(_sContElem,_bType){if(document.getElementsByTagName){var aInput=document.getElementsByTagName('INPUT');if(aInput){var sCeCheck='row-'+_sContElem;var nCeCheckLength=sCeCheck.length;for(var i=0;i<aInput.length;i++){if(aInput[i].name.substring(0,21)=='tx_mhomsqlio_checked-'&&aInput[i].id.substring(0,nCeCheckLength)==sCeCheck){var oParent=tx_mhomsqlio_getParent(aInput[i],'TR');if(oParent!==null&&tx_mhomsqlio_fw(oParent.id,'style.display','none',1))continue;aInput[i].checked=_bType;if(aInput[i].style.visibility=='hidden'||aInput[i].style.visibility==''){if(_bType)aInput[i].style.visibility='visible'}else{if(!_bType)aInput[i].style.visibility='hidden'}}}}}}var tx_mhomsqlio_lastquery='';var tx_mhomsqlio_findtimer='';function tx_mhomsqlio_search(_sContElem){if(typeof(tx_mhomsqlio_findtimer)!="undefined"&&tx_mhomsqlio_keyupdelay)window.clearTimeout(tx_mhomsqlio_findtimer);var sQ=tx_mhomsqlio_fw('tx_mhomsqlio_search-'+_sContElem,'value','',2);if(sQ!=tx_mhomsqlio_lastquery){tx_mhomsqlio_lastquery=sQ;tx_mhomsqlio_fw('tx_mhomsqlio_spinner-'+_sContElem,'style.display','inline',0);tx_mhomsqlio_pre(_sContElem);tx_mhomsqlio_pi1Filter(xajax.getFormValues('tx_mhomsqlio_form-'+_sContElem),'')}}function tx_mhomsqlio_find(_sContElem){if(tx_mhomsqlio_keyCode==13)tx_mhomsqlio_search(_sContElem);else tx_mhomsqlio_findtimer=window.setTimeout('tx_mhomsqlio_search(\''+_sContElem+'\')',tx_mhomsqlio_keyupdelay)}function tx_mhomsqlio_cleanSearch(_sContElem){if(typeof(tx_mhomsqlio_findtimer)!="undefined"&&tx_mhomsqlio_keyupdelay)window.clearTimeout(tx_mhomsqlio_findtimer);tx_mhomsqlio_lastquery='';tx_mhomsqlio_fw('tx_mhomsqlio_spinner-'+_sContElem,'style.display','none',0);tx_mhomsqlio_fw('tx_mhomsqlio_search-'+_sContElem,'value',tx_mhomsqlio_getLang('search'),0)}function tx_mhomsqlio_pagelinks(_sContElem){var nCntCur=parseInt(tx_mhomsqlio_fw(_sContElem+'nPageCurrent','innerHTML','',2));var nCntAll=parseInt(tx_mhomsqlio_fw(_sContElem+'nPageAll','innerHTML','',2));if(nCntAll===1||nCntAll===0){if(document.getElementById){for(var i=1;i<=5;i++){if(document.getElementById('tx_mhomsqlio_pagelinks-'+_sContElem+'-'+i)){document.getElementById('tx_mhomsqlio_pagelinks-'+_sContElem+'-'+i).innerHTML=''}}}return''}aCode=new Array();if(nCntCur!=1){aCode.push('<a href="#" onClick="javascript: tx_mhomsqlio_goto(\''+_sContElem+'\', 0); return false;" title="'+tx_mhomsqlio_getLang('first')+'">&#124;&#171;</a>');aCode.push('<a href="#" onClick="javascript: tx_mhomsqlio_goto(\''+_sContElem+'\', \'previous\'); return false;" title="'+tx_mhomsqlio_getLang('previous')+'">&#171;</a>')}for(var i=(nCntCur-3);i<=(nCntCur+3);i++){if(i<1||i>nCntAll)continue;if(i==nCntCur)aCode.push('<strong>'+i+'</strong>');else aCode.push('<a href="#" onClick="javascript: tx_mhomsqlio_goto(\''+_sContElem+'\', '+(i-1)+'); return false;">'+i+'</a>')}if(nCntCur!=nCntAll){aCode.push('<a href="#" onClick="javascript: tx_mhomsqlio_goto(\''+_sContElem+'\', \'next\'); return false;" title="'+tx_mhomsqlio_getLang('next')+'">&#187;</a>');aCode.push('<a href="#" onClick="javascript: tx_mhomsqlio_goto(\''+_sContElem+'\', '+nCntAll+'); return false;" title="'+tx_mhomsqlio_getLang('last')+'">&#187;&#124;</a>')}if(document.getElementById){var sCode=aCode.join('&nbsp;');for(var i=1;i<=5;i++){if(document.getElementById('tx_mhomsqlio_pagelinks-'+_sContElem+'-'+i)){document.getElementById('tx_mhomsqlio_pagelinks-'+_sContElem+'-'+i).innerHTML=sCode}}}}function tx_mhomsqlio_goto(_sContElem,_mPage){var oT=document.getElementById('mh_omsqlio-table-'+_sContElem);var oRes;if(_mPage=='previous')oRes=Table.pagePrevious(oT);else if(_mPage=='next')oRes=Table.pageNext(oT);else if(_mPage=='reload')oRes=Table.page(oT,oRes.page);else oRes=Table.page(oT,_mPage);var currentPage=oRes.page+1}function tx_mhomsqlio_setFocus(_sName){document.getElementById(_sName).focus();document.getElementById(_sName).select()}function tx_mhomsqlio_setEvent(_sId,_nCol,_sName,_sValue,_bNoFunc){if(document.getElementById){if(document.getElementById(_sId)){var oElem=document.getElementById(_sId);if(_nCol>=0)oElem=oElem.childNodes[_nCol];if(_bNoFunc==1)eval('oElem.'+_sName+' = '+_sValue+';');else eval('oElem.'+_sName+' = function() { '+_sValue+' }')}}}function tx_mhomsqlio_setTextareaLinebreak(_sId,_aPos,_nMinus){var sText=tx_mhomsqlio_fw(_sId,'value','',2);var nLength=sText.length;for(var i=1;i<_aPos.length;i++)sText=sText.substr(0,(_aPos[i]-_nMinus))+'\n'+sText.substr((_aPos[i]-_nMinus));document.getElementById(_sId).value=sText}function tx_mhomsqlio_pre(_sContElem){for(var i=0;i<aContElem.length;i++)if(typeof(aContElem[i])=='object')if(aContElem[i][0]==_sContElem){xajaxRequestUri=aContElem[i][1];xajax.loadingFunction=function(){tx_mhomsqlio_showLoad_init(_sContElem)};xajax.doneLoadingFunction=function(){tx_mhomsqlio_hideLoad(_sContElem)};return true}return false}function tx_mhomsqlio_error(_sError,_sUrl,_nLine){for(var i=0;i<aContElem.length;i++)if(typeof(aContElem[i])=='object')tx_mhomsqlio_hideLoad(aContElem[i][0]);if(confirm('An error appeared:\n\n"'+_sError+' on line '+_nLine+'"\n\nIf this happens regularly please inform the webmaster.\n\nBest for you to go on working is to reload this page.')){window.location.reload()}else return true}
