$(document).ready(function() {

  //blur
  $("a, input[type='image']").focus(function() {
  $(this).blur();
  }); 
  
 // $(".panel_left_tabs li.m01 img").click(function(){
 //   $(".baner_rotation div").removeClass("active");
 //   $(".baner_rotation .p01").addClass("active");
 // });
 // $(".panel_left_tabs li.m02 img").click(function(){
 //   $(".baner_rotation div").removeClass("active");
 //   $(".baner_rotation .p02").addClass("active");
 // });
 // $(".panel_left_tabs li.m03 img").click(function(){
 //   $(".baner_rotation div").removeClass("active");
 //   $(".baner_rotation .p03").addClass("active");
 // });
 // $(".panel_left_tabs li.m04 img").click(function(){
 //   $(".baner_rotation div").removeClass("active");
 //   $(".baner_rotation .p04").addClass("active");
 // });
  
    // top slide
    $(".baner_rotation").css({'height':'336px', 'position' : 'relative'});
    var topSlides = $(".baner_rotation div");
    $(topSlides).css({'height':'336px'});
    var topSlidesCur = 0;
    var topSlidesAll = topSlides.length;
    // var timer = setInterval( showDiv, 5000);
    var topTimer = setInterval(animTop, 5000);
    //$(".baner_rotation div.p02").css({'z-index': '1'});
    //$(".baner_rotation div").click(function() { $(".baner_rotation div.p02").css({'position': 'absolute', 'z-index': '1', 'left': '0', 'top': '0', 'margin-top': '0'}); clearInterval(topTimer); });
    //$(".baner_rotation div.p02").click(function() { $(".baner_rotation div.p02").css({'position': 'absolute', 'z-index': '1', 'left': '0', 'top': '0', 'margin-top': '0'}); clearInterval(topTimer); });
    $(".baner_rotation div").hover(function(){ clearInterval(topTimer); }, function(){ if (topSlidesCur == 1){clearInterval(topTimer);}else{setInterval(animTop, 5000);}  });
    $(".baner_rotation div").click(function(){ clearInterval(topTimer); });
    function animTop() {
    $(".baner_rotation div:eq("+ topSlidesCur +")").animate({
    marginTop : '-336px'
    },600, function() {  
    topSlidesCur++;
    if (topSlidesCur >= topSlidesAll) {    
    topSlidesCur = 0;
    $(topSlides).css({'margin-top':'0px'});
    }
    });
} 
  
});

