//Personalisation
// Modify "getSiteHeader" for logo
// Modify "getToolBarButtons" for flags with other languages

//-------------------------------------------------------------------------------------
function printcontent() {
	var printDate = new Date();
	var printDateStr = "";
	switch (getlng().toUpperCase()){
	case "FR" :
		printDateStr = "Impression : " + printDate.getDate() + "/" + (printDate.getMonth()+1) + "/" + printDate.getFullYear();
 		break;
	case "EN" :
		printDateStr = "Print : "  + (printDate.getMonth()+1) + "/" + printDate.getDate() + "/" + printDate.getFullYear();
 		break;
	case "NL" :
		printDateStr = "Print : " + printDate.getDate() + "/" + (printDate.getMonth()+1) + "/" + printDate.getFullYear();
 		break;
	}
   test = window.open ("","_blank","height=550,width=750,top=0,left=0,scrollbars=yes");
   test.document.open ("text/html","replace");
   test.document.write("<html>");
   test.document.write("<body bgcolor='FFFFFF'>");
   test.document.write("</body></html>");
   test.document.close();
   test.document.body.innerHTML = printZone.innerHTML + "<span class='txtCopyright'><br>" + left(document.URL, document.URL.length-1) + "<BR>" + printDateStr + "</span>";
   //test.document.body.printButton.src="";
   
   for ( i = 0; i < document.styleSheets.length; i++ )
   {
    test.document.createStyleSheet(document.styleSheets(i).href);
   }
   test.print();
   test.close();
}

//----------------------------------------------------
function getlastmodified () {
var lastModified = "";
dateMod = document.fileModifiedDate;
switch (getlng().toUpperCase()){
	case "FR" :
		lastModified = dateMod.substring (3, 5) + "." + dateMod.substring (0, 2) + "." + dateMod.substring (6, 10) + "&nbsp;&nbsp;&nbsp;" + dateMod.substring(11,16)
 		break;
	case "EN" :
		lastModified = left(dateMod, 16);
 		break;
	case "NL" :
		lastModified = dateMod.substring (3, 5) + "." + dateMod.substring (0, 2) + "." + dateMod.substring (6, 10) + "&nbsp;&nbsp;&nbsp;" + dateMod.substring(11,16)
 		break;
	}
	return lastModified;
}

//----------------------------------------------------
function gettoolbarbuttons() {
	var printDate = new Date();
	var printDateStr = "";

 	document.write("<div align='right'><table cellpadding=0 cellspacing=0 border=0 class=dateHP><tr><td valign=middle>");

	switch (getlng().toUpperCase()){
	case "FR" :
		printDateStr = printDate.getDate() + "&nbsp;/&nbsp;" + (printDate.getMonth()+1) + "&nbsp;/&nbsp;" + printDate.getFullYear();
 		break;
	case "EN" :
		printDateStr = (printDate.getMonth()+1) + "&nbsp;/&nbsp;" + printDate.getDate() + "&nbsp;/&nbsp;" + printDate.getFullYear();
 		break;
	case "SP" :
		printDateStr = printDate.getDate() + "&nbsp;/&nbsp;" + (printDate.getMonth()+1) + "&nbsp;/&nbsp;" + printDate.getFullYear();
 		break;
	}
	document.write ("&nbsp;"+ printDateStr + "&nbsp;</td>");
//	document.write ("<td valign='middle'>");
//	document.write("<a href='" + getName() +"_fr.php'><img src='../../../technics/tech_images/tabs/france_flag.gif' width='18' height='12' border='0'></a>&nbsp;");
//	document.write("<a href='"+ getName() +"_en.php'><img src='../../../technics/tech_images/tabs/english_flag.gif' width='18' height='12' border='0'></a>&nbsp;");
//	document.write("<a href='"+ getName() +"_sp.php'><img src='../../../technics/tech_images/tabs/spain_flag.gif' width='18' height='12' border='0' ></a>");
//  document.write("</td>");
	document.write("</tr></table></div>");
//	gettoolsbuttons();
}

