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;
}
}

function caractnav() {
//document.getElementById("val_nav").value=navigator.appName;
//document.getElementById("val_sys").value=navigator.platform;
document.getElementById("val_wsc").value=screen.availWidth;
document.getElementById("val_hsc").value=screen.availHeight;
document.getElementById("val_wwn").value=wwn
document.getElementById("val_hwn").value=hwn;
//window.resizeTo(1024,screen.availHeight);
//window.moveTo(0,0);
}

function wrsz(nom,val) {
document.getElementById("lay_"+nom).style.height=hwn-val;
document.getElementById("if_"+nom).style.height=hwn-val-2;
}
function lhrsz(nom,val) {
document.getElementById(nom).style.height=hwn-val;
}
function lwrsz(nom,vright,vleft) {
if (wwn>1024)
	{
	document.getElementById(nom).style.left=wwn-vright;
	}
else	{
	document.getElementById(nom).style.left=wwn-vleft;
	}
}

function wcookie() {
document.cookie="wwind"+"="+escape(wwn);
document.cookie="hwind"+"="+escape(hwn);
document.cookie="wscr"+"="+escape(screen.availWidth);
document.cookie="hscr"+"="+escape(screen.availHeight);;
}

function cover(name) {
document.getElementById(name).style.visibility="hidden";
}

function see(name) {
document.getElementById(name).style.visibility="visible";
}

function seetable(name,visi) {
document.getElementById(name).style.display=visi;
}

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 prcs(){
	document.getElementById("titre").value="0";
	document.getElementById("desc").value="0";
	document.getElementById("chstr").value="";
	document.getElementById("titre").checked=false;
	document.getElementById("desc").checked=false;
}

var oo=null
var x= null
var y= null

function opusopen(id,col,to){
document.getElementById("cont_opus_zoom").style.top="0";
window.open("opus_zoom.asp?ref="+id+"&fondb="+col,"if_opus_zoom","");
window.open("opus_listdetails.asp?ref="+id+"&fondb="+col,"if_opus_listdetails","");
document.getElementById("titreoeuvre").value=to;
document.getElementById("refoeuvre").value=id;
oo=1
}

function movelay(nlay,arg,npx){
if (arg=="top") document.getElementById(nlay).style.top=npx;
if (arg=="zIndex") document.getElementById(nlay).style.zIndex=npx;
}

function videoopen(id){
window.open("flashvideo.asp?p_img="+id,"video","");
}

function seecatalogue() {
if ((y>500) && (oo=1)) {
document.getElementById("lay_catalogue").style.zIndex="1000";
}
else {
document.getElementById("lay_catalogue").style.zIndex="1";
}
document.getElementById("var_x").value=x;
document.getElementById("var_y").value=y;
document.getElementById("var_oo").value=oo;
}

//****************************************************************************SEEFEL
function lflash(val){
document.getElementById("layflash").style.display=val;
}

function fheight(elem,marg){
if (navigator.appName == "Microsoft Internet Explorer") {
	helem=window.document.body.offsetHeight-marg;
	}
else	{
	helem=window.innerHeight-marg;
}
//document.getElementById("val_helem").value=helem;

if (elem) {
document.getElementById(elem).style.height=helem;
}
if (elem=="fd") {
document.getElementById("cont").style.height=helem-90;
}
}


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 opushome(ida,fa,ido,no)
{
if (confirm('Souhaitez vous affecter cette oeuvre à REGARD SUR ?')) {
document.location="register_opus_home.asp?ida="+ ida +"&fa="+ fa +"&ido="+ ido +"&no="+ no;
}
} 

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 seelaycountry(val1,val2,val3) {
/*alert("la valeur saisie est : " + val1 +" \n la couche est : "+ val2);*/
if (val1=="d_diff")
	{
	see(val2);cover(val3);
	}
else	{
	see(val3);cover(val2);
	}
}

function cleancountry(nform,nfield) {
document.nform.nfield.value= '';
}

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";
}
}

function bgcol(col,nc,el){
if (col==null){col="#FFAA5E";}
document.bgColor=col;
for (i=1; i<=nc; i++) 
	{
	(document.getElementById("col"+i).name==el) ? document.getElementById("col"+i).style.borderColor="black" : document.getElementById("col"+i).style.borderColor=col;
	}
}


function redir(lien,param1,param2) {
document.location.href=lien+param1+param2;
}

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 font_size(increase)
{
fsize = document.getElementById('article').style.fontSize;
fsize = fsize.slice(0,2);

	if (increase == true) 
	{
		if ((fsize>9)&&(fsize<15))
		{
		fsize++;
		}
	}
	else 
	{
		if ((fsize>10)&&(fsize<16))
		{
		fsize--;
		}
	}
document.getElementById('article').style.fontSize = fsize+'px';
//document.getElementById('txtsize').value = fsize;
//document.getElementById('txtsize2').value = fsize;

np=document.getElementsByTagName('p');
for (i=0;i<np.lengh;i++)
	{
	np[i].style.fontSize = parseInt(fsize+10)+'px';
	}

}
function nobut(val){
document.getElementById('nobut').value =val;
	if (val==0)
	{ 
	document.getElementById('laysubfeed').style.display='block';
	document.getElementById('textfeed').value='';
	document.getElementById('inpmsginfo').value='';
	}
	else
	{
	document.getElementById('laysubfeed').style.display='none';
	}
}

