var NO_MENU = 0; function ConfirmDelete(url, str) { str = typeof(str) != 'undefined' ? str : "Czy na pewno chcesz usunąć?"; ndot_alert(url, 'Potwierdzenie', 'Czy na pewno chcesz usunąć?'); } function validateServiceAddForm(theForm) { if (!validRequired(theForm.name, "Nazwa")) return false; if (!validNum(theForm.time_duration, "Czas", true)) return false; if (!validNum(theForm.price, "Cena", true)) return false; return true; } function validateServiceEditForm(theForm) { if (!validRequired(theForm.name, "Nazwa")) return false; if (!validNum(theForm.time_duration, "Czas", true)) return false; if (!validNum(theForm.price, "Cena", true)) return false; if (!validNum(theForm.time_duration, "Czas", true)) return false; if (!validNum(theForm.min_time_interval, "Przedziały czasowe", true)) return false; if (!validNum(theForm.price_per_unit, "Cena za minutę", true)) return false; if (!validNum(theForm.applet_width, "Szerokość appletu", true)) return false; return true; } function validateWorkersEditForm(theForm) { if (!validRequired(theForm.name, "Imię")) return false; if (!validRequired(theForm.surname, "Nazwisko")) return false; return true; } function validateDevicesEditForm(theForm) { if (!validRequired(theForm.name, "Nazwa")) return false; return true; } function maximizedPopupWndwN(name, url) { var w = 800, h = 600; w = screen.width; h = screen.height; var newwindow = null; if (NO_MENU==0) newwindow=window.open(url,name,'height='+h+',width='+w+',top=0,left=0,resizable=yes,scrollbars=yes,menubar=yes,statusbar=no'); else newwindow=window.open(url,name,''); if (window.focus) {newwindow.focus()} } function maximizedPopupWndw(url) { maximizedPopupWndwN('name', url) } function centerPopupWndwN(name, url, wwidth, wheight, forceparams) { var w = 1024, h = 768; w = screen.width; h = screen.height; var ww = typeof(wwidth) != 'undefined' ? wwidth : 950; var wh = typeof(wwidth) != 'undefined' ? wheight : 650; var nm = typeof(forceparams) != 'undefined' ? forceparams : false; var popY = ww, popX = wh; var leftPos = (w-popY)/2, topPos = (h-popX)/2; var newwindow = null; if (NO_MENU==0 || nm==true) newwindow=window.open(url,name,'height='+popX+',width='+popY+',top='+topPos+',left='+leftPos+',resizable=yes,scrollbars=yes,menubar=no,statusbar=no,toolbar=no'); else newwindow=window.open(url,name,''); if (window.focus) {newwindow.focus()} } function centerPopupWndw(url) { centerPopupWndwN('name', url); } function reportTM(theForm) { if (theForm.reptype.value == 15) { theForm.timeFrom.disabled = false; theForm.timeTo.disabled = false; } else { theForm.timeFrom.value = ''; theForm.timeFrom.disabled = true; theForm.timeTo.value = ''; theForm.timeTo.disabled = true; } theForm.submit(); return true; } function reportTMPickerCal(theForm, elem) { if (theForm.reptype.value == 15) { theForm.timeFrom.disabled = false; theForm.timeTo.disabled = false; NewCal(elem,'yyyymmdd',true,24,'arrow',true); } else { ndot_info('Wybierz czas', 'Ustaw "wybrany przedział czasu" jeśli chcesz określić datę'); } } function reportTMPickerCalDateOnly(theForm, elem) { if (theForm.reptype.value == 15) { theForm.timeFrom.disabled = false; theForm.timeTo.disabled = false; NewCal(elem,'yyyymmdd',false,12,'arrow'); } else { ndot_info('Wybierz czas', 'Ustaw "wybrany przedział czasu" jeśli chcesz określić datę'); } } function discountTMPickerCal(elem) { NewCal(elem,'yyyymmdd',true,24,'arrow',true); } function TMPickerCal(elem) { NewCal(elem,'yyyymmdd',true,24,'arrow',true); } function TMPickerCalDateOnly(elem) { NewCal(elem,'yyyymmdd',false,12,'arrow'); } var arrayOfRolloverClasses = new Array(); var arrayOfClickClasses = new Array(); var activeRow = false; var activeRowClickArray = new Array(); function highlightTableRow() { var tableObj = this.parentNode; if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode; if(this!=activeRow){ this.setAttribute('origCl',this.className); this.origCl = this.className; } this.className = arrayOfRolloverClasses[tableObj.id]; activeRow = this; } function clickOnTableRow() { var tableObj = this.parentNode; if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode; if(activeRowClickArray[tableObj.id] && this!=activeRowClickArray[tableObj.id]){ activeRowClickArray[tableObj.id].className=''; } this.className = arrayOfClickClasses[tableObj.id]; activeRowClickArray[tableObj.id] = this; } function resetRowStyle() { var tableObj = this.parentNode; if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode; if(activeRowClickArray[tableObj.id] && this==activeRowClickArray[tableObj.id]){ this.className = arrayOfClickClasses[tableObj.id]; return; } var origCl = this.getAttribute('origCl'); if(!origCl)origCl = this.origCl; this.className=origCl; } function addTableRolloverEffect(tableId,whichClass,whichClassOnClick) { arrayOfRolloverClasses[tableId] = whichClass; arrayOfClickClasses[tableId] = whichClassOnClick; var tableObj = document.getElementById(tableId); var tBody = tableObj.getElementsByTagName('TBODY'); if(tBody){ var rows = tBody[0].getElementsByTagName('TR'); }else{ var rows = tableObj.getElementsByTagName('TR'); } for(var no=0;no' + title + ''); alertWin.document.write(''); alertWin.document.write(''); alertWin.document.write(''); alertWin.document.write('
'); alertWin.document.write('
'); alertWin.document.write(''); alertWin.document.write(''); alertWin.document.write(''); alertWin.document.write(''); alertWin.document.write(''); alertWin.document.write(''); alertWin.document.write(''); alertWin.document.write(''); alertWin.document.writeln('
'); alertWin.document.write(msg); alertWin.document.write('
'); if (popup == '' || typeof(popup) == 'undefined') alertWin.document.write('  '); if (url2 != '' && typeof(url2) != 'undefined') alertWin.document.write('  '); if (popup != '' && typeof(popup) != 'undefined') alertWin.document.write('  '); alertWin.document.write(''); alertWin.document.write('
'); alertWin.document.writeln('
'); alertWin.document.writeln(''); alertWin.document.writeln('
'); alertWin.document.close(); if (window.focus) {alertWin.focus()} } function ndot_info_color(title, msg, color) { var w = 1024, h = 768; w = screen.width; h = screen.height; var popW = 350, popH = 120; var leftPos = (w-popW)/2, topPos = (h-popH)/2; var alertWin = null; alertWin=window.open('','ndot_prompt','height='+popH+',width='+popW+',top='+topPos+',left='+leftPos+',resizable=yes,scrollbars=no,menubar=no,statusbar=no'); alertWin.document.write('' + title + ''); alertWin.document.write(''); alertWin.document.write(''); alertWin.document.write(''); alertWin.document.write('
'); alertWin.document.write('
'); alertWin.document.write(''); alertWin.document.write(''); alertWin.document.write(''); alertWin.document.write(''); alertWin.document.write(''); alertWin.document.write(''); alertWin.document.write(''); alertWin.document.write(''); alertWin.document.writeln('
'); alertWin.document.write(msg); alertWin.document.write('
'); alertWin.document.write('  '); alertWin.document.write('
'); alertWin.document.writeln('
'); alertWin.document.writeln(''); alertWin.document.writeln('
'); alertWin.document.close(); if (window.focus) {alertWin.focus()} } function ndot_info(title, msg) { ndot_info_color(title, msg, '#D6D3CE'); } function ndot_error(title, msg) { ndot_info_color(title, msg, '#FF0000'); } function ndot_prompt(url, title, msg, defval, unit) { var w = 1024, h = 768; w = screen.width; h = screen.height; var popW = 400, popH = 140; var leftPos = (w-popW)/2, topPos = (h-popH)/2; var promptWin = null; promptWin=window.open('','ndot_prompt','height='+popH+',width='+popW+',top='+topPos+',left='+leftPos+',resizable=yes,scrollbars=no,menubar=no,statusbar=no'); promptWin.document.write('' + title + ''); promptWin.document.write(''); promptWin.document.write(''); promptWin.document.write(''); promptWin.document.write('
'); promptWin.document.write('
'); promptWin.document.write(''); promptWin.document.write(''); promptWin.document.write(''); promptWin.document.write(''); promptWin.document.write(''); promptWin.document.write(''); promptWin.document.write(''); promptWin.document.write(''); promptWin.document.write('
'); promptWin.document.write(msg); promptWin.document.write('  '); promptWin.document.write(unit); promptWin.document.write('
'); promptWin.document.write('  '); promptWin.document.write(''); promptWin.document.write('
'); promptWin.document.writeln('
'); promptWin.document.writeln(''); promptWin.document.write('
'); promptWin.document.close(); if (window.focus) {promptWin.focus()} } function ndot_query(url, title, msg, error) { var w = 1024, h = 768; w = screen.width; h = screen.height; var popW = 400, popH = 140; var leftPos = (w-popW)/2, topPos = (h-popH)/2; var promptWin = null; promptWin=window.open('','ndot_prompt','height='+popH+',width='+popW+',top='+topPos+',left='+leftPos+',resizable=yes,scrollbars=no,menubar=no,statusbar=no'); promptWin.document.write('' + title + ''); promptWin.document.write(''); promptWin.document.write(''); promptWin.document.write(''); promptWin.document.write(''); promptWin.document.write('
'); promptWin.document.write('
'); promptWin.document.write(''); promptWin.document.write(''); promptWin.document.write(''); promptWin.document.write(''); promptWin.document.write(''); promptWin.document.write(''); promptWin.document.write(''); promptWin.document.write(''); promptWin.document.write('
'); if (error != '' && error != null) promptWin.document.write('

'+error+'

'); promptWin.document.write(msg); promptWin.document.write('
'); promptWin.document.write('  '); promptWin.document.write(''); promptWin.document.write('
'); promptWin.document.writeln('
'); promptWin.document.writeln(''); promptWin.document.writeln(''); promptWin.document.write('
'); promptWin.document.close(); if (window.focus) {promptWin.focus()} } var rowClickEffect_prev_row = null; var rowClickEffect_prev_class = null; function rowClickEffect(row_ob, classname, url) { if (rowClickEffect_prev_row != null) rowClickEffect_prev_row.className=rowClickEffect_prev_class; rowClickEffect_prev_row = row_ob; rowClickEffect_prev_class = row_ob.className; row_ob.className=classname; if (url!=null && url!='') window.location=url; } function rowClickEffectInputNum(row_ob, classname, url, msg, defval, unit) { if (url!=null && url!='') { ndot_prompt(url, 'N.S New Image', msg, defval, unit); } } function rowClickEffectConfirm(row_ob, classname, url, msg) { if (rowClickEffect_prev_row != null) rowClickEffect_prev_row.className=rowClickEffect_prev_class; rowClickEffect_prev_row = row_ob; rowClickEffect_prev_class = row_ob.className; row_ob.className=classname; if (url!=null && url!='') { var value = confirm(msg); if (value) { window.location = url; } } } function togglechange(id, newClass) { identity=document.getElementById(id); identity.className=newClass; } function tmsgs(msg, obname, classname) { var m = document.getElementById(obname); m.className=classname; m.appendChild(document.createTextNode(msg)); } function SetAllCheckBoxes(FormName, FieldNamePart, CheckValue) { if(!document.forms[FormName]) return; var objCheckBoxes = document.forms[FormName].elements; if(!objCheckBoxes) return; var countCheckBoxes = objCheckBoxes.length; if(!countCheckBoxes) objCheckBoxes.checked = CheckValue; else for(var i = 0; i < countCheckBoxes; i++) { if (objCheckBoxes[i].name.search(FieldNamePart)!=-1) { objCheckBoxes[i].checked = CheckValue; } } } function goToLocation(url) { window.location = url; } function parseFloatX(str) { var newstr = str.replace(',', '.'); return parseFloat(newstr) } function floatToCurrency(val) { var newval = Math.round(val*100)/100; var str = newval.toString(); var newstr = str.replace('.', ','); return newstr } function submitenter(myfield,e) { var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; else return true; if (keycode == 13) { myfield.form.submit(); return false; } else return true; } function closeWindow() { self.close(); }