function chkAvailRoll() { if (document.getElementById && document.createTextNode) { var chkimg=document.getElementById ('chkAvailImg'); if (chkimg) { chkimg.onmouseover=function(){chkimg.src="images/check_btn_ON.gif";return false} chkimg.onmouseout=function(){chkimg.src="images/check_btn_OFF.gif";return false} } } } function preloadChkAvail() { var dontcare = new Image(); dontcare.src="images/chk_btn_ON.jpg"; } function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { oldonload(); func(); } } } // do this to add new onload events: addLoadEvent(clickablePicLink); addLoadEvent(preloadChkAvail); addLoadEvent(chkAvailRoll); /* Date Guesser ** When you tab out of a date field, this script will try to convert the input ** to a sql-friendly string (i.e., YYYY-MM-DD). ** should recognize all sorts of date formats, including ** 6/5/05; // ### ** Jun 5; // s#(#) ** 5 Jun; // #s(#) ** June 5, 2005; // s#(#) ** 5 June, 2005; // #s(#) ** 6/5, // ##(#) ** 2005-12-25 // y## ** and anything else I can think of. The tricky ** part will be that 6/5 could be June, 2005, May 6, 2005, or June 5, 2005. But ** as long as we make a good guess, this will be a useful script ** Must be JavaScript 1.1 or higher ** To invoke this script, simply include it in your html file, and apply the ** class "date" to any text input field that should have the script attached. */ addLoadEvent(addOnBlur); var errorCheck = ""; var mon = Array("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec") var month = Array ("january","february","march","april","may","june","july","august","september","october","november","december"); var now = new Date(); function addOnBlur() { if (document.getElementById) { var inpTags = document.getElementsByTagName('input'); for (var i=0; i 50) { numYear = numYear - 100; } } } } // if we weren't given a year, and if we're closer to next year than this // year, guess next year instead if (!bExplicitYear && thisMonth > 8 && numMonth < thisMonth) { numYear++; } objTextInput.value = numYear+ "-" + numMonth + "-" + numDay; // alert (errorCheck); errorCheck = ""; } function isN (inp) { errorCheck += "isN("+inp+")\n"; if (isNaN(parseInt(inp, 10))) { return false; } else { errorCheck += "returning " + parseInt(inp, 10) + "\n"; return parseInt(inp, 10); } } function isY (inp){ if (isNaN(parseInt(inp, 10))) { return false } if (inp > 32) { if (inp > now.getFullYear()-100) { return inp; } } else { return false; } } function isM (inp) { if (!(inp)) { return false; } var monthNumber for (var i = 0; i 0) { return pad (monthNumber, "0", 2); } else { return false; } } function pad (strToPad, strWith, finalLen) { strToPad = strToPad + ""; // force numbers to be strings if (strToPad.length >= finalLen) { return strToPad } while (strToPad.length < finalLen) { strToPad = strWith.concat(strToPad) } return strToPad }