function PopupImage(img) {
	titre="Apperçu";
	w=open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=no,status=no');	
	w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE>");
	w.document.write("<SC"+"RIPT language=java"+"script> function checksize()  { if (document.images['img'].complete) {  window.resizeTo(document.images[0].width+12,document.images[0].height+30); window.focus();} else { setTimeout('checksize()',250) } }</"+"SCRIPT></HEAD>");
	w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' border=0 name='img'>");
	w.document.write("");
	w.document.write("</BODY></HTML>");
	w.document.close();
}
function changeimage(source){
	var destination = document.getElementById('imaged');
	destination.src = source;
}

function checkinscription(){
    var message_alert = "";
	obligatoires = new Array('nom', 'prenom', 'adresse', 'cp', 'ville', 'email');
	libObligatoires = new Array("Votre nom", "Votre prénom", "Votre adresse", "Votre code postal", "Votre Ville", "Votre adresse email");

    for(var i = 0; i < window.document.forms['inscription'].length ; i++) {				
       	var rechRapide = window.document.forms['inscription'].elements[i].value;
       	var nom_champ = window.document.forms['inscription'].elements[i].name;				   
       	//window.document.forms['contact'].elements[i].className = "inblur";				   
	   	var tag = 0;
	   	for(var j=0; j<obligatoires.length; j++){
	   		if (obligatoires[j] == nom_champ){
				lib_champ = libObligatoires[j];
				tag = 1;
				break;
			}
		}
		if (tag == 1){
	       	if(rechRapide == "") {
				window.document.forms['inscription'].elements[i].focus();				
				window.document.forms['inscription'].elements[i].style.backgroundColor="#F9CAAA";
				window.document.forms['inscription'].elements[i].style.border="solid 1px #dd0000";				
	          	window.document.forms['inscription'].elements[i].className = "inputnonvalide";							
	          	message_alert +=" Veuillez remplir le champ " + lib_champ +"\n";
	       	}else{
				if(nom_champ == 'email'){
					if ((rechRapide.indexOf('@',0)==-1) || (rechRapide.indexOf('.',0)==-1)) {
						message_alert +=" Votre adresse email est invalide\n";
					}
				}			
			}
		}
    }
	if(window.document.forms['inscription'].elements['cgv'].checked==false){
	message_alert +=" Vous devez accepter les conditions générales de vente pour continuer\n";
	}
    if (message_alert == "") {
    	window.document.forms['inscription'].submit();
    } else {
      	message_alert = "Informations nécessaires au traitement de votre demande : \n" + message_alert;
       	alert(message_alert);
       	return false;
    }
}



function toolip(lib, delais, texture, ref){
	var htmlTITRE = "<div style='width:100%;margin:2px; font-weight:bold;'>" + lib.replace("ü", "'") + "</div>";
		

	var htmlDELAIS = "<br />Délais de livraison : "+ delais.replace("ü", "'") + "<br />";
	
	var htmlTEXTURE = "Texture : "+ texture.replace("ü", "'") + "<br /><br />";
	
	var htmlIMAGE1 = "<img src='./imagesProduits/"+ref+"_01.jpg' width='56px' height='56px' hspace='2' border='1'  />";
	var htmlIMAGE2 = "<img src='./imagesProduits/"+ref+"_02.jpg' width='56px' height='56px' hspace='2' border='1'  />";
	var htmlIMAGE3 = "<img src='./imagesProduits/"+ref+"_03.jpg' width='56px' height='56px' hspace='2' border='1' />";		
	var hteumeuleu = "<div style='width:190px;background-color:#ECDCE7;color:#000000;z-index:1000;font-family:arial, sans serif;font-size:9pt'>"+ htmlTITRE +"<div style='width:100%;margin:2px'>"+ htmlDELAIS + htmlTEXTURE + htmlIMAGE1 + htmlIMAGE2+ htmlIMAGE3 + "<br><br></div></div>";
	Nom_Browser = navigator.appName;
	if ( Nom_Browser == "Microsoft Internet Explorer" ){
		return overlib(hteumeuleu,LEFT);
	 }else{
		return overlib(hteumeuleu, SHADOW, SHADOWCOLOR, '#CEC0CA', SHADOWOPACITY, 60, FADEOUT, LEFT);
	}
}
