var myvars = new Array('status','name','date','rid','notes'); var myselectvars = new Array('start','end','station'); function show_view (recordId,tab) { var xmlhttp=GetXmlHttpObject(); var obj = document.getElementById(recordId + 'Content'); obj.innerHTML = '

Loading ...

'; var showdate=get_currents("d"); var url="view.php?s=" +recordId+"&t="+ tab + "&d="+showdate; xmlhttp.open("POST", url); //Send the proper header information along with the request xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttp.setRequestHeader("Cache-control", "no-store, must-revalidate"); //xmlhttp.setRequestHeader("Connection", "close"); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { obj.innerHTML = xmlhttp.responseText; } } xmlhttp.send(null); setTimeout('show_view("'+recordId+'","'+tab+'")',15000); } function show_form (params) { url="signup.php?"+params; var xmlhttp=GetXmlHttpObject(); xmlhttp.open("GET", url); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById('signup_form').innerHTML = xmlhttp.responseText; document.getElementById('signup_form').style.display="block"; } } xmlhttp.send(null); } function GetXmlHttpObject(handler) { var objXMLHttp=null if (window.XMLHttpRequest) { objXMLHttp=new XMLHttpRequest(); } else if (window.ActiveXObject) { try { objXMLHttp = new ActiveXObject('MSXML2.XMLHTTP.3.0'); // ie7 } catch (e) { try {objXMLHttp = new ActiveXObject("Msxml2.XMLHTTP"); //ie 6 } catch(e) { try { objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP"); //older ie's } catch(e) { alert("Your browser does not support AJAX"); objXMLHttp=null; } } } } return objXMLHttp; } function get_currents(varname) { var query = document.location.search.substring(1); var params = query.split('&'); for (i=0; i < params.length; i++) { keyvalues=params[i].split("="); if (keyvalues[0] == varname) { var found=true; return keyvalues[1]; } } if (!found) return ''; } function set_tab() { if (get_currents("t")) { TabbedPanels1.showPanel(get_currents("t")); } } function get_tab() { return TabbedPanels1.currentTabIndex; } function newReservation(timestart,station,rdate,tab) { var params="NUID="+document.authorization.NUID.value; url="signup.php?st="+timestart+"&station="+station+"&date="+rdate+"&t="+tab; var http=GetXmlHttpObject(); http.open("POST", url, true); //Send the proper header information along with the request http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); //http.setRequestHeader("Content-length", params.length); //http.setRequestHeader("Connection", "close"); http.onreadystatechange = function() {//Call a function when the state changes. if(http.readyState == 4 && http.status == 200) { document.getElementById('signup_form').innerHTML=http.responseText; } } http.send(params); } function saveReservation(action,tab) { var params="action="+action; params += "&status=" + document.signup.status.value; params += "&name=" + document.signup.name.value; params += "&start=" + document.signup.start.options[document.signup.start.selectedIndex].value; params += "&end=" + document.signup.end.options[document.signup.end.selectedIndex].value; params += "&date=" + document.signup.date.value; params += "&rid=" + document.signup.rid.value; params += "&item_id=" + document.signup.station.options[document.signup.station.selectedIndex].value; params += "¬es=" + document.signup.notes.value; params += "&t=" + tab; //alert(params); url="reserve.php"; var http=GetXmlHttpObject(); http.open("POST", url, true); //Send the proper header information along with the request http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); //http.setRequestHeader("Content-length", params.length); //http.setRequestHeader("Connection", "close"); http.onreadystatechange = function() {//Call a function when the state changes. if(http.readyState == 4 && http.status == 200) { document.getElementById('signup_form').innerHTML=http.responseText; } } http.send(params); } function refresh_signup(mode,extra_stuff) { mystart = document.signup.start.options[document.signup.start.selectedIndex].value; myend = document.signup.end.options[document.signup.end.selectedIndex].value; mystation = document.signup.station.options[document.signup.station.selectedIndex].value; if (mode == "start") { show_form(''+'&st=' + mystart + '&station=' + mystation + extra_stuff); } else { if (mode == "station") { show_form(''+'&st=08:00&station=' + mystation + extra_stuff); } } } function override(ts, station,rdate,tab) { //overrides the authentication and inserts the reservation with an override patron id var params="NUID=311228653022"; url="signup.php?st="+ts+"&station="+station+"&date="+rdate+"&t="+tab; var http=GetXmlHttpObject(); http.open("POST", url, true); //Send the proper header information along with the request http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.setRequestHeader("Content-length", params.length); //http.setRequestHeader("Connection", "close"); http.onreadystatechange = function() {//Call a function when the state changes. if(http.readyState == 4 && http.status == 200) { document.getElementById('signup_form').innerHTML=http.responseText; } } http.send(params); } function validate_delete() { return window.confirm("Are you sure you want to delete this entry?"); } function checkTime(i) { if (i>12) { i= i-12; } if (i ==0) {i=12;} return i; } function showCurrentTime() { var today = new Date(); var hours = checkTime(today.getHours()); var minutes = today.getMinutes(); var dn = "AM"; if (today.getHours() > 11) {dn = "PM";} if (minutes < 10) {minutes = "0" + minutes;} document.getElementById('current_time').innerHTML = '

Currently it is: Fri Mar 14, 2025 '+hours+":"+minutes+ dn +'

'; setTimeout('showCurrentTime()',500); }