﻿// JScript File
var origL=330;
var origH=270;
var swfPlayerMini="_swf/pv.swf";
var swfPlayerFS="_swf/playerVideo_FS.swf";
var swfbgColor="#ffffff";
var targetShare = "_top";

function gosearch()
{
    document.aspnetForm.action = "Search.aspx";
    document.aspnetForm.submit();
}


var origX=0;
var origY=0;
var isFullScreen=false;

function showVideo(){

	document.getElementById("swf").innerHTML="";
	var swf = document.getElementById("swf");
	var videoSmall = document.createElement("div");
	
	swf.style.position="static";
	swf.style.top="0px";
	swf.style.left="0px";
	swf.style.width=origL+"px";
	swf.style.height=origH+"px";
		
	
	//videoSmall.innerHTML=writeFlash(origL,origH,swfPlayerMini,swfbgColor,urlXml4Swf,urlShare,targetShare);
	//swf.appendChild(videoSmall);
	
	swf.innerHTML=writeFlash2(origL,origH,swfPlayerMini,swfbgColor,urlXml4Swf,urlShare,targetShare);
}


function LaunchFullScreen(){
	if(isFullScreen){
		isFullScreen=false;
		showVideo();
	}else{
		isFullScreen=true;
		document.getElementById("swf").innerHTML="";
		var swf = document.getElementById("swf");
		var video = document.createElement("div");
		
		origX=swf.style.left
		origY=swf.style.left
				
		swf.style.position="absolute";
		swf.style.top="0px";
		swf.style.left="0px";
		
		w="800";
		h="600";
		
		try{
			if ( typeof( window.innerWidth ) == 'number' ){
				// Non IE
				w = window.innerWidth;
				h = window.innerHeight;
			}else if (document.documentElement && (document.documentElement.clientWidth||document.documentElement.clientHeight)){
				// IE 6+
				w = document.documentElement.clientWidth;
				h = document.documentElement.clientHeight;
			}else if(document.body && (document.body.clientWidth||document.body.clientHeight )){
				// Old IE
				w = document.body.clientWidth;
				h = document.body.clientHeight;
			}		
		}catch(e){}
		
		swf.style.width=w;
		swf.style.height=h;
				
		video.innerHTML=writeFlash2(w,h,swfPlayerFS,swfbgColor,urlXml4Swf,urlShare,targetShare);
		swf.appendChild(video);
	}
}

function writeFlash2(w,h,swf,swfbgColor,urlXml4Swf,urlShare,targetShare){
    

//	var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
//	if(hasRightVersion) {  // si nous avons détecté une version acceptable
    	var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
		    + 'width="' + w + '" height="' + h + '"'
		    + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
		    + '<param name="movie" value="' + swf + '" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="scale" value="exactfit" /><param name="bgcolor" value="' + swfbgColor + '" />' 
			+ '<param name="FLASHVARS" value = "urlXml=' + escape(urlXml4Swf) + '&urlShare=' + escape(urlShare) + '&targetShare=' + escape(targetShare) + '">'
		    + '<embed src="' + swf + '" menu="false" quality="high" scale="exactfit" bgcolor="' + swfbgColor + '" '
		    + 'width="' + w + '" height="' + h + '" name="playerVideo" align="middle"'
		    + 'FLASHVARS="urlXml=' + escape(urlXml4Swf) + '&urlShare=' + escape(urlShare) + '&targetShare=' + escape(targetShare) + '"'
			+ 'play="true"'
		    + 'loop="false"'
		    + 'quality="high"'
    		+ 'allowScriptAccess="sameDomain"'
   			+ 'type="application/x-shockwave-flash"'
    		+ 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
    		+ '<\/embed>'
    		+ '<\/object>';
/*	}else{
		var oeTags = 'Ce contenu requiert Macromedia Flash Player.'
		   	+ '<a href=http://www.macromedia.com/go/getflash/>Obtenir Flash</a>'; 
	}
*/	
    return oeTags;
}
