function vjx_write_div( aDivID , aText )
{
	if ( document.getElementById(aDivID) )
	{ document.getElementById(aDivID).innerHTML = aText; }
	else alert('Element '+aDivID+' non trouvé !');
}
//---------------------------------------------------------------

function vjx_get_xobject()
{
	if(window.XMLHttpRequest) // FIREFOX
    { return new XMLHttpRequest(); }
	else if(window.ActiveXObject) // IE
    { return new ActiveXObject("Microsoft.XMLHTTP"); }
    else return(false);
}
//---------------------------------------------------------------

	
function vjx_load_file( aFilename )
{
    vXObject=vjx_get_xobject();
	if (vXObject)
	{
     	vXObject.open("GET", aFilename, false);
     	vXObject.send(null);
     	if( vXObject.readyState == 4) 
		{ return( vXObject.responseText ); }
		else return(false);
	}
	else 
	{
		//alert ('Objet XMLHttpRequest non assigné!');
		return(false); 
	}
}
//---------------------------------------------------------------

function vjx_load_div(aDivID,aFilename,aShow)
{
 	vjx_write_div(aDivID,'Chargement en cours...');
	vText=vjx_load_file(aFilename);
	//alert(vText);
	vjx_write_div(aDivID,vText);
	if (aShow)
	{ vjx_show_div(aDivID); }
}
//---------------------------------------------------------------

function vjx_show_div(aDivID)
{
	var vDiv = document.getElementById(aDivID);
	if (vDiv)
	{ vDiv.style.display = ''; }
}
//---------------------------------------------------------------

function vjx_hide_div(aDivID)
{
	var vDiv = document.getElementById(aDivID);
	if (vDiv)
	{ vDiv.style.display = 'none'; }
}
//---------------------------------------------------------------


function vjx_div_visible($aDivID,$aVisible)
{
	//alert ("vjx_div_visible($aDivID,$aVisible)");
	if ($aVisible)
	{ vjx_show_div($aDivID); }
	else
	{ vjx_hide_div($aDivID); }
}
//---------------------------------------------------------------

function vjx_div_is_visible(aDivID)
{
	var vDiv = document.getElementById(aDivID);
	if (vDiv)
	{
		return ( vDiv.style.display != 'none' );
	}
	else return (false);
}
//---------------------------------------------------------------

function vjx_copy_values( $aFromID , $aToID )
{
	//alert ("copier "+$aFromID+" vers "+$aToID);
	$vFrom = document.getElementById($aFromID);
	$vTo = document.getElementById($aToID)
	$vTo.value = $vFrom.value;	
}
//---------------------------------------------------------------

function vjx_isIE()
{
	return navigator.userAgent.indexOf('MSIE') != -1;
}

/*function MM_checkBrowser(NSvers,NSpass,NSnoPass,IEvers,IEpass,IEnoPass,OBpass,URL,altURL) 
{ //v5.0
  var newURL='', userAgent=navigator.userAgent, version=0;
  if (userAgent.indexOf('Netscape') != -1) 
  {
  	version = parseFloat(userAgent.substring(userAgent.indexOf('Netscape')+9,userAgent.length));
    if (version >= NSvers) 
	{
		if (NSpass>0)
			newURL=(NSpass==1)?URL:altURL;
	}
    else 
	{
		if (NSnoPass>0)
			newURL=(NSnoPass==1)?URL:altURL;
	}
  } 
  else
  {
  	if (userAgent.indexOf('MSIE') != -1) 
	{
  		version = parseFloat(userAgent.substring(userAgent.indexOf('MSIE')+4,userAgent.length));
    	if (version >= IEvers)
		{
			if (IEpass>0) newURL=(IEpass==1)?URL:altURL;
		}
    	else 
		{
			if (IEnoPass>0) newURL=(IEnoPass==1)?URL:altURL;
		}
  	} 
	else 
	{
		if (OBpass>0)
		{
			newURL=(OBpass==1)?URL:altURL;
		}
	}
  	if (newURL) 
	{ 
		window.location=unescape(newURL); 
		document.MM_returnValue=false; 
	}
}*/


