// tooltip
$(document).ready(function() 
{
   
   $('a[rel]').each(function()
   {
      $(this).qtip({
         content: $(this).attr('rel'), 
         style: {
			 name: 'cream', 
		     tip: 'bottomMiddle'
	     },
		 position: {
      		corner: {
         	target: 'topMiddle',
         	tooltip: 'bottomMiddle'
     		}
 		}


      });
   });
});

// tiempo
$(function() {
			$.simpleWeather({
				location: 'santiago, chile',
				unit: 'c',
				success: function(weather) {
					$("#weather").append('<h2><a href="http://weather.yahoo.com/chile/santiago-metropolitan-region/santiago-349859/;_ylt=Apo3OGOQm7aQ9Fb50.OPja2LYDIB?unit=c" target="_blank">'+weather.city+', '+weather.region+' '+weather.country+'</a></h2>');
					$("#weather").append('<div class="miniatura" style="background-image: url('+weather.thumbnail+')"></div>');
					$("#weather").append('<h2>'+weather.high+'&deg; </h2> <h3>/ '+weather.low+'&deg; </h3>');
				},
				error: function(error) {
					$("#weather").html('<span>'+error+'</span>');
				}
			});			
		});

$(window).load(function() {
        $('#slider').nivoSlider({
		pauseTime:5000,
		animSpeed:200,
		effect:'slideInLeft',
		controlNavThumbs:false,
        controlNavThumbsFromRel:false,
		directionNav:false, // Next & Prev navigation
        directionNavHide:false, // Only show on hover
        controlNav:false,
		pauseOnHover:false
		});
    });
/*function mycarousel_initCallback(carousel)
{
    
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
		animation: 'slow',
        auto: 7,
		scroll: 1,
        wrap: 'circular',
        initCallback: mycarousel_initCallback
    });
});*/

// leader

function MM_preloadImages() { //v3.0
  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];}}
}


