﻿$(function () {
    $('a.Regist').click(function (e) {
        e.preventDefault();
        var $this = $(this);
        var horizontalPadding = 15;
        var verticalPadding = 15;
        var widthiframe = 590;
        var heightiframe = 415;
        $('<iframe id="site" src="' + this.href + '" />').dialog({
            title: ($this.attr('title')) ? $this.attr('title') : 'Registro',
            autoOpen: true,
            width: widthiframe,
            height: heightiframe,
            modal: true,
            resizable: false,
            autoResize: true,
            /*close: function (event, ui) { window.location.href = window.location.href; },*/
            overlay: {
                opacity: 0.5,
                background: "black"
            }
        }).width(widthiframe - horizontalPadding).height(heightiframe - verticalPadding);
    });

    $('a.Contacto').click(function (e) {
        e.preventDefault();
        var $this = $(this);
        var horizontalPadding = 15;
        var verticalPadding = 15;
        var widthiframe = 590;
        var heightiframe = 350;
        $('<iframe id="site" src="' + this.href + '" />').dialog({
            title: ($this.attr('title')) ? $this.attr('title') : 'Contáctenos',
            autoOpen: true,
            width: widthiframe,
            height: heightiframe,
            modal: true,
            resizable: false,
            autoResize: true,
            /*close: function (event, ui) { window.location.href = window.location.href; },*/
            overlay: {
                opacity: 0.5,
                background: "black"
            }
        }).width(widthiframe - horizontalPadding).height(heightiframe - verticalPadding);
    });

    $('a.LogIn,a.LogIn2,a.LogIn3').click(function (e) {
        e.preventDefault();
        var $this = $(this);
        var horizontalPadding = 15;
        var verticalPadding = 15;
        var widthiframe = 590;
        var heightiframe = 145;
        $('<iframe id="site" src="' + this.href + '" />').dialog({
            title: ($this.attr('title')) ? $this.attr('title') : 'Inicio de Sesión',
            autoOpen: true,
            width: widthiframe,
            height: heightiframe,
            modal: true,
            resizable: false,
            autoResize: true,
            /*close: function (event, ui) { window.location.href = window.location.href; },*/
            overlay: {
                opacity: 0.5,
                background: "black"
            }
        }).width(widthiframe - horizontalPadding).height(heightiframe - verticalPadding);
    });
    $('a.cerrarsesion').click(function (e) {
        e.preventDefault();
        var $this = $(this);
        var horizontalPadding = 15;
        var verticalPadding = 15;
        var widthiframe = 590;
        var heightiframe = 145;
        $('<iframe id="site" src="' + this.href + '" />').dialog({
            title: ($this.attr('title')) ? $this.attr('title') : 'Cerrar Sesión',
            autoOpen: true,
            width: widthiframe,
            height: heightiframe,
            modal: true,
            resizable: false,
            autoResize: true,
            /*close: function (event, ui) { window.location.href = window.location.href; },*/
            overlay: {
                opacity: 0.5,
                background: "black"
            }
        }).width(widthiframe - horizontalPadding).height(heightiframe - verticalPadding);
    });

 });
    

    

    


var player = null;
function playerReady(thePlayer) {
    player = window.document[thePlayer.id];
}


function createPlayer(multimedia) {
    // alert(multimedia);
    var flashvars = {
        file: multimedia,
        autostart: "true"
    }
    var params = {
        allowfullscreen: "false",
        allowscriptaccess: "always"
    }
    var attributes = {
        id: "player1",
        name: "player1"
    }

    swfobject.embedSWF("/recursos/mediaplayer-5.7/player.swf", "placeholder1", "295", "20", "9.0.115", false, flashvars, params, attributes);
}

function playPlayer(mmedia) {
    if (player) {
        player.sendEvent('STOP');
        player.sendEvent('LOAD', mmedia);

    } else {
        createPlayer(mmedia);
    }
}

/*chage title page */

var prp = 1;
var stprp = 1;
function programa() {
    
    cad = prp;
    if (cad == 1) {
        prp = 0;
        $("#liprogramacion").removeClass('botonera').addClass('menubtmselec ui-corner-top');
        $('#programacion').slideDown('slow');

        if (stprp != 0) {
            /*$('#programacion').load('/programacion/programacion.aspx');*/
            $('#programacion').html('<div style="height:191px;" class="loadingimg"></div>').load('/programacion/programacion.aspx').slideDown('slow'); ;
            stprp = 0;
        } else {
            $('#programacion').slideDown('slow');
         }
    }

    if (cad == 0) {
        prp = 1;
        $("#liprogramacion").removeClass('menubtmselec ui-corner-top');
        $("#programacion").slideUp();
        Act.close();
    }
}
function clearTextBox(textBoxID) {
    document.getElementById(textBoxID).value = "";
}



