/* INICIALIZA TODO LO NECESARIO AL EJECUTAR LA WEB */
function init(){
	MM_preloadImages('http://www.kcsolutions.com/bundles/nectarweb/img/bolita_slider_nav_over.png');
	$('#area_sensible0').fadeOut(0);selected(0);
	init_registro();
	cambiar_estilo('titulo_registro','texto_registro_over');
	/*cambiar_estilo('titulo_1','title_new_hover_default');*/
	selected_button('1');
}
/* ----------------------------------------------- */

/* BEGIN FUNCTION CACHE IMAGENES */
jQuery.preloadImages = function(){
  for(var i = 0; i<arguments.length; i++){
    jQuery("<img>").attr("src", arguments[i]);
  }
}

$.preloadImages("http://www.kcsolutions.com/bundles/nectarweb/img/menu_idioma_bg.png",
				"http://www.kcsolutions.com/bundles/nectarweb/img/menu_micuenta_bg.png",
				"http://www.kcsolutions.com/bundles/nectarweb/img/menu_zoom_bg.png",
				"http://www.kcsolutions.com/bundles/nectarweb/img/quienes_somos.png",
				"http://www.kcsolutions.com/bundles/nectarweb/img/sobre_qrtcn.png",
				"http://www.kcsolutions.com/bundles/nectarweb/img/img_login.jpg");

/* END FUNCTION CACHE IMAGENES */

/* BEGIN ROLLOVER DE IMAGENES - POR DEFECTO DE DREAMWEABER */

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
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];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
/* END ROLLOVER DE IMAGENES - POR DEFECTO DE DREAMWEABER */


function ocultar_mostrar_campo(id_ocultar, id_mostrar)
{
	$("#"+id_ocultar).fadeOut('fast',function(){
		$("#"+id_mostrar).fadeIn('fast',function(){
			$("#"+id_mostrar).focus();
		});
	})
}

///// CAMBIAR ESTILO DE UN ELEMENTO ////////////
function cambiar_estilo(id,estilo){
	document.getElementById(id).className=estilo;   
}
/////////////////////////////////////////////////

/* CAMBIA IMAGEN DE FONDO */
function cambiaImagen(diapositiva,url) {
  document.getElementById('selector'+diapositiva).style.background = 'url('+url+')';
}

/* FUNCIONES PARA EL SLIDER */

/* PONE TODOS LOS SELECTORES EN GRIS */
function restoreall() 
	{
	for (i=0;i<=6;i++)
		{
		cambiaImagen(i,'http://www.kcsolutions.com/bundles/nectarweb/img/bolita_slider_nav.png');
		}
	}


/* PONE TODOS A GRIS Y PONE EL SELECCIONADO EN AZUL */
function selected(diapositiva) 
	{
		restoreall();
		cambiaImagen(diapositiva,'http://www.kcsolutions.com/bundles/nectarweb/img/bolita_slider_nav_over.png');
	}


/* DESPLAZA EL SLIDER Y EL CIRCULO GRIS SELECTOR A LA DIAPOSITIVA DESEADA | MUESTRA TODAS LAS AREAS SENSIBLES Y OCULTA LA SELECCIONADA */
function move(diapositiva) 
	{
	var pixeles= -diapositiva*852;
	var pixeles_icon= (diapositiva*140)+15;
			
	 
	 //activo todas las areas sensibles
	 for (i=0;i<=6;i++)
			{
			$("#area_sensible"+i).fadeIn('fast');
			}
						
	 //oculto el area sensible de la diapo seleccionada para que no haga rollover.
	 $("#area_sensible"+diapositiva).fadeOut(0);
	 
	 	 
	 /*$("#over_icon").stop(false,true).fadeIn('fast');*/ //esto era para el parpadadeo no se usa de momento
	 
	 
	 // muevo el circulo selector al selector seleccionado y cuando se termina de ejecutar pongo el selector en azul
	 $("#over_icon").animate({left: pixeles_icon+"px"},1200,"easeInOutQuart",function(){selected(diapositiva)});
	 
	 
	 // muevo el slider a la diapo seleccionada
	 $("#slider").animate({left: pixeles+"px"},1200,"easeInOutQuart");
	}


/* PARA EL PARPADEO DEL CIRCULO GRIS -- de momento no se usan */
function fade_in()
	{
	$('#over_icon').fadeIn(800, function(){fade_out()});
	}
	
