1 function _(s) { return s } // dummy function for gettext
2 function confirmDelete(message) {
3 return (confirm(message) ? true : false);
7 newin=window.open(link,'popup','width=500,height=400,toolbar=false,scrollbars=yes,resizeable=yes');
10 $.datepicker.setDefaults({
14 buttonImage: '/opac-tmpl/lib/famfamfam/silk/calendar.png',
15 buttonImageOnly: true,
19 $(document).ready(function(){
20 $(".close").click(function(){
24 $( ".datepicker" ).datepicker();
25 // http://jqueryui.com/demos/datepicker/#date-range
26 var dates = $( ".datepickerfrom, .datepickerto" ).datepicker({
29 onSelect: function( selectedDate ) {
30 var option = this.id == "from" ? "minDate" : "maxDate",
31 instance = $( this ).data( "datepicker" );
32 date = $.datepicker.parseDate(
33 instance.settings.dateFormat ||
34 $.datepicker._defaults.dateFormat,
35 selectedDate, instance.settings );
36 dates.not( this ).datepicker( "option", option, date );
39 // clear the basket when user logs out
40 $("#logout").click(function(){
41 var nameCookie = "bib_list";
42 var valCookie = readCookie(nameCookie);
43 if (valCookie) { // basket has contents
45 delCookie(nameCookie);
53 // build Change Language menus
54 YAHOO.util.Event.onContentReady("changelanguage", function () {
55 $(".sublangs").each(function(){
56 var menuid = $(this).attr("id");
57 var menuid = menuid.replace("show","");
59 var oMenu = new YAHOO.widget.Menu("sub"+menuid, { zindex: 2 });
60 function positionoMenu() {
61 oMenu.align("bl", "tl");
63 oMenu.subscribe("beforeShow", function () {
64 if (this.getRoot() == this) {
69 oMenu.cfg.setProperty("context", ["show"+menuid, "bl", "tl"]);
70 function onYahooClick(p_oEvent) {
71 // Position and display the menu
74 // Stop propagation and prevent the default "click" behavior
75 YAHOO.util.Event.stopEvent(p_oEvent);
77 YAHOO.util.Event.addListener("show"+menuid, "click", onYahooClick);
78 YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionoMenu);
84 YAHOO.util.Event.onContentReady("listsmenu", function () {
85 YAHOO.widget.Menu.prototype.onRender = function () { };
86 $("#listsmenu").css("display","block").css("visibility","hidden");
87 $("#listsmenulink").attr("href","#");
88 var listMenu = new YAHOO.widget.Menu("listsmenu");
90 listMenu.cfg.setProperty("context", ["listsmenulink", "tr", "br"]);
91 listMenu.cfg.setProperty("effect",{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.05});
92 listMenu.subscribe("beforeShow",positionlistMenu);
93 listMenu.subscribe("show", listMenu.focus);
94 function positionlistMenu() {
95 listMenu.align("tr", "br");
97 YAHOO.util.Event.addListener("listsmenulink", "click", listMenu.show, null, listMenu);
98 YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionlistMenu);
101 jQuery.fn.preventDoubleFormSubmit = function() {
102 jQuery(this).submit(function() {
103 if (this.beenSubmitted)
106 this.beenSubmitted = true;