/********************************************************************************
* Nom      : createPopup
* Fonction : Permet l'affichage d'une Popup en tête de la page News
* Variables: bcp bcp bcp de variables !
* Auteur   : BRIAN GOSSELIN OF HTTP://SCRIPTASYLUM.COM
* Syntaxe  : createPopup( 'b1002234907432', 'TITRE' , TAILLEX, TAILLEY, POSX, POSY, true,  '#FFCC00' , '#FF6600' , 'black' ,  'TEXTE' , '#000000'  , 8 , 'Comic sans MS','#FFFFFF') ;
********************************************************************************/

var IE5=(document.getElementById && document.all)? true : false;
var W3C=(document.getElementById)? true: false;
var currIDb=null, currIDs=null, xoff=0, yoff=0; zctr=0; totz=0;

function trackmouse(evt){
if((currIDb!=null) && (currIDs!=null)){
var x=(IE5)? event.clientX+document.body.scrollLeft : evt.pageX;
var y=(IE5)? event.clientY+document.body.scrollTop : evt.pageY;
currIDb.style.left=x+xoff+'px';
currIDs.style.left=x+xoff+10+'px';
currIDb.style.top=y+yoff+'px';
currIDs.style.top=y+yoff+10+'px';
return false;
}}

function stopdrag(){
currIDb=null;
currIDs=null;
NS6bugfix();
}

function grab_id(evt){
xoff=parseInt(this.IDb.style.left)-((IE5)? event.clientX+document.body.scrollLeft : evt.pageX);
yoff=parseInt(this.IDb.style.top)-((IE5)? event.clientY+document.body.scrollTop : evt.pageY);
currIDb=this.IDb;
currIDs=this.IDs;
}

function NS6bugfix(){
if(!IE5){
self.resizeBy(0,1);
self.resizeBy(0,-1);
}}

function incrzindex(){
zctr=zctr+2;
this.subb.style.zIndex=zctr;
this.subs.style.zIndex=zctr-1;
}

function createPopup(id, title, width, height, x , y , isdraggable, boxcolor, barcolor, shadowcolor, text, textcolor, textptsize, textfamily, titlecolor ){
if(W3C){
zctr+=2;
totz=zctr;
var txt='';
txt+='<div id="'+id+'_s" style="position:absolute; left:'+(x+10)+'px; top:'+(y+10)+'px; width:'+width+'px; height:'+height+'px; background-color:'+shadowcolor+'; filter:alpha(opacity=50); visibility:visible"> </div>';
txt+='<div id="'+id+'_b" style="border:outset '+barcolor+' 2px; position:absolute; left:'+x+'px; top:'+y+'px; width:'+width+'px; overflow:hidden; height:'+height+'px; background-color:'+boxcolor+'; visibility:visible">';
txt+='<div style="width:'+width+'px; height:16px; background-color:'+barcolor+'; padding:0px; border:1px"><table cellpadding="0" cellspacing="0" border="0" width="'+(IE5? width-4 : width)+'"><tr><td width="'+(width-20)+'"><div id="'+id+'_h" style="width:'+(width-20)+'px; height:14px; font: bold 12px Arial; color:'+titlecolor+'"> '+title+'</div></td><td align="right"><a onmousedown="document.getElementById(\''+id+'_s\').style.display=\'none\'; document.getElementById(\''+id+'_b\').style.display=\'none\';return false"><img src="Images/croix_noire.gif" border="0" height="15" width="15"></a></td></tr></table></div>';
txt+='<div id="'+id+'_ov" width:'+width+'px; style="margin:2px; color:'+textcolor+'; font:'+textptsize+'pt '+textfamily+';">'+text+'</div></div>';
document.write(txt);
this.IDh=document.getElementById(id+'_h');
this.IDh.IDb=document.getElementById(id+'_b');
this.IDh.IDs=document.getElementById(id+'_s');
this.IDh.IDb.subs=this.IDh.IDs;
this.IDh.IDb.subb=this.IDh.IDb;
this.IDh.IDb.IDov=document.getElementById(id+'_ov');
if(IE5){
this.IDh.IDb.IDov.style.width=width-6;
this.IDh.IDb.IDov.style.height=height-22;
this.IDh.IDb.IDov.style.scrollbarBaseColor=boxcolor;
this.IDh.IDb.IDov.style.overflow="auto";
}else{
this.IDh.IDs.style.MozOpacity=.5;
}
this.IDh.IDb.onmousedown=incrzindex;
if(isdraggable){
this.IDh.onmousedown=grab_id;
this.IDh.onmouseup=stopdrag;
}}}

if(W3C)document.onmousemove=trackmouse;
if(!IE5 && W3C)window.onload=NS6bugfix;

/********************************************************************************
* Nom      : AffichePub
* Fonction : Affichage de bannieres de pub en frame horizontale
* Variables: (none)
********************************************************************************/
ejs_banurl = new Array;
ejs_banimageUrl=new Array;
ejs_banimageUrl[0] = "http://start1g.ovh.net/~dragonba/pub/ban468x60_animv2.gif";
ejs_banurl[0] = "http://www.dragon-ball.fr";
ejs_banimageUrl[1] = "http://www.frutiparc.com/ad.php?ref=HonnyVore&size=468_60";
ejs_banurl[1] = "http://www.frutiparc.com/?ref=HonnyVore";
ejs_banimageUrl[2] = "http://www.honnyvore.com/Js/kado.jpg";
ejs_banurl[2] = "http://www.kadokado.com/?ref=honnyvore";
ejs_banimageUrl[3] = "http://www.honnyvore.com/Pub/bannieres_locales/lego468x60_v1.jpg";
ejs_banurl[3] = "http://honnyvore.spaces.live.com";

affiche = false;

function AffichePub()
   {
   if(!affiche){
      numimage= Math.round(Math.random()*(ejs_banurl.length-1));
      document.write ('<A HREF="#" onClick="window.open(ejs_banurl[numimage],\'_blank\')"><IMG SRC="' + ejs_banimageUrl[numimage] + '" BORDER=0 NAME=ejs_banpub></A>')
      affiche = true;}
   else{
      if(numimage == (ejs_banurl.length-1))
	numimage = 0;
      else
	numimage++;
      document.ejs_banpub.src=ejs_banimageUrl[numimage];
      }
   setTimeout("AffichePub()",10000);
   }

/********************************************************************************
* Nom      : AfficheVignette
* Fonction : Affichage de vignettes pour les photos
* Variables: cheminVignette, cheminMaxi, chemin
********************************************************************************/
function afficheVignette(cheminVignette,cheminMaxi)
	{
	document.write('<A HREF="javascript:afficheMaxi(\''+cheminMaxi+'\')"><IMG SRC="'+cheminVignette+'" HSPACE=0 VSPACE=0 BORDER=0 ALT="cliquez ici pour voir en grand"></A>');
	}

function afficheMaxi(chemin)
	{
	i1 = new Image;
	i1.src = chemin;
	html = '<HTML><HEAD><TITLE>Image</TITLE></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><CENTER><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+10,document.imageTest.height+25)"></CENTER></BODY></HTML>';
	popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1');
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close()
	}