	
		
		$(document).ready(function() 
		{
				$("#accordion").accordion({
					autoHeight: false,
					navigation: true
				});	
				$("#accordion2").accordion({
					autoHeight: true,
					navigation: true
				});		
		/*
		$('.gauche .bigbutton').click(function() 
		{
			document.location.href="http://soutenir.framasoft.org/page/don-par-carte?don=10&recurrent=1";
		});
		*/
		
		$('#bouton_campagne').qtip(
		   {
		      content: {
		         title: {
		            text: 'Informations',
		            button: 'Fermer'
		         }
		         //url: '/cmcic/form_don.php',
				 //method: 'GET',
				 //data: { don: "10", recurrent: "1" }
		      },
		      position: {
		         target: $(window), // Position it via the document body...
		         corner: 'center' // ...at the center of the viewport
		      },
		      show: {
		         when: 'click', // Show it on click
		         solo: true // And hide all other tooltips
		      },
		      hide: false,
		      style: {
		         width: 600,
		         padding: '14px',
		         border: {
		            width: 9,
		            radius: 9,
		            color: '#666666'
		         },
		         name: 'light'
		      },
		      api: {
		         beforeShow: function()
		         {
		            
					p_url='/cmcic/form_don.php';
					p_data=new Object; p_data.don=10; p_data.recurrent=1;
					p_method="GET";
					this.loadContent(p_url, p_data, p_method);

		            $('#qtip-blanket').fadeIn(this.options.show.effect.length);
		         },
		         beforeHide: function()
		         {
		            // Fade out the modal "blanket" using the defined hide speed
		            $('#qtip-blanket').fadeOut(this.options.hide.effect.length);
		         }
		      }
		   });

		$('.nonCampagne').qtip(
		   {
		   		prerender: false,
		      content: {
		         title: {
		            text: 'Informations',
		            button: 'Fermer'
		         }
		         //url: '/cmcic/form_don.php',
				 //method: 'get',
				 //data: { don: 10, recurrent: 1 }
				 //text: "bla " + (Math.floor(Math.random()*11)) +" bla"
		      },
		      position: {
		         target: $(window), // Position it via the document body...
		         corner: 'center' // ...at the center of the viewport
		      },
		      show: {
		         when: 'click', // Show it on click
		         solo: true // And hide all other tooltips
		      },
		      hide: false,
		      style: {
		         width: 600,
		         padding: '14px',
		         border: {
		            width: 9,
		            radius: 9,
		            color: '#666666'
		         },
		         name: 'light'
		      },
		      api: {
		         beforeShow: function()
		         {
		            // Fade in the modal "blanket" using the defined show speed	
					//this.elements.content.html(getDonValue());
					p_url='/cmcic/form_don.php';
					p_data=new Object; p_data.don=$("input[name='montant']").val(); p_data.recurrent=$("input[name='recurrent']").val();
					p_method="GET";
					this.loadContent(p_url, p_data, p_method);
					//this.loadContent(this.options.content.url, this.options.content.data, this.options.content.method);

		            $('#qtip-blanket').fadeIn(this.options.show.effect.length);
					
		         },
		         beforeHide: function()
		         {
		            // Fade out the modal "blanket" using the defined hide speed
		            $('#qtip-blanket').fadeOut(this.options.hide.effect.length);
		         }
		      }
		   });

				

		   
		   for (i=1;i<=2;i++) {
				$(".dedu_titre").fadeOut(1000).fadeIn(1000);
				$(".partenariats").fadeTo(1000,0.5).fadeTo(1000,1);
			}
		   
		   // Create the modal backdrop on document load so all modal tooltips can use it
		   $('<div id="qtip-blanket">')
		      .css({
		         position: 'absolute',
		         top: $(document).scrollTop(), // Use document scrollTop so it's on-screen even if the window is scrolled
		         left: 0,
		         height: $(document).height(), // Span the full document height...
		         width: '100%', // ...and full width

		         opacity: 0.7, // Make it slightly transparent
		         backgroundColor: 'black',
		         zIndex: 5000  // Make sure the zIndex is below 6000 to keep it below tooltips!
		      })
		      .appendTo(document.body) // Append to the document body
		      .hide(); // Hide it initially
		
		// AUTRES
		$('.options .dedu_infos img[alt="standard"]').qtip(
		   {
		      content: "<p>Framasoft est une association reconnue d'intérêt général</p>" +
						"<p>A ce titre, si vous êtes soumis à l'impôt sur le revenu, vous pourrez déduire 66% du montant de votre don.<br/>" +
						"Ainsi, si vous avez donné 10&euro; x 12 mois (120&euro;), vous pourrez déduire 120x66% (79,20&euro;) de votre prochaine déclaration.</p>" +
						"Pour des informations plus détaillées, voir <a href=\"/defiscalisation\">notre page explicative</a>.",
			   style: { name: 'cream', fontFamily: 'Arial', fontSize: 12 },
			   hide: { fixed: true, delay:400 },
			   show: { delay: 0 }
		   });
		
		$('.autres .dedu_infos img[alt="standard"]').qtip(
		   {
		      content: "<p>Framasoft est une association reconnue d'intérêt général</p>" +
						"<p>A ce titre, si vous êtes soumis à l'impôt sur le revenu, vous pourrez déduire 66% du montant de votre don.<br/>" +
						"Ainsi, si vous donnez 100&euro;, vous pourrez déduire 100x66% (66&euro;) de votre prochaine déclaration.</p>" +
						"Pour des informations plus détaillées, voir <a href=\"/defiscalisation\">notre page explicative</a>.",
			   style: { name: 'cream', fontFamily: 'Arial', fontSize: 12 },
			   hide: { fixed: true, delay:400 },
			   show: { delay: 0 }
		   });		
		   
		$('.options img[alt="don_mensuel"]').qtip(
		   {
		      content: "<p>Vous serez prélevé le 5 de chaque mois, pendant 12 mois. Vous pourrez arrêter le prélèvement sur <a href=\"/contact\">simple demande</a>.</p>" +
						"",
			   style: { name: 'cream', fontFamily: 'Arial', fontSize: 12 },
			   hide: { fixed: true, delay:400 },
			   show: { delay: 0 }
		   });
		
		function countChecked(n) {
		  $(".don_original").html(n+ " &euro;");
		  $(".don_reduit").html( Math.round(n*34)/100 + " &euro;" );
		  $("input[name='montant']").val(n);
		}
		function clearCheckboxes(data) {
			$("input[alt='" + data + "']").attr("checked", false);
		}
		function clearText(data) {
			if ($("input[id='" + data + "']").val() !=="") {
				$("input[id='" + data + "']").val("");
			} else {
			}
			
		}
		
		$(".maintenant label").css('color','#AAA');		
		// Paiement récurrent : valeur prédefinie
		$("input[name='mois']").change(function(){
			clearCheckboxes('maintenant');
			clearText('maintenant_libre');
			clearText('mois_libre');
			$(".maintenant label").css('color','#AAA');
			$(".mois label").css('color','#333');
			$(".dedu_votre_don .frequence").html("/ mois");
			$("input[name='recurrent']").val("1");
			countChecked($(this).val());
		});
		// Paiement récurrent : valeur libre
		$("input[id='mois_libre']").keyup(function(){
			clearCheckboxes('maintenant');
			clearCheckboxes('mois');
			clearText('maintenant_libre');
			$(".maintenant label").css('color','#AAA');
			$(".mois label").css('color','#333');
			$("input[name='recurrent']").val("1");
			$(".dedu_votre_don .frequence").html("/ mois");

			countChecked($(this).val());
		});
		// Paiement unique : valeur prédefinie
		$("input[name='maintenant']").change(function(){
			clearCheckboxes('mois');
			clearText('mois_libre');
			clearText('maintenant_libre');
			$(".mois label").css('color','#AAA');
			$(".maintenant label").css('color','#333');
			$("input[name='recurrent']").val("0");
			$(".dedu_votre_don .frequence").html("");
			countChecked($(this).val());
		});
		// Paiement unique: valeur libre
		$("input[id='maintenant_libre']").keyup(function(){
			countChecked($(this).val());
			clearCheckboxes('mois');
			clearCheckboxes('maintenant');
			$(".mois label").css('color','#AAA');;
			$(".maintenant label").css('color','#333');
			$("input[name='recurrent']").val("0");
			$(".dedu_votre_don .frequence").html("");
			clearText('mois_libre');
		});
		

		$('.autres .payer_btn').qtip(
		   {
		      content: {
		         title: {
		            text: 'Informations',
		            button: 'Fermer'
		         },
		         url: 'form.html'
		      },
		      position: {
		         target: $(document.body), // Position it via the document body...
		         corner: 'center' // ...at the center of the viewport
		      },
		      show: {
		         when: 'click', // Show it on click
		         solo: true // And hide all other tooltips
		      },
		      hide: false,
		      style: {
		         width: { max: 350 },
		         padding: '14px',
		         border: {
		            width: 9,
		            radius: 9,
		            color: '#666666'
		         },
		         name: 'light'
		      },
		      api: {
		         beforeShow: function()
		         {
		            // Fade in the modal "blanket" using the defined show speed
		            $('#qtip-blanket').fadeIn(this.options.show.effect.length);
		         },
		         beforeHide: function()
		         {
		            // Fade out the modal "blanket" using the defined hide speed
		            $('#qtip-blanket').fadeOut(this.options.hide.effect.length);
		         }
		      }
		   });

			$('.cheque a').qtip(
			   {
			      content: { title: { text: 'Dons par chèque', button: 'Fermer' },
			         text:	'<p>Ordre du chèque : "Association Framasoft"   <br>'+
							'Adresse pour l\'expédition :<br></p> '+
							'<div style="border: 1px solid grey; margin: 5px; padding: 10px; background-color: rgb(238, 238, 238); width: 75%;">Association Framasoft   <br> ' +
							'c/o Q.&nbsp;THEURET   <br>' +
							'3, Rue George SAND   <br>' +
							//'Appartement 70   <br>' +
							'67205	Oberhausbergen   </div>' +
							'<p style="font-size: 90%;"><strong>Défiscalisation</strong> : joignez à votre chèque, sur papier libre, vos nom, prénom, adresses (postale et email). <strong>Sans ces informations, nous ne pourrons pas émettre de reçu&nbsp;!</strong><br></p>'
			      },
			      position: { target: $(document.body), corner: 'center'},
			      show: { when: 'click', solo: true },
			      hide: false,
			      style: { width: { max: 550 }, fontSize: 14, padding: '14px', border: { width: 9, radius: 9, color: '#666666' }, name: 'light'},
			      api: { beforeShow: function() { $('#qtip-blanket').fadeIn(this.options.show.effect.length); },
			         beforeHide: function() { $('#qtip-blanket').fadeOut(this.options.hide.effect.length);  }
			      }
		   });

			$('.virement a').qtip(
			   {
			      content: { title: { text: 'Virement bancaire', button: 'Fermer' },
			         text: '<p>Coordonnées bancaires de Framasoft</p> ' +

							'<div style="border: 1px solid grey; margin: 5px; padding: 10px; background-color: rgb(238, 238, 238); width: 75%;">Titulaire : Framasoft   <br> ' +
							'Domiciliation : CréditCoop Gare de l\'Est   <br> ' +
							'RIB : 42559 00003 21029159609 87   <br> ' +
							'IBAN : FR76 4255 9000 0321 0291 5960 987   <br> ' +
							'BIC : CCOPFRPPXXX ' +
							'</div> ' +
							'<p style="font-size: 90%;"><strong>Défiscalisation</strong> : après avoir effectué votre don, <a title="nous contacter" href="/contact">contactez-nous</a> ' +
							'en  indiquant vos nom, prénom, adresses (postale et email) et montant du virement, après avoir fait votre virement.<strong>Sans ces informations, nous ne pourrons pas émettre de reçu !</strong></p> '
							},
			      position: { target: $(document.body), corner: 'center'},
			      show: { when: 'click', solo: true },
			      hide: false,
			      style: { width: { max: 550 }, fontSize: 14, padding: '14px', border: { width: 9, radius: 9, color: '#666666' }, name: 'light'},
			      api: { beforeShow: function() { $('#qtip-blanket').fadeIn(this.options.show.effect.length); },
			         beforeHide: function() { $('#qtip-blanket').fadeOut(this.options.hide.effect.length);  }
			      }
		   });

		   
		   
		   // Create the modal backdrop on document load so all modal tooltips can use it
		   $('<div id="qtip-blanket">')
		      .css({
		         position: 'absolute',
		         top: $(document).scrollTop(), // Use document scrollTop so it's on-screen even if the window is scrolled
		         left: 0,
		         height: $(document).height(), // Span the full document height...
		         width: '100%', // ...and full width

		         opacity: 0.7, // Make it slightly transparent
		         backgroundColor: 'black',
		         zIndex: 5000  // Make sure the zIndex is below 6000 to keep it below tooltips!
		      })
		      .appendTo(document.body) // Append to the document body
		      .hide(); // Hide it initially


		
		});

	

