


//
function myMenuBarFX(){
			 
//        $("ul.blockeasing li.main").live('hover', function(event) {        	        		
//		    //if (event.type == 'mouseenter') {
//		    if (event.type == 'mouseover') {	        	
//	        	// do something on mouseover	        			        	      
//	        	      $(this).find('.subnav2').stop().animate({height: '330px', opacity:'1'},{queue:false, duration:1500, easing: 'easeOutElastic'});	        	      
//	        	     	        	      
//	        	      //var found = $('ul.subnav2');        	      
//	        	      var found = $(this).find('.subnav2');
//	        	      if (found.length == 0) {
//						//alert ('NO DOM');
//					  }else {
//						//alert ('DOM FOUND');
//						}
//		    } else {		    	
//	        	// do something on mouseout
//	          $(this).find('.subnav2').stop().animate({height:'0px', opacity:'0'},{queue:false, duration:1600, easing: 'easeOutElastic'});
//	    	}
//		});
	
	
	
	    $("ul.blockeasing li.main").mouseover(function(){ //When mouse over ...
        	   //Following event is applied to the subnav itself (making height of subnav 60px)
		      $(this).find('.subnav').stop().animate({height: '330px', opacity:'1'},{queue:false, duration:1500, easing: 'easeOutElastic'})
		});		
		
		$("ul.blockeasing li.main").mouseover(function(){ //When mouse over ...
        	   //Following event is applied to the subnav itself (making height of subnav 60px)
		      $(this).find('.subnav2').stop().animate({height: '150px', opacity:'1'},{queue:false, duration:1500, easing: 'easeOutElastic'})
		});
		
		$("ul.blockeasing li.main").mouseover(function(){ //When mouse over ...
        	   //Following event is applied to the subnav itself (making height of subnav 60px)
		      $(this).find('.subnav3').stop().animate({height: '140px', opacity:'1'},{queue:false, duration:1500, easing: 'easeOutElastic'})
		});
	
	
	
	    $("ul.blockeasing li.main").mouseout(function(){ //When mouse out ...
	          //Following event is applied to the subnav itself (making height of subnav 0px)
		      $(this).find('.subnav').stop().animate({height:'0px', opacity:'0'},{queue:false, duration:1600, easing: 'easeOutElastic'})
		});
		$("ul.blockeasing li.main").mouseout(function(){ //When mouse out ...
	          //Following event is applied to the subnav itself (making height of subnav 0px)
		      $(this).find('.subnav2').stop().animate({height:'0px', opacity:'0'},{queue:false, duration:1600, easing: 'easeOutElastic'})
		});
		$("ul.blockeasing li.main").mouseout(function(){ //When mouse out ...
	          //Following event is applied to the subnav itself (making height of subnav 0px)
		      $(this).find('.subnav3').stop().animate({height:'0px', opacity:'0'},{queue:false, duration:1600, easing: 'easeOutElastic'})
		});
 
          	
        //menu itembackground color animation			
		$(".main,.subli").hover(function() {
              $(this).stop().animate({ backgroundColor: "#002D2D"}, 600);},
           function() {
              $(this).stop().animate({ backgroundColor: "#002D2D" }, 600);
        });
        
//        
//        $(".main,.subli").live('hover', function(event) {
//	    if (event.type == 'mouseenter') {
//        	// do something on mouseover
//        	$(this).stop().animate({ backgroundColor: "#002D2D"}, 600);
//	    } else {
//        	// do something on mouseout
//        	$(this).stop().animate({ backgroundColor: "#002D2D" }, 600);
//    	}
//		});
	
}


//
function myMenuBarFX_Slider() {
	//alert("myMenuBarFX_Slider");
    $('#slider').nivoSlider();
}


function myMenuBarFX_Slider_Init() {
	
	//alert("myMenuBarFX_Slider_Init");
	
    $('#slider').nivoSlider({
        effect:'fade', // Specify sets like: 'fold,fade,sliceDown'
        slices:15, // For slice animations
        boxCols: 8, // For box animations
        boxRows: 4, // For box animations
        animSpeed:500, // Slide transition speed
        pauseTime:3000, // How long each slide will show
        startSlide:0, // Set starting Slide (0 index)
        directionNav:true, // Next & Prev navigation
        directionNavHide:true, // Only show on hover
        controlNav:true, // 1,2,3... navigation
        controlNavThumbs:false, // Use thumbnails for Control Nav
        controlNavThumbsFromRel:false, // Use image rel for thumbs
        controlNavThumbsSearch: '.jpg', // Replace this with...
        controlNavThumbsReplace: '_thumb.jpg', // ...this in thumb Image src
        keyboardNav:true, // Use left & right arrows
        pauseOnHover:true, // Stop animation while hovering
        manualAdvance:false, // Force manual transitions
        captionOpacity:0.8, // Universal caption opacity
        prevText: 'Prev', // Prev directionNav text
        nextText: 'Next', // Next directionNav text
        beforeChange: function(){}, // Triggers before a slide transition
        afterChange: function(){}, // Triggers after a slide transition
        slideshowEnd: function(){}, // Triggers after all slides have been shown
        lastSlide: function(){}, // Triggers when last slide is shown
        afterLoad: function(){} // Triggers when slider has loaded
    });
}

//v3.0	
//Swap Images Functions
function MM_preloadImages() { 
	//alert("MM_preloadImages");	
  	var d=document; 
  	if(d.images){
  		if(!d.MM_p)
  			d.MM_p=new Array();
    		var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
    for(i=0; i<a.length; i++)
    	if (a[i].indexOf("#")!=0){
    		d.MM_p[j]=new Image;
    		d.MM_p[j++].src=a[i];}
    	}
}

function MM_swapImgRestore() { //v3.0	
	//alert("MM_swapImgRestore");	
  	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
	//alert("MM_findObj");		
  	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  //alert("MM_swapImage");		
  var i,j=0,x,a=MM_swapImage.arguments;
  document.MM_sr=new Array;
  for(i=0;i<(a.length-2);i+=3)
  	if ((x=MM_findObj(a[i]))!=null){
  			document.MM_sr[j++]=x;
  			if(!x.oSrc)
  				x.oSrc=x.src;
  				x.src=a[i+2];
  	}
}


function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });
 
    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });
 
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};
 
jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        auto: 2,
		wrap: 'last',
        initCallback: mycarousel_initCallback,		
    });
});


$(document).ready( function() {myMenuBarFX(); }); 
$(window).load( function() {myMenuBarFX_Slider();  });  
$(window).load(  function() {myMenuBarFX_Slider_Init();  });  