function fade_out()
	{
	$('#over_icon').fadeOut(800, function(){fade_in()});
}
/* ------------------------------------------------------------------------------------------------------------- */


/* FUNCIONES MENUS DESPLEGABLES */
	function toggle_menu(capa){
		$('#'+capa).slideToggle("fast");
		$('#left_'+capa).fadeIn(0);
		$('#right_'+capa).fadeIn(0);
		$('#bottom_'+capa).fadeIn(0);
	}
	
	function up_menu(capa){
		$('#'+capa).slideUp("fast");
		$('#left_'+capa).fadeOut(0);
		$('#right_'+capa).fadeOut(0);
		$('#bottom_'+capa).fadeOut(0);
	}
/* ----------------------------- */

/* FUNCIONES FORMULARISO ACCESOS */
var toggle_visitantes=0;
var toggle_pacientes=0;
var toggle_profesionales=0;
var toggle_registro=1;

function init_registro(){
$("#registro_flecha").rotate({angle:90});
}

function toggle_form_visitantes(){
	
		if (toggle_visitantes==0)
			{
			 $('#formulario_visitantes').slideDown("fast");
			 $('#boton_visitantes').delay(200).animate({width: '104px'},400,"easeOutExpo");
			 $('#visitantes_flecha').animate({rotate: '90deg',scale: '1'}, {queue: false, duration: 200});
			 cambiar_estilo('titulo_visitantes','title_new_hover');
			 toggle_visitantes=1;
			 
			 $('#boton_pacientes').animate({width: '0px'},400,"easeOutExpo");
			 $('#formulario_pacientes').delay(100).slideUp("fast");
			 $("#pacientes_flecha").delay(200).animate({rotate: '0deg',scale: '1'}, {queue: false, duration: 250});
			 cambiar_estilo('titulo_pacientes','none');
			 toggle_pacientes=0;
			 
			 $('#boton_profesionales').animate({width: '0px'},400,"easeOutExpo");
			 $('#formulario_profesionales').delay(100).slideUp("fast");
			 $("#profesionales_flecha").delay(200).animate({rotate: '0deg',scale: '1'}, {queue: false, duration: 250});
			 cambiar_estilo('titulo_profesionales','none');
			 
			 toggle_profesionales=0;
			 
			 $('#boton_registro').animate({width: '0px'},400,"easeOutExpo");
			 $('#formulario_registro').delay(100).slideUp("fast");
			 $("#registro_flecha").delay(200).animate({rotate: '0deg',scale: '1'}, {queue: false, duration: 250});
			 cambiar_estilo('titulo_registro','none');
			 toggle_registro=0;
			 			 
			 return;
			}
		
		if (toggle_visitantes==1)
			{
			 $('#boton_visitantes').animate({width: '0px'},400,"easeOutExpo");
			 $('#formulario_visitantes').delay(100).slideUp("fast");
			 $("#visitantes_flecha").delay(300).animate({rotate: '0deg',scale: '1'}, {queue: false, duration: 350});
			 cambiar_estilo('titulo_visitantes','none');
			 toggle_visitantes=0;
			 return;
			}
		}
		

function toggle_form_pacientes(){
	
		if (toggle_pacientes==0)
			{
			 $('#formulario_pacientes').slideDown("fast");
			 $('#boton_pacientes').delay(200).animate({width: '104px'},400,"easeOutExpo");
			 $("#pacientes_flecha").animate({rotate: '90deg',scale: '1'}, {queue: false, duration: 200});
			 cambiar_estilo('titulo_pacientes','title_new_hover');
			 toggle_pacientes=1;
			 
			 $('#boton_visitantes').animate({width: '0px'},400,"easeOutExpo");
			 $('#formulario_visitantes').delay(100).slideUp("fast");
			 $("#visitantes_flecha").delay(200).animate({rotate: '0deg',scale: '1'}, {queue: false, duration: 250});
			 cambiar_estilo('titulo_visitantes','none');
			 toggle_visitantes=0;
			 
			 $('#boton_profesionales').animate({width: '0px'},400,"easeOutExpo");
			 $('#formulario_profesionales').delay(100).slideUp("fast");
			 $("#profesionales_flecha").delay(200).animate({rotate: '0deg',scale: '1'}, {queue: false, duration: 250});
			 cambiar_estilo('titulo_profesionales','none');
			 toggle_profesionales=0;
			 
			 $('#boton_registro').animate({width: '0px'},400,"easeOutExpo");
			 $('#formulario_registro').delay(100).slideUp("fast");
			 $("#registro_flecha").delay(200).animate({rotate: '0deg',scale: '1'}, {queue: false, duration: 250});
			 cambiar_estilo('titulo_registro','none');
			 toggle_registro=0;
			 			 
			 return;
			}
		
		if (toggle_pacientes==1)
			{
			 $('#boton_pacientes').animate({width: '0px'},400,"easeOutExpo");
			 $('#formulario_pacientes').delay(100).slideUp("fast");
			 $("#pacientes_flecha").delay(300).animate({rotate: '0deg',scale: '1'}, {queue: false, duration: 350});
			 cambiar_estilo('titulo_pacientes','none');
			 toggle_pacientes=0;
			 return;
			}
		}
		
