// JavaScript Document


function embedVideo(div, url, image){



    var content ="<div style='padding:10px;'>"+ getLocaleStr("embed_instruction", "<strong>Copy the code below and paste it in any website you could include an HTML code</strong><br/>") +
    "<input id='embed_code' name='embed_code' onclick='this.focus();this.select();' readonly='readonly' style='width:100%;' value=\"<object type='application/x-shockwave-flash' data='http://www.multimediaquest.com/media/flashPlayer.swf?previewVideo=http://www.multimediaquest.com/media/" +
    image +
    "&videoSrc=" +
    url +
    "&hideControl=false' width='350' height='250' />" +
    "<param name='movie' value='http://www.multimediaquest.com/media/flashPlayer.swf?previewVideo=http://www.multimediaquest.com/media/" +
    image +
    "&videoSrc=" +
    url +
    "&hideControl=false' />" +
    "<param name='allowScriptAccess' value='sameDomain' />" +
    "<param name='enableJSURL' value='true' />" +
    "<param name='enableHREF' value='true' />" +
    "<param name='saveEmbedTags' value='true' />" +
    "<param name='quality' value='high' />" +
    "<param name='bgcolor' value='&#035;000000' />" +
    "</object>\"/></div>";
    
    createFloatingPane(div, content);
    
    
    
}

function linkToVideo(div, url){

    var content = "<div style='padding:10px;'>"+ getLocaleStr("linkToVideo_instruction", "<strong>To link to this video copy and paste the address below:</strong><br/>") +
    "<input id='embed_code' name='embed_code' onclick='this.focus();this.select();' readonly='readonly' style='width:100%;' value=\"" +
    url +
    "\"/></div>";
    
    createFloatingPane(div, content);
}

function clearEmbedWindow(currentCommentDiv){
	if(currentCommentDiv!=null && currentCommentDiv!=""){
			var elem=_elem(currentCommentDiv);
			if(elem!=null){
                        elem.innerHTML="";
			elem.style.display='none';
			 } 
		}
		 
}
function createFloatingPane(div, content){
    try {
		  var fPane=null;
        if ((fPane = dojo.byId(div)) == null) {
			var embedDiv = document.createElement("div");
			embedDiv.id = div;
			document.body.appendChild(embedDiv);
		}
		fPane.style.display = "block";
		fPane.innerHTML = content;
		
		
		window.setTimeout("clearEmbedWindow('"+div+"')",15000);
		/*
       fPane =new dojox.layout.FloatingPane({bgcolor: "black",
            toggleDuration: "250",
			bgOpacity: "0.5",
            cacheContent: false,
            hasShadow: true,
			displayMinimizeAction: true,
            displayMaximizeAction: true,
            displayCloseAction: true,
            toggle: "fade",title:'', dockable:true,maxable:false,closable:true,resizable:true}, dojo.byId(div));
        
       
	  if (fPane != null) {
	  	fPane.setContent(content);
	  	fPane.startup();
	  }
*/
        
    } 
    catch (e) {
        console.debug(e.message);
    }
    
}






