var hauteurFenetre = 100;	// Hauteur de la popup
var largeurFenetre = 500;	// Largeur de la popup
var topFenetre = 250			// Distance du haut de la fenetre
var leftFenetre= 400		// Distance du bord gauche de la fenetre

var hauteurBarretitre = 20; // Hauteur de la barre de titre
var couleurHaut = "#c26776"	// Couleur de la barre de titre	
var couleurBas = "#ffffff"	// Couleur du corps de la fenetre

var texteBarretitre = "<b>Vous venez d'ajouter ce Produit à votre Panier.</b>"	// Texte qui apparait dans la barre de titre
var policeBarretitre = "Arial"					// Police dans la barre de titre
var taillePoliceBarretitre = "14"				// taille de la police dans la barre de titre
var couleurPoliceBarretitre = "#FFFFFF"			// Couleur du texte de la barre de titre

	// Texte du corps de la popup

var policeCorps = "Arial"								// Police du corps de la popup
var taillePoliceCorps = "13"							// Taille du texte
var couleurPoliceCorps = "#006699"
var popup_exist=false;
var Ombre = 1				// 0 : pas d'ombre; 1 : ombrage
var clic = false;
function clicDown(tab) {
	abscisse = absc-leftFenetre;
	ordonne = ord-topFenetre;
	clic=true;
}
function clicUp() {
		clic=false;
}
function fermerPopup() {
	document.getElementById("pop_up").style.visibility="hidden";
}
function get_mouse(e){
	if (document.getElementById && document.all) {
		// Internet explorer
		absc = event.x+document.body.scrollLeft;
		ord = event.y+document.body.scrollTop;
	} else if (document.getElementById) {
		// Netscape 6+
		absc = e.pageX
		ord = e.pageY
	} 
	if(clic && document.getElementById){
		leftFenetre = absc-abscisse;
		topFenetre = ord-ordonne;
	}
	if(popup_exist){
	document.getElementById("pop_up").style.left = leftFenetre;
  	document.getElementById("pop_up").style.top = topFenetre;
	}
}
if (document.getElementById && !document.all) {
	document.captureEvents(Event.MOUSEMOVE);
}	
document.onmousemove = get_mouse;

function popup(){
	if (document.getElementById) {
		document.write('<style type="text/css">')
		document.write('table.popup {')
		document.write('	border: 2px solid #c26776;}')
		document.write('td.titre {')
		document.write('	font-family: '+policeBarretitre+';')
		document.write('	font-size: '+taillePoliceBarretitre+'px;')
		document.write('	color: '+couleurPoliceBarretitre+';}')
		document.write('td.corps {')
		document.write('	font-family: '+policeCorps+';')
		document.write('	font-size: '+taillePoliceCorps+'px;')
		document.write('	color: '+couleurPoliceCorps+';}')
		document.write('</style>')
		document.write('<DIV id=pop_up STYLE="position:absolute; top:'+topFenetre+'px; left:'+leftFenetre+'px;visibility:visible;">')
		popup_exist=true;
	
		if (Ombre == 1 ) {
			document.write('<table width="'+largeurFenetre+'" height="'+hauteurFenetre+'" border="0" cellspacing="0" cellpadding="0">')
			document.write('<tr> ')
			largeurFenetre -= 5
			hauteurFenetre -= 5
			document.write('<td width="'+largeurFenetre+'"  height="'+hauteurFenetre+'" colspan="2" rowspan="2" align="left" valign="top">')
		}
       
		document.write('<table width="'+largeurFenetre+'"  height="'+hauteurFenetre+'" border="0" cellspacing="0" cellpadding="5" class="popup">')
		largeurFenetre -= hauteurBarretitre
		hauteurFenetre -= hauteurBarretitre
		document.write('<tr onMouseDown="clicDown()" onMouseUp="clicUp()">')
		document.write('<td bgcolor="'+couleurHaut+'" class="titre" width="'+largeurFenetre+'" height="'+hauteurBarretitre+'" style="cursor: move">' + texteBarretitre +'</td>')
		document.write('</tr>')
		document.write('<tr valign="top">') 
		document.write('<td bgcolor="'+couleurBas+'" width="'+largeurFenetre+'" height="'+hauteurFenetre+'" colspan="2" class="corps">'+texteCorps+'</td>')
		document.write('</tr>')
		document.write('</table>')
	
		if (Ombre == 1 ) {
			document.write('</td>')
			document.write('<td width="5" height="5" background="image6.gif"></td>') 
			document.write('</tr>')
			document.write('<tr>')
			document.write('<td background="image2.gif" width="5" height="'+hauteurFenetre+'"></td>')
			document.write('</tr>')
			document.write('<tr> ')
			document.write('<td height="5" width="5" background="image5.gif"></td>')
			document.write('<td height="5" width="'+largeurFenetre+'" background="image3.gif"></td>')
			document.write('<td height="5" width="5" background="image4.gif"></td>')
			document.write('</tr>')
  			document.write('</table>')
		}
		document.write('</div>')
	}
}