// JavaScript Document
function telephone()
	{
		parent.open('/doc/bebloom/info.asp','teleoperateur','width=500,height=500,toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0,left=180,top=50');
	}

	function newstest(formulaire)
	{	
		if (formulaire.email.value=="ex : nom@free.fr")
		{
		alert ("Pour vous inscrire à notre newsletter, vous devez saisir préalablement votre email dans la zone de saisie.")
		formulaire.email.value = ""
		formulaire.email.focus()
		return false;
		}
		
		var monmail
		monmail=formulaire.email.value
		
		
		var myEMailIsValid = true;
		var myAtSymbolAt = monmail.indexOf('@');
		var myLastDotAt = monmail.lastIndexOf('.');
		var mySpaceAt = monmail.indexOf(' ');
		var myLength = monmail.length;
		var myaccenteAt = monmail.indexOf('é');
		var myaccentgAt = monmail.indexOf('é');
		var myaaccentAt = monmail.indexOf('à');
		var mypointaro = monmail.lastIndexOf('.@');
		var myaropoint = monmail.lastIndexOf('@.');

		if (myaccenteAt != -1 ) {
		myEMailIsValid = false;
		var txt_info = "Une adresse email ne contient jamais d'accent."
		}

		if (myaccentgAt != -1 ) {
		myEMailIsValid = false;
		var txt_info = "Une adresse email ne contient jamais d'accent."
		}
			
		if (myaaccentAt != -1 ) {
		myEMailIsValid = false;
		var txt_info = "Une adresse email ne contient jamais le caractère ' à ' ."
		}

		if (myAtSymbolAt < 1 ) {
			var txt_info = "Une adresse email valide doit contenir le caractére '@'.";
			myEMailIsValid = false;
		}
		
		if (mypointaro > 0) {
			var txt_info = "Une adresse email valide ne contient pas de '.' avant le caractère '@'.";
			myEMailIsValid = false;
		}
		
		if (myaropoint > 0) {
			var txt_info = "Une adresse email valide ne contient pas de '.' après le caractère '@'.";
			myEMailIsValid = false;
		}		
		
		if (myLastDotAt < myAtSymbolAt) {
			var txt_info = "Le domaine de votre adresse email n'est pas correct.";
			myEMailIsValid = false;
		}
		
		if (myLength - myLastDotAt <= 2) {
			var txt_info = "Le domaine de votre adresse email n'est pas correct.";
			myEMailIsValid = false;
		}
		
		if (mySpaceAt != -1) {
			var txt_info = "Une adresse email valide ne contient pas d'espace entre les mots.";
			myEMailIsValid = false
		}
		
		if (myEMailIsValid == true) {
			return true;
			}
		else {
			alert("L'adresse email que vous avez saisie, " + monmail + ", n'est pas une adresse email valide. \n " + txt_info + "\n \n Nous vous invitons à vérifier la saisie de votre email.");
			formulaire.email.focus();
			return false;
		}
	}

	function prisefocus(input)
		{
		if (input.value=="ex : nom@free.fr")
			{input.value=""}
		}
	

	function rech(formulaire)
	{	
		if (formulaire.recherche.value=="ex : roses")
		{
		alert ("Pour faire une recherche, vous devez saisir préalablement le sujet de celle-ci dans la zone de recherche, par exemple roses ...")
		formulaire.recherche.value = ""
		formulaire.recherche.focus()
		return false;
		}
				
	}
	
	function lestylede(idf) { 
	 if (document.getElementById) {
		return document.getElementById(idf).style;
	} else if (document.all) {
		return document.all[idf].style;
    } else if (document.layers) {
		return document.layers[idf];
	} else { return null }
	}

	function menuhover(idf) {
		var strecup=lestylede(idf); 
		if(strecup) {
		strecup.backgroundColor='#FED6C2'
		}
	}
	
	function menurestaure(idf) {
		var strecup=lestylede(idf);
		if(strecup) {
	    strecup.backgroundColor='<%=lbackgroundColor%>'
	    
		}
   }

	

	if (document.getElementById){ 
	document.write('<style type="text/css">\n')
	document.write('.sousmenu{display: none;}\n')
	document.write('</style>\n')
	}

	function SwitchMenu(id){
		var d = document.getElementById(id);
			for (var i = 1; i<=10; i++) {
				if (document.getElementById('btnMenu'+i)) {document.getElementById('btnMenu'+i).className='normal';}
			}
		if (d) {
			if (d.className=="active"){
			d.className="normal";
			}else{
			d.className="active";		
			}
		}
	}
	/*
//Script pour reconnaissance du flash, validation ou mise en place d'une img alternative

var requiredVersion = 6;
var useRedirect = false;


// System globals
var flash2Installed = false;
var flash3Installed = false;
var flash4Installed = false;
var flash5Installed = false;
var flash6Installed = false;
var flash7Installed = false;
var flash8Installed = false;
var flash9Installed = false;
var maxVersion = 9;
var actualVersion = 0;
var hasRightVersion = false;
var jsVersion = 1.0;


// Check the browser...we're looking for ie/win, but not aol
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    // true if we're on ie
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; // true if we're on windows


// This is a js1.1 code block, so make note that js1.1 is supported.
jsVersion = 1.1;

if(isIE && isWin){
  document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
  document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
  document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
  document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');  
  document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');  
  document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
  document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
  document.write('flash9Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
  document.write('<\/SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
}


function detectFlash() {  
  // If navigator.plugins exists...
  if (navigator.plugins) {
    // ...then check for flash 2 or flash 3+.
    if (navigator.plugins["Shockwave Flash 2.0"]
        || navigator.plugins["Shockwave Flash"]) {

      var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;

      var flashVersion = parseInt(flashDescription.substring(16));

      flash2Installed = flashVersion == 2;    
      flash3Installed = flashVersion == 3;
      flash4Installed = flashVersion == 4;
      flash5Installed = flashVersion == 5;
      flash6Installed = flashVersion == 6;
      flash7Installed = flashVersion == 7;
      flash8Installed = flashVersion == 8;
      flash9Installed = flashVersion >= 9;
    }
  }
  
  for (var i = 2; i <= maxVersion; i++) {  
    if (eval("flash" + i + "Installed") == true) actualVersion = i;
  }
  
  if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 4;  
  
  if (actualVersion >= requiredVersion) {
    if (useRedirect) {
      if(jsVersion > 1.0) {
        window.location.replace(flashPage);  
      } else {
        window.location = flashPage;
      }
    }
    hasRightVersion = true;                
  } else {  
    if (useRedirect) {
      if(jsVersion > 1.0) {
        window.location.replace((actualVersion >= 2) ? upgradePage : noFlashPage);
      } else {
        window.location = (actualVersion >= 2) ? upgradePage : noFlashPage;
      }
    }
  }
}
detectFlash();

function stpopup(nomst){
window.open("saint.asp?prenom="+nomst,"Saints","toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1,width=400,height=175,left=180,top=180");
}


data=new Array()
ldesc=new Array()

<%for j=0 to lnbprodselection-1%>
data[<%=j%>]=new Array("images/bouquets/petites/<%=vImgP(j)%>","/produits/detailproduits.asp?reference=<%=vPRef(j)%>","<a class=orange href='/produits/detailproduits.asp?reference=<%=vPRef(j)%>'><b><%=vInti(j)%></b><br /><%=formatnumber(vPrix(j),2)%><%=ladevise%> - <%=replace(replace(vDesc(j),"<b>",""),"</b>","")%></a>","<%=vInti(j)%>","images/bouquets/grands/<%=vImgG(j)%>")
<%next%>

img_places=3// number of image places in the display area
img_size=86 // size of the images, width and height are the same
img_sizew=98
img_sizeh=86

img_spacer=6 // space between the images

scroll_all_images=1
// 0 = first_img_num to the last_img_num
// 1 = scroll through all images in the array

// if scroll_all_images is set at zero the following two lines define a set of images
first_img_num=0 // starting image number, 1 to number of images in the array 
last_img_num=50 // ending image number

display_border=0 //
border_type="ridge" //
border_colour="#FFE7DE" //
display_bgcol="#FFE7DE" // add colour to the space between the images

display_top=386
display_center=0 // 0 = no 1 = yes
display_left=46

speed=1

first_img_num-- // adjust for javascript count 
last_img_num-- // adjust for javascript count 
if(first_img_num== -1){ // check for javascript count 
first_img_num=0
}
if(last_img_num>data.length-1){
last_img_num=data.length-1
}
display_width=(img_places*img_sizew)+(img_places*img_spacer)
initpos=new Array()
nowdivpos=new Array()
next_right=""
nextpic=first_img_num
run_rate=30

function init(){
if(scroll_all_images==1){
nextpic=0
}
document.write("<div id=\"display\" style=\"position:absolute; left:"+display_left+"; top:"+display_top+"; width:"+(display_width+display_border*2)+"px; height:"+(img_sizeh+display_border*2)+"px; border:"+display_border+"px "+border_type+" "+border_colour+";background-color:"+display_bgcol+"\">")

if(display_center==1){
document.getElementById("display").style.left=(document.body.clientwidth/2)-(document.getElementById("display").offsetwidth/2)
}

document.write("<div  id=\"center_div\" style=\"position:absolute; left:0; top:0; width:"+display_width+"px; height:"+img_sizeh+"px; clip:rect(0,"+display_width+","+img_size+",0)\" onmouseover=\"\" onmouseout=\"\">")

for(i=0;i<img_places+1;i++){
document.write("<div id=\"div_"+[i]+"\" style=\"position:absolute\">")
document.write("<a id=\"loc"+[i]+"\" href=../script//"/" onclick=\"newwin(this.location);return false\"><img onmouseover=\"stopme("+[i]+")\" onmouseout=\"move_right(),txt_init()\" src=../script//"/" id=\"pic_"+[i]+"\" width="+img_sizew+" height="+img_sizeh+" border=\"0\"></a></div>")
}
document.write("</div>")
document.write("</div>")
el_center=document.getElementById("center_div")
elpos=-document.getElementById("pic_0").width

for(i=0;i<img_places+1;i++){
elpos+=(document.getElementById("pic_0").width)+img_spacer
initpos[i]=elpos
document.getElementById("div_"+[i]).style.left=initpos[i]

if(scroll_all_images==0&&nextpic>last_img_num){
nextpic=first_img_num
document.getElementById("loc"+[i]).location=data[nextpic][1]
document.getElementById("pic_"+[i]).alt=data[nextpic][3]
document.getElementById("pic_"+[i]).infotag=data[nextpic][2]
document.getElementById("pic_"+[i]).imggde=data[nextpic][4]
document.getElementById("pic_"+[i]).src=data[nextpic++][0]
}
else{
document.getElementById("loc"+[i]).location=data[nextpic][1]
document.getElementById("pic_"+[i]).alt=data[nextpic][3]
document.getElementById("pic_"+[i]).infotag=data[nextpic][2]
document.getElementById("pic_"+[i]).imggde=data[nextpic][4]
document.getElementById("pic_"+[i]).src=data[nextpic++][0]
}

}

move_right()
}

function move_right(){
	for(i=0;i<img_places+1;i++){
	nowdivpos[i]=parseInt(document.getElementById("div_"+i).style.left)
	nowdivpos[i]-=speed

	if(nowdivpos[i]<= -document.getElementById("pic_0").width){
		document.getElementById("div_"+[i]).style.left=parseInt(el_center.style.width)+img_spacer

		if(scroll_all_images==0&&nextpic>last_img_num){
		nextpic=first_img_num
		document.getElementById("loc"+[i]).location=data[nextpic][1]
		document.getElementById("pic_"+[i]).alt=data[nextpic][3]
		document.getElementById("pic_"+[i]).infotag=data[nextpic][2]
		document.getElementById("pic_"+[i]).imggde=data[nextpic][4]
		document.getElementById("pic_"+[i]).src=data[nextpic++][0]
		}
		else{
		if(nextpic>data.length-1){
		nextpic=0
		}
		document.getElementById("loc"+[i]).location=data[nextpic][1]
		document.getElementById("pic_"+[i]).alt=data[nextpic][3]
		document.getElementById("pic_"+[i]).infotag=data[nextpic][2]
		document.getElementById("pic_"+[i]).imggde=data[nextpic][4]
		document.getElementById("pic_"+[i]).src=data[nextpic++][0]
		}

	}
	else{
	document.getElementById("div_"+[i]).style.left=nowdivpos[i]
	}

}
next_right=setTimeout("move_right()",run_rate)

}

function txt_init()
{
	if (document.getElementById)
		{
		document.getElementById("Layer7").innerHTML = "<span class=orange><br />Découvrez chaque bouquet au survol de la souris, et leur fiche produit avec un clic sur leur visuel !</span>";
		//document.getElementById("Layer7").innerHTML = "<a href='/produits/detailproduits.asp?reference=36103336'><img border=0 src='/images/home/pub80roses.gif'></a>";
		document.getElementById("selection").innerHTML =""
		document.getElementById("selection").style.visibility = "hidden";
		document.getElementById("Layer6").style.visibility = "visible";
		}
	else if (document.all) 
		{
		document.all["Layer7"].innerHTML = "<span class=orange><br />Découvrez chaque bouquet au survol de la souris, et leur fiche produit avec un clic sur leur visuel !</span>";
		//document.all["Layer7"].innerHTML = "<a href='/produits/detailproduits.asp?reference=36103336'><img border=0 src='/images/home/pub80roses.gif'></a>";
		document.getElementById("selection").innerHTML =""
		document.all["Layer6"].style.visibility = "visible";
		}
}

function stopme(nb)
{
clearTimeout(next_right) 
	if (document.getElementById)
		{
		document.getElementById("Layer7").innerHTML = document.getElementById("pic_"+[nb]).infotag;
		document.getElementById("selection").innerHTML = "<img width=250 height=250 border=0 src='../script/"+document.getElementById("pic_"+[nb]).imggde+"'>";
		document.getElementById("selection").style.visibility = "visible";
		document.getElementById("Layer6").style.visibility = "hidden";
		}
	else if (document.all) 
		{
		document.all["Layer7"].innerHTML = document.getElementById("pic_"+[nb]).infotag;
		document.all["selection"].innerHTML = "<img width=250 height=250 border=0 src='../script/"+document.getElementById("pic_"+[nb]).imggde+"'>";
		document.all["Layer6"].style.visibility = "hidden";
		}
}

function newwin(loc){
if(loc==""){return}
window.location = loc
}


function telephone()
{
	window.open('/doc/bebloom/info.asp','teleoperateur','width=290,height=200,toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0,left=180,top=345');
}
  window.open("/menu/menu.asp","CadreMenu");
//-->
*/
function afficheCalendrier(elem){
		calendrier=document.getElementById(elem);
		fond=document.getElementById("voile");
			fond.style.display="block";	
			calendrier.style.display="block";	
	
}
function masqueCalendrier(elem){
		calendrier=document.getElementById(elem);
		fond=document.getElementById("voile");
			calendrier.style.display="none";	
			fond.style.display="none";	
	
}
function switchCreneau(id){
	var d = document.getElementById(id);
	if (d) {
		if (d.style.display=="none"){
			d.style.display="block";
		}else{
			d.style.display="none";		
		}
	}
}
