  $(document).ready(function() {
							 
  	$(function() {
 
            $.datepicker.setDefaults($.datepicker.regional['tr']); 
    $("#tarih").datepicker({maxDate: '+0d',minDate:'+0d'});
 
	});
    function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
$('#headmenu .horizontallist #com_menu').dropDownMenu({timer: 1000, parentMO: 'parent-hover', childMO: 'child-hover1'});
$(function() {
    setInterval( "slideSwitch()", 3000 );
});
$("#tarih").change(ChangedTarih);
$("#bolum").change(DoDoc);

 function ChangedTarih() {
 DoBolum();
 DoDocz();
 }
   function DoBolum() {
   var deger = $('#tarih').val();
   if (deger!="") {
        $.ajax({
            type: 'GET',
            url: 'index.php5?g3om=com_doctorsduty&mod=mod_genlistbox&tarih='+deger,
            success: function(ajaxCevap) {
             $('#bolum').html(ajaxCevap);
        }
        });
        }else {
        alert("Bir Tarih Seçiniz");
        }
  }
  function DoDoc() {
  var tarih = $('#tarih').val();
   var deger = $('#bolum').val();
   if (deger>0) {
        $.ajax({
            type: 'GET',
            url: 'index.php5?g3om=com_doctorsduty&mod=mod_genlistbox&tarih='+tarih+'&bolum='+deger,
            success: function(ajaxCevap) {
             $('#doctor').html(ajaxCevap);
        }
        });
        
        $('#doctor').removeAttr("disabled");
        $('#doctor').focus();
        }
  }
  function DoDocz() {
   var tarih = $('#tarih').val();
   $.ajax({
            type: 'GET',
            url: 'index.php5?g3om=com_doctorsduty&mod=mod_genlistbox&tarih='+tarih+'&type=listdoc',
            success: function(ajaxCevap) {
             $('#doctor').html(ajaxCevap);
        }
        });  
  }


  
  });

