//JS Support for stirng trim
String.prototype.trim = function () {
    return this.replace(/^\s*/, "").replace(/\s*$/, "");
}

$(document).ready(function(){
    //target blank fix
    $('a[rel=_blank]').click(function(e){
        e.preventDefault();
        window.open($(this).attr('href'));
    });
    
    
    
});




//=============================================================





$(document).ready(function () {
 $(".file-item").hover(
   function () {$(this).addClass('play');},
   function () {$(this).removeClass('play');
     var playid = $(this).find('OBJECT');
     if (playid != 'undefined') { 
     	var vidid = $(this).find('.videoid').val();
     	playVideo(vidid);
     }
   }
 );
});

function playVideo (videoId)
{
	eval("play"+videoId +"()");
}

function createFlashEmbed(videoFile,container,_width,_height)
{
	flashembed(container, 
	{src:'/static/flash/FlowPlayerClassic.swf',width: _width,height: _height,wmode:'transparent'},

	{config: { autoPlay: true,loop:false, autoBuffering: true,	bufferLength:0,	controlBarBackgroundColor:'0x000000',
	initialScale: 'orig',videoFile: escape(videoFile),hideControls: true,showMenu: false}} 
	)
}