function toggle_form_profesionales(){
	
		if (toggle_profesionales==0)
			{
			 $('#formulario_profesionales').slideDown("fast");
			 $('#boton_profesionales').delay(200).animate({width: '104px'},400,"easeOutExpo");
			 $("#profesionales_flecha").animate({rotate: '90deg',scale: '1'}, {queue: false, duration: 200});
			 cambiar_estilo('titulo_profesionales','title_new_hover');
			 toggle_profesionales=1;
			 
			 $('#boton_visitantes').animate({width: '0px'},400,"easeOutExpo");
			 $('#formulario_visitantes').delay(100).slideUp("fast");
			 $("#visitantes_flecha").delay(200).animate({rotate: '0deg',scale: '1'}, {queue: false, duration: 250});
			 cambiar_estilo('titulo_visitantes','none');
			 toggle_visitantes=0;
			 
			 $('#boton_pacientes').animate({width: '0px'},400,"easeOutExpo");
			 $('#formulario_pacientes').delay(100).slideUp("fast");
			 $("#pacientes_flecha").delay(200).animate({rotate: '0deg',scale: '1'}, {queue: false, duration: 250});
			 cambiar_estilo('titulo_pacientes','none');
			 toggle_pacientes=0;
			 
			 $('#boton_registro').animate({width: '0px'},400,"easeOutExpo");
			 $('#formulario_registro').delay(100).slideUp("fast");
			 $("#registro_flecha").delay(200).animate({rotate: '0deg',scale: '1'}, {queue: false, duration: 250});
			 cambiar_estilo('titulo_registro','none');
			 toggle_registro=0;
			 			 
			 return;
			}
		
		if (toggle_profesionales==1)
			{
			 $('#boton_profesionales').animate({width: '0px'},400,"easeOutExpo");
			 $('#formulario_profesionales').delay(100).slideUp("fast");
			 $("#profesionales_flecha").delay(300).animate({rotate: '0deg',scale: '1'}, {queue: false, duration: 350});
			 cambiar_estilo('titulo_profesionales','none');
			 toggle_profesionales=0;
			 return;
			}
		}


function toggle_form_registro(){
	
		if (toggle_registro==0)
			{
			 $('#formulario_registro').slideDown("fast");
			 $('#boton_registro').delay(200).animate({width: '104px'},400,"easeOutExpo");
			 $("#registro_flecha").animate({rotate: '90deg',scale: '1'}, {queue: false, duration: 200});
			 cambiar_estilo('titulo_registro','texto_registro_over');
			 toggle_registro=1;
			 
			 $('#boton_visitantes').animate({width: '0px'},400,"easeOutExpo");
			 $('#formulario_visitantes').delay(100).slideUp("fast");
			 $("#visitantes_flecha").delay(200).animate({rotate: '0deg',scale: '1'}, {queue: false, duration: 250});
			 cambiar_estilo('titulo_visitantes','none');
			 toggle_visitantes=0;
			 
			 $('#boton_pacientes').animate({width: '0px'},400,"easeOutExpo");
			 $('#formulario_pacientes').delay(100).slideUp("fast");
			 $("#pacientes_flecha").delay(200).animate({rotate: '0deg',scale: '1'}, {queue: false, duration: 250});
			 cambiar_estilo('titulo_pacientes','none');
			 toggle_pacientes=0;
			 
			  $('#boton_profesionales').animate({width: '0px'},400,"easeOutExpo");
			 $('#formulario_profesionales').delay(100).slideUp("fast");
			 $("#profesionales_flecha").delay(200).animate({rotate: '0deg',scale: '1'}, {queue: false, duration: 250});
			 cambiar_estilo('titulo_profesionales','none');
			 toggle_profesionales=0;

			 			 
			 return;
			}
		
		if (toggle_registro==1)
			{
			 $('#boton_registro').animate({width: '0px'},400,"easeOutExpo");
			 $('#formulario_registro').delay(100).slideUp("fast");
			 $("#registro_flecha").delay(300).animate({rotate: '0deg',scale: '1'}, {queue: false, duration: 200});
			 cambiar_estilo('titulo_registro','none');
			 toggle_registro=0;
			 return;
			}
		}
