Fix for gcac contraceptive method report to look at recent services and not just...
[openemr.git] / library / js / common.js
blobf3ae1ddb58c674ec2fe7c072fcbd6d1fe744940c
1 function tabbify() {
3     $('ul.tabNav a').click(function() {
4         var curChildIndex = $(this).parent().prevAll().length + 1;
5         $(this).parent().parent().children('.current').removeClass('current');
6         $(this).parent().addClass('current');
7         $(this).parent().parent().next('.tabContainer').children('.current').each(function() {
8             $(this).removeClass('current');
9             $(this).parent().children('div:nth-child('+curChildIndex+')').each(function() {
10                 $(this).addClass('current');
11             });
12         });
13         return false;
14     });
15     
18 function enable_modals() {
20     // fancy box
21         $(".iframe").fancybox( {
22                 'overlayOpacity' : 0.0,
23                 'showCloseButton' : true,
24         'centerOnScroll' : false
25     });
28 //----------------------------------------
29 function PreventIt(evt)//Specially for the browser chrome.
30  {//When focus is on the text box and enter key is pressed the form gets submitted.TO prevent it this function is used.
31         evt = (evt) ? evt : window.event;
32         var charCode = (evt.which) ? evt.which : evt.keyCode;
33         if (charCode == 13)//tab key,enter key
34          {
35                 if (evt.preventDefault) evt.preventDefault();
36                 if (evt.stopPropagation) evt.stopPropagation();
37          }