$(document).ready(function(){
						   
        // CONFIGURACIÓN  //
		
		var s_slider_main = 'scrollHorz';
		var s_slider_sub = 'scrollHorz';
		
		var s_copyright = 'yes';

		var s_fade_img = 'yes';
		var s_opacity = '0.8';

		var s_tooltip_menu = 'yes';
		var s_tooltip_logo = 'yes';
		var s_tooltip_form = 'yes';

		var s_focus_img = 'yes';

		var s_slide_social = 'yes';	

		var s_lightbox = 'yes';	
		
		// FUNCIONES //
		
	    sun();
	    md_slider();
		md_slider_work();
		md_lightbox();
        md_fade_all_img();
		md_fade_menu();
        md_css();
		md_tooltip();
	    md_move_to();
		md_pngfix();
		
		// CÓDIGO  //
		
		function sun(){  setTimeout(function(){ $("#fade").fadeOut(1000) }, 4000); }
		
		function md_slider(){
			$('#content').cycle({
				fx:     s_slider_main,// see more options at http://malsup.com/jquery/cycle/options.html
				timeout: 0, // time of the rotation
				speed:   400, // speed of the rotation
				cleartype:     !$.support.opacity,
				cleartypeNoBg: true     
				//easing: 'easeInElastic'// use for fx @ http://gsgd.co.uk/sandbox/jquery/easing/
			});
		}
		function md_slider_work(){
			$('#slider-in').cycle({
				fx:      s_slider_sub,// see more options at http://malsup.com/jquery/cycle/options.html
				timeout:  0, // time of the rotation
				speed:   800, // speed of the rotation
				cleartype:     !$.support.opacity,
				prev:    'a#prev',
				next:    'a#next'		
			});
		}
		function md_fade_menu(){
			if(s_fade_img == "yes"){
				$("ul#menu li a img").fadeTo("slow", s_opacity); 
				$("ul#menu img").hover(function(){
						$(this).stop().fadeTo("fast", 1.0); 
					},function(){
						$(this).stop().fadeTo("fast", s_opacity);
				});
			}
		}
 	    function md_css() {
			$(".corners").css({	"-moz-border-radius" : "5px", "-webkit-border-radius" : "5px" });
			$(".corners-r").css({ "-moz-border-radius-topleft" : "5px", "-moz-border-radius-bottomleft" : "5px","-webkit-border-top-left-radius" : "5px", "-webkit-border-bottom-left-radius" : "5px" });		
	    }				
		function md_lightbox(){
			if(s_lightbox == "yes"){
				$(".salud").colorbox({width:400, height:400, iframe:true});
				$(".abrir").colorbox({width:500, height:400, iframe:true});
				$(".video").colorbox();
				$(".staff").colorbox({width:460, height:400, iframe:true});
				$("a[rel='turismo']").colorbox({width:700, height:430, iframe:true});
				$("a[rel='promo']").colorbox();
			}
		}
		function md_move_to(){
			if(s_slide_social == "yes"){
				$('.social-box-left, .social-box-right').hover(function() {
					$(this).find("img").stop().animate({ marginLeft: '10px' }, 400);	
				}, function() { //mouse out
					$(this).find("img").stop().animate({ marginLeft: "4px" }, 400);
				});
			}
			setTimeout(function(){ $("#copyright").animate({ top: '550px' }, 400).animate({ top: '560px' }, 400) }, 1800);
			if(s_copyright == 'yes'){
				$('#copyright').hover(function() {
					$(this).stop().animate({ top: '555px' }, 400);	
				}, function() { //mouse out
					$(this).stop().animate({top: '552px' }, 400).animate({ top: '550px' }, 400);
				});
			}else{
				$('#copyright').hide();	
		    }
		}		
		function md_fade_all_img(){
			if(s_focus_img == "yes"){
				$('.social-box-left, .social-box-right, .project-last, .project').hover(function() {
					$('.social-box-left, .social-box-right, .project-last, .project').stop().fadeTo("fast", 0.5);
					$(this).stop().fadeTo("fast", 1.0);
				}, function() { //mouse out
					$('.social-box-left, .social-box-right, .project-last, .project').stop().fadeTo("fast", 1.0);	
				});
			}
		}
        function md_tooltip(){
			if(s_tooltip_menu == 'yes'){ $('.tip').tipsy({ gravity: 'e' });	}
			if(s_tooltip_logo == 'yes'){ $('.tip_logo').tipsy({	gravity: 's' }); }			
			if(s_tooltip_form == 'yes'){ $('.tip-form').tipsy({	gravity: 'w' }); }		
		}
		function md_pngfix(){
	    	$('#i1, #i2, #i3, #i4, #i5, #work-nav, #logo').supersleight();
		}
		
		$('ul#navigation li').hover(function(){
					$(this).stop().animate({marginRight:6}, 250);
					}, function(){
						$(this).stop().animate({marginRight:0}, 250)
				});

});

		function goto(ID) {	$('#content').cycle(ID); }				
		
Cufon.replace('h1', { textShadow: '2px 3px rgba(0, 0, 0, 0.2)' }); 
Cufon.replace('h2', { textShadow: '2px 2px rgba(0, 0, 0, 0.1)' });  
Cufon.replace('h4', { textShadow: '2px 2px rgba(0, 0, 0, 0.1)' }); 
Cufon.replace('h6', { textShadow: '0.5px 1px rgba(0, 0, 0, 0.2)' }); 
Cufon.replace('ul#navigation li a', { textShadow: '0 2px rgba(0, 0, 0, 0.2)' });
		