//----------------------------------------------------
function gettoolsbuttons() {
 	document.write("<div align='right'><table cellpadding=1 cellspacing=0 border=0 class=tools valign=bottom><tr><td>&nbsp;");
	switch (getlng().toUpperCase()){
	case "FR" :
//	    document.write("<a href='../../a_outils/b_outils/chercher.php?lng=" + getlng() + "' target='_self'><img src='../../../technics/tech_images/tabs/btn_search_fr.gif' border='0' width='73' height='21' alt=' chercher ' ></a>&nbsp;&nbsp;"); 
	    document.write("<a href='../../a_outils/b_outils/sitemap.php?lng=" + getlng() + "' target='_self'><img src='../../../technics/tech_images/tabs/btn_sitemap_fr.gif' border='0' width='69' height='21' alt=' plan du site '></a>"); 
//	    document.write("&nbsp;<a href='../../a_tools/b_tools/options.php?lng=" + getlng() + "' target='_self'><img src='../../../technics/tech_images/tabs/btn_custom_fr.gif' border='0' width='100' height='21' alt=' personnaliser '></a>&nbsp;"); 
 		break;
	case "EN" :
	    document.write("<a href='../../a_tools/b_tools/tools_search_" + getlng() + ".php' target='_self'><img src='../../../technics/tech_images/tabs/btn_search_en.gif' border='0' width='65' height='21' alt=' search '></a>&nbsp;"); 
	    document.write("&nbsp;<a href='../../a_tools/b_tools/tools_site_" + getlng() + ".php' target='_self'><img src='../../../technics/tech_images/tabs/btn_sitemap_en.gif' border='0' width='68' height='21' alt=' sitemap '></a>&nbsp;"); 
    	document.write("&nbsp;<a href='../../a_tools/b_tools/tools_opt_" + getlng() + ".php' target='_self'><img src='../../../technics/tech_images/tabs/btn_custom_en.gif' border='0' width='84' height='21' alt=' options '></a>&nbsp;"); 
 		break;
	case "SP" :
	    document.write("<a href='../../a_tools/b_tools/tools_search_" + getlng() + ".php' target='_blank'><img src='../../../technics/tech_images/tabs/search.gif' border='0' width='17' height='15' alt = ' spain '></a>&nbsp;"); 
	    document.write("&nbsp;<a href='../../a_tools/b_tools/tools_site_" + getlng() + ".php' target='_self'><img src='../../../technics/tech_images/tabs/sitemap.gif' border='0' width='18' height='16' alt=' spain '></a>&nbsp;"); 
	    document.write("&nbsp;<a href='../../a_tools/b_tools/tools_opt_" + getlng() + ".php' target='_blank'><img src='../../../technics/tech_images/tabs/custom.gif' border='0' width='18' height='16' alt = ' spain '></a>&nbsp;"); 
 		break;
	}
    document.write("</td></tr></table></div>");
}
//----------------------------------------------------

function getnavbuttons() {
	document.write("<div align='right'>");
	document.write(g_nextlink);
	document.write("</div>");
}

//----------------------------------------------------
function getsiteheader () {
		document.write("<div align='left'>");
//    	document.write("<a href='../../a_tools/b_admin/server_fr.php'><img src='../../../technics/tech_images/tabs/tr.gif' width='2' height='2' border='0'></a>");
      	document.write("<a href='../../../index.htm'><img src='../../images/page/nomassos.gif' width='480' height='65' border='0'></a></div>");
}

//----------------------------------------------------
function gettransimg () {
	if (relief=="Y") {
	document.write("<img src='../../../technics/tech_images/tabs/tr.gif' width='5' height='10'>");
	}
}

//----------------------------------------------------
function getfirstcol() {
	document.write("<img src='../../../technics/tech_images/tabs/tr.gif' width='10' height='10'>");
}

