
/* ------------------------- GOTO ---------------------------------- */
function Go(gototo) { // ex : <td  onClick="Go('actualite');"> --> index2.php?goto=actualite
	var url = window.location.search;
	var pos = url.indexOf("=")+1;
	window.location.search = url.substring(0,pos)+gototo;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

/* ------------------------- IMPRIMER ---------------------------------- */
function PSR_imprimer() {
	var PSR_f1 = null;
	var PSR_content=document.getElementById('toprint').innerHTML;
	var PSR_title=document.getElementsByTagName('title')[0].innerText;
	if (PSR_f1) {if(!PSR_f1.closed) PSR_f1.close();}
	PSR_f1 = window.open ('',"PSR_f1", "height=500,width=600,menubar=yes,scrollbars=yes,resizable=yes,,left=20,top=20"); ;
	PSR_f1.document.open();
	PSR_f1.document.write("<html><head><title>Bourse du collectionneur</title>");
	PSR_f1.document.write("<link href='../css/styles.css' rel='stylesheet' type='text/css'>");
	PSR_f1.document.write("</head><body bgcolor='#F8F5EB' onload='javascript:self.print();'>"+PSR_content+"</body></html>");
	PSR_f1.document.close();
	//PSR_f1.document.getElementById('PSR_print').style.visibility='hidden';
	PSR_f1.focus();
}

/* ------------------------- POP ---------------------------------- */
var PositionX = 100; var PositionY = 100; // Set the horizontal and vertical position for the popu
var defaultWidth  = 500; var defaultHeight = 500; // Set these value approximately 20 pixels greater than the size of the largest image to be used (needed for Netscape)
var AutoClose = true; // Set autoclose true to have the window close automatically - Set autoclose false to allow multiple popup windows
if (parseInt(navigator.appVersion.charAt(0))>=4){
	var isNN=(navigator.appName=="Netscape")?1:0;
	var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

function PopImg(imageURL,imageTitle) {
	if (isNN){ var imgWin=window.open('about:blank','',optNN);}
	if (isIE){ var imgWin=window.open('about:blank','',optIE);}
	with (imgWin.document){
		writeln('<html><head><title>Loading...</title><style type="text/css">body{margin:0px;overflow:hidden;}</style>');writeln('<sc'+'ript type="text/javascript">');
		writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
		writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
		writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
		writeln('width=100-(document.body.clientWidth-document.images[0].width);');
		writeln('height=100-(document.body.clientHeight-document.images[0].height);');
		writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
		writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
		writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
		if (!AutoClose) writeln('</head><body bgcolor="#000000" scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
		else writeln('</head><body bgcolor="#000000" scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close();" onClick="self.close();">');
		writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
		close();		
	}
}
function popup(url, name, w, h) {
	var l = (screen.availWidth-10 - w) / 2;
	var t = (screen.availHeight-20 - h) / 2;
	features = "width="+w+",height="+h+",left="+l+",top="+t+",screenX="+l+",screenY="+t+",scrollbars=1,resizable=1,location=0,menubar=0,toolbar=0,status=1";
	window.open(url, name, features);
}

/* ------------------------- Rollover ---------------------------------- */
function RollOver(img,lien){
document.images[img].src=lien;
}
/* ------------------------- Sous menu Sac ---------------------------------- */
function montre(cat,scat){	
	var d = document.getElementById(scat);
	//alert("d : "+d);
	var c = document.getElementById(cat);
	//alert("c : "+c);
	if(d)
	{
		var currentDisplay = d.style.display;
		//alert("currentDisplay : "+currentDisplay);
		var currentClass = c.className;
		//alert("currentClass : "+currentClass);
		//alert(smenuTaille);

		if(document.getElementById(scat)){ 
			document.getElementById(scat).style.display = "none";
			document.getElementById(cat).className = "off";
		}

		if( currentDisplay == "block" ){
			d.style.display = "none";	
			c.className = "off";
		}else{
			d.style.display = "block";
			c.className = "on";
		}
	}
}
function trCouleur(id,couleur){
document.getElementById("tr1_"+id).bgColor = couleur;
document.getElementById("tr2_"+id).bgColor = couleur;
document.getElementById("tr3_"+id).bgColor = couleur;
}

/*Menu dhtml */
// detection du navigateur
var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all

function cache_menu(nom) {
	//alert(nom);
	var recup = nom.split("|");
	//alert(recup.length);
	for(i=0;i<recup.length;i++){
		if(document.getElementById){
			document.getElementById(recup[i]).style.visibility = "hidden";
		}else if(document.all){
			document.all("smenu").style.visibility = "hidden";
		}
	}
}

function efface_tout(){
cache_menu('dhtml1|dhtml5|cache|cache2');
}

function reset_roll(img,niveau){
for(i=1;i<7;i++){
	document.images["m"+i].src = niveau+"images/picts_fr/menu/m"+i+".gif";
}
	if(typeof(rub_activ)!='undefined'){
	document.images["m"+rub_activ].src = niveau+"images/picts_fr/menu/m"+rub_activ+"on.gif";
	}

	if(img!=0)
	document.images["m"+img].src = niveau+"images/picts_fr/menu/m"+img+"on.gif";
}

function affiche_menu(nom) {
//alert(nom);
efface_tout();
var recup = nom.split("|");
//alert(recup.length);

for(i=0;i<recup.length;i++){
		if(document.getElementById){
			document.getElementById(recup[i]).style.visibility = "visible";
		}else if(document.all){
			document.all("smenu").style.visibility = "visible";
		}
	}
}

/* Deplacement des calques */

// detection du navigateur
var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all
// Longueur du tableau général
var WidthTable = 940;
// Déclaration des calques et de leurs positions par rapport au bord gauche du tableau général
var TabLayers = new Array();
TabLayers[0] = new Array("cache",0);
TabLayers[1] = new Array("cache2",0);
TabLayers[2] = new Array("dhtml1",0);
TabLayers[3] = new Array("dhtml2",0);
TabLayers[4] = new Array("dhtml3",0);
TabLayers[5] = new Array("dhtml4",0);
TabLayers[6] = new Array("dhtml5",550);
TabLayers[7] = new Array("dhtml6",0);

function Deplace() {
	ie4 ? X = document.body.scrollWidth : ns4 ? X = window.innerWidth : X = document.width;
//alert(X);
	if(navigator.appVersion.indexOf("Safari")!=-1)
		X = document.body.scrollWidth;

	for(i=0; i<TabLayers.length; i++) {
		PosCalqueX = ((X-WidthTable)/2+TabLayers[i][1]);

		if(PosCalqueX < TabLayers[i][1]) {
			if(ie4 && navigator.appVersion.indexOf("Mac")!=-1)
				PosCalqueX = TabLayers[i][1]-2;
			else
				ns4 ? PosCalqueX = TabLayers[i][1]+9 : ie4 ? PosCalqueX = TabLayers[i][1] : PosCalqueX = TabLayers[i][1];
		}
		// Arrondi à l'entier inférieur (les chiffres à virgules decallent de 1 pix les calques sur Mozilla)
		PosCalqueX = Math.floor(PosCalqueX);

		if(ns4) {
			layer = TabLayers[i][0];
			document.layers[layer].left = (PosCalqueX-8);
		} else if(ns6) {
			document.getElementById(TabLayers[i][0]).style.left = (PosCalqueX);
		} else {
			document.getElementById(TabLayers[i][0]).style.left = (PosCalqueX);
		}
	}
}

function Deplace2() {
	if(ie4 && navigator.appVersion.indexOf("Mac")!=-1)
		document.location.reload();
}

function Bandeau(){
var bandeau = new Array();
bandeau[0] = new Array("logo.gif","#D62880");
bandeau[1] = new Array("logo2.gif","#ff6600");
bandeau[2] = new Array("logo3.gif","#ff9900");

var nb = bandeau.length-1;
var num = Math.round(Math.random()*nb);
//alert(num);

document.write('<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">');
document.write('  <tr>');
document.write('    <td width=\"222\"><a href=\"index.php\"><img src=\"images/picts_fr/'+bandeau[num][0]+'\" width=\"222\" height=\"97\" border=\"0\"></a></td>');
document.write('    <td bgcolor=\"'+bandeau[num][1]+'\">&nbsp;</td>');
document.write('  </tr>');
document.write('</table>');

}