function popup(url)
{
neo=window.open(url,'IMAGE','resizable=1,scrollbars=1,menubar=0,width=920,height=600');
if(neo.window.focus){neo.window.focus();}
}

function popfs(url)
{
  var l = screen.availWidth;
  var h = screen.availHeight;
neo=window.open(url,'IMAGE','resizable=1,scrollbars=1,menubar=0,width=' + l + ',height=' + h );
if(neo.window.focus){neo.window.focus();}
}

function pop500(url)
{
neo=window.open(url,'IMAGE','resizable=1,scrollbars=1,menubar=0,width=500,height=500');
if(neo.window.focus){neo.window.focus();}
}

function AffichImage(chemin)
{
if (navigator.appName == 'Microsoft Internet Explorer')
{
window.open(chemin,'IMGE','resizable=1,scrollbars=1,menubar=0,width=650,height=550,top=0,left=20');
}
else
{
  properties = "toolbar=0,menubar=0,status=0,scrollbars=1,resizable=1,width=770,height=550,top=0,left=20";
 i1 = new Image;
  i1.src = chemin;
  html = '<HTML><HEAD><TITLE>'+chemin+'</TITLE></HEAD>'
       + '<BODY bgcolor="#FFFFFF"><CENTER>'
       + '<IMG SRC="'+chemin+'" BORDER="0">'
       + '</CENTER></BODY></HTML>';
neo = window.open('','Image',properties);
neo.document.open()
neo.document.write(html);
neo.document.close();
if(neo.window.focus){neo.window.focus();}
}}

function AfIm(chemin)
{ properties = "toolbar=0,menubar=0,status=0,scrollbars=1,resizable=1,width=770,height=550,top=0,left=20";
  html = '<HTML><HEAD><TITLE>'+chemin+'</TITLE></HEAD>'
       + '<BODY onclick="window.close()" bgcolor="#FFFFFF">'
       + '<CENTER><IMG SRC="'+chemin+'" BORDER="0">'
       + '</CENTER></BODY></HTML>';
neo = window.open('','Image',properties);
neo.document.open()
neo.document.write(html);
neo.document.close();
if(neo.window.focus){neo.window.focus();}
}

function SetText(vv, ii, lo){
    var Newval;
    var Oldval;
    var l;
    if( lo == 0)
    {
        parent.opener.document.REQ.VALUE_$DICO$.value = unescape(vv);
    }
    else
    {
	Oldval = parent.opener.document.REQ.VALUE_$DICO$.value.substring(0, lo);
	Newval = (Oldval + unescape(vv));
        parent.opener.document.REQ.VALUE_$DICO$.value = Newval;
    }
    parent.close() ;
}

function ShowThes(rel, lex, term, cata, nuchmp, loc){
        var     windowThes;
windowThes=open('', 'Thesaurus', 'width=650,height=350,scrollbars,resizable');
windowThes.document.writeln("rel=" + rel + "<BR>")
windowThes.document.writeln("lex=" + lex + "<BR>")
windowThes.document.writeln("term=" + term + "<BR>")
windowThes.document.writeln("cata=" + cata + "<BR>")
windowThes.document.writeln("nuchmp=" + nuchmp + "<BR>")
windowThes.document.writeln("loc=" + loc + "<BR>")
windowThes.location='$SCRIPT_NAME$?ACTION=THESAURUS&USRNAME=$USRNAME$&USRPWD=$USRPWD$$IND_FLDS$&RELATION=' + rel + '&LEXICON=' + lex + '&TERM=' + term + '&CATA_FIELD=' + cata + "&NUMCHAMP=" + nuchmp + "&LOCAT=" + loc
}

function NewSearch(){
    window.location='$SCRIPT_NAME$?ACTION=RETOUR&USRNAME=$USRNAME$&USRPWD=$USRPWD$'
}

function Help(){
    window.location='$SCRIPT_NAME$?ACTION=HELP&USRNAME=$USRNAME$&USRPWD=$USRPWD$'
}

function ShowLex(nb_lex){
    document.REQ.ACTION.value = "INDEX"
    document.REQ.DICO.value = nb_lex
    document.forms[0].submit()
} 