//--------------------------------------------
function getsendurl() {
posgif = 0;
nameToDisp = "";
	nameToDisp=levela;
	if ( levela.indexOf('&nbsp;') !=-1 ) {
		posgif = levela.indexOf('&nbsp;');
		nameToDisp = left(levela, posgif);
	}
    document.write("<a href=mailto:?subject=" + replaceall(translatedesc(sitename), " ", "%20") + "%20-%20"+ replaceall(nameToDisp, " ", "%20") +"-" + replaceall(levelb, " ", "%20") +"-" + replaceall(levelc, " ", "%20") +"-" + replaceall(leveld, " ", "%20") +"-" + "&amp;body=%0d%0a" + document.URL + ">");
    document.write("<img src='../../../technics/tech_images/page/send_url.gif' border=0 align=top><span class='txtSend'>");
    switch (getlng().toUpperCase()){
	case "FR" :
		document.write("Envoyer l'adresse de cette page par email");
 		break;
	case "EN" :
		document.write("Send the adresse of this page by email");
 		break;
	case "NL" :
		document.write("Stuur adres van dit blad");
 		break;
	}
    document.write("</a></span>");
}

//----------------------------------------------------
// to use full client zone under tabs
// function must be called from htm file, in the content table
function setfulltab(){
tdfullcontent.style.backgroundColor = '#FFDFBD';
tdfullcontent.style.borderTop = 'none';
tdfullcontent.style.borderLeft = 'none';
tdfullcontent.style.borderRight = 'none';
tdfullcontent.style.borderBottom = 'none';
}

//----------------------------------------------------
// to use a background in the client zone
// function must be called from htm file, in the content table
function setbackimg(image){
tdfullcontent.style.backgroundImage="url('../../images/back/" + image +"')";
}

//----------------------------------------------------
function getcopyright(){
// copyright
document.write("<div align='right'><BR>");
document.write("<a href='#top'><img src='../../../technics/tech_images/page/buttonTop_" + getlng() + ".gif' width='59' height='16' border='0' align='absmiddle'></a>&nbsp;&nbsp;&nbsp;");
document.write("</div>");
document.write('<p><hr size="1" noshade color=#006400>');
document.write ("<table width='100%' border='0' cellspacing='0' cellpadding='0'>");
document.write("<tr><td class='txtCopyright'>Copyright (c) 2005 - " + translatedesc(sitename) + " asbl & <a href='http://www.pragmasoft.be' target=_blank>Pragmasoft asbl</a>");
/*
switch (getlng().toUpperCase()){
	case "FR" :
		document.write("Mise à jour : "+ getlastmodified());
 		break;
	case "EN" :
		document.write("Last update : " + getlastmodified());
 		break;
	case "NL" :
		document.write("Last update : " + getlastmodified());
		break;
	}
*/
document.write("</td></tr></table>");
}

//----------------------------------------------------

function getupmenu() {
if (upmenu=='Y'){
   document.write("<script language='JavaScript1.2' src='../../../technics/scripts/coolmenus3.js'></script>");
   document.write("<script language='JavaScript1.2' src='../../scripts_data/menu/MenuTop_cfg.js'></script>");
   document.write("<script language='JavaScript1.2' src='../../scripts_data/menu/menutop_"+ getlng() + ".js'></script>");
}
}
//----------------------------------------------------
function displayupmenu(){
if (upmenu=='Y'){
   oCMenu.makeStyle(); oCMenu.construct();
   document.write("<BR>");
}
}

//----------------------------------------------------
function displayiconmenu(){
	if (menuwidth==0) {return 0;}
		if (menuicon == "") {
			menuicon = "icondefault.gif"
		}
		document.write("<img src='../../images/menu/" + menuicon + "'><br><br>");
// \begin{Chris}, 13/02/03, modification compatibilite mozilla, menus latéraux
		td = document.getElementById("tdmenu");
		td.style.backgroundImage="url('../../images/menu/" + menuback +"')";
		td.style.backgroundRepeat = 'no-repeat';
//\end{Chris}
}

function linklocaldata () {
//	document.write('<script language="javascript" src="' + getName() + '.js"></script>');
}

//----------------------------------------------------
function getlocaldata(){
   getlngnum();
   getname();
   gettabsvar();
}

//----------------------------------------------------
function setlocaldata(fileName){
	g_forcedname = fileName;
}