/* END FUNCIONES FORMULARISO ACCESOS */

/* MUESTRA EL FORMULARIO SELECCIONADO */
function show_form(id){	
	$('html, body').animate({scrollTop:0}, 'slow',function(){$('#bg_lightbox').fadeIn('normal',function(){$('#'+id).fadeIn('normal');});});
}
/* END MUESTRA EL FORMULARIO SELECCIONADO */

/*OCULTA EL FORMULARIO SELECCIONADO */
function hide_form(id){
	$('#bg_lightbox').fadeOut('normal',function(){close_tooltip();});
	$('#'+id).fadeOut('normal');
}
/* END OCULTA EL FORMULARIO SELECCIONADO*/


/* MUESTRA EL FORMULARIO DE REGISTRO*/
function show_form_register(){
    
        $('html, body').animate({scrollTop:0}, 'slow',function(){$('#bg_lightbox').fadeIn('normal',function(){$('#register_form_container').fadeIn('normal');});});
	//$.scrollTo('#web_container',1000,{easing:'easeInOutQuart',onAfter:function(){$('#bg_lightbox').fadeIn('normal',function(){$('#register_form_container').fadeIn('normal');});}});
}
/* END OCULTA EL FORMULARIO DE ENVIAR A UN AMIGO*/

/* MUESTRA EL FORMULARIO DE PLANO*/
function show_form_plano(){
	$.scrollTo('#web_container',1000,{easing:'easeInOutQuart',onAfter:function(){$('#bg_lightbox').fadeIn('normal',function(){$('#plano_form_container').fadeIn('normal');});}});
} 
/* END OCULTA EL FORMULARIO PLANO*/

/* MARCA UNA OPCION */
function check_option(id){
document.getElementById(id).checked='checked';
}

/* -----------------*/


/* TOOLTIP QUE SIGUE AL RATON */
// position of the tooltip relative to the mouse in pixel //
var offsetx = -26;
var offsety =  -32;

function newelement(newid)
{
    if(document.createElement)
    {
        var el = document.createElement('div');
        el.id = newid;
        with(el.style)
        {
            display = 'none';
            position = 'absolute';
        }
        el.innerHTML = '&nbsp;';
        document.body.appendChild(el);
    }
}
var ie5 = (document.getElementById && document.all);
var ns6 = (document.getElementById && !document.all);
var ua = navigator.userAgent.toLowerCase();
var isapple = (ua.indexOf('applewebkit') != -1 ? 1 : 0);
function getmouseposition(e)
{
    if(document.getElementById)
    {
        var iebody=(document.compatMode &&
        	document.compatMode != 'BackCompat') ?
        		document.documentElement : document.body;
        pagex = (isapple == 1 ? 0:(ie5)?iebody.scrollLeft:window.pageXOffset);
        pagey = (isapple == 1 ? 0:(ie5)?iebody.scrollTop:window.pageYOffset);
        mousex = (ie5)?event.x:(ns6)?clientX = e.clientX:false;
        mousey = (ie5)?event.y:(ns6)?clientY = e.clientY:false;

        var lixlpixel_tooltip = document.getElementById('tooltip');
        lixlpixel_tooltip.style.left = (mousex+pagex+offsetx) + 'px';
        lixlpixel_tooltip.style.top = (mousey+pagey+offsety) + 'px';
    }
}
function tooltip(tip)
{
    if(!document.getElementById('tooltip')) newelement('tooltip');
    var lixlpixel_tooltip = document.getElementById('tooltip');
    lixlpixel_tooltip.innerHTML = tip;
    $('#tooltip').fadeIn('fast');
    document.onmousemove = getmouseposition;
}
function close_tooltip()
{
    $('#tooltip').fadeOut('150');
}

