var atn=0;
var hwn=0;
var wwn=0;

function detnav() {
if (navigator.appName == "Microsoft Internet Explorer") {
	hwn=window.document.body.offsetHeight;
	wwn=window.document.body.offsetWidth;
}
else	{
	hwn=window.innerHeight;
	wwn=window.innerWidth;
	if(document.getElementById("badnav")) {document.getElementById("badnav").style.display="block";}
}
//document.getElementById("valhwn").value=hwn;
//document.getElementById("valwwn").value=wwn;
}


function wszmini() {

var msg_task
window.resizeTo(830,screen.availHeight);	
if (document.body.clientHeight<730) document.getElementById("szalert").style.visibility="visible";
document.getElementById("sh").value=screen.height;
document.getElementById("sw").value=screen.width;
document.getElementById("ecran").style.height=Math.floor(screen.height/5);
w_ecran=Math.floor(screen.width/5)
document.getElementById("ecran").style.width=w_ecran;
document.getElementById("sah").value=screen.availHeight;

document.getElementById("fenetre").style.height=Math.floor((screen.availHeight/5)-2);
document.getElementById("fenetre").style.width=Math.floor(w_ecran/4*3);
//document.getElementById("wh").value=window.outerHeight;
document.getElementById("wch").value=document.body.clientHeight;
document.getElementById("fenetre_u").style.marginTop=Math.floor(-(document.body.clientHeight/5));
document.getElementById("fenetre_u").style.height=Math.floor((document.body.clientHeight/5)-2);
	if (screen.availHeight<screen.height) 
	{
	h_task=screen.height-screen.availHeight
	document.getElementById("task").style.visibility="inherit";
	document.getElementById("task").style.marginTop=Math.floor(-(h_task/5)+1);
	document.getElementById("task").style.height=Math.floor(h_task/5);
	document.getElementById("htask").value=h_task;
	document.getElementById("msgtask").style.visibility="inherit";
	}
}

function cover(name) {
document.getElementById(name).style.visibility="hidden";
}
function see(name) {
document.getElementById(name).style.visibility="visible";
}
function disp(name,visi) {
document.getElementById(name).style.display=visi;
}
function rockcol(cid,col1,col2) {
document.getElementById(cid).style.backgroundColor = col1;
document.getElementById(cid).style.color = col2;
}

function movlay(nid,arg,val) {
if (arg=="top") document.getElementById(nid).style.top=hwn-val;
if (arg=="height") document.getElementById(nid).style.height=hwn-val;
}

function changeCouleur(cellule,couleurFond) {
cellule.style.backgroundColor = couleurFond;
}

function coverp(name,info) {
document.getElementById(name).style.visibility="hidden";
}

function seep(name,info) {
document.getElementById(name).style.visibility="visible";
document.all.infoprod.innerHTML= info
}

function redir(lien,param) {
document.location.href=lien+param;
}

function distab(targ,stat) {
document.getElementById(targ).style.display=stat;
}

function distaball(n,stat) {
for (i=0;i<n;i++) {
lay="detj"+i;
document.getElementById(lay).style.display=stat;
}
}

function addfav(ptit,purl) {
document.getElementById("nomnavigateur").value=navigator.userAgent;
if (navigator.userAgent.search("Firefox")>0) {
window.sidebar.addPanel(ptit,purl,"");
}
else {
window.external.AddFavorite(purl,ptit);
}
}

function butlight(ni,n) {
for (i=0;i<n;i++) 
	{
	if (document.getElementById("im"+i).name==ni) 
		{
		document.getElementById("im"+i).style.visibility="visible";
		}
	else 	{
		document.getElementById("im"+i).style.visibility="hidden";
		}
	}
}

//****************************************************************************SEEFEL

function seeplan(source)
{
document.getElementById('imgplan').src=source;
//document.getElementById('zoomplan').src=source;
}
function popplan(nomimg)
{
nomimg=document.getElementById("imgplan").src;
popps("pzoom.asp?progimg="+nomimg,"pop",screen.width,screen.height,"","","menubar=yes");
}

function popimg(mpict, mtit, minfo)
{
w = window.open('','chargement','width=10,height=10,top=0,left=0');
w.document.write( "<html><head><title>"+mtit+"</title>\n" );
w.document.write( "<script language='JavaScript'>\n");
w.document.write( "IE5=NN4=NN6=false;\n");
w.document.write( "if(document.all)IE5=true;\n");
w.document.write( "else if(document.getElementById)NN6=true;\n");
w.document.write( "else if(document.layers)NN4=true;\n");
w.document.write( "function autoSize() {\n");
w.document.write( "if(IE5) self.resizeTo(document.images[0].width+10,document.images[0].height+80);\n");
w.document.write( "else if(NN6) self.sizeToContent();\n");
w.document.write( "else window.resizeTo(document.images[0].width+30,document.images[0].height+30);\n");
w.document.write( "self.focus();\n");
w.document.write( "}\n</scri");
w.document.write( "pt>\n");

w.document.write( "</head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad='javascript:autoSize();' onContextMenu='return false;'> \n");
w.document.write( "<a href='javascript:window.close();'><img src='"+mpict+"' border=0 alt='cliquer ici pour fermer' \n");
w.document.write( " onselectstart='return false' oncontextmenu='return false' ondragstart='return false'></a> \n");
w.document.write( " <span style='font-size:10px;font-family:verdana;color:gray;'><i>cliquez sur l''image pour fermer le popup</i> \n");
w.document.write( "<div style='position: absolute; width: 200px; left: 2px; top: 2px; height: 20px; z-index: 3; visibility: visible;'>" );
w.document.write( "<table><tr><td><font color='white' face='verdana' size='1'>"+minfo+"</font></td></tr></table></div>" );
w.document.write( "<div style='position: absolute; width: 200px; left: 3px; top: 3px; height: 20px; z-index: 2; visibility: visible;'>" );
w.document.write( "<table><tr><td><font face='verdana' size='1'>"+minfo+"</font></td></tr></table></div>" );
w.document.write( "</body></html>" );
w.document.close();
}


var ww = null;
function popps(page,fenetre,largeur,hauteur,ratt,ratl,options)
{
var top = (screen.height-hauteur-17)/ratt;
var left = (screen.width-largeur-17)/ratl;
ww = window.open(page,fenetre,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
ww.focus();
}
function ferme(idw)
{
if (ww) ww.close(idw);
ww = null;
}

function supprime(page,isup,retour) 
{
if (confirm('Souhaitez vous supprimer cet élément ?')) {
document.location=page +"?id="+ isup +"&ret="+ retour
} 
}

function actualise(iact,page,parpage,typ_prod,sfamille,tri,filtre,refprod)
{
document.location="list_prod.asp?id="+ iact +"&pg="+ page +"&parpage="+ parpage +"&typ_prod="+ typ_prod +"&sfamille="+ sfamille +"&tri=" +tri +"&filtre=" +filtre+ "&refprod=" +refprod+ "#but"
} 

pv=0
pu=0
qte=0


function checkl(val,orig,dest) {
strl=document.getElementById(orig).value.length
if (parseInt(strl) > parseInt(val)) 
{
document.getElementById(dest).value = "chaine trop longue";
document.getElementById(dest).style.color="#FF661C";
document.getElementById(dest).style.fontWeight="bold";
}
else
{
document.getElementById(dest).value = parseInt(val-strl) +" car. restant";
document.getElementById(dest).style.color="#9BBD24";
}
}


