function fileF(fichier)
     { var xhr_object=null;
     if(window.XMLHttpRequest) // FIREFOX
          xhr_object = new XMLHttpRequest();
     else if(window.ActiveXObject) // IE
          xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
     else
          return(false);
     xhr_object.open("GET", fichier, false);
     xhr_object.send(null);
     if(xhr_object.readyState == 4) return(xhr_object.responseText);
     else return(false);
}
	 

function getWindowSize(){
  windowWidth =  window.innerWidth;
  windowWidth = (windowWidth)? windowWidth : document.documentElement.clientWidth;
  windowWidth = (windowWidth)? windowWidth : document.body.clientWidth;
  windowHeight =  window.innerHeight;
  windowHeight = (windowHeight)? windowHeight: document.documentElement.clientHeight;
  windowHeight = (windowHeight)? windowHeight: document.body.clientHeight;  
  return {'width': windowWidth, 'height': windowHeight};
}
/* function getWindowSize(){
  db=(!d.documentElement.clientWidth)?document.body:document.documentElement;  
  var windowWidth = (window.innerWidth)? window.innerWidth : db.clientWidth;
  var windowHeight = (window.innerHeight)? window.innerHeight: db.clientHeight;
  return {'width': windowWidth, 'height': windowHeight};
}*/

 
function getPageSize(){
  var windowSize = getWindowSize() ;
  var xScroll = document.body.scrollWidth;
  var yScroll = (window.innerHeight && window.scrollMaxY)? window.innerHeight + window.scrollMaxY : document.body.scrollHeight;
  var pageWidth = (xScroll < windowSize.width)? windowSize.width : xScroll;  
  var pageHeight = (yScroll < windowSize.height)? windowSize.height : yScroll;
  return {'width': pageWidth, 'height': pageHeight-1}; /*pageWidth-15*/
}


function getScrollPage(){
var x,y;
if (self.pageYOffset) // all except Explorer
{	x = self.pageXOffset;	y = self.pageYOffset;
}else if (document.documentElement && document.documentElement.scrollTop) // Explorer 6 Strict
{	x = document.documentElement.scrollLeft;	y = document.documentElement.scrollTop;
}else if (document.body) // all other Explorers
{	x = document.body.scrollLeft; y = document.body.scrollTop;  }
return {'width': x, 'height': y};
}

function alert1() { alert( getWindowSize().width + " " +   getWindowSize().height ) ;  }
function alert2() { alert( getPageSize().width + " " +   getPageSize().height ) ;  }
function alert3() { alert( getScrollPage().width + " " +   getScrollPage().height ) ;  }

function PopupCentrer(page,largeur,hauteur,options) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
} 



function fermerFicheF()
{
document.getElementById('infoF').innerHTML = "";
document.getElementById('fondF').style.display = "none";
document.getElementById('contenuF').style.display = "none";
document.getElementById('player2').style.visibility = "visible";  


document.getElementById('menu').style.visibility = "visible";  
document.getElementById('cache_menu').style.visibility = "visible";  

}	

function myFounisseur1( id ){
//document.getElementById('contenuF').style.display = "block";
 
document.getElementById('menu').style.visibility  = "hidden";  
document.getElementById('cache_menu').style.visibility  = "hidden";  
document.getElementById('player2').style.visibility = "hidden";  
 
document.getElementById('contenuF').style.height = (getWindowSize().height -55 )+"px" ;
document.getElementById('fondF').style.width = "100%"; // getPageSize().width +"px";
document.getElementById('fondF').style.height = getPageSize().height +"px" ;
document.getElementById('fondF').style.display = "block";

//document.getElementById('infoF').style.left  = (getScrollPage().width - 450/2) +"px";
document.getElementById('contenuF').style.top = (getScrollPage().height + 45) +"px" ;

//document.getElementById('infoF').innerHTML = "<img align='center' src='images/picto/loading.gif' border='0' />";

 
document.getElementById('infoF').innerHTML =  fileF("fiche_fournisseur2.php?id="+id);
document.getElementById('fondF').style.display = "block";
document.getElementById('contenuF').style.display = "block";
}	
function produitdufournisseur( id ){
//document.getElementById('contenuF').style.display = "block";
fermerFicheF();
document.getElementById('menu').style.visibility  = "hidden";  
document.getElementById('cache_menu').style.visibility  = "hidden";  
document.getElementById('player2').style.visibility = "hidden";  
 
document.getElementById('contenuF').style.height = (getWindowSize().height -55 )+"px" ;
document.getElementById('fondF').style.width = "100%"; // getPageSize().width +"px";
document.getElementById('fondF').style.height = getPageSize().height +"px" ;
document.getElementById('fondF').style.display = "block";

//document.getElementById('infoF').style.left  = (getScrollPage().width - 450/2) +"px";
document.getElementById('contenuF').style.top = (getScrollPage().height + 45) +"px" ;

//document.getElementById('infoF').innerHTML = "<img align='center' src='images/picto/loading.gif' border='0' />";

 
document.getElementById('infoF').innerHTML =  fileF("produitdufournisseur.php?id="+id);
document.getElementById('fondF').style.display = "block";
document.getElementById('contenuF').style.display = "block";
}
function myFounisseur2( url ){
//document.getElementById('contenuF').style.display = "block";
 
document.getElementById('contenuF').style.height = (getWindowSize().height -55 )+"px" ;
document.getElementById('fondF').style.width = "100%"; // getPageSize().width +"px";
document.getElementById('fondF').style.height = getPageSize().height +"px" ;
document.getElementById('fondF').style.display = "block";

//document.getElementById('infoF').style.left  = (getScrollPage().width - 450/2) +"px";
document.getElementById('contenuF').style.top = (getScrollPage().height + 45) +"px" ;

//document.getElementById('infoF').innerHTML = "<img align='center' src='images/picto/loading.gif' border='0' />";

 
document.getElementById('infoF').innerHTML =  fileF(url);
document.getElementById('fondF').style.display = "block";
document.getElementById('contenuF').style.display = "block";
return false;
}	
	 
function affListeProduit( id )
{ 	

//alert( document.getElementById('lpf1').innerHTML  );
  document.getElementById('voirListeProd1').innerHTML =  "&nbsp;";
  document.getElementById('lpf1').innerHTML =  fileF("listeProduitsVIC.php?id="+id);
	
	//document.getElementById('lpf1').innerHTML = " Ruddy" ;
}


function MM_preloadImagesF1() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
