

function now() {  

    var now_Date    = new Date();
    
    var now_Year    = now_Date.getFullYear();
    var now_Month   = now_Date.getMonth() + 1;
    var now_Day     = now_Date.getDate();
    var now_Hours   = now_Date.getHours();
    var now_Minutes = now_Date.getMinutes();
    var now_Seconds = now_Date.getSeconds();
    
    if (now_Month < 10)
        now_Month = '0' + now_Month
        
    if (now_Day < 10)
        now_Day = '0' + now_Day
    
    return (now_Year + "," + now_Month + "," + now_Day + "," + now_Hours + "," + now_Minutes + "," + now_Seconds);
    
}  




function timeDifference() {

	var laterdate = new Date(2011,11,20,21,20,00);
	var earlierdate = new Date();
	
  var difference = laterdate.getTime() - earlierdate.getTime();
    
  var daysDifference = Math.floor(difference/1000/60/60/24);
  difference -= daysDifference*1000*60*60*24
  if (daysDifference < 10)
    daysDifference = '0' + daysDifference;
    
  var hoursDifference = Math.floor(difference/1000/60/60);
  difference -= hoursDifference*1000*60*60
  if (hoursDifference < 10)
    hoursDifference = '0' + hoursDifference;
    
  var minutesDifference = Math.floor(difference/1000/60);
  difference -= minutesDifference*1000*60
  if (minutesDifference < 10)
    minutesDifference = '0' + minutesDifference;
    
  var secondsDifference = Math.floor(difference/1000);
  if (secondsDifference < 10)
    secondsDifference = '0' + secondsDifference;
    
  return (daysDifference + ':' + hoursDifference + ':' + minutesDifference + ':' + secondsDifference);
}



/*
function MostrarFecha() {  
   document.write ( obtiene_fecha() )  
}
*/


$(window).load(function() {
    $('#no').nivoSlider({
        effect:'slideInLeft', // Specify sets like: 'fold,fade,sliceDown'
        slices: 1, // For slice animations
        boxCols: 1, // For box animations
        boxRows: 1, // 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
    });
});


/*
sliceDown
sliceDownLeft
sliceUp
sliceUpLeft
sliceUpDown
sliceUpDownLeft
fold
fade
random
slideInRight
slideInLeft
boxRandom
boxRain
boxRainReverse
boxRainGrow
boxRainGrowReverse
*/







$(document).ready(function(){
	
	
	
	$('#previews li a[rel=example_group]').fancybox({
    'padding'           :      '0px',
    'autoScale'         :      true,
    'centerOnScroll'    :      true,
    'overlayColor'      :      '#FFF',
    'overlayOpacity'    :      0.7,
    'speedIn'           :      '500',
    'speedOut'          :      '500',
    'easingIn'          :      'swing',
    'easingOut'         :      'swing',
    'cyclic'            :      true
  });


  var nowDate = timeDifference();
  console.log(nowDate);

  
  $('#counter').countdown({
    
    stepTime: 60,
    format: 'dd:hh:mm:ss',
    startTime: nowDate,
    digitImages: 6,
    digitWidth: 53,
    digitHeight: 77,
    image: 'images/digits.png'
  });

	$('#lasttwitter .slider .content').easySlider({
  	auto:           true,
  	continuous:     true,
  	pause:			    5000
  });
  
  $('li.twitts .slider .content').easySlider({
  	auto:           true, 
  	continuous:     true,
  	pause:			    3500,
  	nextId:         'nextBtn2',
  	prevId: 		    'prevBtn2'
  });
  
  
	$('#previews li a').hover(
		function () {
      $(this).find('.preview-hover').stop().animate({ opacity: 1 });
   	},
   	function () {
   	  $(this).find('.preview-hover').stop().animate({ opacity: 0 });
   	}
	);

  $('.ubicaciones a, #ubication .close').click(function() {
    $('#columns').toggle('slow');
    $('#ubication').toggle('slow');
  });



  $('li#golden').hover(
		function () {
      $('ul.map li').not('.golden').stop().animate({ opacity: 0 });
      $('ul.map li.golden').stop().animate({ opacity: 1 });
   	},
   	function () {
      $('ul.map li').stop().animate({ opacity: 0 });
   	} 
	);
  $('li#vip').hover(
		function () {
      $('ul.map li').not('.vip').stop().animate({ opacity: 0 });
      $('ul.map li.vip').stop().animate({ opacity: 1 });
   	},
   	function () {
      $('ul.map li').stop().animate({ opacity: 0 });
   	}
	);
  $('li#platea').hover(
		function () {
      $('ul.map li').not('.platea').stop().animate({ opacity: 0 });
      $('ul.map li.platea').stop().animate({ opacity: 1 });
   	},
   	function () {
      $('ul.map li').stop().animate({ opacity: 0 });
   	}
	);
  $('li#lateral').hover(
		function () {
      $('ul.map li').not('.lateral').stop().animate({ opacity: 0 });
      $('ul.map li.lateral').stop().animate({ opacity: 1 });
   	},
   	function () {
      $('ul.map li').stop().animate({ opacity: 0 });
   	}
	);
  $('li#general').hover(
		function () {
      $('ul.map li').not('.general').stop().animate({ opacity: 0 });
      $('ul.map li.general').stop().animate({ opacity: 1 });
   	},
   	function () {
      $('ul.map li').stop().animate({ opacity: 0 });
   	}
	);
	





  
  
  
});









