
function deletePlayer(theWrapper, thePlaceholder, thePlayerId) {
    swfobject.removeSWF(thePlayerId);
    var tmp = document.getElementById(theWrapper);
    if (tmp) { tmp.inner = "<div id=" + thePlaceholder + "></div>"; }
}
function createPlayer(thePlaceholder, thePlayerId, theFile) {
    var flashvars = {
        file: theFile,
        autostart: "false"
    }
    var params = {
        allowfullscreen: "true",
        allowscriptaccess: "always"
    }
    var attributes = {
        id: thePlayerId,
        name: thePlayerId
    }
    swfobject.embedSWF("http://"+window.location.hostname.toString()+"/flvplayer.swf", thePlaceholder, "244", "200", "9.0.115", false, flashvars, params, attributes);
}
function createPlayerLargle(thePlaceholder, thePlayerId, theFile) {
    var flashvars = {
        file: theFile,
        autostart: "false"
    }
    var params = {
        allowfullscreen: "true",
        allowscriptaccess: "always"
    }
    var attributes = {
        id: thePlayerId,
        name: thePlayerId
    }
	document.getElementById('videoclip').innerHTML='<div id="video1"></div>';
   var so= swfobject.embedSWF("http://"+window.location.hostname.toString()+"/flvplayer.swf", thePlaceholder, "286", "212", "9.0.115", false, flashvars, params, attributes);
   so.write("videoclip");
}
function initPlayer(theFile) {
    deletePlayer('videoclip', 'videoclip', 'videoclip');
    createPlayer('videoclip', 'videoclip', theFile);
}
function gddplay(theFile){
document.getElementById('videoclip').innerHTML='<div id="video1"></div>';
var so = new swfobject("http://"+window.location.hostname.toString()+"/flvplayer.swf", "some_unique_id_in_page_987", "286", "212", "8", "#62636B"); //change the player size as you want (now:500x360)
so.addParam("scale", "noscale");
so.addParam("quality", "best");
so.addParam("allowScriptAccess", "always");
so.addParam("allowFullScreen", 'true');
//VIDEO PARAMS
so.addVariable("autoplay", 'false'); // autoplay: true or false  | default: false
so.addVariable("sound", '80'); // sound volume 0-100
so.addVariable("vdo", escape(theFile)); //video file
so.write("videoclip"); // put the player inside div id=gddflvplayer
}

function initPlayerLargle(theFile) {
    //deletePlayer('videoclip', 'videoclip', 'videoclip');
    createPlayerLargle('videoclip', 'videoclip', theFile);
	//gddplay(theFile);
}
function loadPlayerYouTube(theFile) {
  // The video to load
  var videoID = "videoclip"
  // Lets Flash from another domain call JavaScript
  var params = { allowScriptAccess: "always" };
  // The element id of the Flash embed
  var atts = { id: "videoclip" };
  // All of the magic handled by SWFObject (http://code.google.com/p/swfobject/)
  swfobject.embedSWF(theFile,"videoclip", "244", "188", "8", null, null, params, atts);
}
function loadPlayerYouTubeLargle(theFile) {
  // The video to load
  var videoID = "videoclip"
  // Lets Flash from another domain call JavaScript
  var params = { allowScriptAccess: "always" };
  // The element id of the Flash embed
  var atts = { id: "videoclip" };
  // All of the magic handled by SWFObject (http://code.google.com/p/swfobject/)
  document.getElementById('videoclip').innerHTML='<div id="video1"></div>';
 var so=  swfobject.embedSWF(theFile,"videoclip", "286", "212", "8", null, null, params, atts);
 so.write("videoclip");
}
