function check_email(mail) {
	if ((mail.indexOf("@")>=0)&&(mail.indexOf(".")>=0)) {
		return true 
	} else {
		alert("Email invalide !");
		return false
	}
}

function check_delete(form) {
	if(confirm("Are you sure, you want to delete this item ?")) {
		form.submit();
	}
}

function check_contact_form(form) {
	if (form.lastname.value == "Votre nom") {
		alert( "Entrez votre nom." );
		form.lastname.focus();
		return false ;
	}
	if (form.firstname.value == "Votre prénom") {
		alert( "Entrez votre prénom." );
		form.firstname.focus();
		return false ;
	}
	if (form.email.value == "Votre adresse e-mail") {
		alert( "Entrez votre email." );
		form.email.focus();
		return false ;
	} else {
		if ( ! check_email(form.email.value) ) {
			form.email.focus();
			return false;
		}
	}
	if (form.tel.value == "Votre téléphone") {
		alert( "Entrez votre téléphone." );
		form.tel.focus();
		return false ;
	}
	if (form.demand.value == "Votre demande") {
		alert( "Entrez votre demande." );
		form.demand.focus();
		return false ;
	}
	form.submit();
	return true;
}

function showPic( imgName, imgCaption, imgWidth, imgHeight, textColor, bgColor ) {
	if(imgWidth<=100) imgWidth=100;
	if(imgHeight<=100) imgHeight=100;
	winHeight = imgHeight+20;
	w = window.open('','Demo','toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes,copyhistory=no,width='+imgWidth+',height='+winHeight);
w.document.write( 
"<html><head><title>"+imgCaption+"</title>" +
"<STYLE TYPE='text/css'>" +
"A {font-family: verdana; font-size: 10px; color: "+textColor+"; text-decoration : none;}" +
"A:Visited {font-family: verdana;font-size: 10px; color: "+textColor+"; }" +
"A:Active { font-family: verdana; font-size: 10px; color: "+textColor+"; }" +
"A:Hover { font-family: verdana; font-size: 10px; color: "+textColor+"; }" +
"IMG {border-color : "+textColor+";}" +
"BODY { font-family: verdana; font-size : 10px; font-weight: normal; color : "+textColor+"; background-color : "+bgColor+"; }" +
"</STYLE>" +
"<script language='JavaScript'>\n" +
"IE5=NN4=NN6=false\n" +
"if(document.all)IE5=true;\n" +
"else if(document.getElementById)NN6=true\n" +
"else if(document.layers)NN4=true\n" +
"function autoSize() {\n" +
"	if(IE5) self.resizeTo(document.images[0].width+10,document.images[0].height+31+30+20)\n" +
"	else if(NN6) self.sizeToContent()\n" +
"	else top.window.resizeTo(document.images[0].width,document.images[0].height+30+20)\n" +
"	self.focus()\n" +
"}\n" +
"</script>\n" +
"</head>" +
"<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad='javascript:autoSize();'>" +
"<table cellpadding=0 cellspacing=0 border=0><tr><td><a href='javascript:top.window.close();'><img src='"+imgName+"' border=0 alt='"+imgCaption+"'></a></td></tr>" +
"<tr><td align='center'><a href='javascript:top.window.close();'>Close window</a>&nbsp;&nbsp;</td></tr>" +
"</table></body></html>");
	w.document.close();
}

