var hplayer  = null;
var vidpath = "/media/useruploads/video/";
var thumbpath = vidpath+"thumbs/";
var swfpath = "/swf/";

function playonclick(filename,thumbname,divname,bool,url,width,height)
{
    if(divname)
    {
        var swffile = swfpath + "player-licensed.swf";
        var vidthumb = thumbpath + escape(thumbname);
        var vidfile =   vidpath+ filename;
        if(width == null || width == undefined || width == "")
        {
              width =  575;   
        }
        if(height == null || height == undefined || height == "")
        {
              height =  335;
        }
        jwplayer(divname).setup(
        {
            allowfullscreen: 'true',
            flashplayer: swffile,
            icons: true,
            wmode: 'opaque',
            'controlbar.idlehide': false,
            //frontcolor:'86C29D',
            backcolor:  'FAFAFA',
            screencolor: '3E4B5D',
            image: vidthumb,
            allowscriptaccess: 'always',
            file:vidfile,
            height: height,
            width: width,
            autostart:bool,
            stretching: 'exactfit',
            provider: 'video',
            plugins:
            {
                gapro:{ accountid : "UA-5990399-2" } ,
                dsharing :{
                     dskin :'/media/useruploads/swf/DSharingSample.swf',
                     sharetoolbar : 'false',
                     mailaction : '/files/sendmail',
                     thumb :  vidthumb,
                     label_name : 'Paste LINK here',
                     label_email : 'Your email',
                     label_friend : 'Friend\'s e-mail',
                     label_link : 'URL of this video',
                     label_replay :'Replay video',
                     label_send : 'Send',
                     label_delete : 'Delete',
                     embedvalue : url
                }
            }
        }); 
    }
}

    
