function affrevue() {

	document.getElementById("listerevhid").style.display = "block";
}

String.prototype.split = function(separator, limit) {
			var flags = "";
			
			/* Behavior for separator: If it's...
			- Undefined: Return an array containing one element consisting of the entire string
			- A regexp or string: Use it
			- Anything else: Convert it to a string, then use it */
			if (separator === undefined) {
				return [this.toString()]; // toString is used because the typeof this is object
			} else if (separator === null || separator.constructor !== RegExp) {
				// Convert to a regex with escaped metacharacters
				separator = new RegExp(String(separator).replace(/[.*+?^${}()|[\]\/\\]/g, "\\$&"), "g");
			} else {
				flags = separator.toString().replace(/^[\S\s]+\//, "");
				if (!separator.global) {
					separator = new RegExp(separator.source, "g" + flags);
				}
			}
			
			// Used for the IE non-participating capturing group fix
			var separator2 = new RegExp("^" + separator.source + "$", flags);
			
			/* Behavior for limit: If it's...
			- Undefined: No limit
			- Zero: Return an empty array
			- A positive number: Use limit after dropping any decimal value (if it's then zero, return an empty array)
			- A negative number: No limit, same as if limit is undefined
			- A type/value which can be converted to a number: Convert, then use the above rules
			- A type/value which cannot be converted to a number: Return an empty array */
			if (limit === undefined || +limit < 0) {
				limit = false;
			} else {
				limit = Math.floor(+limit);
				if (!limit) return []; // NaN and 0 (the values which will trigger the condition here) are both falsy
			}
			
			var match,
				output = [],
				lastLastIndex = 0,
				i = 0;
			
			while ((limit ? i++ <= limit : true) && (match = separator.exec(this))) {
				// Fix IE's infinite-loop-resistant but incorrect RegExp.lastIndex
				if ((match[0].length === 0) && (separator.lastIndex > match.index)) {
					separator.lastIndex--;
				}
				
				if (separator.lastIndex > lastLastIndex) {
					/* Fix IE to return undefined for non-participating capturing groups (NPCGs). Although IE
					incorrectly uses empty strings for NPCGs with the exec method, it uses undefined for NPCGs
					with the replace method. Conversely, Firefox incorrectly uses empty strings for NPCGs with
					the replace and split methods, but uses undefined with the exec method. Crazy! */
					if (match.length > 1) {
						match[0].replace(separator2, function(){
							for (var j = 1; j < arguments.length - 2; j++){
								if (arguments[j] === undefined) match[j] = undefined;
							}
						});
					}
					
					output = output.concat(this.substring(lastLastIndex, match.index), (match.index === this.length ? [] : match.slice(1)));
					lastLastIndex = separator.lastIndex;
				}
				
				if (match[0].length === 0) {
					separator.lastIndex++;
				}
			}
			
			return (lastLastIndex === this.length)
				? (separator.test("") ? output : output.concat(""))
				: (limit ? output : output.concat(this.substring(lastLastIndex)));
		};

function cherchetitre() {


chainerevue = document.getElementById("listerevhid").innerHTML;
var expsplit=new RegExp("\<\/a\>","gi");
var lesrevues = chainerevue.split(expsplit);

var revuestrouv = new Array();

var lemot =   document.formu.chtit.value;
var chainetrouv = '';
if (lemot == '')
{
chainetrouv = '</p>Veuillez entrer l\'extrait de titre de revue recherch&eacute;.</p>'; 
 }
else
{
for (nbrevue in lesrevues) { 
var exp=new RegExp(lemot,"gi");

if(exp.test(lesrevues[nbrevue]))
{
revuestrouv.push(lesrevues[nbrevue]);
}
	}
	

for (nbrevue in revuestrouv) { 
chainetrouv += '<div class="nomlistrev">'+ revuestrouv[nbrevue] + '</a></div>';
	}

if (chainetrouv == '')
{
chainetrouv = '<p>Aucune revue ne correspond &agrave; votre recherche.<br/> Merci de bien vouloir recommencer.</p>'; 
}

}
	document.getElementById("revuetrouvees").innerHTML = chainetrouv;
	document.getElementById("revuetrouvees").style.display = "block";
	

	}

// RECHERCHE

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 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_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_swapLogo(ID_IMG,BOOK,EDITEUR)
{
    var img;
    
    img = 'vign_rev/'+ID_IMG+'.jpg';
    
    MM_swapImage('vignette','',img,1);
    
    document.getElementById('valBook').innerHTML=BOOK;
    document.getElementById('valEditeur').innerHTML=EDITEUR;
    
}

function MM_swapISBN (PG,NUM)
{  
    document.getElementById('valpage').innerHTML= PG ;
    document.getElementById('valIsbn').innerHTML= NUM ;
}