//----------------------------------------------------
function forcelng(lng){
	g_forcedlng = lng;
}


//----------------------------------------------------

function ap_getobj(name) { 
	if (document.getElementById) { 
		return document.getElementById(name).style; 
	} 
	else if (document.all) { 
		return document.all[name].style;
	} 
	else if (document.layers) { 
	return document.layers[name]; 
	} 
} 

//----------------------------------------------------

function ap_showwaitmessage(div,flag) { 
// \begin{Chris}, 04/02/03, compatibilite Mozilla, box d'attente s'efface
  if (!document.getElementById("waitDiv")) {
// \end{Chris}
	document.write("<DIV ID='waitDiv' style='position:absolute;left:40%;top:50%;visibility:hidden'><center>");
	document.write("<table cellpadding=6 border=2 bgcolor='#FFDFBD' bordercolor='#000000'><tr><td align='center'>");
	document.write("<span class=loadmessage>Chargement en cours ...</span><br> <img src='../../../technics/tech_images/page/await.gif' border='0'>");
	document.write("</td></tr></table></center></DIV>");
// begin{Chris}, fin de modification précédente
  }
// \end{Chris}
	var DHTML = (document.getElementById || document.all || document.layers);

	if (!DHTML) return; 
	var x = ap_getObj(div); 
	x.visibility = (flag) ? 'visible':'hidden' 
	if(! document.getElementById) if(document.layers) x.left=280/2; 

	return true; 
} 

//----------------------------------------------------
function openimg(name,sizeW, sizeH) {
	window.open ("../../../technics/htm/image.php?" + name + sizeW + sizeH, '_blank', "Height=100px, Width=100px, top=" + (((screen.height)/2)-50) +  "px left= " + (((screen.width)/2)-50) +  "px, resizable=no, menubar=no, scrollbars=no, status=no, toolbar=no, location=no");
}

//----------------------------------------------------
function opennews(id) {
	window.open ("technics/htm/news.php?id=" + id, '_blank', "Height=500px, Width=700px, top=10px left=10px, resizable=yes, menubar=no, scrollbars=yes, status=no, toolbar=no, location=no");
}

//----------------------------------------------------
function openspecies(genre, espece, ss_espece) {
	window.open ("../../../technics/htm/species.php?genre=" + genre + "&espece=" + espece + "&ss_espece=" + ss_espece, '_blank', "Height=500px, Width=700px, top=10px left=10px, resizable=yes, menubar=no, scrollbars=yes, status=no, toolbar=no, location=no");
}

//----------------------------------------------------
function wincooropen(map) {
	if (map=="M") {window.open('map_m.htm', null, "Height=620px, Width=720px, top=10px left=10px, resizable=yes, menubar=no, status=no, toolbar=no, location=no");} else {window.open('map_h.htm', null, "Height=620px, Width=720px, top=10px left=10px, resizable=yes, menubar=no, status=no, toolbar=no, location=no");}
}

//----------------------------------------------------
function openinventmou(id, cebe) {
	window.open ("../../../technics/htm/invent_mou.php?id=" + id, '_blank', "Height=500px, Width=750px, top=10px left=10px, resizable=yes, menubar=no, scrollbars=yes, status=no, toolbar=no, location=no");
}

//----------------------------------------------------
function openinvent(id, cebe) {
	window.open ("../../../technics/htm/invent.php?loc="+cebe+"&id=" + id, '_blank', "Height=500px, Width=750px, top=10px left=10px, resizable=yes, menubar=no, scrollbars=yes, status=no, toolbar=no, location=no");
}

//----------------------------------------------------
function openinventpdf(fullfilename, cebe) {
	window.open ("../../../technics/htm/invent_pdf.php?filename="+fullfilename+"&cebe="+cebe, '_blank', "Height=500px, Width=750px, top=10px left=10px, resizable=yes, menubar=yes, scrollbars=yes, status=yes, toolbar=yes, location=yes");
}

