/** Displays confirmation dialog ("Are you sure?"). * @return bool true - user have clicked 'yes', false - 'no' */ function sure(sMsg){ var sMess; sMess = (sMsg && sMsg.length > 10) ? sMsg : msg[0]; var aMessages = aMessages; if (aMessages && aMessages['js.sure']) sMess = aMessages['js.sure']; return confirm(sMess); } function formatMes(sKey) { var i = 1; var sMsg = aMessages[sKey]; var sMsg2 = aMessages[sKey]; while (sMsg.length) { if (sMsg.search(/%s/) != -1) { sMsg = sMsg.replace(/.*?(%s.*|\n)/ , '$1'); sMsg = sMsg.replace(/^%s/, ''); sMsg2 = sMsg2.replace(/%s/, arguments[i]); i++; } else { sMsg = sMsg.replace(/.*/, ''); } } return sMsg2; } /** Open popup window. * @param string url url to open in popup window * @param string name window name * @param int width window width * @param int height window height * @param bool bIsResize true - window resizable, false - fixed size */ function openWin(url, name, width, height, bIsResize){ if (!width) width = screen.width*0.9; if (!height) height = screen.height*0.75; IsReize = bIsResize?1:0; var newWindow = window.open(url, name, 'left=' + Math.ceil((screen.width - width)/2) + ',top=' + Math.ceil((0+screen.height - height)/2) + ',width=' + width + ',height=' + height + ',location=0,toolbar=0,directories=0,status=0,menubar=0,scrollbars=1,resizable='+bIsResize+',channelmode=0,fullscreen=0'); return false; } /** Selects/deselects all checkbox with given name * @param string name checbox name * @param bool val true - select, false - deselect boxes */ function selectAll(name,val){ a = document.getElementsByName(name); for(i=0;i