/*---------------------------------------------------------------------------------
Description : Ensemble de base pour les GS Sites - Fonctions généralistes pour le positionnement
              des cadres
Copyright : GS Soft et Stéphane Garnaud 1999 - 2001
Adresse : http://www.gs-soft.fr
Fonctions : 
	- gs_calqueplace
	  Place un calque à un endroit donné
	  paramètres : gt_nom = nom du calque
						gt_x = position horizontale du calque en pixels (négatif ou positif) ou valeur donnée (centre, gauche, droite)
						gt_y = position verticale du calque en pixels (négatif ou positif) ou valeur donnée (milieu, haut, bas)
						gt_visible = rend le calque visible ou pas (valeur 0 ou 1)
	- gs_calquevisible
	  rend un calque visible
	  paramètres : gt_nom = nom du calque
						gt_visible = rend le calque visible ou pas (valeur 0 ou 1)
											
---------------------------------------------------------------------------------*/

function gs_calqueplace(gt_nom,gt_x,gt_y,gt_visible){
var gt_o="";var gt_px=-9999; var gt_py=-9999;
//si netscape
if  (navigator.appName.indexOf("Netscape") != -1){alert("Désolé ! Ce script ne fonctionne que sous le navigateur Internet Explorer");return false;}
//l'objet
var gt_o=document.all[gt_nom];
//invisible
gs_calquevisible(gt_nom,0)
//les dimensions
var gt_l=gt_o.clientWidth;
var gt_h=gt_o.clientHeight;
var gt_lfen=document.body.clientWidth;
var gt_hfen=document.body.clientHeight;
//traitement
if (gt_x.toUpperCase()=='CENTRE' || gt_x.toUpperCase()=='CENTER'){gt_px=(gt_lfen-gt_l)/2;}
if (gt_x.toUpperCase()=='GAUCHE' || gt_x.toUpperCase()=='LEFT'){gt_px=0;}
if (gt_x.toUpperCase()=='DROITE' || gt_x.toUpperCase()=='RIGHT'){gt_px=gt_lfen-gt_l;}
if (gt_px==-9999){if (gt_x<0){gt_px=gt_lfen+gt_x-gt_l;}else{gt_px=gt_x;}}
if (gt_y.toUpperCase()=='MILIEU' || gt_y.toUpperCase()=='MIDDLE'){gt_py=(gt_hfen-gt_h)/2;}
if (gt_y.toUpperCase()=='HAUT' || gt_y.toUpperCase()=='TOP'){gt_py=0;}
if (gt_y.toUpperCase()=='BAS' || gt_y.toUpperCase()=='BOTTOM'){gt_py=gt_hfen-gt_h;}
if (gt_py==-9999){if (gt_y<0){gt_py=gt_hfen+gt_y-gt_h;}else{gt_py=gt_y;}}
if(gt_px+ document.body.scrollLeft>0){gt_o.style.left=gt_px+ document.body.scrollLeft;}
else{gt_o.style.left=0;}
if(gt_py+ document.body.scrollTop>0){gt_o.style.top=gt_py+ document.body.scrollTop;}
else{gt_o.style.top=0;}
gs_calquevisible(gt_nom,gt_visible);
}

function gs_calquevisible(gt_nom,gt_visible) {
//l'objet
var gt_o=document.all[gt_nom];

//visible ou pas
if (gt_visible==0)
{gt_o.style.visibility='hidden';}
else
{gt_o.style.visibility='visible';}
}


