var idPelicula = "8065" || undefined, solapa = "peliculaTabSumario" || undefined; var tabManager; function puntajeSubmit(rateSelected) { if ( !idPelicula || !solapa ) return; var callback = function ( res ) { console.log( res.responseText ) }, post = { RateSelected: rateSelected, IdPelicula: idPelicula }; Cines.ajax.PeliculaPuntajeSubmit( post, callback ); } function mostrarEnviarCriticaPublico() { $("enviarCriticaPublico").style.display = 'block'; $("editarComentario").style.display = 'none'; } function criticaFueUtil(idComentario, idUsuario) { var post = { IdComentario: idComentario }, callback = function ( res ) { $('rowFueUtil'+idComentario).innerHTML = res.responseText; }; Cines.ajax.CriticaFueUtil( post, callback); } function chargeCriticaPublico(page, idSitio) { page = page || 1; function ok(obj) { $('criticasPublico').innerHTML = obj.responseText; window.location.hash = 'criticasPublico'; } var sUrl = '/pelicula/' + idPelicula + '/criticapublico/' + page + '/' + idSitio + '/'; var callback = { cache: false, success: ok, failure: null }; YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, null); } YAHOO.util.Event.onDOMReady( function() { //Tabs tabManager = new TabManager('Active','Inactive'); tabManager.addTab('peliculaTabSumario', function() { function ok(obj) { $('textoDetalle').innerHTML = obj.responseText; var evalScripts = new EvalScripts(); evalScripts.eval(obj.responseText); } var sUrl = '/pelicula/' + idPelicula + '/sumario'; var callback = { cache: false, success: ok, failure: null } YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, null); } ); tabManager.addTab('peliculaTabDatosCompletos', function() { function ok(obj) { $('textoDetalle').innerHTML = obj.responseText; } var sUrl = '/pelicula/' + idPelicula + '/datoscompletos'; var callback = { cache: false, success: ok, failure: null } YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, null); } ); tabManager.addTab('peliculaTabFotos', function() { function ok(obj) { $('textoDetalle').innerHTML = obj.responseText; } var sUrl = '/pelicula/' + idPelicula + '/fotos'; var callback = { cache: false, success: ok, failure: null } YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, null); } ); tabManager.addTab('peliculaTabVideos', function() { if (tabManager.getActualTab() == 'peliculaTabVideos') return; function ok(obj) { $('textoDetalle').innerHTML = obj.responseText; var evalScripts = new EvalScripts(); evalScripts.eval(obj.responseText); } var sUrl = '/pelicula/' + idPelicula + '/trailer'; var callback = { cache: false, success: ok, failure: null } YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, null); } ); tabManager.addTab('peliculaTabNotas', function() { if (tabManager.getActualTab() == 'peliculaTabNotas') return; function ok(obj) { $('textoDetalle').innerHTML = obj.responseText; var evalScripts = new EvalScripts(); evalScripts.eval(obj.responseText); } var sUrl = '/pelicula/' + idPelicula + '/notas'; var callback = { cache: false, success: ok, failure: null } YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, null); } ); YAHOO.util.Event.addListener ( 'editarComentario', 'click' , function() { mostrarEnviarCriticaPublico() }); YAHOO.util.Event.addListener ( 'linkDatosCompletos', 'click' , function() { tabManager.goToTab('peliculaTabDatosCompletos', false); }); tabManager.goToTab(solapa, false); new Lightbox(); } );