﻿ $(document).ready(function(){
    

    $("ul#mydiv li").hover(function(){
  			//alert('dfdf');
        //$(this).addClass("hover");
		
        $('div.submenutop',this).slideDown('fast');
		
		$('.submenutop li',this).hover(
		function(){
			$('.innermenutop',this).show('fast');
		},
		function(){
			$('.innermenutop',this).hide('fast');
		});
		
    
    }, function(){
    
       // $(this).removeClass("hover");
        $('.submenutop',this).slideUp('fast');
    
    });


//banner




	var $currtxt1 = $("#txtStart1");
	var $counter1 = 0;
	var child = $(".slide ul li").size();
	
	
	function nextrotate(){
		if($counter1 < child){
			
			if($counter1 == 0){
				$(".slide ul li").fadeOut();
				$currtxt1.fadeIn();
				$counter1 = $counter1 + 1;
			}
			else{
			
		    
	   	   $counter1 = $counter1 + 1;
		    
		   if($counter1 <= child)
		   {
			   
			  $currtxt1 = $currtxt1.next();
			  //alert($currtxt1);
			  $(".slide ul li").fadeOut();
			  $currtxt1.fadeIn();
			  if($counter1 == child){
			  	$("#next1").addClass('disable');
				var $currtxt= $("#txtStart1");
			
				$currtxt1 = $currtxt;
				$counter1 = 0;   
	   		
			  }
			  else if($counter1 > 1){
				$("#pre1").removeClass('disable');	  
			  }
			 
			 
		   }
		   else{
			  $("#next").addClass('disable');
			  
		   }
		   
			}
		   
	   }
	  
	   
	   
	   
			
	}
	
	function prerotate(){
		if($counter1 > 1)
	  	{
			$counter1 = $counter1 - 1;	
			if($counter1 >= 1)
			{	
				$currtxt1 = $currtxt1.prev();

				$(".slide ul li").fadeOut();
				$currtxt1.fadeIn(); 	
				
				if($counter1 == 1){
			  	$("#pre1").addClass('disable');
				}
				else if($counter1 > 1){
				$("#next1").removeClass('disable');	  
				}
			}
		}	
	}
	
    $("#next1").click(function () {
	   nextrotate();
    });
	
	
	
	$("#pre1").click(function () {
							   
      	prerotate();
	  
    });

	setInterval(function(){
		nextrotate();	
	}, 3000);

//banner end




});
