/* Author: 

*/
$(document).ready(function(){

// CUFON 
//Cufon.replace('h1, h2, h3', {fontFamily: 'Merrell Casual', hover: 'true'} );	
$('#slider').nivoSlider({effect:'fade', controlnav:false});

$("a.prettyFrame").prettyPhoto({
			animation_speed: 'fast',
			slideshow: false, /* false OR interval time in ms */
			autoplay_slideshow: false, /* true/false */
			opacity: 0.80, /* Value between 0 and 1 */
			show_title: false, /* true/false */
			modal: true,
			theme: 'facebook', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
			autoplay: false, /* Automatically start videos: True/False */
			keyboard_shortcuts: false, /* Set to false if you open forms inside prettyPhoto */
			social_tools: false,
			gallery_markup:'<div class="pp_gallery"> \</div>',
		});
		
		$("#photos li a").prettyPhoto({
			animation_speed: 'fast',
			slideshow: false, /* false OR interval time in ms */
			autoplay_slideshow: false, /* true/false */
			opacity: 0.80, /* Value between 0 and 1 */
			show_title: false, /* true/false */
			modal: true,
			theme: 'facebook', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
			autoplay: false, /* Automatically start videos: True/False */
			keyboard_shortcuts: false, /* Set to false if you open forms inside prettyPhoto */
			social_tools: false,
			gallery_markup:'<div class="pp_gallery"> \</div>',
		});
		
		
		$('#listado').dataTable({
		"bPaginate": false,
		"bLengthChange": false,
		"bFilter": true,
		"bSort": false,
		"bInfo": false,
		"bAutoWidth": true
		});	
		
		$('#listado2').dataTable({
		"bPaginate": false,
		"bLengthChange": false,
		"bFilter": true,
		"bSort": false,
		"bInfo": false,
		"bAutoWidth": true,
		"aoColumnDefs": [ 
                        { "bVisible": false, "aTargets": [ 7 ] },
                        { "bVisible": false, "aTargets": [ 8 ] }
                    ] 
		});
		
		
	function randomXToY(minVal,maxVal,floatVal) {
      var randVal = minVal+(Math.random()*(maxVal-minVal));
      return typeof floatVal=='undefined'?Math.round(randVal):randVal.toFixed(floatVal);
   }

		
		
	$("#photos li").each(function(){
	    var rotDegrees = randomXToY(-20, 20); // rotate
		$(this).rotate({animateTo:rotDegrees});
	});
	$("#photos li").hover(function(){
		var rotDegrees = randomXToY(-10, 15); // rotate
		$(this).rotate({animateTo:rotDegrees});
	});
	

	$('#slider-prod').nivoSlider({directionNav:false, directionNav:false, directionNavHide:false, controlNav:false, effect:'fade'}); 	
});



