// JavaScript Document
$(document).ready( function(){
							
							
	//$('#cabezabg').fadeTo("fast", 0.28);
			$('#logotipor').css({backgroundPosition: '-200px 0px'});
			$('#iraactor').css({backgroundPosition: '200px 0px'});
			$('.kwicks').fadeTo("fast", 0);
			$('.kwicks').kwicks({ maxWidth : 300, spacing : 5,duration: 1000,easing: 'easeOutBounce'});
				$('.kwicks').fadeTo("slow", 1);
				$('#contenido').fadeTo("fast", 0.28);
//	$('#cabezabg').fadeTo("fast", 0.28);
// ANTES	$('#cabezabg').animate({height: '140px'}, 1200, 'easeOutExpo', function() {
	$('#cabezabg').animate({height: '70px'}, 2600, 'easeInOutExpo', function() {
	//$('#contenido').animate({height: '500px'}, 1200, 'easeOutElastic');
	//$('#cabeza').fadeIn("slow");
	//$('#cabezabg').fadeTo("fast", 0.28);

		$('#iraactor').animate({backgroundPosition: '0px 0px'}, 800, 'easeOutExpo');
		$('#logotipor').animate({backgroundPosition: '0px 0px'}, 800, 'easeOutExpo');
		$('#menu').fadeIn('slow');
		$('#footer').fadeTo("fast", 0.28);				
	});

 $(".navv").bind('mouseover', function() {
//	 	$(this).animate({backgroundPosition: '0% 0%'}, 'fast');
		$(this).animate({backgroundPosition: '300% 0%'}, 'slow', 'easeOutElastic');
	//	$(this).animate({backgroundPosition: '0% 0%'}, 'fast');
	//	$(this).animate({backgroundPosition: '200% 0%'}, 'fast', 'easeInOutElastic');
		$(this).css({cursor: 'hand'});
 });
  $(".navv").bind('mouseout', function() {
		$(this).animate({backgroundPosition: '0% 0%'}, 'fast', 'easeInOutElastic');
		$(this).css({cursor: 'default'});
 });
 
 	 $(".btn_col").bind('mouseover', function() {
	 $(this).fadeTo(50,0.6).fadeTo(400, 1 );
	 });
 
	$("#btn_01").click( function() {window.open('index.html', '_self'); return false; });
	$("#btn_02").click( function() {window.open('historia.html', '_self'); return false; });
	$("#btn_03").click( function() {window.open('coleccion.html', '_self'); return false; });
	$("#btn_04").click( function() {window.open('fotos.html', '_self'); return false; });
	$("#btn_05").click( function() {window.open('fotos.html', '_self'); return false; });
	$("#btn_06").click( function() {window.open('prensa.html', '_self'); return false; });
	$("#btn_07").click( function() {window.open('videos.html', '_self'); return false; });
	$("#btn_08").click( function() {window.open('http://www.myspace.com/marianocabrera', '_blank'); return false; });
	$("#btn_09").click( function() {window.open('contacto.html', '_self'); return false; });	

	$("#kwick_meet").click( function() {window.open('floreros.html', '_self'); return false; });
	$("#kwick_kwicks").click( function() {window.open('museo.html', '_self'); return false; });
	$("#kwick_for").click( function() {window.open('italpark.html', '_self'); return false; });
	$("#kwick_jquery").click( function() {window.open('agradecimientos.html', '_self'); return false; });

 $(".kwicks").bind('mouseover', function() { $(this).css({cursor: 'hand'});  });
 $(".kwicks").bind('mouseout', function() { $(this).css({cursor: 'default' });  });

$("#iraactor").bind('mouseover', function() { $(this).css({cursor: 'hand'}); $(this).animate({backgroundPosition: '10px 0px'}, 500, 'easeOutElastic'); });
$("#iraactor").bind('mouseout', function() { $(this).css({cursor: 'default' }); $(this).animate({backgroundPosition: '0px 0px'}, 300, 'easeOutExpo');  });

$("#logotipor").bind('mouseover', function() { $(this).animate({backgroundPosition: '-10px 0px'}, 500, 'easeOutElastic');  });
$("#logotipor").bind('mouseout', function() { $(this).animate({backgroundPosition: '0px 0px'}, 300, 'easeOutExpo');  });

$("#iraactor").click( function() {window.open('http://www.marianocabrera.com.ar/actor/', '_self'); return false; });


// jquery timer

 jQuery.timer = function (interval, callback)
 {


	var interval = interval || 100;

	if (!callback)
		return false;
	
	_timer = function (interval, callback) {
		this.stop = function () {
			clearInterval(self.id);
		};
		
		this.internalCallback = function () {
			callback(self);
		};
		
		this.reset = function (val) {
			if (self.id)
				clearInterval(self.id);
			
			var val = val || 100;
			this.id = setInterval(this.internalCallback, val);
		};
		
		this.interval = interval;
		this.id = setInterval(this.internalCallback, this.interval);
		
		var self = this;
	};
	
	return new _timer(interval, callback);
 };

$.timer(6000, function (timer) { 	$("#logotipor").animate({backgroundPosition: '-10px 0px'}, 500, 'easeInElastic', function() { 	$("#logotipor").animate({backgroundPosition: '0px 0px'}, 500, 'easeOutElastic'); 		});  timer.reset(6000);   });

});
