	var videos = { nosotros: function() { 
									$('#video_NOSOTROS').flash({swf:'video/player.swf?image=img/nosotros.jpg&file=../video/VIDEO_NOSOTROS.flv&backcolor=0x000000&frontcolor=0xCCCCCC&lightcolor=0x557722',width:400,height:300});
							 },
				   home: function() {
					   				$('#video_HOME').flash({swf:'video/player.swf?image=img/home.jpg&file=../video/HOME.flv&backcolor=0x000000&frontcolor=0xCCCCCC&lightcolor=0x557722',width:720,height:480});
				   		 },
				   equipo: function() {
					   				$('#video_EQUIPO').flash({swf:'video/player.swf?image=img/equipo.jpg&file=../video/VIDEOS_EQUIPO.flv&backcolor=0x000000&frontcolor=0xCCCCCC&lightcolor=0x557722',width:400,height:300});
				   		 },
				   servicios: function() {
					   				$('#video_SERVICIOS').flash({swf:'video/player.swf?image=img/servicios.jpg&file=../video/VIDEO_SERVICIOS.flv&backcolor=0x000000&frontcolor=0xCCCCCC&lightcolor=0x557722',width:400,height:300});
				   		 },
				   reel: function() {
					   				$('#video_REEL').flash({swf:'video/player.swf?image=img/reel.jpg&file=../video/VIDEO_REEL_EQUIPO.flv&backcolor=0x000000&frontcolor=0xCCCCCC&lightcolor=0x557722',width:400,height:300});
				   		 }
				 };	
				 
	var show = function(equipo) {
		Shadowbox.open({
			content	: '<p class="equipo">'+$('.'+equipo).html()+'</p>',
			player	: 'html',
			height	: 150,
			width	: 650
		});
	};
	
	function getWindowHeight() {
		var windowHeight = 0;
		if (typeof(window.innerHeight) == 'number') {
			windowHeight = window.innerHeight;
		}
		else {
			if (document.documentElement && document.documentElement.clientHeight) {
				windowHeight = document.documentElement.clientHeight;
			}
			else {
				if (document.body && document.body.clientHeight) {
					windowHeight = document.body.clientHeight;
				}
			}
		}
		return windowHeight;
	}
	function setFooter() {
		if (document.getElementById) {
			var windowHeight = getWindowHeight();
			if (windowHeight > 0) {
				var contentHeight = document.getElementById('contenido').offsetHeight;
				var footerElement = document.getElementById('footer');
				var footerHeight  = footerElement.offsetHeight;
				if (windowHeight - (contentHeight + footerHeight) >= 0) {
					footerElement.style.position = 'absolute';
					footerElement.style.top = (windowHeight - footerHeight) + 'px';
				}
				else {
					footerElement.style.top = '0px';
				}
			}
		}
	}
	
	var slider = Array(), mover, w;
	$(document).resize(function() {
		//setFooter();
	});
	$(document).ready(function() {			
		var s = $("#slider li").length;
		var w = $('#slider').width();
		$("#slider ul").css('width',s*w);
		
		$('#slider li').each(function(){
			slider.push($(this).attr('id'));
		});
		
		mover = function(id) {
			var pos = null, move = 0;
			$.each(slider, function(i, val){
				if (val == id) {
					pos = i; return false;
				}
			});
			
			move = (pos*w*-1);
			
			$('#slider ul').animate({ marginLeft: move }, 800, function(){
				$('#slider li div[id^=video_]:not(:eq('+pos+'))').empty();
				if (pos == 0) {
					videos.nosotros();
					videos.equipo();
					videos.servicios();
					videos.reel();
				}
				if (pos == 1) {
					videos.home();
					videos.equipo();
					videos.servicios();
					videos.reel();
				}
				if (pos == 2) {
					videos.home();
					videos.nosotros();
					videos.servicios();
					videos.reel();
				}
				if (pos == 3) {
					videos.home();
					videos.nosotros();
					videos.equipo();
					videos.reel();
				}
				if (pos == 4) {
					videos.home();
					videos.nosotros();
					videos.servicios();
					videos.equipo();
				}
			});
		};
		
		//setFooter();
		mover('home');
	});