function getTrCount () { i = 0; while (document.getElementById('left_navi_tr_' + i) != null) { i++; } return i - 1; } function deleteRow (row_number) { // first step: determine the absolute number of table rows var tr_count = getTrCount(); // second step: iterate through all rows in the interval [row_number, tr_count] and shift the content up for (i = row_number; i < tr_count; i++) { new_index = parseInt(i) + 1; document.getElementById('mode_' + i).value = document.getElementById('mode_' + new_index).value document.getElementById('p1_' + i + '_data').selectedIndex = document.getElementById('p1_' + new_index + '_data').selectedIndex; document.getElementById('p1_' + i + '_descr').innerHTML = document.getElementById('p1_' + new_index + '_descr').innerHTML; document.getElementById('p1_' + i + '_tr').style.display = document.getElementById('p1_' + new_index + '_tr').style.display; document.getElementById('p2_' + i + '_data').value = document.getElementById('p2_' + new_index + '_data').value; document.getElementById('p2_' + i + '_descr').innerHTML = document.getElementById('p2_' + new_index + '_descr').innerHTML; document.getElementById('p2_' + i + '_tr').style.display = document.getElementById('p2_' + new_index + '_tr').style.display; document.getElementById('p3_' + i + '_data').value = document.getElementById('p3_' + new_index + '_data').value; document.getElementById('p3_' + i + '_descr').innerHTML = document.getElementById('p3_' + new_index + '_descr').innerHTML; document.getElementById('p3_' + i + '_tr').style.display = document.getElementById('p3_' + new_index + '_tr').style.display; } // third step: remove the last row (which is now identical to the second last row, if it exists) document.getElementById('left_navi_tr_' + tr_count).parentNode.removeChild(document.getElementById('left_navi_tr_' + tr_count)); // fourth step: if there are no other rows left, display the insert(0) button if (tr_count <= 1) { document.getElementById('left_navi_tr_0').style.display = 'block'; } } function moveUpRow (row_number) { // first step: determine the absolute number of table rows // (remember to subtract one because that is the table's first two rows, i.e. the header with the cell descriptions and the auxiliary button) // var tr_count = document.getElementById('nav_table').rows.length - 2; var tr_count = getTrCount(); // second step: is it possible to move up? I.e. are there more than one table rows && is the current row not the first row // then simply switch the values of the current row and the row before if ((tr_count > 1) && (row_number > 1)) { above_index = parseInt(row_number) - 1; tmp = document.getElementById('mode_' + above_index).selectedIndex; document.getElementById('mode_' + above_index).selectedIndex = document.getElementById('mode_' + row_number).selectedIndex; document.getElementById('mode_' + row_number).selectedIndex = tmp; tmp = document.getElementById('mode_' + above_index).style.display; document.getElementById('mode_' + above_index).style.display = document.getElementById('mode_' + row_number).style.display; document.getElementById('mode_' + row_number).style.display = tmp; tmp = document.getElementById('p1_' + above_index + '_data').selectedIndex; document.getElementById('p1_' + above_index + '_data').selectedIndex = document.getElementById('p1_' + row_number + '_data').selectedIndex; document.getElementById('p1_' + row_number + '_data').selectedIndex = tmp; tmp = document.getElementById('p1_' + above_index + '_descr').innerHTML; document.getElementById('p1_' + above_index + '_descr').innerHTML = document.getElementById('p1_' + row_number + '_descr').innerHTML; document.getElementById('p1_' + row_number + '_descr').innerHTML = tmp; tmp = document.getElementById('p1_' + above_index + '_tr').style.display; document.getElementById('p1_' + above_index + '_tr').style.display = document.getElementById('p1_' + row_number + '_tr').style.display; document.getElementById('p1_' + row_number + '_tr').style.display = tmp; tmp = document.getElementById('p2_' + above_index + '_data').value; document.getElementById('p2_' + above_index + '_data').value = document.getElementById('p2_' + row_number + '_data').value; document.getElementById('p2_' + row_number + '_data').value = tmp; tmp = document.getElementById('p2_' + above_index + '_descr').innerHTML; document.getElementById('p2_' + above_index + '_descr').innerHTML = document.getElementById('p2_' + row_number + '_descr').innerHTML; document.getElementById('p2_' + row_number + '_descr').innerHTML = tmp; tmp = document.getElementById('p2_' + above_index + '_tr').style.display; document.getElementById('p2_' + above_index + '_tr').style.display = document.getElementById('p2_' + row_number + '_tr').style.display; document.getElementById('p2_' + row_number + '_tr').style.display = tmp; tmp = document.getElementById('p3_' + above_index + '_data').value; document.getElementById('p3_' + above_index + '_data').value = document.getElementById('p3_' + row_number + '_data').value; document.getElementById('p3_' + row_number + '_data').value = tmp; tmp = document.getElementById('p3_' + above_index + '_descr').innerHTML; document.getElementById('p3_' + above_index + '_descr').innerHTML = document.getElementById('p3_' + row_number + '_descr').innerHTML; document.getElementById('p3_' + row_number + '_descr').innerHTML = tmp; tmp = document.getElementById('p3_' + above_index + '_tr').style.display; document.getElementById('p3_' + above_index + '_tr').style.display = document.getElementById('p3_' + row_number + '_tr').style.display; document.getElementById('p3_' + row_number + '_tr').style.display = tmp; } } // this function will insert a row after the current row function insertRow (row_number) { // first step: determine the absolute number of table rows // (remember to subtract one because that is the table's first two rows, i.e. the header with the cell descriptions and the auxiliary button) var tr_count = getTrCount(); // second step: have the auxiliary button disappear document.getElementById('left_navi_tr_0').style.display = 'none'; // third step: create the new table row and its table cells, var left_navi_table_tr = document.createElement("tr"); var left_navi_mode = document.createElement("td"); left_navi_table_tr.appendChild(left_navi_mode); var left_navi_content = document.createElement("td"); left_navi_table_tr.appendChild(left_navi_content); var left_navi_delete = document.createElement("td"); left_navi_table_tr.appendChild(left_navi_delete); var left_navi_move_up = document.createElement("td"); left_navi_table_tr.appendChild(left_navi_move_up); var left_navi_insert = document.createElement("td"); left_navi_table_tr.appendChild(left_navi_insert); // fill the cells, new_id = tr_count + 1; left_navi_mode.innerHTML = ''; left_navi_content.innerHTML = '
page:
text:
'; left_navi_delete.innerHTML = ''; left_navi_move_up.innerHTML = ''; left_navi_insert.innerHTML = ''; left_navi_table_tr.setAttribute('id', 'left_navi_tr_' + new_id); // and add it to the main table document.getElementById('nav_table').appendChild(left_navi_table_tr); // fourth step: shift all entries down so that the row after row row_number is empty; only do that for non-vanishing rows if (row_number > 0) { for (i = tr_count + 1; i >= parseInt(row_number) + 1; i--) { var above_index = parseInt(i) - 1; document.getElementById('mode_' + i).selectedIndex = document.getElementById('mode_' + above_index).selectedIndex; document.getElementById('p1_' + i + '_data').selectedIndex = document.getElementById('p1_' + above_index + '_data').selectedIndex; document.getElementById('p1_' + i + '_descr').innerHTML = document.getElementById('p1_' + above_index + '_descr').innerHTML; document.getElementById('p1_' + i + '_tr').style.display = document.getElementById('p1_' + above_index + '_tr').style.display; document.getElementById('p2_' + i + '_data').value = document.getElementById('p2_' + above_index + '_data').value; document.getElementById('p2_' + i + '_descr').innerHTML = document.getElementById('p2_' + above_index + '_descr').innerHTML; document.getElementById('p2_' + i + '_tr').style.display = document.getElementById('p2_' + above_index + '_tr').style.display; document.getElementById('p3_' + i + '_data').value = document.getElementById('p3_' + above_index + '_data').value; document.getElementById('p3_' + i + '_descr').innerHTML = document.getElementById('p3_' + above_index + '_descr').innerHTML; document.getElementById('p3_' + i + '_tr').style.display = document.getElementById('p3_' + above_index + '_tr').style.display; } } var new_index = parseInt(row_number) + 1; document.getElementById('mode_' + new_index).selectedIndex = 1; document.getElementById('p1_' + new_index + '_data').selectedIndex = 0; adaptIDList(new_index); } function adaptNavTable (select_id, nav_table_id) { // broad layout (i.e. no left navigation) if (document.getElementById(select_id).selectedIndex == 0) { document.getElementById(nav_table_id).style.display = "none"; } else { document.getElementById(nav_table_id).style.display = "table"; } } function adaptIDListForNavi (nav_template_id, id_list_id, configuration_table_id, configuration_notification_id) { // "no": specify data for left navigation manually if (document.getElementById(nav_template_id).selectedIndex == 0) { document.getElementById(id_list_id).disabled = true; document.getElementById(configuration_table_id).style.display = "table"; document.getElementById(configuration_notification_id).style.display = "none"; createPreview(); // "yes": use existing left hand navigation data } else if (document.getElementById(nav_template_id).selectedIndex == 1) { document.getElementById(id_list_id).disabled = false; document.getElementById(configuration_table_id).style.display = "none"; document.getElementById(configuration_notification_id).style.display = "table"; document.getElementById(configuration_notification_id).innerHTML = "No manual configuration necessary; data will be imported from the site selected above."; document.getElementById(configuration_notification_id).style.textAlign = "center"; document.getElementById("preview_td").innerHTML = ""; } } function adaptIDListForNavi_edit (nav_template_id, id_list_id, configuration_table_id, configuration_notification_id, change_only_locally_tr_id) { // "no": specify data for left navigation manually if (document.getElementById(nav_template_id).selectedIndex == 0) { document.getElementById(id_list_id).disabled = true; document.getElementById(configuration_table_id).style.display = "table"; document.getElementById(configuration_notification_id).style.display = "none"; document.getElementById(change_only_locally_tr_id).style.display = "table-row"; createPreview(); // "yes": use existing left hand navigation data } else if (document.getElementById(nav_template_id).selectedIndex == 1) { document.getElementById(id_list_id).disabled = false; document.getElementById(configuration_table_id).style.display = "none"; document.getElementById(configuration_notification_id).style.display = "table"; document.getElementById(configuration_notification_id).innerHTML = "No manual configuration necessary; data will be imported from the site selected above."; document.getElementById(configuration_notification_id).style.textAlign = "center"; document.getElementById(change_only_locally_tr_id).style.display = "none"; document.getElementById("preview_td").innerHTML = ""; } } function adaptIDList (id_number) { // remember: id_number is a number, not the whole id // headline if (document.getElementById("mode_" + id_number).selectedIndex == 0) { document.getElementById("p1_" + id_number + "_tr").style.display = "none"; document.getElementById("p2_" + id_number + "_tr").style.display = "table-row"; document.getElementById("p2_" + id_number + "_descr").innerHTML = "text:"; document.getElementById("p2_" + id_number + "_data").value = ""; document.getElementById("p3_" + id_number + "_tr").style.display = "none"; // internal link } else if (document.getElementById("mode_" + id_number).selectedIndex == 1) { document.getElementById("p1_" + id_number + "_tr").style.display = "table-row"; document.getElementById("p1_" + id_number + "_descr").innerHTML = "page:"; document.getElementById("p2_" + id_number + "_tr").style.display = "table-row"; document.getElementById("p2_" + id_number + "_descr").innerHTML = "text:"; document.getElementById("p2_" + id_number + "_data").value = ""; document.getElementById("p3_" + id_number + "_tr").style.display = "none"; // external link } else if (document.getElementById("mode_" + id_number).selectedIndex == 2) { document.getElementById("p1_" + id_number + "_tr").style.display = "none"; document.getElementById("p2_" + id_number + "_tr").style.display = "table-row"; document.getElementById("p2_" + id_number + "_descr").innerHTML = "URL:"; document.getElementById("p2_" + id_number + "_data").value = ""; document.getElementById("p3_" + id_number + "_tr").style.display = "table-row"; document.getElementById("p3_" + id_number + "_descr").innerHTML = "text:"; document.getElementById("p3_" + id_number + "_data").value = ""; // image } else if (document.getElementById("mode_" + id_number).selectedIndex == 3) { document.getElementById("p1_" + id_number + "_tr").style.display = "none"; document.getElementById("p2_" + id_number + "_tr").style.display = "table-row"; document.getElementById("p2_" + id_number + "_descr").innerHTML = "URL:"; document.getElementById("p2_" + id_number + "_data").value = ""; document.getElementById("p3_" + id_number + "_tr").style.display = "none"; // separator } else if (document.getElementById("mode_" + id_number).selectedIndex == 4) { document.getElementById("p1_" + id_number + "_tr").style.display = "none"; document.getElementById("p2_" + id_number + "_tr").style.display = "table-row"; document.getElementById("p2_" + id_number + "_descr").innerHTML = "color:"; document.getElementById("p2_" + id_number + "_data").value = "#4379a5"; document.getElementById("p3_" + id_number + "_tr").style.display = "none"; // line } else if (document.getElementById("mode_" + id_number).selectedIndex == 5) { document.getElementById("p1_" + id_number + "_tr").style.display = "none"; document.getElementById("p2_" + id_number + "_tr").style.display = "table-row"; document.getElementById("p2_" + id_number + "_descr").innerHTML = "color:"; document.getElementById("p2_" + id_number + "_data").value = "#cccccc"; document.getElementById("p3_" + id_number + "_tr").style.display = "none"; // vertical space } else if (document.getElementById("mode_" + id_number).selectedIndex == 6) { document.getElementById("p1_" + id_number + "_tr").style.display = "none"; document.getElementById("p2_" + id_number + "_tr").style.display = "table-row"; document.getElementById("p2_" + id_number + "_descr").innerHTML = "height:"; document.getElementById("p2_" + id_number + "_data").value = "1em"; document.getElementById("p3_" + id_number + "_tr").style.display = "none"; // direct HTML } else if (document.getElementById("mode_" + id_number).selectedIndex == 7) { document.getElementById("p1_" + id_number + "_tr").style.display = "none"; document.getElementById("p2_" + id_number + "_tr").style.display = "table-row"; document.getElementById("p2_" + id_number + "_descr").innerHTML = "HTML:"; document.getElementById("p2_" + id_number + "_data").value = ""; document.getElementById("p3_" + id_number + "_tr").style.display = "none"; // direct PHP } else if (document.getElementById("mode_" + id_number).selectedIndex == 8) { document.getElementById("p1_" + id_number + "_tr").style.display = "none"; document.getElementById("p2_" + id_number + "_tr").style.display = "table-row"; document.getElementById("p2_" + id_number + "_descr").innerHTML = "PHP:"; document.getElementById("p2_" + id_number + "_data").value = ""; document.getElementById("p3_" + id_number + "_tr").style.display = "none"; } } function createPreviewIfPossible (mode_id) { if (document.getElementById(mode_id).selectedIndex == 0) { createPreview(); } else { alert("No preview possible; please visit the respective page to see the navigation."); } } function createPreview () { var table_id = 'nav_table'; var preview_td_id = 'preview_td'; // the HTML output var HTML = ''; document.getElementById(preview_td_id).innerHTML = HTML; } var db_URL_names = ["","Research","Students","Group","Organization","Contact","Misc","Themes","Energy-Transport","Nanoscale-Dynamics","Biomatter-And-Microscopy","Optical-Switching-And-Control","Publications","PhD-Theses","Courses","Student-Projects","People","Former-Members","Positions","Photo-Galleries","01-The-Great-Move","02-The-Removal-Party","03-The-Dutch-Dinner","04-Christmas-Dinner-2007","05-Columbian-BBQ-2008","Links","Phone-List","Templates","Complex-Materials","Group-Meetings","Admin","Sitemap","Events","Other","Zernike-Chair-Lectures","2015","Private","Group-Meetings-2012","Group-Meetings-2011","Group-Meetings-2010","Group-Meetings-2009","Group-Meetings-2008","Group-Meetings-2007","Group-Meetings-2006","Group-Meetings-2005","Group-Meetings-2004","Group-Meetings-2013","OCMS-Events","Archive","06-Christmas-Dinner-2008","07-BBQ-2009","08-Christmas-Dinner-And-Bowling-2009","09-BBQ-2010","10-BBQ-2011","11-BBQ-2012","12-Christmas-Dinner-And-Climbing-2012","13-Farewell-Dinner-Paul-2013","14-Christmas-Dinner-And-Cocktail-Workshop-2013","Chess","Lab-Schedule","Book","Unbook","Calendar","OCMS-Output","Samples","Show","Add","Search","Modify","Delete","Software","Old-Student-Reports","Old-Stuff","OCMS-Old-Positions","Show","Search","Add-Publication","Add-Presentation","Add-Other","Delete","Fundamental-And-Functional-Properties-Of-Nanomaterials-2012","Fundamental-And-Functional-Properties-Of-Nanomaterials-2011","Fundamental-And-Functional-Properties-Of-Nanomaterials-2010","Fundamental-And-Functional-Properties-Of-Nanomaterials-2009","Fundamental-And-Functional-Properties-Of-Nanomaterials-2008","Quantum-Mechanics-II-2010","Quantum-Mechanics-II-2009","Lectures","Quantum-Mechanics-II-2008","Lectures","Laser-Microscopy-2010","Suggested-Reading","Laser-Microscopy-2009","Photons-And-Matter-2010","Photons-And-Matter-2009","Physics-Of-Lasers-2011","Physiscs-Of-Lasers-2010","Intro-TopMaster-Nanoscience-2009","Intro-TopMaster-Nanoscience-2008","Characterization-Of-Nano-Materials-2010","Characterization-Of-Nano-Materials-2011","Characterization-Of-Nano-Materials-2008-2009","Complex-Matter","Semiconductors","Polymers-And-Photovoltaics","Molecular-Physics","Optically-Induced-Phenomena","Molecular-Excitons","Single-Molecule-Microscopy","Test","Modify","Confirm","Proceed","Confirm","LDCMS-FAQ","Group-Meetings-2014","RUG","Pauls-birthday-party2013","Lecture-Notes","SS14-Photons-Matter","WS13-14-Structure-Of-Matter","labinfo","WS14-15-Condensed-Matter-Physics-I","WS13-14","SS14","CMPII","UWC","WS1415-superconductivity","Group-Meetings-2016","SS16photonsmatter","Student-Reports","GroupCalendar","GroupeCalendar2","WS16-17-Condensed-Matter-Physics-I","Group-Meetings-2017","SS17-Condensed-Matter-Physics-II","SFB-PDF","Group-Meetings-2018","SS18-Magnetism","Group-Meetings-2019","SS19-Magnetism","Group-Meetings","GroupMeetings","GroupMeetings2022","GroupMeetings2023"]; var db_URLs = {"1":"","3":"Research\/","4":"Students\/","5":"Group\/","6":"Organization\/","7":"Contact\/","8":"Misc\/","9":"Research\/Themes\/","10":"Research\/Themes\/Energy-Transport\/","11":"Research\/Themes\/Nanoscale-Dynamics\/","12":"Research\/Themes\/Biomatter-And-Microscopy\/","13":"Research\/Themes\/Optical-Switching-And-Control\/","14":"Research\/Publications\/","15":"Research\/PhD-Theses\/","16":"Students\/Courses\/","17":"Students\/Student-Projects\/","18":"Group\/People\/","19":"Group\/People\/Former-Members\/","20":"Group\/Positions\/","21":"Group\/Photo-Galleries\/","22":"Group\/Photo-Galleries\/RUG\/01-The-Great-Move\/","23":"Group\/Photo-Galleries\/RUG\/02-The-Removal-Party\/","24":"Group\/Photo-Galleries\/RUG\/03-The-Dutch-Dinner\/","25":"Group\/Photo-Galleries\/RUG\/04-Christmas-Dinner-2007\/","26":"Group\/Photo-Galleries\/RUG\/05-Columbian-BBQ-2008\/","27":"Group\/Links\/","28":"Group\/Phone-List\/","29":"Group\/Private\/Templates\/","31":"Research\/Themes\/Complex-Materials\/","32":"Group\/Group-Meetings\/","47":"Contact\/Admin\/","51":"Sitemap\/","60":"Events\/","61":"Events\/Other\/","62":"Students\/Zernike-Chair-Lectures\/","69":"Events\/2015\/","84":"Group\/Private\/","85":"Events\/Group-Meetings-2012\/","86":"Events\/Group-Meetings-2011\/","87":"Events\/Group-Meetings-2010\/","88":"Events\/Group-Meetings-2009\/","89":"Events\/Group-Meetings-2008\/","90":"Events\/Group-Meetings-2007\/","91":"Events\/Group-Meetings-2006\/","92":"Events\/Group-Meetings-2005\/","93":"Events\/Group-Meetings-2004\/","94":"Events\/Group-Meetings-2013\/","95":"Events\/OCMS-Events\/","96":"Events\/OCMS-Events\/Archive\/","97":"Group\/Photo-Galleries\/RUG\/06-Christmas-Dinner-2008\/","98":"Group\/Photo-Galleries\/RUG\/07-BBQ-2009\/","99":"Group\/Photo-Galleries\/RUG\/08-Christmas-Dinner-And-Bowling-2009\/","100":"Group\/Photo-Galleries\/RUG\/09-BBQ-2010\/","101":"Group\/Photo-Galleries\/RUG\/10-BBQ-2011\/","102":"Group\/Photo-Galleries\/RUG\/11-BBQ-2012\/","103":"Group\/Photo-Galleries\/RUG\/12-Christmas-Dinner-And-Climbing-2012\/","104":"Group\/Photo-Galleries\/RUG\/13-Farewell-Dinner-Paul-2013\/","105":"Group\/Photo-Galleries\/RUG\/14-Christmas-Dinner-And-Cocktail-Workshop-2013\/","106":"Misc\/Chess\/","107":"Group\/Private\/Lab-Schedule\/","108":"Group\/Private\/Lab-Schedule\/Book\/","109":"Group\/Private\/Lab-Schedule\/Unbook\/","110":"Group\/Private\/Lab-Schedule\/Calendar\/","111":"Group\/Private\/OCMS-Output\/","112":"Group\/Private\/Samples\/","113":"Group\/Private\/Samples\/Show\/","114":"Group\/Private\/Samples\/Add\/","115":"Group\/Private\/Samples\/Search\/","116":"Group\/Private\/Samples\/Modify\/","117":"Group\/Private\/Samples\/Delete\/","118":"Group\/Private\/Software\/","119":"Group\/Private\/Student-Reports\/Old-Student-Reports\/","120":"Group\/Private\/Old-Stuff\/","121":"Group\/Private\/Old-Stuff\/OCMS-Old-Positions\/","122":"Group\/Private\/OCMS-Output\/Show\/","123":"Group\/Private\/OCMS-Output\/Search\/","124":"Group\/Private\/OCMS-Output\/Add-Publication\/","125":"Group\/Private\/OCMS-Output\/Add-Presentation\/","126":"Group\/Private\/OCMS-Output\/Add-Other\/","127":"Group\/Private\/OCMS-Output\/Delete\/","128":"Group\/Private\/Old-Stuff\/Fundamental-And-Functional-Properties-Of-Nanomaterials-2012\/","129":"Group\/Private\/Old-Stuff\/Fundamental-And-Functional-Properties-Of-Nanomaterials-2011\/","130":"Group\/Private\/Old-Stuff\/Fundamental-And-Functional-Properties-Of-Nanomaterials-2010\/","131":"Group\/Private\/Old-Stuff\/Fundamental-And-Functional-Properties-Of-Nanomaterials-2009\/","132":"Group\/Private\/Old-Stuff\/Fundamental-And-Functional-Properties-Of-Nanomaterials-2008\/","133":"Group\/Private\/Old-Stuff\/Quantum-Mechanics-II-2010\/","134":"Group\/Private\/Old-Stuff\/Quantum-Mechanics-II-2009\/","135":"Group\/Private\/Old-Stuff\/Quantum-Mechanics-II-2009\/Lectures\/","136":"Group\/Private\/Old-Stuff\/Quantum-Mechanics-II-2008\/","137":"Group\/Private\/Old-Stuff\/Quantum-Mechanics-II-2008\/Lectures\/","138":"Group\/Private\/Old-Stuff\/Laser-Microscopy-2010\/","139":"Group\/Private\/Old-Stuff\/Laser-Microscopy-2010\/Suggested-Reading\/","140":"Group\/Private\/Old-Stuff\/Laser-Microscopy-2009\/","141":"Group\/Private\/Old-Stuff\/Photons-And-Matter-2010\/","142":"Group\/Private\/Old-Stuff\/Photons-And-Matter-2009\/","143":"Group\/Private\/Old-Stuff\/Physics-Of-Lasers-2011\/","144":"Group\/Private\/Old-Stuff\/Physiscs-Of-Lasers-2010\/","145":"Group\/Private\/Old-Stuff\/Intro-TopMaster-Nanoscience-2009\/","146":"Group\/Private\/Old-Stuff\/Intro-TopMaster-Nanoscience-2008\/","147":"Group\/Private\/Old-Stuff\/Characterization-Of-Nano-Materials-2010\/","148":"Group\/Private\/Old-Stuff\/Characterization-Of-Nano-Materials-2011\/","149":"Group\/Private\/Old-Stuff\/Characterization-Of-Nano-Materials-2008-2009\/","151":"Research\/Publications\/Complex-Matter\/","152":"Research\/Publications\/Semiconductors\/","153":"Research\/Publications\/Polymers-And-Photovoltaics\/","154":"Research\/Publications\/Molecular-Physics\/","155":"Research\/Publications\/Optically-Induced-Phenomena\/","156":"Research\/Publications\/Molecular-Excitons\/","157":"Research\/Publications\/Single-Molecule-Microscopy\/","161":"Contact\/Admin\/Test\/","162":"Group\/Private\/OCMS-Output\/Search\/Modify\/","163":"Group\/Private\/OCMS-Output\/Delete\/Confirm\/","164":"Group\/Private\/Samples\/Modify\/Proceed\/","165":"Group\/Private\/Samples\/Delete\/Confirm\/","166":"Contact\/Admin\/LDCMS-FAQ\/","167":"Events\/Group-Meetings-2014\/","168":"Group\/Photo-Galleries\/RUG\/","169":"Group\/Photo-Galleries\/Pauls-birthday-party2013\/","170":"Students\/Lecture-Notes\/","171":"Students\/Lecture-Notes\/SS14-Photons-Matter\/","172":"Students\/Lecture-Notes\/WS13-14-Structure-Of-Matter\/","173":"Group\/Private\/labinfo\/","174":"Students\/Lecture-Notes\/WS14-15-Condensed-Matter-Physics-I\/","175":"Events\/Group-Meetings-2016\/WS13-14\/","176":"Events\/Group-Meetings-2016\/SS14\/","179":"Students\/Lecture-Notes\/CMPII\/","181":"Students\/UWC\/","182":"Students\/Lecture-Notes\/WS1415-superconductivity\/","183":"Events\/Group-Meetings-2016\/","184":"Students\/Lecture-Notes\/SS16photonsmatter\/","185":"Group\/Private\/Student-Reports\/","186":"Group\/Private\/GroupCalendar\/","187":"Group\/Private\/GroupeCalendar2\/","188":"Students\/Lecture-Notes\/WS16-17-Condensed-Matter-Physics-I\/","189":"Events\/Group-Meetings-2017\/","190":"Students\/Lecture-Notes\/SS17-Condensed-Matter-Physics-II\/","191":"SFB-PDF\/","192":"Events\/Group-Meetings-2018\/","193":"Students\/Lecture-Notes\/SS18-Magnetism\/","194":"Events\/Group-Meetings-2019\/","195":"Students\/Lecture-Notes\/SS19-Magnetism\/","196":"Events\/Group-Meetings\/","198":"Events\/GroupMeetings\/","199":"Events\/GroupMeetings2022\/","200":"Events\/GroupMeetings2023\/"}; var db_URL_names_for_parent_id = {"1":"Events@Research@Students@Group@Organization@Contact@Misc@Sitemap@SFB-PDF","3":"Themes@Publications@PhD-Theses","4":"Lecture-Notes@Courses@Student-Projects@Zernike-Chair-Lectures@UWC","5":"People@Positions@Photo-Galleries@Links@Phone-List@Group-Meetings@Private","6":"","7":"Admin","8":"Chess","9":"Energy-Transport@Nanoscale-Dynamics@Biomatter-And-Microscopy@Optical-Switching-And-Control@Complex-Materials","10":"","11":"","12":"","13":"","14":"Complex-Matter@Semiconductors@Polymers-And-Photovoltaics@Molecular-Physics@Optically-Induced-Phenomena@Molecular-Excitons@Single-Molecule-Microscopy","15":"","16":"","17":"","18":"Former-Members","19":"","20":"","21":"RUG@Pauls-birthday-party2013","22":"","23":"","24":"","25":"","26":"","27":"","28":"","29":"","31":"","32":"","47":"Test@LDCMS-FAQ","51":"","60":"Other@2015@Group-Meetings-2012@Group-Meetings-2011@Group-Meetings-2010@Group-Meetings-2009@Group-Meetings-2008@Group-Meetings-2007@Group-Meetings-2006@Group-Meetings-2005@Group-Meetings-2004@Group-Meetings-2013@OCMS-Events@Group-Meetings-2014@GroupMeetings@Group-Meetings-2016@Group-Meetings-2017@Group-Meetings-2018@Group-Meetings-2019@Group-Meetings@GroupMeetings2022@GroupMeetings2023","61":"","62":"","69":"","84":"labinfo@Templates@Lab-Schedule@OCMS-Output@Samples@Software@Old-Stuff@Student-Reports@GroupCalendar@GroupeCalendar2","85":"","86":"","87":"","88":"","89":"","90":"","91":"","92":"","93":"","94":"","95":"Archive","96":"","97":"","98":"","99":"","100":"","101":"","102":"","103":"","104":"","105":"","106":"","107":"Book@Unbook@Calendar","108":"","109":"","110":"","111":"Show@Search@Add-Publication@Add-Presentation@Add-Other@Delete","112":"Show@Add@Search@Modify@Delete","113":"","114":"","115":"","116":"Proceed","117":"Confirm","118":"","119":"","120":"Fundamental-And-Functional-Properties-Of-Nanomaterials-2010@OCMS-Old-Positions@Fundamental-And-Functional-Properties-Of-Nanomaterials-2012@Quantum-Mechanics-II-2010@Fundamental-And-Functional-Properties-Of-Nanomaterials-2011@Fundamental-And-Functional-Properties-Of-Nanomaterials-2009@Fundamental-And-Functional-Properties-Of-Nanomaterials-2008@Quantum-Mechanics-II-2009@Quantum-Mechanics-II-2008@Laser-Microscopy-2010@Laser-Microscopy-2009@Photons-And-Matter-2010@Photons-And-Matter-2009@Physics-Of-Lasers-2011@Physiscs-Of-Lasers-2010@Intro-TopMaster-Nanoscience-2009@Intro-TopMaster-Nanoscience-2008@Characterization-Of-Nano-Materials-2010@Characterization-Of-Nano-Materials-2011@Characterization-Of-Nano-Materials-2008-2009","121":"","122":"","123":"Modify","124":"","125":"","126":"","127":"Confirm","128":"","129":"","130":"","131":"","132":"","133":"","134":"Lectures","135":"","136":"Lectures","137":"","138":"Suggested-Reading","139":"","140":"","141":"","142":"","143":"","144":"","145":"","146":"","147":"","148":"","149":"","151":"","152":"","153":"","154":"","155":"","156":"","157":"","161":"","162":"","163":"","164":"","165":"","166":"","167":"","168":"01-The-Great-Move@02-The-Removal-Party@03-The-Dutch-Dinner@04-Christmas-Dinner-2007@05-Columbian-BBQ-2008@06-Christmas-Dinner-2008@07-BBQ-2009@08-Christmas-Dinner-And-Bowling-2009@09-BBQ-2010@10-BBQ-2011@11-BBQ-2012@12-Christmas-Dinner-And-Climbing-2012@13-Farewell-Dinner-Paul-2013@14-Christmas-Dinner-And-Cocktail-Workshop-2013","169":"","170":"SS14-Photons-Matter@WS13-14-Structure-Of-Matter@WS14-15-Condensed-Matter-Physics-I@CMPII@WS1415-superconductivity@SS16photonsmatter@WS16-17-Condensed-Matter-Physics-I@SS17-Condensed-Matter-Physics-II@SS18-Magnetism@SS19-Magnetism","171":"","172":"","173":"","174":"","175":"","176":"","179":"","181":"","182":"","183":"WS13-14@SS14","184":"","185":"Old-Student-Reports","186":"","187":"","188":"","189":"","190":"","191":"","192":"","193":"","194":"","195":"","196":"","198":"","199":"","200":""}; var db_usernames = ["Boos","Hazel","Koch","Koethe","pvl","Reinhoffer"]; var db_protect_id_for_id = {"1":null,"3":null,"4":null,"5":null,"6":null,"7":null,"8":null,"9":null,"10":null,"11":null,"12":null,"13":null,"14":null,"15":null,"16":null,"17":null,"18":null,"19":null,"20":null,"21":null,"22":null,"23":null,"24":null,"25":null,"26":null,"27":null,"28":null,"29":"84","31":null,"32":null,"47":null,"51":null,"60":null,"61":null,"62":null,"69":null,"84":"84","85":null,"86":null,"87":null,"88":null,"89":null,"90":null,"91":null,"92":null,"93":null,"94":null,"95":null,"96":null,"97":null,"98":null,"99":null,"100":null,"101":null,"102":null,"103":null,"104":null,"105":null,"106":null,"107":"84","108":"84","109":"84","110":"84","111":"84","112":"84","113":"84","114":"84","115":"84","116":"84","117":"84","118":"84","119":"84","120":"84","121":"84","122":"84","123":"84","124":"84","125":"84","126":"84","127":"84","128":"84","129":"84","130":"84","131":"84","132":"84","133":"84","134":"84","135":"84","136":"84","137":"84","138":"84","139":"84","140":"84","141":"84","142":"84","143":"84","144":"84","145":"84","146":"84","147":"84","148":"84","149":"84","151":null,"152":null,"153":null,"154":null,"155":null,"156":null,"157":null,"161":"161","162":"84","163":"84","164":"84","165":"84","166":null,"167":null,"168":null,"169":null,"170":null,"171":null,"172":null,"173":"84","174":null,"175":null,"176":null,"179":null,"181":"181","182":"182","183":null,"184":"184","185":"84","186":"84","187":"84","188":"188","189":null,"190":"190","191":null,"192":null,"193":"193","194":null,"195":"195","196":null,"198":null,"199":null,"200":null}; var db_title_for_id = {"1":"Home","3":"Research","4":"Students","5":"The OCMS Group","6":"Organization","7":"Contact","8":"Misc. & Fun","9":"Research Themes","10":"Energy transport","11":"Nanoscale dynamics","12":"Biomatter and microscopy","13":"Optical switching and control","14":"Publications","15":"Ph.D. Theses","16":"Courses","17":"Student projects","18":"People","19":"Former OCMS members","20":"Open positions","21":"Photo galleries","22":"The Great Move, 2007","23":"The "Removal" party","24":"The Dutch Dinner, 2007","25":"Christmas Dinner, 2007","26":"Columbian BBQ, 2008","27":"Links","28":"Phone list","29":"Templates","31":"Complex materials","32":"Group meetings","47":"Website Administration","51":"Sitemap","60":"Events","61":"Other Events","62":"Zernike Chair Lectures","69":"Group Meetings 2015","84":"Private Area","85":"Group Meetings 2012","86":"Group Meetings 2011","87":"Group Meetings 2010","88":"Group Meetings 2009","89":"Group Meetings 2008","90":"Group Meetings 2007","91":"Group Meetings 2006","92":"Group Meetings 2005","93":"Group Meetings 2004","94":"Group Meetings 2013","95":"OCMS Events","96":"Archive","97":"Christmas Dinner, 2008","98":"BBQ 2009","99":"Christmas Dinner & Bowling, 2009","100":"BBQ 2010","101":"BBQ 2011","102":"BBQ 2012","103":"Christmas Dinner & Climbing, 2012","104":"Farewell Dinner Paul 2013","105":"Christmas Dinner & Cocktail Workshop, 2013","106":"Play Chess","107":"Lab Schedule","108":"Book a lab","109":"Remove booking(s)","110":"Calendar","111":"OCMS Output","112":"Samples","113":"Show Samples","114":"Add Samples","115":"Search Samples","116":"Modify Samples","117":"Delete Samples","118":"Software","119":"Old Student Reports","120":"Old Stuff","121":"OCMS Old Positions","122":"Show OCMS Output","123":"Search OCMS output","124":"Add Publication","125":"Add Presentation","126":"Add other","127":"Delete OCMS output","128":"Fundamental and functional properties of nanomaterials 2012","129":"Fundamental and functional properties of nanomaterials 2011","130":"Fundamental and functional properties of nanomaterials 2010","131":"Fundamental and functional properties of nanomaterials 2009","132":"Fundamental and functional properties of nanomaterials 2008","133":"Quantum-mechanics II 2010","134":"Quantum-mechanics II 2009","135":"Lectures","136":"Quantum-mechanics II 2008","137":"Lectures","138":"Laser microscopy 2010","139":"Suggested reading","140":"Laser microscopy 2009","141":"Photons and Matter 2010","142":"Photons and Matter 2009","143":"Physics of Lasers 2011","144":"Physiscs of Lasers 2010","145":"Intro TopMaster Nanoscience 2009","146":"Intro TopMaster Nanoscience 2008","147":"Characterization of Nano-materials 2010","148":"Characterization of Nano-materials 2011","149":"Characterization of Nano-materials 2008-2009","151":"Complex matter","152":"Semiconductors and semiconductor structures","153":"Conjugated polymers and plastic photovoltaics","154":"Molecular physics","155":"Optically induced phenomena","156":"Molecular excitons","157":"Single molecule microscopy","161":"Testing Area","162":"Modify OCMS output","163":"Confirm Delete","164":"Proceed Modifying Sample","165":"Confirm Delete","166":"LDCMS F. A. Q.","167":"Group Meetings 2014","168":"University of Groningen 2007 - 2013","169":"Pauls birthday party 2013","170":"Lecture Notes and Materials","171":"SS14 Photons Matter","172":"WS13\/14 Structure of Matter","173":"Lab Info","174":"WS14\/15 Condensed Matter Physics I ","175":"Group Meetings Winter Term 2013 \/ 2014","176":"Group Meetings Summer Term 2014","179":"SS15 Condensed Matter Physics II","181":"UWC optics and magnetism","182":"WS15\/16 Superconductivity","183":"Group Meetings 2016","184":"SS16 Photons Matter","185":"Student Reports","186":"Group Calendar","187":"Group Calendar 2 ","188":"WS16\/17 Condensed Matter Physics I","189":"Group Meetings 2017","190":"SS17 Condensed Matter Physics II","191":"SFB1238","192":"Group Meetings 2018","193":"SS18 Magnetism","194":"Group Meetings 2019","195":"SS19 Magnetism","196":"Group Meetings 2020","198":"Group Meetings 2021","199":"Group Meetings 2022","200":"Group Meetings 2023"}; function protection_check (current_id, parent_select_id, notification_tr_id, notification_td_id, login_time_id, advanced_settings_id, advanced_settings_checkbox_id) { // is the page protected by itself? if (current_id != "") { id = document.getElementById(current_id).value; if (db_protect_id_for_id[id] == id) { document.getElementById(notification_tr_id).style.display = "table-row"; document.getElementById(notification_td_id).innerHTML = "Note: This page is already directly protected."; document.getElementById(login_time_id).style.display = "table-row"; document.getElementById(advanced_settings_id).style.display = "table-row-group"; document.getElementById(advanced_settings_checkbox_id).checked = true; return; } } // is the parent id protected already? parent_id = document.getElementById(parent_select_id).value; protect_id = db_protect_id_for_id[parent_id]; if (protect_id != null) { document.getElementById(notification_tr_id).style.display = "table-row"; document.getElementById(notification_td_id).innerHTML = "Note: This page is already protected by the following parent page: " + db_title_for_id[protect_id] + "
Specifying a password and / or username here will override the current protection and introduce an additional layer of security."; document.getElementById(login_time_id).style.display = "none"; document.getElementById(advanced_settings_id).style.display = "table-row-group"; document.getElementById(advanced_settings_checkbox_id).checked = true; } else { document.getElementById(notification_tr_id).style.display = "none"; document.getElementById(notification_td_id).innerHTML = ""; document.getElementById(advanced_settings_id).style.display = "none"; document.getElementById(advanced_settings_checkbox_id).checked = false; } } function updateNewUserTable (checkbox_id, tr1_id, tr2_id, name_new_id) { if (document.getElementById(checkbox_id).checked == true) { document.getElementById(tr1_id).style.display = "table-row"; document.getElementById(tr2_id).style.display = "table-row"; document.getElementById(name_new_id).focus(); } else { document.getElementById(tr1_id).style.display = "none"; document.getElementById(tr2_id).style.display = "none"; } } function checkNewUserData (text_id, email_id, pwd_id, checkbox_id, alert_mode) { if (document.getElementById(checkbox_id).checked == 0) { return true; } OK = true; for (i = 0; i < db_usernames.length; i++) { if (document.getElementById(text_id).value == db_usernames[i]) { document.getElementById(text_id).style.border = "1px solid red"; document.getElementById(text_id).style.background = "#ffcccc"; OK = false; if (alert_mode == "alert") { alert("This username is already taken."); } } } if (document.getElementById(text_id).value.trim() == "") { document.getElementById(text_id).style.border = "1px solid red"; document.getElementById(text_id).style.background = "#ffcccc"; if (alert_mode == "alert") { alert("Please specify a username."); } OK = false; } else if (OK == true) { document.getElementById(text_id).style.border = ""; document.getElementById(text_id).style.background = ""; } if (document.getElementById(email_id).value.trim() == "") { document.getElementById(email_id).style.border = "1px solid red"; document.getElementById(email_id).style.background = "#ffcccc"; if (alert_mode == "alert") { alert("Please specify a valid email address."); } OK = false; } else { document.getElementById(email_id).style.border = ""; document.getElementById(email_id).style.background = ""; } if (document.getElementById(pwd_id).value.trim() == "") { document.getElementById(pwd_id).style.border = "1px solid red"; document.getElementById(pwd_id).style.background = "#ffcccc"; if (alert_mode == "alert") { alert("Please specify a password."); } OK = false; } else { document.getElementById(pwd_id).style.border = ""; document.getElementById(pwd_id).style.background = ""; } return OK; } // checks, if the url shows up ANYWHERE in the database // (makes no sense, since a url name is still unique if it does not show up twice on the same level) function checkForExistingUrlName_depr (title_id) { document.getElementById(title_id).style.border = ""; title = document.getElementById(title_id).value; for (i = 0; i <= db_URL_names.length; i++) { if (title == db_URL_names[i]) { return true; } } return false; } // conducts a basic spell check for a url_name: it may only contain letters a-z as well as numbers and the minus sign - function spellCheck (url_id) { // check the phrase var reg_exp = /^([a-zA-Z0-9\-]+)$/; phrase = document.getElementById(url_id).value; if (!phrase.match(reg_exp)) { return false; } return true; } // checks if the url_name already exists function checkForExistingUrlName (url_name_id, parent_id_id, old_url_name) { // get the entered URL name and the parent id url_name = document.getElementById(url_name_id).value; parent_id = document.getElementById(parent_id_id).value; // if the parent id is zero then there is no need for a check because then this id is the root if (parent_id == 0) { return false; } // "explode" the string of url names into a temporary array // (if it is non-trivial) if (db_URL_names_for_parent_id[parent_id] != "") { url_names_array = db_URL_names_for_parent_id[parent_id].split("@"); // search for the respective url for (i = 0; i < url_names_array.length; i++) { if ((url_names_array[i] == url_name) && (url_names_array[i] != old_url_name)) { return true; } } } return false; } // overall check of the entered url_name function url_name_check (url_id, parent_id, alert_mode, old_url_name) { check_passed = true; if (spellCheck(url_id) == false) { document.getElementById(url_id).style.border = "1px solid red"; document.getElementById(url_id).style.background = "#ffcccc"; if (alert_mode == "alert") { alert("Note: The URL name may only contain letters, numbers, and the hyphen -.\nBlank spaces or other symbols are not allowed."); } check_passed = false; } if (checkForExistingUrlName(url_id, parent_id, old_url_name) == true) { document.getElementById(url_id).style.border = "1px solid red"; document.getElementById(url_id).style.background = "#ffcccc"; if (alert_mode == "alert") { alert("Note: The URL name already exists."); } check_passed = false; } if (check_passed == true) { document.getElementById(url_id).style.border = ""; document.getElementById(url_id).style.background = ""; return true; } else { return false; } } // overall check of the entered url_name for the root page function url_name_check_for_root (url_id, alert_mode) { // check the phrase var reg_exp = /^([a-zA-Z0-9\-]*)$/; phrase = document.getElementById(url_id).value; if (!phrase.match(reg_exp)) { document.getElementById(url_id).style.border = "1px solid red"; document.getElementById(url_id).style.background = "#ffcccc"; if (alert_mode == "alert") { alert("Note: The URL name may only contain letters, numbers, and the hyphen -.\nBlank spaces or other symbols are not allowed."); } return false; } else { document.getElementById(url_id).style.border = ""; document.getElementById(url_id).style.background = ""; return true; } } function setURL (parent_id, td_id) { parent_id = document.getElementById(parent_id).value; if (parent_id != 0) { document.getElementById(td_id).innerHTML = "http://loosdrecht.ph2.uni-koeln.de/" + db_URLs[parent_id]; } else { document.getElementById(td_id).innerHTML = "http://loosdrecht.ph2.uni-koeln.de/"; } } // check of the entered title (should be non-empty) function title_check (title_id, alert_mode) { if (document.getElementById(title_id).value.trim() == "") { document.getElementById(title_id).style.border = "1px solid red"; document.getElementById(title_id).style.background = "#ffcccc"; if (alert_mode == "alert") { alert("Please enter a non-empty title."); } return false; } else { document.getElementById(title_id).style.border = ""; document.getElementById(title_id).style.background = ""; return true; } } function completeCheck(url_id, parent_id, title_id, old_url_name, login_time_id) { result = (url_name_check(url_id, parent_id, 'alert', old_url_name) && title_check(title_id, 'alert') && time_check(login_time_id, 'alert')); return result; } function completeCheck_for_root (title_id, login_time_id) { result = (title_check(title_id, 'alert') && time_check(login_time_id, 'alert')); return result; } function time_check (login_time_id, alert_mode) { if (isNaN(document.getElementById(login_time_id).value) || (parseInt(document.getElementById(login_time_id).value) < 0)) { if (alert_mode == "alert") { alert("The entered login time is not a valid positive number."); } document.getElementById(login_time_id).style.border = "1px solid red"; document.getElementById(login_time_id).style.background = "#ffcccc"; return false; } document.getElementById(login_time_id).style.border = ""; document.getElementById(login_time_id).style.background = ""; return true; } function adaptAccess_create (access_type_id, username_id, password_id) { // public access if (document.getElementById(access_type_id).selectedIndex == 0) { document.getElementById(username_id).disabled = true; document.getElementById(username_id).value = ""; document.getElementById(password_id).disabled = true; document.getElementById(password_id).value = ""; // password only } else if (document.getElementById(access_type_id).selectedIndex == 1) { document.getElementById(username_id).disabled = true; document.getElementById(username_id).value = ""; document.getElementById(password_id).disabled = false; // password and username } else { document.getElementById(username_id).disabled = false; document.getElementById(password_id).disabled = false; } } function adaptAccess (access_type_id, username_id, password_id, pwd_info_id) { // public access if (document.getElementById(access_type_id).selectedIndex == 0) { document.getElementById(username_id).disabled = true; document.getElementById(username_id).value = ""; document.getElementById(password_id).disabled = true; document.getElementById(password_id).value = ""; document.getElementById(pwd_info_id).style.display = "none"; // password only } else if (document.getElementById(access_type_id).selectedIndex == 1) { document.getElementById(username_id).disabled = true; document.getElementById(username_id).value = ""; document.getElementById(password_id).disabled = false; document.getElementById(pwd_info_id).style.display = "table-row"; // password and username } else { document.getElementById(username_id).disabled = false; document.getElementById(password_id).disabled = false; document.getElementById(pwd_info_id).style.display = "table-row"; } } function toggle_advanced_settings (checkbox_id, tbody_id) { if (document.getElementById(checkbox_id).checked == true) { document.getElementById(tbody_id).style.display = "table-row-group"; } else { document.getElementById(tbody_id).style.display = "none"; } } function showLoginTime (access_id) { if (document.getElementById(access_id).selectedIndex == 0) { document.getElementById("login_time").style.display = "none"; document.getElementById("expiration_time_in_minutes").value = "15"; } else { document.getElementById("login_time").style.display = "table-row"; } } function updateImgPreviewSrc (header_image_url_id, header_image_url_img_id) { document.getElementById(header_image_url_img_id).style.background = "url(" + document.getElementById(header_image_url_id).value + ") no-repeat"; } function updateImgPreviewHeight (header_height_id, header_image_url_img_id) { document.getElementById(header_image_url_img_id).style.height = document.getElementById(header_height_id).value; } function updateImgPreviewBackgroundColor (header_image_url_id, header_image_url_img_id) { document.getElementById(header_image_url_img_id).style.background = document.getElementById(header_image_url_id).value; } function updateIconPreviewSrc (icon_image_url_id, icon_image_url_img_id) { document.getElementById(icon_image_url_img_id).setAttribute("src", document.getElementById(icon_image_url_id).value); } // ******************** // main navigation stuff // switch the level of the main navigation element, change the level button's arrow direction accordingly function MainNavigation_toggleLevel (item_number) { if (document.getElementById("mn_li_" + item_number).getAttribute("class") == "MainNavLi") { document.getElementById("mn_li_" + item_number).setAttribute("class", "MainNavLi_Sub"); document.getElementById("mn_table_" + item_number).setAttribute("class", "MainNavTable_Sub"); document.getElementById("mn_toggle_" + item_number).setAttribute("value", "\u2190"); document.getElementById("mn_level_" + item_number).checked = "checked"; } else { document.getElementById("mn_li_" + item_number).setAttribute("class", "MainNavLi"); document.getElementById("mn_table_" + item_number).setAttribute("class", "MainNavTable"); document.getElementById("mn_toggle_" + item_number).setAttribute("value", "\u2192"); document.getElementById("mn_level_" + item_number).checked = ""; } } // controls the visibility of either the page dropdown list or the URL text field depending on the item's mode function MainNavigation_adjustItemLink (item_number) { // internal link? if (document.getElementById("mn_mode_" + item_number).value == "0") { document.getElementById("mn_link_td_" + item_number).style.display = "none"; document.getElementById("mn_link_id_td_" + item_number).style.display = "table-cell"; // external link? } else { document.getElementById("mn_link_td_" + item_number).style.display = "table-cell"; document.getElementById("mn_link_id_td_" + item_number).style.display = "none"; } } // get the number of main navigation item function MainNavigation_getNumberOfItems () { tmp = 1; while (document.getElementById('mn_li_' + tmp) != null) { tmp++; } return tmp - 1; } // delete item with number 'item_number' from the main navigation item list function MainNavigation_deleteItem (item_number) { // first step: determine the absolute number of navigation elements var item_count = MainNavigation_getNumberOfItems(); // second step: iterate through all rows in the interval [item_number, item_count] and shift the content up for (i = item_number; i < item_count; i++) { MainNavigation_switchItems(i, parseInt(i) + 1); } // third step: remove the last item (which is now identical to the second last item, if it exists) document.getElementById('mn_li_' + item_count).parentNode.removeChild(document.getElementById('mn_li_' + item_count)); // fourth step: no items left? then show the "create main navigation" button if (item_count <= 1) { document.getElementById('mn_li_0').style.display = 'block'; } } // insert an item after the position of the item with number 'item_number' function MainNavigation_insertItem (item_number) { // first step: determine the absolute number of navigation elements var item_count = MainNavigation_getNumberOfItems(); // second step: hide the "create main navigation" button if (item_count <= 1) { document.getElementById('mn_li_0').style.display = 'none'; } // third step: create the new list entry and the table it contains with the buttons and data fields // (note: structure can be found in index.php) var new_item_number = item_count + 1; var mn_li_new = document.createElement("li"); mn_li_new.setAttribute("id", "mn_li_" + new_item_number); mn_li_new.setAttribute("class", "MainNavLi"); var mn_table_new = document.createElement("table"); mn_table_new.setAttribute("id", "mn_table_" + new_item_number); mn_table_new.setAttribute("class", "MainNavTable"); mn_li_new.appendChild(mn_table_new); var mn_tr_new = document.createElement("tr"); mn_table_new.appendChild(mn_tr_new); var mn_toggle = document.createElement("td"); mn_tr_new.appendChild(mn_toggle); mn_toggle.innerHTML = ''; var mn_level = document.createElement("td"); mn_tr_new.appendChild(mn_level); mn_level.style = "display: none;"; mn_level.innerHTML = ''; var mn_insert = document.createElement("td"); mn_tr_new.appendChild(mn_insert); mn_insert.innerHTML = ''; var mn_delete = document.createElement("td"); mn_tr_new.appendChild(mn_delete); mn_delete.innerHTML = ''; var mn_move_down = document.createElement("td"); mn_tr_new.appendChild(mn_move_down); mn_move_down.innerHTML = ''; var mn_mode = document.createElement("td"); mn_tr_new.appendChild(mn_mode); mn_mode.innerHTML = ''; var mn_text = document.createElement("td"); mn_tr_new.appendChild(mn_text); mn_text.innerHTML = ''; var mn_link_td = document.createElement("td"); mn_tr_new.appendChild(mn_link_td); mn_link_td.setAttribute("id", "mn_link_td_" + new_item_number); mn_link_td.setAttribute("style", "width: 100%; display: none;"); mn_link_td.innerHTML = ''; var mn_link_id_td = document.createElement("td"); mn_tr_new.appendChild(mn_link_id_td); mn_link_id_td.setAttribute("id", "mn_link_id_td_" + new_item_number); mn_link_id_td.innerHTML = ''; // and add it to the main list document.getElementById('MainNavList').appendChild(mn_li_new); // fourth step: shift all entries down so that the item after the item with number 'item_number' is empty; // only do that for non-vanishing items if (item_number > 0) { for (i = item_count + 1; i > parseInt(item_number) + 1; i--) { MainNavigation_switchItems(i, i - 1); } } } // this function switches two items in the main navigation list function MainNavigation_switchItems (item_number_1, item_number_2) { tmp = document.getElementById('mn_li_' + item_number_1).getAttribute("class"); document.getElementById('mn_li_' + item_number_1).setAttribute("class", document.getElementById('mn_li_' + item_number_2).getAttribute("class")); document.getElementById('mn_li_' + item_number_2).setAttribute("class", tmp); tmp = document.getElementById('mn_table_' + item_number_1).getAttribute("class"); document.getElementById('mn_table_' + item_number_1).setAttribute("class", document.getElementById('mn_table_' + item_number_2).getAttribute("class")); document.getElementById('mn_table_' + item_number_2).setAttribute("class", tmp); tmp = document.getElementById('mn_toggle_' + item_number_1).value; document.getElementById('mn_toggle_' + item_number_1).value = document.getElementById('mn_toggle_' + item_number_2).value; document.getElementById('mn_toggle_' + item_number_2).value = tmp; tmp = document.getElementById('mn_level_' + item_number_1).checked; document.getElementById('mn_level_' + item_number_1).checked = document.getElementById('mn_level_' + item_number_2).checked; document.getElementById('mn_level_' + item_number_2).checked = tmp; tmp = document.getElementById('mn_mode_' + item_number_1).selectedIndex; document.getElementById('mn_mode_' + item_number_1).selectedIndex = document.getElementById('mn_mode_' + item_number_2).selectedIndex; document.getElementById('mn_mode_' + item_number_2).selectedIndex = tmp; tmp = document.getElementById('mn_text_' + item_number_1).value; document.getElementById('mn_text_' + item_number_1).value = document.getElementById('mn_text_' + item_number_2).value; document.getElementById('mn_text_' + item_number_2).value = tmp; tmp = document.getElementById('mn_link_td_' + item_number_1).style.display; document.getElementById('mn_link_td_' + item_number_1).style.display = document.getElementById('mn_link_td_' + item_number_2).style.display; document.getElementById('mn_link_td_' + item_number_2).style.display = tmp; tmp = document.getElementById('mn_link_' + item_number_1).value; document.getElementById('mn_link_' + item_number_1).value = document.getElementById('mn_link_' + item_number_2).value; document.getElementById('mn_link_' + item_number_2).value = tmp; tmp = document.getElementById('mn_link_id_td_' + item_number_1).style.display; document.getElementById('mn_link_id_td_' + item_number_1).style.display = document.getElementById('mn_link_id_td_' + item_number_2).style.display; document.getElementById('mn_link_id_td_' + item_number_2).style.display = tmp; tmp = document.getElementById('mn_link_id_' + item_number_1).selectedIndex; document.getElementById('mn_link_id_' + item_number_1).selectedIndex = document.getElementById('mn_link_id_' + item_number_2).selectedIndex; document.getElementById('mn_link_id_' + item_number_2).selectedIndex = tmp; } // this function checks the main navigation item list for consistency, i.e. the first element needs to be level 0 function MainNavigation_checkItems () { // first step: determine the absolute number of navigation elements item_count = MainNavigation_getNumberOfItems(); // second step: check the first element, if available if (item_count >= 1) { // problem? then display a message if (document.getElementById('mn_li_1').getAttribute("class") == "MainNavLi_Sub") { document.getElementById("mn_notification_tr").style.display = "none"; //document.getElementById('mn_li_1').setAttribute("class", "MainNavLi"); //document.getElementById('mn_table_1').setAttribute("class", "MainNavTable"); //document.getElementById('mn_toggle_1').setAttribute("value", "\u2192"); alert("Error: The first main navigation element needs to be a root."); return false; } // no items? } else { alert("Error: The main navigation is emtpy."); return false; } return true; } // moves a main navigation item up in the list function MainNavigation_moveUpItem (item_number) { // first step: determine the absolute number of items var item_count = MainNavigation_getNumberOfItems(); // second step: is it possible to move up? I.e. are there more than one items above && is the current item not the first one? // then simply switch the values of the current item and the item before if ((item_count > 1) && (item_number > 1)) { MainNavigation_switchItems(item_number, item_number - 1); } } // creates the main navigation preview function MainNavigation_createPreview () { // first step: determine the absolute number of items var item_count = MainNavigation_getNumberOfItems(); // second step: check if the first navigation element (if it exists) is a level 0 type // (because otherwise the main navigation structure is faulty and cannot be previewed properly) if (item_count > 0) { if (MainNavigation_isItemLevel0(1) == false) { document.getElementById("MainNavigation_Preview").innerHTML = ""; alert("Error: Preview could not be generated.\nThe first main navigation element needs to be a root."); return; } } // third step: cycle through all items and create the navigation html var html = ''; in_submenu = false; } // does it have a sub navigation? if (MainNavigation_isNextItemPartOfSubNav(i)) { submenu_counter += 1; in_submenu = true; html += '