﻿function closeJq(dialogID) {
    $('#' + dialogID).jqmHide();
}
function createJqDialog(dialogID) {
    $('#' + dialogID).jqm({
        //onShow: onPopupOpen,
        onHide: onPopupClose,
        overlay: 30
    })
}
var onPopupClose = function(hash) {
    $('#itest').attr('src', '');
    hash.w.fadeOut(100);
    hash.o.fadeOut(100, function() { hash.o.remove(); });
};
function openJq(dialogID) {
    $('#' + dialogID).jqmShow();
}

$().ready(function() {
    createJqDialog('dialog');
});

function showMovie(src, w, h) {
    var leftMargin = w / 2;

    document.getElementById('dialog').style.position = 'fixed';
    document.getElementById('dialog').style.top = '90px';
    document.getElementById('dialog').style.left = '50%';
    document.getElementById('dialog').style.marginLeft = -leftMargin + 'px';
    document.getElementById('dialog').style.width = (w + 20) + 'px';
    //document.getElementById('dialog').style.height = h;

    $('#itest').attr('src', src);
    $('#itest').attr('width', w);
    $('#itest').attr('height', h);

    openJq('dialog');
}

jQuery('#Tabs .readmore').click(function() {
    jQuery('#Tabs .readmore').hide();
    jQuery('.tab_long').show();
});
jQuery('#Tabs .collapse').click(function() {
    jQuery('#Tabs .readmore').show();
    jQuery('.tab_long').hide();
});

function expand() {
    jQuery('#Tabs .readmore').hide();
    jQuery('.tab_long').show();
}

function collapse() {
    jQuery('#Tabs .readmore').show();
    jQuery('.tab_long').hide();
}
