// media browser for get games


jQuery(document).ready(function() {

    $( '.media-select .selectah' ).click( function() {
        $( '#pixbox>div' ).removeClass( 'on' )
        $( '#' + $( this ).attr( 'href' ).split( '#' )[ 1 ] ).addClass( 'on' );
        $( '.media-select>li' ).removeClass( 'active' )
        $( this.parentNode ).addClass( 'active' );
        return false;
    } );
    $("a.prodscreen").fancybox( {
        'titleShow'     : false,
        'transitionIn'  : 'elastic',
        'transitionOut' : 'elastic'
    } );
    //$('#video').jqm();
	/*$('.screensblock').masonry({ columnWidth: 93, itemSelector: '.prodscreen', saveOptions: false });*/
    /*$(".vid-preview a").click( function() {
        $('#video').css(
            {
                "width" : $(this).attr( 'vid:width' ),
                "height" : $(this).attr( 'vid:height' )
            }
        );
        $('#video').center();
        $('#video').jqmShow();
        flowplayer(
            "vidplayer",
            {
                src : "/static/flowplayer/flowplayer.swf",
                version: [ 9, 115 ],
                wmode: 'opaque'
            },
            {
                plugins : { 
                    controls: "/static/flowplayer/flowplayer.controls.swf" 
                },
                clip : {
                    autoBuffering: true
                },
                playlist : [
                    {
                        url: $(this).attr( 'href' ),
                        autoPlay: true
                    }
                ],
                canvas: { 
                    backgroundColor: '#1E1E1E',
                    backgroundGradient: 'none'
                },
                onFinish: function() {
                    $('#video').jqmHide();
                }
            }
        );
        return false;
    } );*/
/*    $(".vid-preview a").fancybox( {
        'titleShow'     : false,
        'transitionIn'  : 'elastic',
        'transitionOut' : 'elastic',
        'content'       : '
        ',
        //'type'          : 'swf',
        //'href'          : '/static/flowplayer/flowplayer.swf',
        //'swf'           : { config:'{"clip":"' + $(this).attr('href') + '"}' },
        //'swf'           : { config:'{"clip":"http://egtv.s3.amazonaws.com/movies/serioussamhdfinaltrailer1280x720international_stream_h264v2_med_2.mp4?AWSAccessKeyId=0XCAJPH9PTY72X5Q7AR2&Expires=1281591049&Signature=X5sQmKV75AVEfs%2BgE%2FK231BK2wE%3D"}' },
        /*'onStart' :function(){
        'content'       : '<div id="videoflow"></div>',
            flowplayer(
                "videoflow",
                { src : "/static/flowplayer/flowplayer.swf", version: [ 9, 115 ] },
                { plugins : { controls: "/static/flowplayer/flowplayer.controls.swf" },
                  clip : { autoBuffering: true },
                  playlist : [ { url: $(this).attr('href'), autoPlay: false } ],
                  canvas: { backgroundColor: '#1E1E1E', backgroundGradient: 'none' },
                  onFinish:function(){
                    $.fancybox.close();
                  }
                }   
            );
        }
    } );*/

} );



