$(document).ready(function(){
    $("div.mainMenu ul li").hover(function() {
//					$(this).addClass("active");
					$(this).find("div.menuDown").show();
				},function() {
					$(this).find("div.menuDown").hide();
//					$(this).removeClass("active");
				});
				$("div.cur").toggle(function() {
					$(this).addClass("active");
					$("ul.currencyChoise").show();
				},function() {
					$("ul.currencyChoise").hide();
//					$(this).removeClass("active");
				});

//        $("div.boxTitleOptional").toggle(function(){
//	$(this).find("div.downMenu").show();
//	}, function(){
//	$(this).find("div.downMenu").hide();
//	});

		        $("div.boxTitleOptional").click(function(){
		        	$(this).find("div.downMenu").show();
		        });
				
		        $(document).live("click",function(e) {
		        	
		        	if($(e.target).is('.no-click')==false){
		        		$("div.downMenu").hide();
		        	}
		        	
				});
	//---------------------------------------Rotator
    window.active_video = 1;
    var top_video_prev  =  $('#videoList li');
    
    $('#videoList li').hover(function() {
            $(this).find('div.r-active').show();
            if($(this).hasClass('activeLi')==false && $('#bigImgContainer li:animated').length < 3){
                var cur_video = top_video_prev.length - $(this).nextAll().length-1;		
                top_video_prev.removeClass('activeLi');		
                $(this).addClass('activeLi');
                $('#bigImgContainer li').fadeOut();
                $('#bigImgContainer li').eq(cur_video).fadeIn();
                // clearInterval(rotateIntervalVideo);
            }
        },function(){
            $(this).find('div.r-active').hide();
            // rotateIntervalVideo = setInterval(function() {			
            //         if(active_video==3){active_video=0}
            //         rotate_top_videos(active_video)
            //     }, 5000);
        });
	    $("#videoList li.activeLi").find('div.r-active').show();
    function rotate_top_videos(active_video) {
		top_video_prev.find('div.r-active').hide();
    	top_video_prev.removeClass('activeLi');
		top_video_prev.eq(active_video).addClass('activeLi');
		top_video_prev.eq(active_video).find('div.r-active').show();
		$('#bigImgContainer li').fadeOut().eq(active_video).fadeIn();
		window.active_video=active_video+1;
	}
	
	
	var rotateIntervalVideo = setInterval(function() {			
		if(active_video==4){active_video=0}
		rotate_top_videos(active_video)
	}, 5000);
	//---------------------------------------end_Rotator
    });

