1 function ValidateCode()
3 // Validating the patron id by Oscar R. Paredes
4 // Please do not remove this line and the line above.
5 var patron_id = document.forms['auth'].userid.value;
6 var snumber = "Pp 0123456789";
7 var len = patron_id.length;
8 var new_patron_id = "";
10 if (patron_id.length != 0)
12 for (i=0;(i<len)&&(bOK);i++)
13 { pos = snumber.indexOf(patron_id.substring(i,i+1));
14 if (pos <0 || pos > 12)
15 { alert("Your card number is invalid, please verify it.");
20 car = patron_id.substring(i,i+1);
23 new_patron_id = new_patron_id + car;
26 while (bOK && (new_patron_id.length < 7))
27 new_patron_id = "0" + new_patron_id;
28 if (new_patron_id.length > 7)
29 { alert("Your library card number is too long.");
33 document.forms['auth'].userid.value = new_patron_id;
36 document.forms['auth'].userid.value = "";
37 document.forms['auth'].userid.focus();
44 count = document.mainform.elements.length;
45 for (i=0; i < count; i++)
47 if(document.mainform.elements[i].checked == 1){
48 document.mainform.elements[i].checked = 0;
50 document.mainform.elements[i].checked = 1;
55 function confirmDelete(message) {
56 var agree = confirm(message);
64 function Dopop(link) {
65 newin=window.open(link,'popup','width=500,height=400,toolbar=false,scrollbars=yes');