function ShowLexrtbf(ff, vv, ii){
var	OUETSAUF=" OU ET SAUF ou et sauf OR AND XCPT or and xcpt O Y NO o y no ";
var     Newvv;
var     re;
var     loca;
var     i;
var     j;
var     l;

windowImage=open('', 'Lexique', 'width=650,height=450,scrollbars,resizable');
l = vv.length;
loca = 0;
for( i = 0; i < l; i++ )
{
    if( vv[i] == " " )
    {
      for( j = i + 1; j < l; j++ )
      {
	if( vv[j] == " " )
	{
	  lgope = (j - i) + 1;
	  if( lgope <= 6 )
	  {
		re = vv.substring(i, i + lgope);
		if( OUETSAUF.search(re) != -1 )
		{
	  		loca = i + lgope;
	  		i = j;
			break;
		}
	  	else
		{
			i = j;
			i--;
			break;
		}
	  }
	  else
	  {
		i = j;
		i--;
		break;
	  }
	}	
      }
    }
}
if( (l == 0) || (l == loca) )
{
    Newvv = escape(" ");
}
else
{
    Newvv = escape(vv.substring(loca, l));
}
windowImage.location='$SCRIPT_NAME$?ACTION=INDEX&FIELD_' + ii + '=' + ff + '&VALUE_' + ii + '=' + Newvv + '&DICO=' + ii + '&LOCATION=' + loca + '&USRNAME=$USRNAME$&USRPWD=$USRNAME$'
}

function ShowLexF(nb_lex){
    parent.corps.REQ.ACTION.value = "INDEX"
    parent.corps.REQ.DICO.value = nb_lex
    parent.corps.forms[0].submit()
}
   
function MisNot(base,ref) {
  var url="http://www.culture.gouv.fr/public/mistral/" + base + "_fr?ACTION=CHERCHER&FIELD_98=REF&VALUE_98=";
  ref=ref.replace(/\+/g,"%2B");
  url=url+(ref);
  properties = "toolbar=1,location=0,directories=0,status=0,"
   + "menubar=0,scrollbars=1,resizable=1,"
   + "width=930,height=600,top=0,left=0";
neo=window.open(url, "Notice", properties);
if(neo.window.focus){neo.window.focus();}
} 

function Question(base,trm) {
  var l = screen.availWidth - 100;
  var h = screen.availHeight - 100;
 var url="http://www.culture.gouv.fr/public/mistral/" + base + "_fr?ACTION=CHERCHER";
  trm=trm.toUpperCase();
  trm=trm.replace(/\+/g,"%2B");
  url=url+(trm);
  properties = "toolbar=1,location=1,directories=0,status=0,"
   + "menubar=0,scrollbars=1,resizable=1,"
   + "width=900,height=600,top=0,left=0";
neo=window.open(url, "BaseV", properties);
if(neo.window.focus){neo.window.focus();}
} 

function JocRef(ref) {
  var l = screen.availWidth - 40;
  var h = screen.availHeight - 100;
  var url="http://www.culture.gouv.fr/public/mistral/joconde_fr?ACTION=CHERCHER&FIELD_98=REF&VALUE_98=" + ref;
  properties = "toolbar=1,location=0,directories=0,status=0,"
   + "menubar=0,scrollbars=1,resizable=1,"
   + "width=" + l + ",height=" + h +",top=0,left=20";
neo=window.open(url, "NotJoc", properties);
if(neo.window.focus){neo.window.focus();}
} 

function chan1(ref) {
  var l = screen.availWidth - 140;
  var h = screen.availHeight - 120;
  var url="http://www.culture.gouv.fr/public/mistral/chan_fr?ACTION=CHERCHER&FIELD_98=REF&VALUE_98=" + ref;
  properties = "toolbar=1,location=0,directories=0,status=0,"
   + "menubar=0,scrollbars=1,resizable=1,"
   + "width=" + l + ",height=" + h +",top=0,left=30";
neo=window.open(url, "fonds", properties);
if(neo.window.focus){neo.window.focus();}
} 

function joconde(trm) {
  var l = screen.availWidth - 40;
  var h = screen.availHeight - 100;
 var url="http://www.culture.gouv.fr/public/mistral/joconde_fr?ACTION=CHERCHER&FIELD_5=LOCA&VALUE_5=";
  trm=trm.toUpperCase();
  trm=trm.replace(/\+/g,"%2B");
  url=url+(trm);
  properties = "toolbar=1,location=0,directories=0,status=0,"
   + "menubar=0,scrollbars=1,resizable=1,"
   + "width=" + l + ",height=" + h +",top=0,left=20";
neo=window.open(url, "Joconde", properties);
if(neo.window.focus){neo.window.focus();}
} 

function unimarc(ref) {
  var l = screen.availWidth - 40;
  var h = screen.availHeight - 100;
  var url="http://www.culture.gouv.fr/public/mistral/ccmn_fr?ACTION=CHERCHER&FIELD_6=REF&VALUE_6=" + ref;
  properties = "toolbar=1,location=0,directories=0,status=0,"
   + "menubar=0,scrollbars=1,resizable=1,"
   + "width=" + l + ",height=" + h +",top=0,left=20";
neo=window.open(url, "unimarc", properties);
if(neo.window.focus){neo.window.focus();}
} 

