﻿




$(document).ready(function() {


    $('#back').click(function() {
        $(".item").each(function() {



            if (($(this).children().length) > 2) {

                if ($(this).children().get(2).name != null && $(this).children().get(2).name != "") {

                    var element = $(this).children().get(2).name


                    var player = document.getElementById('ply' + element);
                    player.sendEvent('STOP');
                }
            }



        })

    });

    $('#next').click(function() {

        $(".item").each(function() {
       

            if (($(this).children().length) > 2) {

                if ($(this).children().get(2).name != null && $(this).children().get(2).name != "") {

                    var element = $(this).children().get(2).name
                    var player = document.getElementById('ply' + element);
                    player.sendEvent('STOP');


                }
            }




        })
    });



    //imagenes y videos
    $('#media-items').cycle({

        fx: 'scrollHorz',
        timeout: 0,
        prev: '#back',
        next: '#next'
    });
    $("#leer").click(function() {
    if ($(".condiciones").is(":hidden")) {
        var padre = $(window.parent.document);

        $(padre).find(".lightBoxContent").css('height', '700px');
        
            $(".condiciones").slideDown("slow");
        }
        else {
            $(".condiciones").slideUp("slow");
        }
     



        



    });


});

