function submitFormTable(ref, wait_message, action) { buttons = ref.form.getElementsByTagName('input'); for (i = 0; i < buttons.length; i++) { if (buttons[i].type == 'button' || buttons[i].type == 'submit') { buttons[i].value = wait_message; buttons[i].disabled = true; } } ref.form.action.value = action; ref.form.submit(); } function toggleAllFormCheckboxes(form, check) {var o=document.forms[form].elements;for(var i=0;idocument.body.offsetWidth+ietruebody().scrollLeft){o.style.right=(10-ietruebody().scrollLeft)+'px';if(o.offsetWidth+20>document.body.offsetWidth){o.style.left=(ietruebody().scrollLeft+10)+'px';if(f==1)o.style.right='';else o.style.whiteSpace='normal';}} else o.style.left=nx+'px'; if(ny+o.offsetHeight+20>document.documentElement.offsetHeight+ietruebody().scrollTop){var nt=ny-o.offsetHeight-20;o.style.top=nt+'px';if(nto.clientHeight)o.style.height=(o.scrollHeight+4)+"px";else{var r=o.rows*16;o.style.height=r+'px';o.style.height=(o.scrollHeight'+sel.text+'';if (len==0)sel.move('character',-9);sel.select();} else{var start=ele.selectionStart;var end=ele.selectionEnd;ele.value=ele.value.substring(0,start)+''+ele.value.substring(start, end)+''+ele.value.substring(end,ele.value.length);ele.focus();ele.selectionStart=end+(start==end?8:17);ele.selectionEnd=ele.selectionStart;} } function makeSelectionItalic(ele){ if(document.selection){ele.focus();var sel=document.selection.createRange();var len=sel.text.length;sel.text=''+sel.text+'';if (len==0)sel.move('character',-9);sel.select();} else{var start=ele.selectionStart;var end=ele.selectionEnd;ele.value=ele.value.substring(0,start)+''+ele.value.substring(start, end)+''+ele.value.substring(end,ele.value.length);ele.focus();ele.selectionStart=end+(start==end?8:17);ele.selectionEnd=ele.selectionStart;} } function makeSelectionLink(ele){ if(document.selection){ele.focus();var url=prompt('Please enter the URL', 'http://');if(typeof url != 'string'){alert('Please allow scripted windows.');return false;}var sel=document.selection.createRange();var len=sel.text.length;sel.text=''+sel.text+'';if (len==0)sel.move('character',-4);sel.select();} else{var url=prompt('Please enter the URL', 'http://');var start=ele.selectionStart;var end=ele.selectionEnd;ele.value=ele.value.substring(0,start)+''+ele.value.substring(start,end)+''+ele.value.substring(end,ele.value.length);ele.focus();ele.selectionStart=end+(start==end?27:31)+url.length;ele.selectionEnd=ele.selectionStart;} } function updateWCCount(ob, oc){ len=ob.value.replace(/<\/?(?!\!)[^>]*>/g, '').replace(/^\s+|\s+$/g,'').length; document.getElementById(oc+'words').innerHTML=(len?ob.value.replace(/<\/?(?!\!)[^>]*>/g, '').replace(/^\s+|\s+$/g,'').replace(/\s+/g, ' ').split(/[ \/\-]/).length : 0); document.getElementById(oc+'chars').innerHTML=len; } function tshs(n){n=n.toString().split('.');return n[0].split('').reverse().join('').replace(/([0-9]{3})/g, '$1,').replace(/,$/, '').split('').reverse().join('')+(n.length>1?'.'+n[1]:'')} function tabul(t){var w=$(t).parent().parent();$(w).find('.tabult').attr('data-sel',0);$(w).find('.tabulc').attr('data-sel',0);$(t).attr('data-sel',1);$(w).find('.tabulc[data-id='+$(t).data('id')+']').attr('data-sel',1)}