//----------------------------------------------------
function openinventmoupdf(fullfilename, cebe) {
	window.open ("../../../technics/htm/invent_mou_pdf.php?filename="+fullfilename, '_blank', "Height=500px, Width=750px, top=10px left=10px, resizable=yes, menubar=yes, scrollbars=yes, status=yes, toolbar=yes, location=yes");
}

//----------------------------------------------------
function openspecies(genre, espece, ss_espece) {
	window.open ("../../../technics/htm/invent.php?loc=p&genre=" + genre + "&espece=" + espece + "&ss_espece=" + ss_espece, '_blank', "Height=500px, Width=750px, top=10px left=10px, resizable=yes, menubar=no, scrollbars=yes, status=no, toolbar=no, location=no");
}

//----------------------------------------------------
function openlocalimage(name, width, height, titre, author) {
	widthnum = parseInt(width)+50;
	heightnum = parseInt(height)+100;
	posx = ((screen.width/2)-(widthnum/2));
	posy = ((screen.height/2)-(heightnum/2));
	window.open ("../../../technics/htm/image.php?name=" + name + "&titre=" + titre + "&auteur=" + author, '_blank', "Height=" + heightnum + "px, Width=" + widthnum + "px, top=" + posy +"px left=" + posx + "px, resizable=yes, menubar=no, scrollbars=yes, status=no, toolbar=no, location=no");
}

//----------------------------------------------------
function openlocalimagefree(name, width, height, titre, author) {
	widthnum = parseInt(width)+50;
	heightnum = parseInt(height)+100;
	posx = ((screen.width/2)-(widthnum/2));
	posy = ((screen.height/2)-(heightnum/2));
	window.open ("../../../technics/htm/imagefree.php?name=" + name + "&titre=" + titre + "&auteur=" + author, '_blank', "Height=" + heightnum + "px, Width=" + widthnum + "px, top=" + posy +"px left=" + posx + "px, resizable=yes, menubar=no, scrollbars=yes, status=no, toolbar=no, location=no");
}


//----------------------------------------------------
function openimage(name, titre, author, width, height) {
	widthnum = parseInt(width)+50;
	heightnum = parseInt(height)+100;
	posx = ((screen.width/2)-(widthnum/2));
	posy = ((screen.height/2)-(heightnum/2));
	window.open ("../../../technics/htm/image.php?name=" + name + "&titre=" + titre + "&auteur=" + author, '_blank', "Height=" + heightnum + "px, Width=" + widthnum + "px, top=" + posy +"px left=" + posx + "px, resizable=yes, menubar=no, scrollbars=yes, status=no, toolbar=no, location=no");
}

//----------------------------------------------------
function openimagefree(name, titre, author, width, height) {
	widthnum = parseInt(width)+50;
	heightnum = parseInt(height)+100;
	posx = ((screen.width/2)-(widthnum/2));
	posy = ((screen.height/2)-(heightnum/2));
	window.open ("../../../technics/htm/imagefree.php?name=" + name + "&titre=" + titre + "&auteur=" + author, '_blank', "Height=" + heightnum + "px, Width=" + widthnum + "px, top=" + posy +"px left=" + posx + "px, resizable=yes, menubar=no, scrollbars=yes, status=no, toolbar=no, location=no");
}

//----------------------------------------------------

function openpreview(text) {
	window.open ("../../../technics/htm/preview.php?" + text, '_blank', "Height=500px, Width=700px, top=" + (50) +  "px left= " + (50) +  "px, resizable=yes, menubar=no, scrollbars=yes, status=yes, toolbar=no, location=no");
}

//----------------------------------------------------
function openwindow(page) {
	window.open (page, '_blank', "Height=500px, Width=700px, top=" + (50) +  "px left= " + (50) +  "px, resizable=yes, menubar=no, scrollbars=yes, status=yes, toolbar=no, location=no");
}



//----------------------------------------------------
function ag() {
document.write("<img src=\"/cgi-bin/ag/ag.pl?referer=");
document.write(escape(document.referrer));
document.write("\" width=1 height=1>");
}



//----------------------------------------------------
function setpdf(){
g_pdf=1;
} 





