function Pause(argMilliSec) {
	//
	// Pause, en millisecondes
	//
	deb = Date.parse(Date());  
	fin = deb + argMilliSec;
	while(deb < fin){
	  	deb = Date.parse(Date()) ; 
		}
	}

function openVoyageAndGotoPOld(argNumP)
//
// Ouvre le catalogue Voyage dans une fenêtre popup en un seul exemplaire.	
// Entrée :
//	  - argNumP : n° de la page à atteindre
//
{
	URLStr = 'civoy_popup.htm?' + (new Date()).getTime();
	larg = 986;
	haut = 685;
	x = (screen.width/2)  - larg/2;
	y = (screen.height/2) - haut/2;
	var WinId = window.open('', 'CIVOY', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,width='+larg+',height='+haut+',left='+x+', top='+y+',screenX='+x+',screenY='+y+'');
	if (WinId.location) {
		// Fermée ?
		 alert('1 :' + argNumP);

		if ( (WinId.location.href == '') || (WinId.location.href == 'about:blank') ) {
			alert('2 :' + argNumP);
			WinId.location.href = URLStr; 
			WinId.focus();
			Pause(3000);		// Laisse le temps au SWF d'être chargé
			 alert('3 :' + argNumP);
			WinId.window.document.getElementById('CIVoyage').SetVariable("iJSPagenum", argNumP);
			}
		else { 
			// Déjà active 
			WinId.focus();
			WinId.WinShow();
			WinId.window.document.getElementById('CIVoyage').SetVariable("iJSPagenum", argNumP);
			alert('4 :' + argNumP);
			}

		}	
}
function openVoyageAndGotoPTest2(argNumP)
//
// Ouvre une fenêtre popup en un seul exemplaire quelque soit la fenêtre.	
//
{

 	URLStr =  'civoy_popup.asp?pageNum='+ argNumP +'&'+ (new Date()).getTime();
	larg = 986;
	haut = 685;
	x = (screen.width/2)  - larg/2;
	y = (screen.height/2) - haut/2;
    if ( typeof( WinId ) != 'undefined' ) {
      if ( ! WinId.closed ) {
          WinId.focus();
        }
        else {
		//alert('2 :' + argNumP);
         CIVOY.closed();
		 WinId = window.open(URLStr, 'CIVOY', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,width='+larg+',height='+haut+',left='+x+', top='+y+',screenX='+x+',screenY='+y+'');
		 Pause(3000);		// Laisse le temps au SWF d'être chargé
		 
		 //WinId.window.document.getElementById('CIVoyage').SetVariable("iJSPagenum", argNumP);
		 
         }
    }
    else {
	//alert('1 :' + argNumP);
     WinId = window.open(URLStr, 'CIVOY', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,width='+larg+',height='+haut+',left='+x+', top='+y+',screenX='+x+',screenY='+y+'');
     WinId.focus();
	 Pause(3000);
	 
	 //WinId.window.document.getElementById('CIVoyage').SetVariable("iJSPagenum", argNumP);
	
    }
}

//var WinId = null;

function openVoyageAndGotoPTest2(argNumP)
//
// Ouvre le catalogue Voyage dans une fenêtre popup en un seul exemplaire.

// Entrée :
//	  - argNumP : n° de la page à atteindre
//
{
	URLStr =  'civoy_popup.asp?pageNum='+ argNumP +'&'+ (new Date()).getTime();
	larg = 986;
	haut = 685;
	x = (screen.width/2)  - larg/2;
	y = (screen.height/2) - haut/2;
	if (WinId != null) {
		WinId.close();
		WinId = null;
		}
	WinId = window.open(URLStr, 'CIVOY','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,width='+larg+',height='+haut+',left='+x+',top='+y+',screenX='+x+',screenY='+y+'');
	WinId.focus();
	Pause(3000);		// Laisse le temps au SWF d'être chargé
	
//WinId.window.document.getElementById('CIVoyage').SetVariable("iJSPagenum",argNumP);
}
function openVoyageAndGotoP(argNumP)
//
// Ouvre le catalogue Voyage dans une fenêtre popup en un seul exemplaire.

// Entrée :
//	  - argNumP : n° de la page à atteindre
//
{

	URLStr = 'civoy_popup.asp?pageNum='+ argNumP +'&'+ (new Date()).getTime();

	larg = 986;
	haut = 685;
	h = 750;
	x = (screen.width/2)  - larg/2;
	y = (screen.height/2) - h/2;
	
	if (GetCookie("civoyage")=="true")
	{
		arrParam = navigator.appVersion.split(";");
		//alert("param :" + arrParam);
		sOS = "Windows NT 5.0";
		sParam = arrParam[2];
		//alert("param2 :" + arrParam[2]);
		if(arrParam[2]==sOS)
		{
			if ( (WinId.location.href == '') || (WinId.location.href == 'about:blank') ) 
			{
				URLStr =  'civoy_popup.asp?pageNum='+ argNumP +'&'+ (new Date()).getTime();

				WinId = window.open('', 'CIVOY','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,width='+larg+',height='+haut+',left='+x+',top='+y+',screenX='+x+',screenY='+y+'');
				WinId.location.href = URLStr; 
				WinId.focus();
				WinId.WinShow();
				Pause(3000);		// Laisse le temps au SWF d'être chargé
	
				WinId.window.document.getElementById('CIVoyage').SetVariable("iJSPagenum", argNumP);
			}
			else
			{
				WinId = window.open('', 'CIVOY','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,width='+larg+',height='+haut+',left='+x+',top='+y+',screenX='+x+',screenY='+y+'');
				WinId.focus();
				WinId.WinShow();
				WinId.window.document.getElementById('CIVoyage').SetVariable("iJSPagenum", argNumP);
			}
		}
		else
		{
	
		WinId = window.open('', 'CIVOY','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,width='+larg+',height='+haut+',left='+x+',top='+y+',screenX='+x+',screenY='+y+'');
		WinId.focus();
		WinId.WinShow();
		WinId.window.document.getElementById('CIVoyage').SetVariable("iJSPagenum", argNumP);
		}

	}
	else
	{
		WinId = window.open(URLStr, 'CIVOY','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,width='+larg+',height='+haut+',left='+x+',top='+y+',screenX='+x+',screenY='+y+'');
		WinId.focus();
	}

	

}

function openVoyageAndGotoPFiche(argNumP, sSite)
//
// Ouvre le catalogue Voyage dans une fenêtre popup en un seul exemplaire.

// Entrée :
//	  - argNumP : n° de la page à atteindre
//
{
	if(sSite == "ete")
	{
		URLStr = 'http://'+document.location.host+'/voyages/ete2007/civoy_popup.asp?pageNum='+ argNumP +'&'+ (new Date()).getTime();
	}
	else
	{
		URLStr =  'http://'+document.location.host+'/voyages/hiver2007/civoy_popup.asp?pageNum='+ argNumP +'&'+ (new Date()).getTime();
	}
	larg = 986;
	haut = 685;
	h = 750;
	x = (screen.width/2)  - larg/2;
	y = (screen.height/2) - h/2;
	
	if (GetCookie("civoyage")=="true")
	{
		arrParam = navigator.appVersion.split(";");
		//alert("param :" + arrParam);
		sOS = "Windows NT 5.0";
		sParam = arrParam[2];
		//alert("param2 :" + arrParam[2]);
		if(arrParam[2]==sOS)
		{
			if ( (WinId.location.href == '') || (WinId.location.href == 'about:blank') ) 
			{
				if(sSite == "ete")
				{
					URLStr = 'http://'+document.location.host+'/voyages/ete2007/civoy_popup.asp?pageNum='+ argNumP +'&'+ (new Date()).getTime();
				}
				else
				{
					URLStr =  'http://'+document.location.host+'/voyages/hiver2007/civoy_popup.asp?pageNum='+ argNumP +'&'+ (new Date()).getTime();
				}
				WinId = window.open('', 'CIVOY','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,width='+larg+',height='+haut+',left='+x+',top='+y+',screenX='+x+',screenY='+y+'');
				WinId.location.href = URLStr; 
				WinId.focus();
				WinId.WinShow();
				Pause(3000);		// Laisse le temps au SWF d'être chargé
	
				WinId.window.document.getElementById('CIVoyage').SetVariable("iJSPagenum", argNumP);
			}
			else
			{
				WinId = window.open('', 'CIVOY','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,width='+larg+',height='+haut+',left='+x+',top='+y+',screenX='+x+',screenY='+y+'');
				WinId.focus();
				WinId.WinShow();
				WinId.window.document.getElementById('CIVoyage').SetVariable("iJSPagenum", argNumP);
			}
		}
		else
		{
	
		WinId = window.open('', 'CIVOY','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,width='+larg+',height='+haut+',left='+x+',top='+y+',screenX='+x+',screenY='+y+'');
		WinId.focus();
		WinId.WinShow();
		WinId.window.document.getElementById('CIVoyage').SetVariable("iJSPagenum", argNumP);
		}

	}
	else
	{
		WinId = window.open(URLStr, 'CIVOY','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,width='+larg+',height='+haut+',left='+x+',top='+y+',screenX='+x+',screenY='+y+'');
		WinId.focus();
	}

}

function openVoyageAndGotoPT(argNumP)
//
// Ouvre le catalogue Voyage dans une fenêtre popup en un seul exemplaire.

// Entrée :
//	  - argNumP : n° de la page à atteindre
//
{
	URLStr =  'civoy_popup.asp?pageNum='+ argNumP +'&'+ (new Date()).getTime();
	larg = 986;
	haut = 685;
	h = 750;
	x = (screen.width/2)  - larg/2;
	y = (screen.height/2) - h/2;

	if (GetCookie("civoyage")=="true")
	{
			
		WinId = window.open('', 'CIVOY','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,width='+larg+',height='+haut+',left='+x+',top='+y+',screenX='+x+',screenY='+y+'');
		WinId.focus();
		WinId.WinShow();
		WinId.window.document.getElementById('CIVoyage').SetVariable("iJSPagenum", argNumP);
	

	}
	else
	{
		
		WinId = window.open(URLStr, 'CIVOY','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,width='+larg+',height='+haut+',left='+x+',top='+y+',screenX='+x+',screenY='+y+'');
		WinId.focus();
		
	}

	
//WinId.window.document.getElementById('CIVoyage').SetVariable("iJSPagenum",argNumP);
}


// Get et Set Cookie 
function GetCookie(name)
{
 var MyCookie = document.cookie;
 var i = 0;
 name = name + '=';
 var LenName = name.length;
 while (i < MyCookie.length)
 {
  if (MyCookie.substring(i, LenName + i) == name)
  {
   var LastDot = MyCookie.indexOf (";", LenName + i);
   if (LastDot == -1) LastDot = MyCookie.length;
   return unescape(MyCookie.substring(LenName + i,LastDot));
  }
  else
  {
   i++;
  }
 }
 return null;
}
 
function setCookie (name, value, expires) {
 if (!expires)
 {document.cookie = name + "=" + escape(value) + "; path=/";}
 else
 {document.cookie = name + "=" + escape(value) + "; expires=" + expires.toGMTString() +  "; path=/";}
 
}