var left2 = 0; //Starting Location - left2
var top2 = 0; //Starting Location - top2
var Videointerval2 = 20; //Move 10px every initialization
var LinkPlay2 = "";
var LinkImage2 = "";
var grabheight = 0;
var grabwidth = 0;

function ShowDiafimisi(NewLink, NewLinkImage2)
{
	LinkPlay2  = NewLink;
	
	LinkImage2 = NewLinkImage2;
	
	var VideoWindow = document.getElementById('PreviewVideoDiaf');
	
	var newdiv = document.createElement('div');
	newdiv.setAttribute('id', "ShowVideoNew");
	newdiv.setAttribute('style', "Z-INDEX: 102; POSITION: absolute; BACKGROUND-COLOR: #FFFFFF;width: 0px; height:0px;filter: alpha(opacity=100);-moz-opacity: 1; opacity:1; margin-left: 9px; margin-top: -111px;");
	newdiv.innerHTML = '';
	VideoWindow.appendChild(newdiv);
 
	var newdiv2 = document.createElement('div');
	newdiv2.setAttribute('id', "ShowVideoNew2");
	newdiv2.setAttribute('style', "Z-INDEX: 103;POSITION: absolute; BACKGROUND-COLOR: black; width: 313px; height:108px;border: 0px solid black ; margin-left: 11px; margin-top: -108px;");
	newdiv2.innerHTML = '';
	VideoWindow.appendChild(newdiv2);
	
	newdiv.style.width =  317 + "px"; //"100%"; //document.getElementById("AllDocument").style.width;
	newdiv.style.height = 114 + "px"; //"120%"; //document.getElementById("AllDocument").style.height;
	
	window.setTimeout('CreateVideo()',100);
}

function CreateVideo()
{
	var newdiv2 = document.getElementById('ShowVideoNew2');
	
	var newwidth = 313;
	var newheight = 108;
	
	var sHTML="<div style='BACKGROUND-COLOR: #black;'><div id='mediaspace' style='BACKGROUND-COLOR: #black;'></div>";
	newdiv2.innerHTML  = sHTML; //+ sScript;
	
	var scriptVideo=document.createElement("script");
	scriptVideo.setAttribute("type","text/javascript");
	scriptVideo.text = "var so = new SWFObject('images/media/player.swf','mpl','" + newwidth + "','" + newheight + "','9'); so.addParam('allowfullscreen','false'); so.addParam('allowscriptaccess','always'); so.addParam('wmode','opaque'); so.addVariable('file','" + LinkPlay2 + "'); so.addVariable('image','" + LinkImage2 + "'); so.addVariable('backcolor','FFFFFF'); so.addVariable('controlbar','none'); so.addVariable('autostart','false'); so.addVariable('icons','true'); so.addVariable('quality','false'); so.addVariable('bufferlength','10'); so.addVariable('stretching','exactfit'); so.write('mediaspace');";
	newdiv2.appendChild(scriptVideo);
	
	//window.setTimeout('removeVideo()',40000);
}

function removeVideo(divNum) {
	document.getElementById("mpl").sendEvent("Stop");
	$("mpl").remove();
	$("mediaspace").remove();
	 	
	left2 = parseInt(document.getElementById("ShowVideoNew2").style.left);
	
	//window.setTimeout('CloseWindowVideoWidth()',10);
	
	document.getElementById("ShowVideoNew2").style.height =  0 + 'px';
	document.getElementById("ShowVideoNew2").style.width = 0 + 'px';

	document.getElementById("ShowVideoNew").style.height =  0 + 'px';
	document.getElementById("ShowVideoNew").style.width = 0 + 'px';
	
	var VideoWindow = document.getElementById('PreviewVideo');
	var newdiv = document.getElementById('ShowVideoNew');
	var newdiv2 = document.getElementById('ShowVideoNew2');
	VideoWindow.removeChild(newdiv2);
	VideoWindow.removeChild(newdiv);
}