function desplegar(capa)
{
	capa='#'+capa;
	$(capa).slideDown('fast');
}

/* FUCNIONES SECCION NOTICIAS */
function show_leer_mas(id){
	cambiar_estilo('title_'+id,'title_new_hover');
	cambiar_estilo('noticia_'+id,'noticia_shadow');	
	$('#leer_mas_'+id).animate({height: '140px'},300,'easeInOutQuart');
	}
	
function hide_leer_mas(id){
	cambiar_estilo('title_'+id,'title_new');
	cambiar_estilo('noticia_'+id,'noticia');	
	$('#leer_mas_'+id).animate({height: '0px'},300,'easeInOutQuart');
	}

/* -------------------------------------------*/



/*FUNCIONES FAQ */
function ver_faq(id)
	{
	 for (i=1;i<=5;i++)
				{
				cambiar_estilo('title_faq_'+i,'titulo_faq');
				$('#texto_faq_'+i).slideUp('fast');
				}
		 
	cambiar_estilo('title_faq_'+id,'title_faq_hover_default');
	$('#texto_faq_'+id).slideDown('fast');
	}

/* ------------------------------- */


/* FUNCIONES CARGAR PASOS PLANO QUIRURGICO */
var paso=1;

function load_paso_mas()
{
	paso=paso+1;
	//realiza un slideup de la capa contenedora del paso correspondiente
						$.scrollTo('#web_container',900,{easing:'easeInOutQuart',onAfter:function(){
							$('#elements_form_plano_container').slideUp(600,'easeInOutQuart', function() 
								{
									for (i=1;i<=5;i++)
									{
									document.getElementById('step_'+i).style.display='none';
									}
									
									$('#step_'+paso).fadeIn(10,function(){$('#elements_form_plano_container').slideDown(600,'easeInOutQuart',function(){check_paso()});});
								});
							}});	
}

function load_paso_menos()
{
	paso=paso-1;
	//realiza un slideup de la capa contenedora del paso correspondiente
	$.scrollTo('#web_container',900,{easing:'easeInOutQuart',onAfter:function(){
							$('#elements_form_plano_container').slideUp(600,'easeInOutQuart', function() 
								{
									for (i=1;i<=5;i++)
									{
									document.getElementById('step_'+i).style.display='none';
									}
									
									$('#step_'+paso).fadeIn(10,function(){$('#elements_form_plano_container').slideDown(600,'easeInOutQuart',function(){check_paso()});});
								});
							}});
}

/* -------------------------------------------------------------------- */


/* HABILITAR / DESHABILITAR LOS CAMPOS DE UN FORM */
function deshabilitar_form(form_id)
{
	$(form_id+' input:text, '+form_id+' input:radio, '+form_id+' select, '+form_id+' textarea').attr('disabled', 'disabled');
}

function habilitar_form()
{
	$('input:text, input:radio, select, textarea').removeAttr('disabled', 'disabled');
	$('#boton_editar_datos_fake').hide();
	$('#boton_editar_datos').fadeIn();
}


/* -------------------------------------------------------------------- */

/* ANIMACION SLIDER */

function init_animation(){
	$('#texto_titular_1').fadeIn(1000);
	/*$('#texto_titular_1').animate({width: '239px'},600,'easeInOutQuart');*/
	$('#icons_container').delay(200).animate({width: '499px'},600,'easeInOutQuart');
	$('#icon_medico').delay(400).animate({bottom: '0px'},600,'easeInOutQuart');
	$('#icon_visitante').delay(600).animate({bottom: '0px'},600,'easeInOutQuart');
	$('#icon_paciente').delay(900).animate({bottom: '0px'},600,'easeInOutQuart');
	$('#texto_titular_1').delay(4000).fadeIn(1000,function(){move(1);});
	$('#texto_titular_1').delay(1000).fadeIn(1000,function(){init_animation_1();});
}