function unimalr(ref) {
  var l = screen.availWidth - 40;
  var h = screen.availHeight - 100;
  var url="http://www.culture.gouv.fr/public/mistral/malr-u_fr?ACTION=CHERCHER&FIELD_6=REF&VALUE_6=" + ref;
  properties = "toolbar=1,location=0,directories=0,status=0,"
   + "menubar=0,scrollbars=1,resizable=1,"
   + "width=" + l + ",height=" + h +",top=0,left=20";
neo=window.open(url, "unimarc", properties);
if(neo.window.focus){neo.window.focus();}
} 

function merimee(ref) {
  var l = screen.availWidth - 40;
  var h = screen.availHeight - 100;
  var url="http://www.culture.gouv.fr/public/mistral/merimee_fr?ACTION=CHERCHER&FIELD_8=REF&VALUE_8=" + ref;
  properties = "toolbar=1,location=0,directories=0,status=0,"
   + "menubar=0,scrollbars=1,resizable=1,"
   + "width=" + l + ",height=" + h +",top=0,left=20";
neo=window.open(url, "merimee", properties);
if(neo.window.focus){neo.window.focus();}
} 

function memoire(ref) {
  var l = screen.availWidth - 40;
  var h = screen.availHeight - 100;
  ref=ref.replace(/ /g,"%20");
  var url="http://www.culture.gouv.fr/public/mistral/memoire_fr?ACTION=CHERCHER&FIELD_98=REF&VALUE_98=" + ref;
  properties = "toolbar=1,location=0,directories=0,status=0,"
   + "menubar=0,scrollbars=1,resizable=1,"
   + "width=" + l + ",height=" + h +",top=0,left=20";
neo=window.open(url, "memoire", properties);
if(neo.window.focus){neo.window.focus();}
} 

function palissy(ref) {
  var l = screen.availWidth - 40;
  var h = screen.availHeight - 100;
  ref=ref.replace(/ /g,"%20");
  ref=ref.replace(/\+/g,"%2B");
  var url="http://www.culture.gouv.fr/public/mistral/palissy_fr?ACTION=CHERCHER&FIELD_8=REF,REFA&VALUE_8=" + ref;
  properties = "toolbar=1,location=0,directories=0,status=0,"
   + "menubar=0,scrollbars=1,resizable=1,"
   + "width=" + l + ",height=" + h +",top=0,left=20";
neo=window.open(url, "palissy", properties);
if(neo.window.focus){neo.window.focus();}
} 

function dossier(adr) {
  var l = screen.availWidth - 40;
  var h = screen.availHeight - 100;
  var url="http://" + adr;
  properties = "toolbar=1,location=1,directories=1,status=1,"
   + "menubar=0,scrollbars=1,resizable=1,"
   + "width=" + l + ",height=" + h +",top=0,left=20";
neo=window.open(url, "dossier", properties);
if(neo.window.focus){neo.window.focus();}
} 

function frequent(ref) {
  var l = screen.availWidth - 40;
  var h = screen.availHeight - 100;
  var url="http://www.culture.gouv.fr/public/mistral/frequent_fr?ACTION=CHERCHER&FIELD_3=REF&VALUE_3=" + ref;
  properties = "toolbar=1,location=0,directories=0,status=0,"
   + "menubar=0,scrollbars=1,resizable=1,"
   + "width=" + l + ",height=" + h +",top=0,left=20";
neo=window.open(url, "dossier", properties);
if(neo.window.focus){neo.window.focus();}
} 

function saint(ref) {
  var term=ref.replace(/ et /g,"%20\?\?%20");
  var url="http://www.culture.gouv.fr/public/mistral/sancti_fr?ACTION=CHERCHER&FIELD_1=TERME&VALUE_1=" + term;
 window.location=url;
} 

function memoirimg(ref) {
  var l = screen.availWidth - 40;
  var h = screen.availHeight - 100;
  var url="http://www.culture.gouv.fr/public/mistral/memoire_fr?ACTION=CHERCHER&FIELD_5=LBASE&VALUE_5=" + ref;
  properties = "toolbar=1,location=0,directories=0,status=0,"
   + "menubar=0,scrollbars=1,resizable=1,"
   + "width=" + l + ",height=" + h +",top=0,left=20";
neo=window.open(url, "memoire", properties);
if(neo.window.focus){neo.window.focus();}
} 

function AffUrl(url) {
var l = screen.availWidth - 40;
var h = screen.availHeight - 100;
properties = "toolbar=0,location=0,directories=0,status=0,"
 + "menubar=0,scrollbars=1,resizable=1,"
 + "width=" + l + ",height=" + h +",top=0,left=20";
neo=window.open(url, "popup", properties);
if(neo.window.focus){neo.window.focus();}
}  

