/**
 * script pour 9 davril
 */
window.onload = function(){
   //alert('testteste');
   HideBook('book2','hide');
}
//
function Browser() {
	if (navigator.userAgent.indexOf('Opera') !=-1)
	this.opera = true;
	if (navigator.userAgent.indexOf('Konqueror') !=-1)
	this.Konqueror = true;
	if (navigator.userAgent.indexOf('Safari') !=-1)
	this.safari = true;
	if (navigator.userAgent.indexOf('Firefox/1.0') !=-1)
	this.ff10 = true;
	if (navigator.userAgent.indexOf('Firefox/1.5') !=-1)
	this.ff15 = true;
	if (navigator.userAgent.indexOf('Firefox/2.0') !=-1)
	this.ff20 = true;
	if (navigator.userAgent.indexOf('Netscape/7.0') !=-1)
	this.netscape = true;
	if (navigator.userAgent.indexOf('MSIE 7') != -1)
	this.ie7 = true;
	if (navigator.userAgent.indexOf('MSIE 6') != -1)
	this.ie6 = true;
	}
//
//
 function SiteenConstruction(){
    var texteafficher = 'Disponible prochainement - Essayez ulterieurement, svp\n';
	    texteafficher += 'Available soon...try again later, please\n';
		texteafficher += 'Disponible proximamente...-Ensaye mas tarde por favor';
    alert(texteafficher);
 }
//fonction de raccourci
function $(id){ return document.getElementById(id);}
//fonction pour masquer le livre (au demarrage par exemple)
 function HideBook(idofzebook,stateofdisplay){
  if(stateofdisplay == 'hide'){
    var Zebooktohide = document.getElementById(idofzebook);
	with(Zebooktohide.style){
	   display = 'none';
	}
	}
  if(stateofdisplay == 'show'){
    var Zebooktohide = document.getElementById(idofzebook);
	with(Zebooktohide.style){
	   display = 'block';
	}
	}
 }
