﻿function showTVAd() {
    var 
        src = $(this).attr('vSrc'),
        width = parseInt($(this).attr('vWidth')),
        height = parseInt($(this).attr('vHeight'));

    $('<div></div>')
        .dialog({
            autoOpen: true,
            title: 'TV Ads',
            width: width + 40,
            height: height + 80,
            resizable: false,
            draggable: false,
            modal: true
        })
        .flashembed({
            src: '/Assets/Videos/flvPlayer.swf',
            version: [9, 0],
            width: width,
            height: height
        }, {
            videoPath: src,
            imagePath: src + '.jpg',
            stageW: width,
            stageH: height,
            autoStart: 'true',
            autoHide: 'true',
            autoHideTime: '3',
            hideLogo: 'true',
            volAudio: '100',
            disableMiddleButton: 'false',
            playSounds: 'false',
            soundBarColor: '0xCC0000',
            barColor: '0xCC0000',
            barShadowColor: '0xAAAAAA',
            subbarColor: '0xFFFFFF',
            extendVideo: 'true'
        });
}

$(document).ready(function() {
    $('#filmstripthumbs')
        .jcarousel({ scroll: 1, animation: 500, wrap: 'both' });

    $('a.video')
        .bind('click', showTVAd);

    $('img.tvadthumb').attr('style', 'zoom: 1');        
});
