 		jQuery(document).ready(function() {
 			cambiarImagen(1);
			jQuery("#calendario").datepicker({
				showOtherMonths:true, selectOtherMonths:true,dateFormat: 'yy-mm-dd',
				dayNames: ['Domingo', 'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado'],
				dayNamesMin: ['D', 'L', 'M', 'Mi', 'J', 'V', 'S'],
				onSelect: function(dateText, inst) {
					//INICIA Se modificó esta parte para Sedes Alternas  ** Juan Adrian Pérez Pérez ** 17/Enero/2012
					var s="";
					if(jQuery('#1').is(":visible"))
						s=1;
					if(jQuery('#2').is(":visible"))
						s=2;
					if(jQuery('#3').is(":visible"))
						s=3;
					if(jQuery('#4').is(":visible"))
						s=4;
					if(jQuery('#5').is(":visible"))
						s=5;
					if(jQuery('#6').is(":visible"))
						s=6;
					if(jQuery('#7').is(":visible"))
						s=7;
					if(jQuery('#8').is(":visible"))
						s=8;
					if(jQuery('#9').is(":visible"))
						s=9;
					if(s=="")
						location.href="http://www.cinetecanacional.net/cartelera_dia.php?dia=" + dateText;
					else
						location.href="http://www.cinetecanacional.net/cartelera_dia.php?s=" + s + "&dia=" + dateText;
					//FIN Se modificó esta parte para Sedes Alternas  ** Juan Adrian Pérez Pérez ** 17/Enero/2012
				}
			});
			 var div_alto = jQuery("#datos").height();
	 	        //alert(div_alto);
	 	        if (div_alto > 263){
	 	        jQuery("#sinop").width(380);}
			jQuery("#calendario").datepicker( "option", "monthNames", ['Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'] );
			
		    jQuery(".trailer").click(function(){
		      var idpel=jQuery(this).attr("id");
		      detFicha(idpel,1); 	
		    });
		    
		    jQuery(".fechas").click(function(){
			      var idpel=jQuery(this).attr("id");
			      detFicha(idpel,2); 	
			 });
		    
		    jQuery("#ubic").click(function(){
			      detFicha(0,3);
			      jQuery("#utube").hide();
			 });
		    
		    jQuery("#prec").click(function(){
			      detFicha(0,4);
			      jQuery("#utube").hide();
			 });

                    jQuery("*").filter("#ubicyprecAltern").click(function(){
				var seccion = jQuery(this).get(0).name;
                              detFicha(0,5,seccion);
                              jQuery("#utube").hide();
                         });
	    });
 		
 		function cambiarImagen(item){
 				var valor="./cartelera/anim" + item + ".jpg";
 				var src_img='url(\''+ valor + '\')';
 				jQuery('#fotos-pie').html(jQuery('#' + item ).html());
 				jQuery("#fotos").css('background-image',src_img);
 				jQuery("#fotos img").attr("src",valor);
 		}
 		
 		 function muestraInfo(categoria,param,idioma){
 			switch(categoria){
 			case "consulta":
 				jQuery.get("consultas_2010.php?ajax=s",{opcion:param,lang:idioma},function(data){
					jQuery("#cuerpo").html(data);
 				});
 	 		break;
 			case "sitios":
 				if(param==1){
 					jQuery.post("convocatorias/index1.php",{option:param},function(data){
 						jQuery("#cuerpo").html(data);
 	 				});
 				} else {
 					jQuery.post("sitios.php",{option:param},function(data){
 						jQuery("#cuerpo").html(data);
 		 			}); 					
 				}
 			break;
 			case "servicios":
 				jQuery.post("servicios.php",{option:param},function(data){
						jQuery("#cuerpo").html(data);
	 			});
 			break;
 			case "contacto":
 				jQuery.post("correo.php",{option:param},function(data){
						jQuery("#cuerpo").html(data);
	 			});
 			break;
 			default:
 			  alert("No option selected");
 			} 
 		 }
 		 
 		 function  noticiasAnio(periodo){
 			 jQuery.get("index.php",{id:"h",anio:periodo},function(data){
				jQuery("#cuerpo").html(data);
			});
 		  }

 		function detFicha(clave,tip,seccion){ 	
 			var tit="";
 			var ancho=390;
 			var alto=385;
 			var pos="center";
 			var ruta="det_ficha.php";
 			
 			
 			switch(tip){
 			  case 1:
 				tit="Tr\u00E1iler";
 				pos="center";
 			  break;
 			  case 2:
 				tit="M\u00E1s fechas de exhibici\u00F3n";
 				pos="center";
 			  break;
 			  case 3:
 				tit="Ubicaci\u00F3n"; //ubicacion
 				pos=[80,'center'];
 				var ancho=480;
 	 			var alto=480;
 			  break;
 			 case 4:
  				tit="Precios"; //precios
  				pos=[80,'center'];
  				var ancho=480;
  	 			var alto=520;
  			  break;
			case 5:
                                tit="Ubicacion y Precios de Sedes Alternas"; //precios
                                pos=[80,'center'];
				var ruta="servicios.php?opcion=2&popup=1&sec=" + seccion;
                                var ancho=835;
                                var alto=520;
                          break;
 			 case 12:
 	  				tit="Servicios para personas con discapacidad"; //salas
 	  				pos="center";
 	  			    ruta="./../det_ficha.php";
 	  			    var ancho=700;
 		 			var alto=520;
 	  			  break;
  			  default:
  				tit="Salas"; //salas
  				pos="center";
  			    ruta="./../det_ficha.php";
  			    var ancho=550;
	 			var alto=520;
  			  break;
 			}

			jQuery('#detalle').dialog({
				bgiframe: false,
				autoOpen: false,
				draggable: true,
				rezisable: false,
				title:tit,
				width:ancho,
				height:alto,
				position:pos,
				modal:true,
				open: function(event, ui){
                			jQuery("#detalle").parent().children().children('.ui-dialog-titlebar-close').click(function() {
						jQuery("#utube").show();
					});
				}
			});			
	 		jQuery.get(ruta,{cvePel:clave,tipo:tip},function(data){
	 			jQuery("#detalle").html(data);
				jQuery('#suelo').focus();
				jQuery('#irasecc').focus();
			});
			jQuery('#detalle').dialog('open');
 		}

 		 
 		 function consultaLista(option,op,pag){
 			jQuery("#resultado").html("");
 			jQuery.get("consultas.php?opcion=" + option + "&act="+ op + "&pag=" + pag + "&ajax='S'",jQuery("#forma").serialize(),function(data){
				jQuery("#resultado").html(data);
			});
 		 }
 		 
 		 function enviaMensaje(){
 			if(jQuery("#nombre").get(0).value ==""){
 				alert("Por favor escribe tu nombre.");
 				jQuery("#nombre").focus();
 				return;
 			 }
 			if(jQuery("#correo").get(0).value ==""){
				alert("Por favor escribe tu direccion de correo.");
				jQuery("#correo").focus();
				return;
			 }
 			if(jQuery("#asunto").get(0).value ==""){
				alert("Por favor escribe el titulo del mesaje.");
				jQuery("#asunto").focus();
				return;
			 }
 			if(jQuery("#mensaje").get(0).value ==""){
				alert("Por favor escribe el mensaje.");
				jQuery("#mensaje").focus();
				return;
			 }
 			 jQuery.get("correo.php?btnEnviar=Enviar",jQuery("#forma").serialize(),function(data){
 				jQuery("#resultado").html(data);
 				limpiarMsg(false);
 			 });	  
 		 }
 		  
 		 function limpiarMsg(flag){
 			jQuery("#nombre").get(0).value ="";
 			jQuery("#correo").get(0).value ="";
 			jQuery("#asunto").get(0).value ="";
 			jQuery("#mensaje").get(0).value ="";			  
 			if (flag==true){
 			  jQuery("#resultado").html("");
 			} 
 		 }
 		  		 
 		 /***************/
 	     function busca(){
 	       var frm=document.cseb;
 	       if(frm.q.value != ""){
 	         frm.submit();
 	       }
 	     }

 	

