/////////////////////////////////////////////////////////////////////////////
// Au chargement de la fenêtre, appel de la fonction "correctPNG" pour IE  //
/////////////////////////////////////////////////////////////////////////////
//window.attachEvent("onload", correctPNG);

/////////////////////////////////////////////////////////////
// Pour que le fond d'écran ne tarde pas trop a s'afficher //
/////////////////////////////////////////////////////////////
function MM_preloadImages() {
	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];}}
}

///////////////////////////
// Pour imprimer le plan //
///////////////////////////
//function printMap() {	
//	f = window.open("plan.html", "", "width=600,height=600,toolbar=1,menubar=1,scrollbars=0,resizable=0,status=0,location=0,left=10,top=10");
//	f.window.print();
//}
function openMap(c) {
	f = window.open(c, "", "width=600,height=600,toolbar=1,menubar=1,scrollbars=0,resizable=0,status=0,location=0,left=10,top=10");
}
function printMap() {	
	window.print();
}


///////////////////////////////////
// Pour imprimer le plan anglais //
///////////////////////////////////
function printMap_uk() {	
	f = window.open("access map.html", "", "width=600,height=600,toolbar=1,menubar=1,scrollbars=0,resizable=0,status=0,location=0,left=10,top=10");
	f.window.print();
}

/////////////////////////////////////////////////////////////////////////
// Permet d'afficher correctment les PNGs transparents avec IE 5.5 & 6 //
/////////////////////////////////////////////////////////////////////////
//function correctPNG() {
//   var arVersion = navigator.appVersion.split("MSIE");
//   var version = parseFloat(arVersion[1]);
//   if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
//   {
//      for(var i=0; i<document.images.length; i++)
//      {
//         var img = document.images[i];
//         var imgName = img.src.toUpperCase();
//		 if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
//         {
//            var imgID = (img.id) ? "id='" + img.id + "' " : "";
//            var imgClass = (img.className) ? "class='" + img.className + "' " : "";
//            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
//            var imgStyle = "display:inline-block;" + img.style.cssText ;
//            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
//            var strNewHTML = "<span " + imgID + imgClass + imgTitle
//            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
//            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
//            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" ;
//            img.outerHTML = strNewHTML;
//            i = i-1;
//         }
//      }
//   }    
//}

/////////////////////////////////////////////////////////////////////////////////////////////////
// Permet d'ouvrir une image dans une nouvelle fenetre, avec les bonnes dimensions OU avec les //
// dimensions maximales de l'ecran suivant sa resolution                                       //
/////////////////////////////////////////////////////////////////////////////////////////////////
function openPic(id, w, h){
	if (screen.height < h) {
		h == screen.height;
	}
	if (screen.width < w){
		w == screen.width;
	}
	var l = screen.width - w - 12;
//	self.focus();
	window.open('_images/'+id+'.jpg', id, 'menubar=0,toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=1,copyhistory=0,top=0,left='+l+',width='+w+',height='+h);
}

function openPic_png(id, w, h){
	if (screen.height < h) {
		h == screen.height;
	}
	if (screen.width < w){
		w == screen.width;
	}
	var l = screen.width - w - 10;
//	self.focus();
	window.open('_images/'+id+'.png', id, 'menubar=0,toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=1,copyhistory=0,top=0,left='+l+',width='+w+',height='+h);
}

/////////////////////////////////////////////////////////////////////////////////////
// Permet d'ouvrir une fenetre contenant la definition d'un terme un peu complique //
/////////////////////////////////////////////////////////////////////////////////////
function help(url){
	window.open(url, 'definition', 'menubar=0,toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=1,copyhistory=0,width=400,height=250');
}

//////////////////////////////////////////////////////////////////////////////////////////
// Permet d'ouvrir une nouvelle fenetre en plein ecran avec la presentation du logiciel //
//////////////////////////////////////////////////////////////////////////////////////////
function openlogtsp2() {
	window.open('_logiciel/tsp.htm', 'presentationtsp', 'menubar=0,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,copyhistory=0,width='+screen.width+',height='+screen.height+',left=0,top=0');
}
function openlogtsp() {
	window.open('_logiciel/tsp_fr.htm', 'presentationtsp', 'menubar=0,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,copyhistory=0,width='+screen.width+',height='+screen.height+',left=0,top=0');
}