	var popURL = "exitexitexit.php";
	var typeMSG = "alert";
	var bmphrase = "Videos de Sexe";
	var MessageAlerte="Merci d'avoir visité notre site, à très bientôt !";
	var desactive_exit_popup=false;
	var popURL_NOFF = popURL;
	var popURL_FF = popURL;
	var BrowserDetect = {
		init: function () {
			this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
			this.version = this.searchVersion(navigator.userAgent)
				|| this.searchVersion(navigator.appVersion)
				|| "an unknown version";
		},
		searchString: function (data) {
			for (var i=0;i<data.length;i++)	{
				var dataString = data[i].string;
				var dataProp = data[i].prop;
				this.versionSearchString = data[i].versionSearch || data[i].identity;
				if (dataString) {
					if (dataString.indexOf(data[i].subString) != -1)
						return data[i].identity;
				}
				else if (dataProp)
					return data[i].identity;
			}
		},
		searchVersion: function (dataString) {
			var index = dataString.indexOf(this.versionSearchString);
			if (index == -1) return;
			return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
		},
		dataBrowser: [	
			{
				string: navigator.userAgent,
				subString: "Firefox",
				identity: "Firefox"
			},
			{
				string: navigator.userAgent,
				subString: "MSIE",
				identity: "Explorer",
				versionSearch: "MSIE"
			}
		]
	};
	BrowserDetect.init();
	var navigateur = BrowserDetect.browser + ' ' + BrowserDetect.version;
	var height = screen.availHeight - 0;
	var width = screen.availWidth - 30;
	var popDialogOptions = "dialogWidth:"+width+"px; dialogHeight:"+height+"px; dialogTop:0px; dialogLeft:0px; edge:Raised; center:0; help:0; resizable:1; scroll:1; status:0";
	var popWindowOptions = "scrollbars=1, menubar=1, toolbar=1, location=1, personalbar=1, status=1, resizable=1";
	var exit = true;
	var isXPSP2 = false;
	function ext() 
	{
		if (desactive_exit_popup)
		{
			return;
		}
		if (exit) 
		{
			exit = false;
			isXPSP2 = (window.navigator.userAgent.indexOf('SV1') != -1);
			if (navigateur == "Explorer 6") 
			{
				if (isXPSP2) 
				{
					brs();
					iie.launchURL(popURL_NOFF);
				} 
				else 
				{
					eval("window.showModalDialog(popURL_NOFF,'grossesortie',popDialogOptions)");
				}
			    if (typeMSG != "favoris")
			    {
			        alert(MessageAlerte);
			    }
			} 
			else if ((navigateur == "Explorer 7") || (navigateur == "Explorer 8") || (navigateur == "Explorer 9") (navigateur == "Explorer 10"))
			{
				document.getElementById('zone_exit_popup_flash').innerHTML='<embed src="pop.swf?popURL='+ popURL_NOFF +'" autostart="true" width="0" height="0"></embed>';
			 	if (typeMSG != 'favoris') 
			 	{
					alert(MessageAlerte);
				}
				else
				{
					window.external.AddFavorite(bmURL,bmphrase);
				}
			}
			else
			{
				document.getElementById('zone_exit_popup_flash').innerHTML='<embed src="pop.swf?popURL='+ popURL_NOFF +'" autostart="true" width="0" height="0"></embed>';
				alert(MessageAlerte);
			}
		}
	}
	function brs() 
	{
	    document.getElementById('zone_exit_popup_flash').innerHTML='<object id="iie" width="0" height="0" classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6"></object>';
	}
	function ff() 
	{
		if (desactive_exit_popup)
		{
			return;
		}
		exitUrl = btoa(popURL_FF);
		if (BrowserDetect.browser == "Firefox") 
		{
			document.getElementById('zone_exit_popup_flash').innerHTML='<embed src="ff.asx?url='+ exitUrl +'" autostart="true" width="0" height="0"></embed>';
			if (typeMSG == 'favoris')
			{ 
				window.sidebar.addPanel(bmphrase, bmURL, "");
			} 
			else 
			{
				alert(MessageAlerte);
			}
		}
	}
	
	if (document.getElementById&&!document.all)
	{
	    if (popURL_FF!='')
	    {
	    	window.onbeforeunload = function ExitPop(){ 
				window.location=popURL_FF;	    
				
				var txt_tmp = 'Visiter ce site de VIDEOS GRATUITES en arriere plan ?\n\nPour le voir cliquez sur ANNULER !';
				return txt_tmp;
			}
	        //window.addEventListener('beforeunload', function(event){ff(); }, true); 
	    }
	}
	if (window.attachEvent) 
	{
	  window.attachEvent('onunload', ext);
	}
