width=100;
height=1;


function popup(){
		if(document.getElementById('video')){document.getElementById('video').style.display="none";}
	
		var fond=document.createElement("div");
		fond.className="cache";
		fond.id="fond";
		fond.style.top='0px';
		fond.style.left='0px';
		fond.style.width=screen.width+'px';
		fond.style.height=screen.height+'px';
		fond.onclick=function(){
			exit_popup();
			}
		document.body.appendChild(fond);

		var del=document.createElement("div");
		del.className="delete";
		del.id="delete";
		del.onclick=function(){
			exit_popup();
			}
		document.body.appendChild(del);

		var popup=document.createElement("div");
		popup.className="popup";
		popup.id="popup";
		popup.style.top=(screen.height/2)-110+"px";
		popup.style.left=(screen.width/2)-(width/2)+"px";
		document.body.appendChild(popup);
		
		document.getElementById('delete').style.left=popup.style.left;
		size2();
}

function size(){
	
	document.getElementById('popup').style.left=(screen.width/2)-(width/2)+"px";
	document.getElementById('popup').style.width=width+"px";
	//document.getElementById('delete').innerHTML=parseInt(document.getElementById('popup').style.left.substring(0,document.getElementById('popup').style.left.indexOf('px')))+parseInt(document.getElementById('popup').style.width.substring(0,document.getElementById('popup').style.width.indexOf('px')))+"px";
	
	document.getElementById('delete').style.left=parseInt(document.getElementById('popup').style.left.substring(0,document.getElementById('popup').style.left.indexOf('px')))+parseInt(document.getElementById('popup').style.width.substring(0,document.getElementById('popup').style.width.indexOf('px')))+40+"px";
		width+=40;
		if(width<1005){
			time2=setTimeout("size()",1);
		}else{
			clearTimeout(time2);
			document.getElementById('popup').style.width=width+"px";
			
	document.getElementById('delete').style.left=parseInt(document.getElementById('popup').style.left.substring(0,document.getElementById('popup').style.left.indexOf('px')))+parseInt(document.getElementById('popup').style.width.substring(0,document.getElementById('popup').style.width.indexOf('px')))+40+"px";
			
	document.getElementById('popup').innerHTML='<div id="errorLocation" style="font-size: small;color: Gray;"></div><div id="silverlightControlHost"><object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="1000" height="300"><param name="source" value="ClientBin/LeCerkle.SilverlightApplication.xap"/><param name="onerror" value="onSilverlightError" /><param name="background" value="white" /><param name="minRuntimeVersion" value="2.0.31005.0" /><param name="autoUpgrade" value="true" /><param name="initParams" value="CatalogName=C1,PagesCount='+nb_cli+'"/><a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"><img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Téléchargez Microsoft Silverlight" style="border-style: none"/></a></object><iframe style="visibility:hidden;height:0;width:0;border:0px"></iframe></div>';
			
			
			
		}
}

function size2(){
	document.getElementById('popup').style.top=(screen.height/2)-(height/2)-110+"px";
	document.getElementById('popup').style.height=height+"px";
		height+=8;
		if(height<305){
			time2=setTimeout("size2()",1);
		}else{
			clearTimeout(time2);
			document.getElementById('popup').style.height=height+"px";
			size();
		}
}
function exit_popup(){
	if(document.getElementById('video')){document.getElementById('video').style.display="block";}
	document.getElementById('popup').innerHTML="";
	document.body.removeChild(document.getElementById('popup'));
	document.body.removeChild(document.getElementById('fond'));
	document.body.removeChild(document.getElementById('delete'));
	width=100;
	height=1;
}
