function gb() { var xmlHttp; try { xmlHttp=new XMLHttpRequest(); return xmlHttp; } catch (e) { try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); return xmlHttp; } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); return xmlHttp; } catch (e) { dlogin(); return false; } } } } setNewsColumnFF = function() { if (navigator.appName.indexOf('Netscape') != -1) { /* document.getElementById('frontpage_news').style.position = 'absolute'; document.getElementById('frontpage_news').style.zIndex = '100000'; document.getElementById('frontpage_news').style.marginLeft = '305px'; document.getElementById('frontpage_news').style.marginTop = '229px'; */ } } /* Leggur eitt overlay útyvir síðuna */ function showblank() { document.getElementById('blank').style.width = document.body.scrollWidth+'px'; document.getElementById('blank').style.height = document.body.scrollHeight+'px'; document.getElementById('blank').style.left = '0px'; document.getElementById('blank').style.top = '0px'; document.getElementById('blank').style.visibility = 'visible'; } /* Goymir overlay'ið */ function hideblank() { document.getElementById('blank').style.visibility = 'hidden'; document.getElementById('blank').style.width = '0px'; document.getElementById('blank').style.height = '0px'; } /* Lukkar context-menu'ina */ function closeContext() { document.getElementById('context').style.visibility = 'hidden'; } /* Tilpassar browsaran til Firefox, Chrome og Safari */ function adaptBrowser() { } insertPicture = new Object; insertPictureEdit = new Object; function editManagerResize(w,h) { /* if (document.getElementById('editImageIw')) { document.getElementById('editImageIw').style.width = (w.replace('px','')-190)+'px'; document.getElementById('editImageIw2').style.width = (w.replace('px','')-190)+'px'; } if (document.getElementById('editImageIw')) { document.getElementById('editImageIw').style.height = (h.replace('px','')-150)+'px'; document.getElementById('editImageIw2').style.height = (h.replace('px','')-130)+'px'; } */ } insertPicture.resizeWindow = function() { var h = document.getElementById('window_insertImg').style.height.replace('px',''); document.getElementById('psdlist').style.height = (h-250)+'px'; } function showPictureList(t,dir) { if (dir == '' || dir == undefined) { dir = document.getElementById('currentDir').value; } else { document.getElementById('currentDir').value = dir; } xmlHttp_word_showPictureList = gb(); xmlHttp_word_showPictureList.onreadystatechange=function() { if(xmlHttp_word_showPictureList.readyState==4) { if (xmlHttp_word_showPictureList.responseText) { document.getElementById('psdlist').innerHTML = xmlHttp_word_showPictureList.responseText; showcurrentfolder(); } } } xmlHttp_word_showPictureList.open("GET","components/picturelistAjax.php?dir="+dir+"&t="+t,true); xmlHttp_word_showPictureList.send(null); } function showFolderDetails(name, location) { document.getElementById('details_table').style.visibility = 'hidden'; document.getElementById('details_howmany').style.visibility = 'hidden'; document.getElementById('details_filename').innerHTML = name; document.getElementById('details_filename').style.visibility = 'visible'; document.getElementById('details_fileorfolder').innerHTML = "Fílumappa"; document.getElementById('details_fileorfolder').style.visibility = 'visible'; document.getElementById('details_size').style.visibility = 'hidden'; document.getElementById('details_thumb').firstChild.src='word/images/picture_folder.png'; document.getElementById('details_thumb').style.visibility = 'visible'; } function showFileDetails(name, location, tlocation, x, y, fsize, created, modified) { var type = ''; var nname = ''; switch (name.substring((name.length-4), name.length).toLowerCase()) { case '.png': type = 'PNG fíl'; nname = name.substring(0, (name.length-4)); break; case '.gif': type = 'GIF fíl'; nname = name.substring(0, (name.length-4)); break; case 'jpeg': type = 'JPEG fíl'; nname = name.substring(0, (name.length-5)); break; default: type = 'JPG fíl'; nname = name.substring(0, (name.length-4)); break; } document.getElementById('details_table').style.visibility = 'visible'; document.getElementById('details_howmany').style.visibility = 'hidden'; document.getElementById('details_filename').innerHTML = nname; document.getElementById('details_filename').style.visibility = 'visible'; document.getElementById('details_fileorfolder').innerHTML = type; document.getElementById('details_fileorfolder').style.visibility = 'visible'; document.getElementById('details_size').innerHTML = x+'x'+y; document.getElementById('details_size').style.visibility = 'visible'; rfsize = Math.round(fsize/1024); ext = "bytes"; if (rfsize >= 1000) { ext = "MB"; } else if (rfsize >= 1) { ext = "KB"; } document.getElementById('details_fsize').innerHTML = rfsize+' '+ext; document.getElementById('details_fsize').style.visibility = 'visible'; document.getElementById('details_thumb').firstChild.src=tlocation+name; document.getElementById('details_thumb').style.visibility = 'visible'; document.getElementById('pictureName').value = name; } function showcurrentfolder() { var mps; var fls; if (document.getElementById('psd').value != 'true') { if (document.getElementById('hm_folders') && document.getElementById('hm_files')) { if (document.getElementById('hm_folders').value > 1) { mps = ' mappur og '; } else if (document.getElementById('hm_folders').value == 0) { mps = ' mappur og ' } else { mps = ' mappa og '; } if (document.getElementById('hm_files').value > 1) { fls = ' fílir'; } else if (document.getElementById('hm_files').value == 0) { fls = ' fílir' } else { fls = ' fíl'; } document.getElementById('details_howmany').innerHTML = document.getElementById('hm_folders').value+mps+document.getElementById('hm_files').value+fls; } } document.getElementById('details_table').style.visibility = 'hidden'; document.getElementById('details_filename').style.visibility = 'hidden'; document.getElementById('details_fileorfolder').style.visibility = 'hidden'; document.getElementById('details_size').style.visibility = 'hidden'; document.getElementById('details_howmany').style.visibility = 'visible'; document.getElementById('details_thumb').firstChild.src='word/images/picture_folder.png'; document.getElementById('details_thumb').style.visibility = 'visible'; document.getElementById('pictureName').value = ''; } function markOns(id) { if (document.getElementById('img_'+id)) { hideOns(); document.getElementById('img_'+id).className='imgOn'; document.getElementById('psd').value = 'true'; if (document.getElementById('img_'+id).tp == 'img') { showFileDetails(document.getElementById('img_name_'+id).value,document.getElementById('img_dir_'+id).value,document.getElementById('img_thumbdir_'+id).value,document.getElementById('img_giz0_'+id).value,document.getElementById('img_giz1_'+id).value,document.getElementById('img_fsize_'+id).value); document.getElementById('img_'+id).focus(); } else { showFolderDetails(document.getElementById('folder_name_'+id).value,document.getElementById('folder_dir_'+id).value); document.getElementById('img_'+id).focus(); } } } function hideOns() { for(i=1;i<=document.getElementById('hm_maxcount').value;i++) { if (document.getElementById('img_'+i)) { document.getElementById('img_'+i).className=''; } } } function closePictureWindow() { document.getElementById('details_filename').style.visibility = 'hidden'; document.getElementById('details_fileorfolder').style.visibility = 'hidden'; document.getElementById('details_size').style.visibility = 'hidden'; document.getElementById('details_howmany').style.visibility = 'hidden'; document.getElementById('details_thumb').style.visibility = 'hidden'; document.getElementById('moving_window').style.width = '0px'; document.getElementById('moving_window').style.height = '0px'; document.getElementById('moving_window').style.visibility = 'hidden'; document.body.scroll = 'auto'; hideblank(); } function openPictureEditBox(file,location) { var w = 920; var h = 600; wWindows.openWindow('pictureEditBox','components/windows/insertPicture_editImage_window.php?f='+file+'&l='+location,w,h,'Tillaga mynd'); /* var l = (parent.document.body.clientWidth/2)-(w/2)+20; var t = parseInt(parent.document.body.scrollTop)+50; document.getElementById('moving_window2').style.width=w+'px'; document.getElementById('moving_window2').style.height=h+'px'; document.getElementById('moving_window2').style.left=l+'px'; document.getElementById('moving_window2').style.top=t+'px'; // document.getElementById('moving_window2').style.backgroundImage = 'url(word/images/insertpicture.png)'; document.getElementById('insertPictureBlank').style.visibility='visible'; document.body.scroll = 'no'; xmlHttp_word_openPictureEditBox = gb(); xmlHttp_word_openPictureEditBox.onreadystatechange=function() { if(xmlHttp_word_openPictureEditBox.readyState==4) { if (xmlHttp_word_openPictureEditBox.responseText) { document.getElementById('moving_window2').innerHTML = xmlHttp_word_openPictureEditBox.responseText; document.getElementById('moving_window2').style.visibility='visible'; pEMgetSelectorArea(85,85); } } } xmlHttp_word_openPictureEditBox.open("GET","../components/windows/insertPicture_editImage_window.php?f="+file+"&l="+location,true); xmlHttp_word_openPictureEditBox.send(null); */ } var pEsx; var pEsy; var pEpressed = false; function pictureEditorSelectorMark(obj) { pEsx = event.offsetX; pEsy = event.offsetY; pEpressed = true; } function pictureEditorSelectorUnMark(obj) { pEpressed = false; } function pictureEditorSelectorMove(obj,w,h,x,y) { if (pEpressed) { if (!x) { x = event.offsetX; } if (!y) { y = event.offsetY; } document.getElementById('pictureEditorMarker').style.marginLeft = pEsx+'px'; document.getElementById('pictureEditorMarker').style.marginTop = pEsy+'px'; if (w && h) { document.getElementById('pictureEditorMarker').style.width = w+'px'; document.getElementById('pictureEditorMarker').style.height = h+'px'; } else { document.getElementById('pictureEditorMarker').style.width = (x-pEsx)+'px'; document.getElementById('pictureEditorMarker').style.height = (y-pEsy)+'px'; } if (document.getElementById('pictureEditorMarker').style.width == '0px' && document.getElementById('pictureEditorMarker').style.height == '0px') { document.getElementById('pictureEditorMarker').style.visibility = 'hidden'; } else { document.getElementById('pictureEditorMarker').style.visibility = 'visible'; } } } function pEMhover(obj) { if (!pEpressed) { obj.style.cursor = 'move'; } else { // pictureEditorSelectorMove(document.getElementById('editorPicture'),'','',(document.getElementById('pictureEditorMarker').style.width.replace('px','')-event.offsetX),(document.getElementById('pictureEditorMarker').style.height.replace('px','')-event.offsetY)); } } function pEMgetSelectorArea(w,h) { if (!pEsx && !pEsy) { pEsx = 0; pEsy = 0; } pEpressed = true; pictureEditorSelectorMove(document.getElementById('editorPicture'),w,h); pEpressed = false; } insertPictureEdit.resizeWindow = function() { var hw = document.getElementById('window_pictureEditBox').style.width.replace('px',''); var hh = document.getElementById('window_pictureEditBox').style.height.replace('px',''); document.getElementById('editImageIw2').style.width = (hw-200)+'px'; document.getElementById('editImageIw2').style.height = (hh-120)+'px'; } wWindows = new Object; wWindows.resizeWindowId = 'false'; wWindows.moveWindowId = 'false'; wWindows.l = ''; wWindows.t = ''; wWindows.w = ''; wWindows.h = ''; wWindows.x = ''; wWindows.y = ''; wWindows.currentWindow = ''; wWindows.lastZindex = 5000; wWindows.openWindow = function(id,location,w,h,title,modal) { if (document.getElementById('window_'+id)) { this.loadWindow(id,location,w,h,title,modal); // this.createWindow(id,location,w,h); } else { this.createWindow(id,location,w,h,title,modal); } document.body.scroll = 'no'; } wWindows.createWindow = function(id,location,w,h,title,modal) { var newDiv = '
'; document.getElementById('windows').innerHTML = document.getElementById('windows').innerHTML+newDiv; this.loadWindow(id,location,w,h,title,modal); } wWindows.loadWindow = function(id,location,w,h,title,modal) { xmlHttp_loadWindow = new Array; xmlHttp_loadWindow[id] = gb(); xmlHttp_loadWindow[id].onreadystatechange=function() { if(xmlHttp_loadWindow[id].readyState==4) { if (xmlHttp_loadWindow[id].responseText) { document.getElementById('window_'+id).innerHTML = xmlHttp_loadWindow[id].responseText; wWindows.showWindow(id,w,h); wWindows.loadFile(id,location,w,h); } } } xmlHttp_loadWindow[id].open("GET",'components/windows/window.phpx?id='+id+'&title='+title+'&location='+location+'&modal='+modal,true); xmlHttp_loadWindow[id].send(null); } wWindows.loadFile = function(id,location,w,h) { xmlHttp_loadFile = new Array; xmlHttp_loadFile[id] = gb(); xmlHttp_loadFile[id].onreadystatechange=function() { if(xmlHttp_loadFile[id].readyState==4) { if (xmlHttp_loadFile[id].responseText) { document.getElementById('windowfile_'+id).innerHTML = xmlHttp_loadFile[id].responseText; if (id == 'holisskipan') { holisskipan.resizeWindow(); holisskipan.loadContent(); } else if (id == 'logbook') { logbook.changeColumnWidth(); logbook.showCwIframesTimeout(); lastColumns = new Array; } else if (id == 'insertImg') { showPictureList('',''); insertPicture.resizeWindow(); } else if (id == 'pictureEditBox') { insertPictureEdit.resizeWindow(); } else if (id == 'equipment_alert') { for(i=0;i
"+document.getElementById('lbaul_userlistEntry_class_'+lbaul_id).innerHTML+"
"+document.getElementById('lbaul_userlistEntry_'+lbaul_id).innerHTML+""; document.getElementById('lbaul_userlistEntry_'+lbaul_id).style.visibility='hidden'; document.getElementById('lbaul_userlistEntry_'+lbaul_id).style.position='absolute'; document.getElementById('lbaum_input').value = document.getElementById('lbaum_input').value+','+lbaul_id; lbaul_unmark('1'); lbaul_unmark('2'); } } function lbaul_removeUser(id) { if (document.getElementById('lbaum_main').style.visibility != 'visible') { showLbaumList(); } document.getElementById('lbaum_input').value = document.getElementById('lbaum_input').value.replace(','+id,''); document.getElementById('lbaul2_userlist_'+id).outerHTML = ''; document.getElementById('lbaul_userlistEntry_'+id).style.visibility='visible'; document.getElementById('lbaul_userlistEntry_'+id).style.position=''; } var lbaucl_x; var lbaucl_y; var lbaucl_pressed = false; var lbaucl_id = ''; function lbaucl_mark(id) { lbaucl_id = id; lbaucl_pressed = true; } function lbaucl_unmark(i) { lbaucl_id = ''; lbaucl_pressed = false; document.getElementById('lbaucl_'+i+'_Usermove').style.left = '0px'; document.getElementById('lbaucl_'+i+'_Usermove').style.top = '0px'; document.getElementById('lbaucl_'+i+'_Usermove').style.visibility = 'hidden'; document.getElementById('lc_ldap_list').style.overflow = 'auto'; document.getElementById('lbaucl_2_module').style.overflow = 'auto'; } function lbaucl_hide(i) { document.getElementById('lbaucl_'+i+'_Usermove').style.left = '0px'; document.getElementById('lbaucl_'+i+'_Usermove').style.top = '0px'; document.getElementById('lbaucl_'+i+'_Usermove').style.visibility = 'hidden'; document.getElementById('lc_ldap_list').style.overflow = 'auto'; document.getElementById('lbaucl_2_module').style.overflow = 'auto'; } function lbaucl_move(i) { if (lbaucl_id != '' && lbaucl_pressed) { if (i == 1) { obj = 'lc_ldap_list'; } else { obj = 'lbaucl_'+i+'_module'; } document.getElementById(obj).style.overflow = 'hidden'; if (event.offsetX && event.offsetY) { document.getElementById('lbaucl_'+i+'_Usermove').style.left = event.offsetX+10; document.getElementById('lbaucl_'+i+'_Usermove').style.top = event.offsetY+10; } document.getElementById('lbaucl_'+i+'_Usermove').innerHTML = document.getElementById('lbaucl_faklistEntry_'+lbaucl_id).innerHTML; document.getElementById('lbaucl_'+i+'_Usermove').style.visibility = 'visible'; } } function lbaucl_dropClass() { if (lbaucl_id != '') { document.getElementById('lbaucl_2_module').innerHTML = document.getElementById('lbaucl_2_module').innerHTML + "\n
"+document.getElementById('lbaucl_faklistEntry_'+lbaucl_id).innerHTML+"
"; document.getElementById('lbaucl_faklistEntry_'+lbaucl_id).style.visibility='hidden'; document.getElementById('lbaucl_faklistEntry_'+lbaucl_id).style.position='absolute'; document.getElementById('lbaucm_input').value = document.getElementById('lbaucm_input').value+','+lbaucl_id; lbaucl_unmark('1'); lbaucl_unmark('2'); } } function lbaucl_removeClass(id) { if (document.getElementById('lbaucm_main').style.visibility != 'visible') { showLbaucmList(); } document.getElementById('lbaucm_input').value = document.getElementById('lbaucm_input').value.replace(','+id,''); document.getElementById('lbaucl2_userlist_'+id).outerHTML = ''; document.getElementById('lbaucl_faklistEntry_'+id).style.visibility='visible'; document.getElementById('lbaucl_faklistEntry_'+id).style.position=''; } var lbaum_pressed = false; var lbaum_y; var lbaum_h; function lbaum_mark() { lbaum_y = event.clientY; lbaum_h = document.getElementById('lbaum_main').style.height.replace('px',''); lbaum_pressed = true; document.body.style.cursor = 'row-resize'; } function lbaum_unmark() { lbaum_pressed = false; document.body.style.cursor = 'default'; } function lbaum_move() { if (lbaum_pressed == true) { var h = (parseInt(lbaum_h)+(event.clientY-lbaum_y)); if (h < 200) { h = 200; document.getElementById('mull2').style.visibility = 'hidden'; } else { document.getElementById('mull2').style.visibility = 'visible'; } document.getElementById('lbaum_main').style.height = h+'px'; document.getElementById('lb_ldap_list').style.height = (h-3)+'px'; } } function showLbaumList() { if (document.getElementById('lbaum_main').style.visibility == 'visible') { document.getElementById('lbaum_main').style.visibility = 'hidden'; document.getElementById('lbaul_2_module').style.border = '1px solid #aaaaaa'; } else { document.getElementById('lbaucm_main').style.visibility = 'hidden'; document.getElementById('lbaucl_2_module').style.border = '1px solid #aaaaaa'; document.getElementById('lbaum_main').style.visibility = 'visible'; document.getElementById('lbaul_2_module').style.border = '1px solid #00598c'; } } function moveUpLbaumList() { var lh = document.getElementById('lbaum_main').style.height.replace('px',''); if (lh != undefined && lh > 200) { setLbaumList(lh); } } var sLbTimer; function setLbaumList(h) { var m = 20; if (h > 200) { document.getElementById('lbaum_main').style.height = h+'px'; document.getElementById('lb_ldap_list').style.height = (h-3)+'px'; var mh = (h-m); sLbTimer = setTimeout("setLbaumList("+mh+")",10); } else { nh = 200; document.getElementById('lbaum_main').style.height = nh+'px'; document.getElementById('lb_ldap_list').style.height = (nh-3)+'px'; document.getElementById('mull2').style.visibility = 'hidden'; clearTimeout(sLbTimer); } } var lbaucm_pressed = false; var lbaucm_y; var lbaucm_h; function lbaucm_mark() { lbaucm_y = event.clientY; lbaucm_h = document.getElementById('lbaucm_main').style.height.replace('px',''); lbaucm_pressed = true; document.body.style.cursor = 'row-resize'; } function lbaucm_unmark() { lbaucm_pressed = false; document.body.style.cursor = 'default'; } function lbaucm_move() { if (lbaucm_pressed == true) { var h = (parseInt(lbaucm_h)+(event.clientY-lbaucm_y)); if (h < 200) { h = 200; document.getElementById('mull1').style.visibility = 'hidden'; } else { document.getElementById('mull1').style.visibility = 'visible'; } document.getElementById('lbaucm_main').style.height = h+'px'; document.getElementById('lc_ldap_list').style.height = (h-3)+'px'; } } function showLbaucmList() { if (document.getElementById('lbaucm_main').style.visibility == 'visible') { document.getElementById('lbaucm_main').style.visibility = 'hidden'; document.getElementById('lbaucl_2_module').style.border = '1px solid #aaaaaa'; } else { document.getElementById('lbaum_main').style.visibility = 'hidden'; document.getElementById('lbaul_2_module').style.border = '1px solid #aaaaaa'; document.getElementById('lbaucm_main').style.visibility = 'visible'; document.getElementById('lbaucl_2_module').style.border = '1px solid #00598c'; } } function moveUpLbaucmList() { var lh = document.getElementById('lbaucm_main').style.height.replace('px',''); if (lh != undefined && lh > 200) { setLbaucmList(lh); } } var sLbcTimer; function setLbaucmList(h) { var m = 20; if (h > 200) { document.getElementById('lbaucm_main').style.height = h+'px'; document.getElementById('lc_ldap_list').style.height = (h-3)+'px'; var mh = (h-m); sLbcTimer = setTimeout("setLbaucmList("+mh+")",10); } else { nh = 200; document.getElementById('lbaucm_main').style.height = nh+'px'; document.getElementById('lc_ldap_list').style.height = (nh-3)+'px'; document.getElementById('mull1').style.visibility = 'hidden'; clearTimeout(sLbcTimer); } } function checkAddLogbookForm() { var ncol = 0; var ncoltext = 0; for(i=1;i<=document.getElementById('selectColumns').value;i++) { if (document.getElementById('logbook_heiti_'+i).value == '') { ncol = 1; } if (document.getElementById('logbook_vegleidingartekstur_'+i).value == '') { ncoltext = 1; } } if (document.getElementById('logbook_name').value == '') { alert('Tú mást skriva eitt heiti til loggbókina!'); document.getElementById('logbook_name').focus(); return false; } else if (ncol > 0) { alert('Tú mást skriva eitt heiti til allar kolonnirnar!'); return false; } else if (ncoltext > 0) { alert('Tú mást skriva ein vegleiðingartekst til allar kolonnirnar!'); return false; } else { return true; } } function loadCalendar(date,fr,id) { var dt; var month; var day; var year; var cl; var months = new Array; months["01"] = "Januar"; months["02"] = "Februar"; months["03"] = "Mars"; months["04"] = "Apríl"; months["05"] = "Mai"; months["06"] = "Juni"; months["07"] = "Juli"; months["08"] = "August"; months["09"] = "September"; months["10"] = "Oktober"; months["11"] = "November"; months["12"] = "Desember"; if (document.getElementById('calendarmenu_calendar_div')) { document.getElementById('calendarmenu_calendar_div').style.visibility = 'hidden'; if (fr == 'f') { month = date.substr(4,2); year = date.substr(0,4); if (month == 12) { month = 01; year = (parseFloat(year)+1); } else { month = (parseFloat(month)+1); } if (month.toString().length == 1) { month = '0'+month; } day = date.substr(6,2); date = year + '' + month + '' + day; document.getElementById('currentmonth').value = date; } else if (fr == 'r') { month = date.substr(4,2); year = date.substr(0,4); if (month == 01) { month = 12; year = (parseFloat(year)-1); } else { month = (parseFloat(month)-1); } if (month.toString().length == 1) { month = '0'+month; } day = date.substr(6,2); date = year + '' + month + '' + day; document.getElementById('currentmonth').value = date; } else { dt = new Date(); month = (dt.getMonth()+1); if (month <= 9) { month = '0'+month; } day = dt.getDate(); if (day <= 9) { day = '0'+day; } year = dt.getFullYear(); date = year + '' + month + '' + day; document.getElementById('currentmonth').value = date; } /* if ((months && month != '' && year != '') && document.getElementById('calendar_loader')) { var ml; document.getElementById('calendar_loader').innerHTML = 'Heintar '+months[month]+' '+year+' ...'; if (month == "01" || month == "02") { ml = 62; } else if (month == "03") { ml = 57; } else if (month == "04") { ml = 56; } else if (month == "05" || month == "07") { ml = 53; } else if (month == "06") { ml = 55; } else if (month == "08") { ml = 63; } else if (month == "09") { ml = 72; } else if (month == "10") { ml = 65; } else if (month == "11") { ml = 70; } else if (month == "12") { ml = 70; } else { ml = parseFloat(months[month].length*5); } // document.getElementById('calendar_loader').style.marginLeft = '-'+ml+'px'; } */ cl = setTimeout("document.getElementById('calendar_loader').style.visibility = 'visible';",1000); xmlHttp_cal = gb(); xmlHttp_cal.onreadystatechange=function() { if(xmlHttp_cal.readyState==4) { if (xmlHttp_cal.responseText) { document.getElementById('calendarmenu_calendar_div').innerHTML = xmlHttp_cal.responseText; document.getElementById('calendarmenu_month').innerHTML = months[month]+" "+year; document.getElementById('calendar_loader').style.visibility = 'hidden'; document.getElementById('calendarmenu_calendar_div').style.visibility = 'visible'; clearTimeout(cl); } } } xmlHttp_cal.open("GET","components/calendarAjax.php?date="+date,true); xmlHttp_cal.send(null); } } function loadCalendarInfo(date) { xmlHttp_cal2 = gb(); xmlHttp_cal2.onreadystatechange=function() { if(xmlHttp_cal2.readyState==4) { if (xmlHttp_cal2.responseText) { document.getElementById('calendar_info_div').innerHTML = xmlHttp_cal2.responseText; } } } if (date != '' && date != undefined) { xmlHttp_cal2.open("GET","components/calendarInfoAjax.php?date="+date,true); } else { xmlHttp_cal2.open("GET","components/calendarInfoAjax.php",true); } xmlHttp_cal2.send(null); } function absencecalc() { for(i=1;i<=document.getElementById('numberofstudents').value;i++) { if (document.getElementById('student_'+i)) { if (document.getElementById('student_'+i).value > 0) { document.getElementById('student_'+i+'_percent').innerHTML = Math.round(((parseInt(document.getElementById('student_'+i).value)/parseInt(document.getElementById('numberofhours').value))*100))+'%'; } else { document.getElementById('student_'+i).value = 0; } } } }