function AffImg(chemin,txt)
{
  properties = "toolbar=0,location=0,directories=0,status=0,"
   + "menubar=0,scrollbars=1,resizable=1,"
   + "width=500,height=500,top=0,left=20";
  i1 = new Image;
  i1.src = chemin;
  html = '<HTML><HEAD><TITLE>'+chemin+'</TITLE>'
       + '<script language="javascript" type="text/javascript" src="/documentation/js/mistral.js">'
       + '</script></HEAD>'
       + '<BODY  onload="resize()" style="margin:0" bgcolor=#FFFFFF><CENTER>'
       + '<IMG SRC="'+chemin+'" BORDER="0" onclick="window.close()">'
       + '<br><font size="2" color="#999966">'+txt+'</font>'
       + '</CENTER></BODY></HTML>';
neo = window.open('','Image',properties);
neo.document.open()
neo.document.write(html);
neo.document.close();
if(neo.window.focus){neo.window.focus();}
}
  
function museo(trm) {
 if (trm != 2205002) {
  var l = screen.availWidth - 40;
  var h = screen.availHeight - 100;
  var url="http://www.culture.gouv.fr/public/mistral/museo_fr?ACTION=CHERCHER&FIELD_98=REF&VALUE_98=" + trm;
  properties = "toolbar=1,location=0,directories=0,status=0,"
   + "menubar=0,scrollbars=1,resizable=1,"
   + "width=" + l + ",height=" + h +",top=0,left=20";
neo=window.open(url, "Musee", properties);
if(neo.window.focus){neo.window.focus();}
}} 

function archim(trm) {
  var l = screen.availWidth - 40;
  var h = screen.availHeight - 100;
  var url="http://www.culture.gouv.fr/public/mistral/caran_fr?ACTION=CHERCHER&FIELD_98=LBASE&VALUE_98=" + trm;
  properties = "toolbar=1,location=0,directories=0,status=0,"
   + "menubar=0,scrollbars=1,resizable=1,"
   + "width=" + l + ",height=" + h +",top=0,left=20";
neo=window.open(url, "Musees", properties);
if(neo.window.focus){neo.window.focus();}
} 

function Varcade(ref) {
  var l = screen.availWidth - 40;
  var h = screen.availHeight - 100;
  ref=ref.replace(/ /g,"%20");
  var url="http://www.culture.gouv.fr/public/mistral/arcade_fr?ACTION=CHERCHER&FIELD_98=REF&VALUE_98=" + ref;
  properties = "toolbar=1,location=0,directories=0,status=0,"
   + "menubar=0,scrollbars=1,resizable=1,"
   + "width=" + l + ",height=" + h +",top=0,left=20";
neo=window.open(url, "Musees", properties);
if(neo.window.focus){neo.window.focus();}
}

function alea(Max) {
 var page = Math.ceil(Math.random()*Max);
 var l = screen.availWidth - 40;
 var h = screen.availHeight - 100;
 var url="/documentation/accueil/TEMP/pat-" + (page) + ".htm";
 prop = "toolbar=1,location=0,directories=0,status=0,"
   + "menubar=0,scrollbars=1,resizable=1,"
   + "width=" + l + ",height=" + h +",top=0,left=20";
neo=window.open(url, "patimg", prop);
if(neo.window.focus){neo.window.focus();}
} 

function MM_preloadImages() { //v3.0
  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];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function VisuH(url) {
  properties = "toolbar=0,location=0,directories=0,status=0,"
   + "menubar=0,scrollbars=1,resizable=1,"
   + "width=250,height=130,top=20,left=450";
 window.open(url, 'query', properties);
}

function resize(){
	var NS = (navigator.appName=="Netscape")?true:false;
	iWidth = (NS)?window.innerWidth:document.body.clientWidth; 
	iHeight = (NS)?window.innerHeight:document.body.clientHeight; 
	var img = document.images[0];
	if(img){
		iWidth = 20 + img.width - iWidth; 
		iHeight = 50 + img.height - iHeight;
		window.resizeBy(iWidth, iHeight);
	}
}

function chlies(ref) {
  var url="http://www.culture.gouv.fr/public/mistral/systemd_fr?ACTION=CHERCHER&FIELD_1=ETIQ&VALUE_1=" + ref;
 window.location=url;
} 

function mdpmem(nump) {
  var l = screen.availWidth - 40;
  var h = screen.availHeight - 100;
  var url="http://www.culture.gouv.fr/public/mistral/memsmn_fr?ACTION=CHERCHER&FIELD_7=NUMP&VALUE_7=" + nump;
  properties = "toolbar=1,location=0,directories=0,status=0,"
   + "menubar=0,scrollbars=1,resizable=1,"
   + "width=" + l + ",height=" + h +",top=0,left=20";
neo=window.open(url, "memoire", properties);
if(neo.window.focus){neo.window.focus();}
}


