//var encours = new Image(); encours.src = '../../img/attente.gif'; encours.width='140'; encours.height='40';
//var fin = new Image(); fin.src = '../../img/attentefini.gif'; fin.width='0'; fin.height='0'; 
//var nav=navigator.appName;

var myEnv = new Environment();

function afficheImgAttenteBo() {
 if (myEnv.isWin){
	document.write('<div id="tabattente"><layer id="tabattente" visibility="show"><table border="0" width="100%" cellpadding="0" cellspacing="0"><tr><td align="center"><img src="../img/bo_attente.gif" border="0" name="searchStatus"></td></tr></table></layer></div>');
 }
}
function afficheImgAttenteFo() {
	 if (myEnv.isWin){
		document.write('<div id="tabattente"><layer id="tabattente" visibility="show"><table border="0" width="100%" cellpadding="0" cellspacing="0"><tr><td align="center"><img src="../img/fo_attente.gif" border="0" name="searchStatus"></td></tr></table></layer></div>');
	}
}
function afficheImgFini()
{
//alert(nav);
//alert(navigator.userAgenr);
//alert(navigator.appCodeName);
//alert(navigator.appVersion);

//    if (nav=="Microsoft Internet Explorer" || (nav=="Netscape" && navigator.appVersion>='5.0'))
   if (myEnv.isWin){
	    if (myEnv.isIE || (myEnv.isNSP && myEnv.navVersion>=5.0))
	    {
		    var tempColl    = document.getElementsByTagName('DIV');
	        var tempCollCnt = tempColl.length;
	        for (var i = 0; i < tempCollCnt; i++) 
	          if (tempColl[i].id == 'tabattente')
	            tempColl[i].style.display = 'none';
	    }
	    else
	    {
	        var theLayers  = document.layers;
	        var layersCnt  = theLayers.length;
	        for (var i = 0; i < layersCnt; i++) 
	    	  if (theLayers[i].id == 'tabattente')
	            theLayers[i].visibility   = 'hide';
	    }
	}
}

function afficheImgFiniRes()
{
//alert(nav);
//alert(navigator.userAgenr);
//alert(navigator.appCodeName);
//alert(navigator.appVersion);

//    if (nav=="Microsoft Internet Explorer" || (nav=="Netscape" && navigator.appVersion>='5.0'))
   if (myEnv.isWin){
	    if (myEnv.isIE || (myEnv.isNSP && myEnv.navVersion>=5.0))
	    {
		    var tempColl    = document.getElementsByTagName('DIV');
	        var tempCollCnt = tempColl.length;
	        for (var i = 0; i < tempCollCnt; i++) 
	          if (tempColl[i].id == 'tabattenteres')
	            tempColl[i].style.display = 'none';
	    }
	    else
	    {
	        var theLayers  = document.layers;
	        var layersCnt  = theLayers.length;
	        for (var i = 0; i < layersCnt; i++) 
	    	  if (theLayers[i].id == 'tabattenteres')
	            theLayers[i].visibility   = 'hide';
	    }
	}
}

function centrePopup(pRef, pIw, pIh) {
	pRef.moveTo((screen.width-pIw)/2, (screen.height-pIh)/2);
}

// change de page de liste de résultat (LD du bas)
function changePageBas(pBestPopup)
{
	if (pBestPopup)
	{
		this.window.location = document.forms[0].FLdPageBas.options[document.forms[0].FLdPageBas.selectedIndex].value;
	}
	else
	{
		for(i=0;i<document.formLdPageBas.elements[0].options.length;i++)
			if(document.formLdPageBas.elements[0].options[i].selected)
				this.window.location = document.formLdPageBas.elements[0].options[i].value;
	}
	//this.window.location = document.forms[0].elements[0].options[document.forms[0].elements[0].selectedIndex].value;
}

// change de page de liste de résultat (LD du haut)
function changePageHaut(pBestPopup)
{
	if (pBestPopup)
	{
		this.window.location = document.forms[0].FLdPageHaut.options[document.forms[0].FLdPageHaut.selectedIndex].value;
	}
	else
	{
		for(i=0;i<document.formLdPageHaut.elements[0].options.length;i++)
			if(document.formLdPageHaut.elements[0].options[i].selected)
				this.window.location = document.formLdPageHaut.elements[0].options[i].value;
	}
	//this.window.location = document.forms[0].elements[0].options[document.forms[0].elements[0].selectedIndex].value;
}



function zjump(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


function showCalendar(pSnomChampDate)
{
    //var h = 240; var l = 210;
	var h = 218; var l = 196;
    var posX = (screen.width-l)/2;
    var posY = (screen.height-h)/2;
    calend=window.open("../../js/cal.htm?input="+pSnomChampDate, 'calend', 'height='+h+',width='+l+',dependent=yes,resizable=no,toolbar=no,location=no,personalbar=no,status=no,menubar=no,statusbar=no,scrollbars=no,locationbar=no,title=no,titlebar=no,top='+posY+',left='+posX);
    calend.window.focus()
}


/*
function showCalendarFront(pSnomChampDate)
{
    var h = 240; var l = 210;
    var posX = (screen.width-l)/2;
    var posY = (screen.height-h)/2;
    calend=window.open("../../js/frontcal.htm?input="+pSnomChampDate, 'calend', 'height='+h+',width='+l+',dependent=yes,resizable=no,toolbar=no,location=no,personalbar=no,status=no,menubar=no,statusbar=no,scrollbars=no,locationbar=no,title=no,titlebar=no,top='+posY+',left='+posX);
    calend.window.focus()
}
*/
function showCalendarFront(pSnomChampDate, pDdefaut, pDmini, pDmaxi, pBafficheDateJour)
{
    var h = 245; var l = 210;
    var posX = (screen.width-l)/2;
    var posY = (screen.height-h)/2;
    calend=window.open("../../js/calendar.htm?input="+pSnomChampDate+"&datedefaut="+pDdefaut+"&datemini="+pDmini+"&datemaxi="+pDmaxi+"&affichedatejour="+pBafficheDateJour, 
						'calend', 
						'height='+h+',width='+l+',dependent=yes,resizable=no,toolbar=no,location=no,personalbar=no,status=no,menubar=no,statusbar=no,scrollbars=no,locationbar=no,title=no,titlebar=no,top='+posY+',left='+posX);
    calend.window.focus();
	centrePopup(calend, l, h);	
}


function openMyWindow(pStitle,pSURL)
{
    var l = 500;var h = 400; 
    var posX = (screen.width-l)/2;
    var posY = (screen.height-h)/2;
    mywin=window.open(pSURL, 
						pStitle, 
						'height='+h+',width='+l+',dependent=yes,resizable=yes,toolbar=no,location=no,personalbar=no,status=no,menubar=no,statusbar=no,scrollbars=yes,locationbar=no,title=no,titlebar=no,top='+posY+',left='+posX);
	mywin.window.focus();
	centrePopup(mywin, l, h);
}



//function afficheImgAttente()
//{
//    if(nav=="Microsoft Internet Explorer")
//    {
//    	document.write('<img border="0" name="searchStatus">');  
//    }
//    else
//    {
//    	document.write('<img border="0" width="1" height="1" name="searchStatus">');
//    }
//    bascule('searchStatus', encours);
//	
//}
//
//
//
//
//function bascule(from, to) 
//{ 
//	document[from].src = to.src; 
//}

