function getPFImage(idPortfolio, lang)
{	
    //alert(idPortfolio);	
    var xmlhttp = getXmlHttpRequest();
    if (xmlhttp != null && idPortfolio != null && idPortfolio != "" && lang != null && lang != "")
	{
	    //alert("iii");
	    var imgAvant = document.getElementById('imageAvant'); 
	    var imgApres = document.getElementById('imageApres'); 
	    var imgAvantZoom = document.getElementById('imageAvantZoom'); 
	    var imgApresZoom = document.getElementById('imageApresZoom'); 	    
	    var descPortfolio = document.getElementById('descPortfolio'); 
	    var url = "/portfolio/_getData.php?idpf=" + idPortfolio + "&lang=" + lang;
	  
	    xmlhttp.open('GET',url,true);
	    xmlhttp.setRequestHeader("Content-Type","text/xml");
        
         $("#imageAvant").fadeIn("slow");
         $("#imageApres").fadeIn("slow"); 
        
	    xmlhttp.onreadystatechange = function(data) {
            if (xmlhttp.readyState == 4 && xmlhttp.status == 200) 
            {      
              //alert(xmlhttp.responseText);               
               imgAvant.src = xmlhttp.responseXML.getElementsByTagName("avant")[0].firstChild.nodeValue;              
               imgApres.src = xmlhttp.responseXML.getElementsByTagName('apres')[0].firstChild.nodeValue; 
               
               imgAvantZoom.href = xmlhttp.responseXML.getElementsByTagName("avantZoom")[0].firstChild.nodeValue;              
               imgApresZoom.href = xmlhttp.responseXML.getElementsByTagName('apresZoom')[0].firstChild.nodeValue; 
               
               //alert(xmlhttp.responseXML.getElementsByTagName('descPortfolio')[0].firstChild.nodeValue)          	    
        	   descPortfolio.innerHTML = xmlhttp.responseXML.getElementsByTagName('descPortfolio')[0].firstChild.nodeValue;
        	    
        	  //$("#imageAvant").fadeIn("slow");
              //$("#imageApres").fadeIn("slow");        	    
            }
        }   	
	    xmlhttp.send(null);
	 }
}

function doFade(divId)
{
    $("#" + divId).fadeIn("slow", function(){
        
    });
}

function getXmlHttpRequest() 
{
    try 
    {
        return new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e) 
    {
        try 
        {
            return new XMLHttpRequest();
        }
        catch (e) 
        {
            alert("XMLHttpRequest not supported");
	        return null;  
        } 
    }		 
}