function init_animation_1(){
	$('#texto_titular_2').fadeIn(1000);
	$('#pizarra').delay(200).show('normal');
	$('#icon_container_2').delay(300).animate({width: '169px'},600,'easeInOutQuart');
	$('#icon_visitante_2').delay(600).animate({bottom: '0px'},600,'easeInOutQuart');
	$('#texto_titular_2').delay(4000).fadeIn(1000,function(){move(2);});
	$('#texto_titular_2').delay(1000).fadeIn(1000,function(){init_animation_2();});
}

function init_animation_2(){
	$('#texto_titular_3').fadeIn(1000);
	$('#circulo_1').delay(200).animate({bottom: '0px'},600,'easeInOutQuart');
	$('#circulo_2').delay(400).animate({bottom: '0px'},600,'easeInOutQuart');
	$('#bocadillo_izq_1').delay(1000).animate({bottom: '0px'},400,'easeInOutQuart');
	$('#bocadillo_izq_2').delay(1200).animate({bottom: '0px'},400,'easeInOutQuart');
	$('#bocadillo_dcha_1').delay(1500).animate({bottom: '0px'},400,'easeInOutQuart');
	$('#bocadillo_dcha_2').delay(1700).animate({bottom: '0px'},400,'easeInOutQuart');
	/*$('#bocadillo_izq_1').delay(1000).fadeIn('slow');
	$('#bocadillo_izq_2').delay(1200).fadeIn('slow');
	$('#bocadillo_dcha_1').delay(1500).fadeIn('slow');
	$('#bocadillo_dcha_2').delay(1700).fadeIn('slow');*/
	$('#texto_titular_3').delay(4000).fadeIn(1000,function(){move(3);});
	$('#texto_titular_3').delay(1000).fadeIn(1000,function(){init_animation_3();});
}

function init_animation_3(){
	$('#texto_titular_4').fadeIn(1000);
	$("#mapa_img").delay(200).show("scale",{percent: 100, direction: 'both'}, 300);
	$('#puntero').delay(600).fadeIn('slow');
	$('#ruta').delay(1200).fadeIn('slow');
	$('#destino').delay(1800).fadeIn('slow');
	$('#map_container').delay(2400).animate({left: '43px'},600,'easeInOutQuart');
	$("#circulo_medico").delay(2600).show("scale",{percent: 100, direction: 'both'}, 300);
	$('#texto_titular_4').delay(4000).fadeIn(1000,function(){move(4);});
	$('#texto_titular_4').delay(1000).fadeIn(1000,function(){init_animation_4();});
}

function init_animation_4(){
	$('#texto_titular_5').fadeIn(1000);
	$('#foto_logo_metal').delay(200).animate({bottom: '0px'},1000,'easeInOutQuart');
	$('#texto_titular_5').delay(3500).fadeIn(1000,function(){move(5);});
	$('#texto_titular_5').delay(1000).fadeIn(1000,function(){init_animation_5();});
}

function init_animation_5(){
	$('#texto_titular_6').fadeIn(1000);
	$('#medico_1').delay(300).animate({width: '118px'},600,'easeInOutQuart');
	$('#medico_1_foto').delay(500).animate({bottom: '0px'},600,'easeInOutQuart');
	$('#medico_2').delay(600).animate({width: '118px'},600,'easeInOutQuart');
	$('#medico_2_foto').delay(800).animate({bottom: '0px'},600,'easeInOutQuart');
	$('#medico_3').delay(900).animate({width: '118px'},600,'easeInOutQuart');
	$('#medico_3_foto').delay(1100).animate({bottom: '0px'},600,'easeInOutQuart');
	
	$('#hoja').delay(1500).fadeIn('normal');
	$('#hoja2').delay(1700).fadeIn('normal');
	$('#hoja3').delay(1900).fadeIn('normal');
	$('#hoja4').delay(2100).fadeIn('normal');
	
	$('#texto_titular_6').delay(4000).fadeIn(1000,function(){move(6);});
	$('#texto_titular_6').delay(1000).fadeIn(1000,function(){init_animation_6();});
}

function init_animation_6(){
	$('#texto_titular_7').fadeIn(1000);
	$('#imac_imagen').delay(500).animate({bottom: '0px'},600,'easeInOutQuart');
	$('#form_anim_imagen').delay(800).animate({bottom: '0px'},600,'easeInOutQuart');
	$('#inactivo').delay(4000).fadeOut(250,function(){move(0);});
}
