// JavaScript Document

//The following content is Copyright ©2005 Advanced Data Network.
//Please contact Advanced Data Network by e-mail at adn@adnsa.com if you want to use a part or the whole of it.


function test()
{
//alert("fonction test Cata");
document.body.style.overflow="hidden";

var query = self.location.search;
if (query.length>0){
var repertoire="";
var pf=-1;
var pf1 = query.indexOf("file_tec=");
var pf2 = query.indexOf("file_ins=");
if (pf1!=-1){
 repertoire = "fichtech";
 pf=pf1;
 }
 if (pf2!=-1){
 repertoire = "instruct";
 pf=pf2;
 }

   if ((pf1!=-1) || (pf2!=-1)){
   fichier = query.substring(pf+9);
  
    if (fichier.length>0){
	 langue = fichier.substring(0,2);
      		if (langue=="fr"){
	             self.location.href="/site/pdf_"+repertoire+"/"+fichier;
	   		}
	 		 else{
	 			 self.location.href="/site_"+langue+"/pdf_"+repertoire+"/"+fichier;
	   		 }
		return;	 
    }//length
   }//pf
 

}//query.length

var nav = navigator.userAgent;
var uri= document.location.toString();
var pos = uri.lastIndexOf("/");
var nom="";
var URL="";
if (pos!=-1)
{
var pos2 = uri.indexOf(".htm",pos);
nom=uri.substring(pos+1,pos2);
URL = uri.substring(0,pos+1)+nom+".pdf";
var w=eval(document.body.clientWidth-30);
var h=eval(document.body.clientHeight);

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//patch NL 240708
//Determine la versione de l'explorateur. Si different de Netscape, alors, applique procedure d'integration des PDF via la balise IMG.

// Cherche "SAFARI" dans le navigator.useragent. S'il trouve, isSA est vrai.
pn = nav.toLowerCase().indexOf("safari");
if (pn!=-1){
	isSA = true;
}else{
	isSA = false;
}

	
//Dans l'hypothese ou l'on est sous mac, MacPPC et Mac Intel sont vrai.
if ((navigator.platform == "MacPPC") || (navigator.platform == "MacIntel")) {
	//On verifie donc que l'on est sous SAFARI.

	if (isSA == true){
		//Dans ce cas, on integre les pdf via la methode traditionnelle.
		document.getElementById("ft").innerHTML="<CENTER><EMBED SRC=\""+URL+"\" WIDTH=\""+w+"\" HEIGHT=\""+h+"\"></EMBED></CENTER>";
	//si on est PAS sous SAFARI
	} else {

		//Dans ce cas, on applique la méthode IMG pour l'intégration des PDF.
		document.getElementById("ft").innerHTML="<CENTER><EMBED SRC=\""+URL+"\" WIDTH=\""+w+"\" HEIGHT=\""+h+"\"></EMBED></CENTER>";

	}
	
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//CODE d'origine.
//if (navigator.platform == "MacPPC") {
//document.cookie="url="+uri+"#";
//safari est capable d'integrer du PDF seulementsi c'est dans une balise IMG !!!!
//document.write("<a href=\""+URL+"\"><img src=\""+URL+"\" id=\"img_pdf\" width=\"100%\" border=\"0\"></a>");
//}
else
{
// Plate forme win
var nav_name = navigator.appName;	
		if(nav_name=="Microsoft Internet Explorer"){
			document.getElementById("ft").innerHTML="<CENTER><EMBED SRC=\""+URL+"\" WIDTH=\""+w+"\" HEIGHT=\""+h+"\"></EMBED></CENTER>";
		} else {
		   document.location.href = URL;  
		   
		}
}
}
}