	
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-650162-27']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

$(document).ready(function(){
	
	$(document).pngFix(); 
						   
     $("a.tracking").bind("click",function() {
          var titre = this.title;			  
          var retour = _gaq.push(['_trackEvent','Ouverture formulaire',titre, window.location.href ]);
			console.info(">GA : "+titre+" = "+retour);           
     });

  $('ul#top_menu').superfish();
  $(".rappeler").colorbox({width:"600px", inline:true, href:"#rappeler",onOpen:function(){		
																							$("h2.titreDyn",$("#rappeler")).remove();
																							if($(this).attr("alt")!="" && $(this).attr("alt")!=undefined && $("#rappeler h2").length<=0)
																								$("#rappeler").prepend("<h2 class='titreDyn'>"+$(this).attr("alt")+"</h2>");
																							}
						  
																						});
  $(".rencontrons").colorbox({width:"600px", inline:true, href:"#rencontrons",onOpen:function(){	
																							$("h2.titreDyn",$("#rencontrons")).remove();
																							if($(this).attr("alt")!=""&& $(this).attr("alt")!=undefined && $("#rencontrons h2").length<=0)
																								$("#rencontrons").prepend("<h2 class='titreDyn'>"+$(this).attr("alt")+"</h2>");
																							}
						  
																						});
 $(".pharmagora").colorbox({width:"600px", inline:true, href:"#pharmagora",onOpen:function(){	
																							$("h2.titreDyn",$("#pharmagora")).remove();
																							if($(this).attr("alt")!=""&& $(this).attr("alt")!=undefined && $("#pharmagora h2").length<=0)
																								$("#pharmagora").prepend("<h2 class='titreDyn'>"+$(this).attr("alt")+"</h2>");
																							}
						  
																						});
  $(".scrollable").scrollable({ vertical: true,circular:true,speed:1000 }).autoscroll({interval:5000});
  $('.form').jqTransform();


	$("#rappeler form").submit(function(){
	
		var form = $(this);
		var civilite = $("input[name=civilite]",form).val();
		var nom = $("input[name=nom]",form).val();
		var entreprise = $("input[name=entreprise]",form).val();
		var activite = $("input[name=activite]",form).val();
		var date = $("input[name=date]",form).val();
		var heure = $("input[name=heure]",form).val();
		var tel = $("input[name=tel]",form).val();
		$.post(
			"inc/gestionFormulaire.php",
			{act:"rappeler",civilite:civilite,nom:nom,entreprise:entreprise,activite:activite,date:date,heure:heure,tel:tel},
			function(msg){
				
				msg = eval("("+msg+")");
				if(msg.etat==1){
					$(".message",form).html(msg.texte);
					$(':input',form)
					 .not(':button, :submit, :reset, :hidden, [name=civilite]')
					 .val('')
					 .removeAttr('checked')
					 .removeAttr('selected');
					 
					$(':input[name=civilite]',form).removeAttr('checked').removeAttr('selected');
				}else if(msg.etat==2){
					$(".message",form).html(msg.texte);
				}else if(msg.etat==3){
					$(".message",form).html(msg.texte);
				}
				
			}
		);
		
		return false;
	});

	$("#rencontrons form").submit(function(){
	
		var form = $(this);
		
		var civilite = $("input[name=civilite]:checked",form).val();
		var nom = $("input[name=nom]",form).val();
		var prenom = $("input[name=prenom]",form).val();
		var pharmacie = $("input[name=pharmacie]",form).val();
		var adresse = $("input[name=adresse]",form).val();
		var cp = $("input[name=cp]",form).val();
		var ville = $("input[name=ville]",form).val();
		var tel = $("input[name=tel]",form).val();
		var portable = $("input[name=portable]",form).val();
		var email = $("input[name=email]",form).val();
		var commentaires = $("textarea[name=commentaires]",form).val();
		
		$.post(
			"inc/gestionFormulaire.php",
			{act:"rencontrons",civilite:civilite,nom:nom,prenom:prenom,pharmacie:pharmacie,adresse:adresse,cp:cp,ville:ville,tel:tel,portable:portable,email:email,commentaires:commentaires},
			function(msg){
				
				msg = eval("("+msg+")");
				if(msg.etat==1){
					$(".message",form).html(msg.texte);
					$(':input',form)
					 .not(':button, :submit, :reset, :hidden, [name=civilite]')
					 .val('')
					 .removeAttr('checked')
					 .removeAttr('selected');
					$(':input[name=civilite]',form).removeAttr('checked').removeAttr('selected');
				}else if(msg.etat==2){
					$(".message",form).html(msg.texte);
				}else if(msg.etat==3){
					$(".message",form).html(msg.texte);
				}
				
			}
		);
		
		return false;
	});
	
	
	$("#pharmagora form").submit(function(){
	
		var form = $(this);
		
		var civilite = $("input[name=civilite]:checked",form).val();
		var nom = $("input[name=nom]",form).val();
		var prenom = $("input[name=prenom]",form).val();
		var pharmacie = $("input[name=pharmacie]",form).val();
		var adresse = $("input[name=adresse]",form).val();
		var cp = $("input[name=cp]",form).val();
		var ville = $("input[name=ville]",form).val();
		var tel = $("input[name=tel]",form).val();
		var portable = $("input[name=portable]",form).val();
		var email = $("input[name=email]",form).val();
		
		var jour = $("input[name=jour]:checked",form).val();
		var creneau = $("input[name=creneau]:checked",form).val();
		
		$.post(
			"inc/gestionFormulaire.php",
			{act:"pharmagora",civilite:civilite,nom:nom,prenom:prenom,pharmacie:pharmacie,adresse:adresse,cp:cp,ville:ville,tel:tel,portable:portable,email:email,jour:jour,creneau:creneau},
			function(msg){
				
				msg = eval("("+msg+")");
				if(msg.etat==1){
					$(".message",form).html(msg.texte);
					$(':input',form)
					 .not(':button, :submit, :reset, :hidden, [type=radio]')
					 .val('')
					 .removeAttr('checked')
					 .removeAttr('selected');
					//$(':input[type=radio]',form).removeAttr('checked').removeAttr('selected');
				}else if(msg.etat==2){
					$(".message",form).html(msg.texte);
				}else if(msg.etat==3){
					$(".message",form).html(msg.texte);
				}
				
			}
		);
		
		return false;
	});
	$(".job .contenu-job").toggle();
  	$(".job .details-job").click(function(){
		$(this).next().slideToggle();
		return false;
	});
  	$(".job .fermer-job").click(function(){
		$(this).parent().slideToggle();
		return false;
	});


	//OUTLET
$(".outlet-slides").cycle({pager:"#outlet-pagination",pagerAnchorBuilder:function(index,dom){
return "<li>"+$("#visuel_"+index).html()+"</li>";
}}); 

});
//DD_belatedPNG.fix('img, #left, #right, #header, #header ul#top_menu li ul.methode, #header ul#top_menu li ul.methode li');
