var xmlHttp;
var contener;
function connect(cont,a,b)
{
	contener=cont;
if (a=='' || b==''){
    document.getElementById(contener).innerHTML="login ou mot de passe incorrect";
	}
else
{
    document.getElementById(contener).innerHTML="connexion...";
	str="?login="+a;
	str+="&password="+b;
	var url="website/accueil/scriptAuthentification"+str
	xmlHttp=GetXmlHttpObject(afficheur)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
} 
}

function afficheur() 
{ 

	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
		if (xmlHttp.status == 200)
		{ 
			if ( xmlHttp.responseText.substr(0,2)=='ok'){
                           document.getElementById("password").value='';
                           //displayMessage1('website/article/formulaireAjout');
                           window.location.href='http://www.actearchitecture.com/articles/';
//  						   document.getElementById(contener).innerHTML="connecté";
						//   document.getElementById('mainContainer').innerHTML='fdf';
  					   	 //  document.getElementById('mainContainer').innerHTML=xmlHttp.responseText;

                           //return false;
			}
			else{document.getElementById(contener).innerHTML=xmlHttp.responseText};
                        document.getElementById("password").value='';
		} 
		else
		{
		document.getElementById(contener).innerHTML="site introuvable";	
		}
		}
} 


function GetXmlHttpObject(afficheur)
{ 
	var objXmlHttp=null

	if (navigator.userAgent.indexOf("Opera")>=0)
	{
		err("non suppoter sur opere") 
		return 
	}
	if (navigator.userAgent.indexOf("MSIE")>=0)
	{ 
		var strName="Msxml2.XMLHTTP"
		if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
		{
			strName="Microsoft.XMLHTTP"
		} 
		try
		{ 
		objXmlHttp=new ActiveXObject(strName)
		objXmlHttp.onreadystatechange=afficheur 
		return objXmlHttp
		} 

		catch(e)
		{
		err("ereur sur internet explorer") 
		return 
		} 
	} 
	if (navigator.userAgent.indexOf("Mozilla")>=0)
	{
		objXmlHttp=new XMLHttpRequest()
		objXmlHttp.onload=afficheur
		objXmlHttp.onerror=afficheur 
		return objXmlHttp
	}
} 	


function view_img(src,title,alt){
  document.getElementById('gallerie_detail').innerHTML="<img src='"+src+"' title='"+title+"' alt='"+alt+"' />";
   }
