/*
 * "Contusvideocomments for jomcomment" - Version 1.1
 * Author: Contus Support - http://www.contussupport.com
 * Copyright (c) 2010 Contus Support - support@webflvrecorder.net
 * License: GNU/GPL http://www.gnu.org/copyleft/gpl.html
 * Project page and Demo at http://www.webflvrecorder.net
 * Creation Date: June 15 2010
 */

/* following function is insert the video name in textarea */
function onRecordPublished(obj)
{
    //document.getElementById('jc_title').value=obj.title;
    //document.getElementById('recorderdiv').style.display="none";
    var comment_box=  document.getElementById('jc_comment');
    val=obj.description+'\n\n'+'Video Comments plugin for JomComments '+obj.filename+' ';
    comment_box.value=val+'\n'+'Please refresh the page to see your video comments';
}
/* following function is close the recorder div */
function closediv(divname)
{
    document.getElementById('jc_comment').readOnly = false;
    document.getElementById(divname).style.display="none";
}

/* following function is close the player div and enable the thumb view*/
function closeplayer(divname)
{
    document.getElementById(divname+'_playerdiv').style.display="none";
    document.getElementById(divname+'_playerdiv').innerHTML='<div id="'+divname+'" style="text-align:center;" align="center"></div>';
    document.getElementById(divname+'clsbtn').style.display="none";
    document.getElementById(divname+'_thump').style.display="block";
}

/* following function to show the recorder  */
function addplayer(serverPath,licensekey,recorderModeValue,baseUrl,duration)
{
    document.getElementById("jc_comment").readOnly = true;
    document.getElementById("recorderdiv").style.display="block";
    var params = {
        allowScriptAccess: "always",
        allowFullScreen: "true",
        flashvars:"license="+licensekey+"&server="+serverPath+"&mode="+recorderModeValue+"&maxduration="+duration
        };
    var atts = {
        id: "recorder"
    };
    swfobject.embedSWF(baseUrl+"plugins/system/videocomments/recorder.swf", "recorder", "350", "295", "8", null, null, params, atts);
}


/* following the function is enable the player from thum click */
function showplayer(filepath,serverPath,licensekey,baseUrl)
{
    document.getElementById(filepath+"clsbtn").style.display="block";
    document.getElementById(filepath+"_playerdiv").style.display="block";
    var params = {
        allowScriptAccess: "always",
        allowFullScreen: "true",
        wmode: "transparent",
        flashvars:"file="+filepath+".flv&streamer="+serverPath
        };
    var atts = {
        id: filepath
    };
    swfobject.embedSWF(baseUrl+"plugins/system/videocomments/hdplayer.swf",filepath, "420", "315", "9", null, null, params, atts);
    document.getElementById(filepath+"_thump").style.display="none";
}