//
function FlipFlop(thingId){
 var zebook1 = document.getElementById('book1');
 var zebook2 = document.getElementById('book2');
 if(zebook1.style.display = 'none'){
   zebook2.style.display = '';
 }else{
   zebook1.style.display = 'none';
 }
}
//ici on change le lien pour lire l'introduction
function changeIntroduction(statut){
    //
	if(statut == 'dentelle'){
	 linktodisplay = '<a href="Intro.pdf" target="_blank">Lire l\'Introduction</a>';
	 $('Layer7').innerHTML = linktodisplay;
	}
	if(statut == 'molas'){
	 linktodisplay = '<a href="javascript:hideFiche(\'fiche_mola\');">Lire l\'Introduction</a>';
	 $('Layer7').innerHTML = linktodisplay;
	}
}
//fpnction de flipflop
function visibilite(thingId,nextid){
var targetElement;
targetElement = document.getElementById(thingId) ;
previousElement = document.getElementById(nextid) ;
if (targetElement.style.display == "none")
{
 targetElement.style.display = "" ;
 showForm('molas');
 changeIntroduction('molas');
 $('Layer5').style.display = "";
} else {
 targetElement.style.display = "none" ;
 showForm('dentelle');
 changeIntroduction('dentelle');
 $('fiche_mola').style.display = 'none';
 $('Layer5').style.display = "";
}
//
if (previousElement.style.display == "none")
{
 previousElement.style.display = "" ;
 showForm('dentelle');
 changeIntroduction('dentelle');
 $('fiche_mola').style.display = 'none';
 $('Layer5').style.display = "";
} else {
 previousElement.style.display = "none" ;
 showForm('molas');
 changeIntroduction('molas');
 $('Layer5').style.display = "";
}
}
//
function showForm(kindofformular){
 var form1 = "";
 form1 += '<form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="form_dentelle">';
 form1 += '<input type="hidden" name="cmd" value="_s-xclick">';
 form1 += '<input type="hidden" name="hosted_button_id" value="8654516">';
 form1 += '<input type="image" src="https://www.paypal.com/fr_FR/FR/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - la solution de paiement la plus simple!">';
 form1 += '<img alt="" border="0" src="https://www.paypal.com/fr_FR/i/scr/pixel.gif" width="1" height="1">';
 form1 += '</form>';
 //
 var form2 = "";
 form2 += '<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" id="form_lesmolas">';
 form2 += '<input type="hidden" name="cmd" value="_s-xclick">';
 form2 += '<input type="hidden" name="hosted_button_id" value="9209974">'
 form2 += '<table>';
 form2 += '<tr><td><input type="hidden" name="on0" value="Livre + expedition transport TTC"><span id="titrexped">Livre + expedition transport TTC</span></td></tr><tr><td><select name="os0">';
 //form2 += '<option value="Si transport internationale">Si transport international Û37,00<option value="Si transport France">Si transport France Û34,00';
 form2 += '<option value="Si transport France">Si transport France Û34,00</option>';
 form2 += '<option value="Si transport internationale">Si transport international Û37,00</option>';
 form2 += '</select> </td></tr>';
 form2 += '</table>';
 form2 += '<input type="hidden" name="currency_code" value="EUR">';
 form2 += '<input type="image" src="https://www.paypal.com/fr_FR/FR/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - la solution de paiement en ligne la plus simple!">';
 form2 += '<img alt="" border="0" src="https://www.paypal.com/fr_FR/i/scr/pixel.gif" width="1" height="1">';
 form2 += '</form>';
 //
 if(kindofformular == 'dentelle'){
  $('pay_bypaypal').innerHTML = form1;
 }
 if(kindofformular == 'molas'){
 $('pay_bypaypal').innerHTML = form2;
   /*with($('form_lesmolas').style){
      position = 'relative';
	  top = '20px';
   }*/
   with($('titrexped').style){
    color = 'black';
	backgroundColor = 'white';
   }
 }
}
//fonction pour afficher la fiche d'un produit
function ShowFiche(nameofzefiche){
  $(nameofzefiche).style.display = "block";
  with($(nameofzefiche).style){
    //
	width = "465px";
	backgroundColor = "white";
	position = "relative";
	left = "440px";
	top = "460px";
	//
  }
  with($('Layer6').style){
    //
	display = "none";
	//
  }
//
}
//
function hideFiche(nameofzefiche){
   //fonction de flipflopp pour afficher la fiche du livre
   var ficha = $(nameofzefiche);
  if (ficha.style.display == "none")
 {
   //alert('etat egal un');
     $(nameofzefiche).style.display = "block";
  with($(nameofzefiche).style){
    //
	width = "465px";
	backgroundColor = "white";
	display = "block";
	position = "relative";
	left = "280px";
	top = "416px";
	Zindex = "3000";
	overflow = "auto";
	width = "480px";
	height = "300px";
	padding = "0px";
	//
  }
$('Layer5').style.display = "none";
  //onchange le texte pour fermer l'introduction
  $('Layer7').innerHTML = '<a href="javascript:hideFiche(\'fiche_mola\');">Fermer l\'Introduction</a>';
   //ficha.style.display = "" ;
 } else {
   //alert('etat egal 2');
     $(nameofzefiche).style.display = "none";
	 $('Layer7').innerHTML = '<a href="javascript:hideFiche(\'fiche_mola\');">Lire l\'Introduction</a>';
	 $('Layer5').style.display = "";
   //ficha.style.display = "none" ;
 }
}
//fonction pour afficher le menu//
function showMenu(id){
	//
	var targettouse;
	targettouse = document.getElementById(id) ;
	if (targettouse.style.display == "none")
	{
	targettouse.style.display = "" ;
	with($(id).style){
	      display = "block";
	      //border = "1px solid yellow";
	      width = "120px";
	      height = "60px";
	      position = "relative";
	      top = "0px";
	      left = "-45px";
	      padding = "0px";
	      backgroundColor = "black";
			}
	} else {
	targettouse.style.display = "none" ;
	}
}
//fontion pour masquer le menu //
function hideMenu(id){
	//
	with($(id).style){
      display = "none";   
		}
}
//
function visibilite(thingId){
	var targetElement;
	targetElement = document.getElementById(thingId) ;
	if (targetElement.style.display == "none")
	{
	targetElement.style.display = "" ;
	} else {
	targetElement.style.display = "none" ;
	}
	}
