$(document).ready(function() {
  
  $('.mainPageSlider').nivoSlider({   
    effect:'fade',    
    animSpeed:1000, // Slide transition speed
    pauseTime:5000, // How long each slide will show
    directionNav:false,
    controlNav: false
  });

  $('.mainPageLogos ul').jcarousel({
    vertical: false,
    visible: 7,
    scroll: 7
  });
               
  $('.bigPhotoSlider ul').cycle({ 
    fx:     'scrollRight', 
    speed:  'slow', 
    timeout: 5000, 
    next:   '#menu_right', 
    prev:   '#menu_left',
    pager:  '.bigPhotoSliderPagination',
    pause:   1
  });
    
    
  // ------------ newsletter form
	$("form.newsletter").validate({
    submitHandler: function(form) {
	     var email = $("form.newsletter input[name='formSubNewsletterEmail']").val();
	     $.get('ajax.response.php?action=addEmailToNewslleter&email='+email, '', function(data){
          $("form.newsletter").html(data);
      }); 
   },	
	 rules: {
			formSubNewsletterEmail: {required: true, email: true}
		}
	});
	
	
	$(".sub .subMenu").treeview({
		animated: "slow",
		collapsed: true,
		unique: true
	});
	
  $('a.targetBlank').attr('target', '_blank');
	
 $("a[rel='lightbox']").lightBox({
			imageLoading:			'img/lightbox-ico-loading.gif',		// (string) Path and the name of the loading icon
			imageBtnPrev:			'img/lightbox-btn-prev.gif',			// (string) Path and the name of the prev button image
			imageBtnNext:			'img/lightbox-btn-next.gif',			// (string) Path and the name of the next button image
			imageBtnClose:		'img/lightbox-btn-close.gif',		// (string) Path and the name of the close btn
			imageBlank:				'img/lightbox-blank.gif'	
  }
 );
 
	
	
	
	
});
                              
