






/*-------------Google Analytics------------------------ */


var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try {
var pageTracker = _gat._getTracker("UA-5386943-2");
pageTracker._trackPageview();
} catch(err) {}



/*<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-5386943-2");
pageTracker._trackPageview();
} catch(err) {}</script>*/



/*-------------------------------------------------- */



(function($) {

	$.fn.toggleVal = function(theOptions) {

		// check whether we want real options, or to destroy functionality

		if(!theOptions || typeof(theOptions) == "object") {

			theOptions = $.extend({

				focusClass: "tv-focused", // class during focus

				changedClass: "tv-changed", // class after focus

				populateFrom: "default", // choose from: default, label, custom, or alt

				text: null, // text to use in conjunction with populateFrom: custom

				removeLabels: false // remove labels associated with the fields

			}, theOptions);

		}

		else if(typeof(theOptions) == "string" && theOptions.toLowerCase() == "destroy") {

			var destroy = true;

		}

		

		return this.each(function() {

			// unbind everything if we're destroying, and stop executing the script

			if(destroy) {

				$(this).unbind("focus.toggleval").unbind("blur.toggleval").removeData("defText");

				return false;

			}

			

			// define our variables

			var defText = "";

			

			// let's populate the text, if not default

			switch(theOptions.populateFrom) {

				case "alt":

					defText = $(this).attr("alt");

					$(this).val(defText);

					break;

				case "label":

					defText = $("label[for='" + $(this).attr("id") + "']").text();

					$(this).val(defText);

					break;

				case "custom":

					defText = theOptions.text;

					$(this).val(defText);

					break;

				default:

					defText = $(this).val();

			}

			

			// let's give this field a special class, so we can identify it later

			// also, we'll give it a data attribute, which will help jQuery remember what the default value is

			$(this).addClass("toggleval").data("defText", defText);

			

			// now that fields are populated, let's remove the labels if applicable

			if(theOptions.removeLabels == true) { $("label[for='" + $(this).attr("id") + "']").remove(); }

			

			// on to the good stuff... the focus and blur actions

			$(this).bind("focus.toggleval", function() {

				if($(this).val() == $(this).data("defText")) { $(this).val(""); }

				

				// add the focusClass, remove changedClass

				$(this).addClass(theOptions.focusClass).removeClass(theOptions.changedClass);

			}).bind("blur.toggleval", function() {

				if($(this).val() == "") { $(this).val($(this).data("defText")); }

				

				// remove focusClass, add changedClass if, well, different

				$(this).removeClass(theOptions.focusClass);

				if($(this).val() != $(this).data("defText")) { $(this).addClass(theOptions.changedClass); }

					else { $(this).removeClass(theOptions.changedClass); }

			});

		});

	};

})(jQuery);





/////////////////////////////////////////////////////////////////EXCUTION///////////////////////////////////////////////////////////////////////////////////





$(document).ready(function(){



						   

						   

//.............................Formulaire...................



		var nom = $(":input.nom").val();

		var mail = $(":input.mail").val();

		var com = $(":input.message").val();



//....................Effacement des champs Formulaire..............



		/*$("input[name='nom']").toggleVal();

		$("input[name='mail']").toggleVal();

		$("textarea").toggleVal();*/

				

//....................Message d'Alerte Formulaire...................



		/*$("#infobulle").show();*/



		/*$("#infobulle").hide();

		

		$(":input").focus(function(){

			iForm_Come ();

		});



		function iForm_Come (txF) {

				//$("#infobulle").html('<p class="tx_infobulle">'+txF+'</p>');

				$("#infobulle").show(function(){

					tx_Come (txF);					  

					//$(".tx_infobulle").stop().show("fast");							

				});												

		}



		function tx_Come (txF) {

				$(".tx_infobulle").html(txF).show("slow");										

		}	

		

		

		$(".mail").blur (verifMail);	

		$(".message").blur (verifCom);

		$(".mail").keyup (verifMail);	

		$(".message").keyup (verifCom);

		

		

		function verifMail () {

			reg=/^[a-z0-9._-]+@[a-z0-9._-]{2,}\.[a-z]{2,4}$/;

			if(!reg.test(mail)) { 

			tx_Come ('Adresse incorrecte<br/><br/>');

			} else {

			tx_Come ('Bon ok...');	

			}			

		}

		

		function verifCom  () {

			if( com == "" || com == "Message"){

				tx_Come ('Commentaire requis<br/><br/>');

				} else {

				tx_Come ('OK');

				}

		}

				

		$(".envoyer").click(function(){  

		});  

			*/	

		
	
			
		

				

//............................Presse infobulle..........................//



		$(".P_prog, .P_pres, .P_aff").hide();

		

		

		function iPress_Come (pIf, nP ,txP) { 

			var nPa = nP-10+"px";

			$(pIf).css({'top' : nPa /*, 'width': "0px", 'height' :'0px'*/});

				if ($.browser.msie && $.browser.version <= 7){

				$(P_bulle).animate({"opacity": 0.9}, 0);

				} 	

			timer = setTimeout( function() { 

				 $(pIf).animate({"top": "+=10px", "opacity": "toggle"/*, 'width': "133px", 'height' :'134px'*/}, 450);	 

										 }, 200);

		}

	

		function iPress_End (pIf) {	

			clearTimeout(timer);

			$(pIf).hide();

		}

			

		$(".p_programme").stop().hover(

			function(){	iPress_Come('.P_prog', '185','.txP_prog'); },

			function(){	iPress_End('.P_prog'); }

			);

		

		$(".p_presse").stop().hover(

			function(){	iPress_Come('.P_pres', '200','.txP_presse'); },

			function(){	iPress_End('.P_pres'); }

			);

		

		$(".p_affiche").stop().hover(

			function(){	iPress_Come('.P_aff', '220','.txP_affiche'); },

			function(){	iPress_End('.P_aff'); }

			);

		



//............................Programme Concert/Contests.............................//



		var clickOn = 0;



		$("#preC h1 a,#tx_P h2 a ,#tx_P h3 a").stop().click(function(){

				clickOn++;

				page=$(this).attr("href");

				$.ajax({

					url: "http://www.100contests.fr/"+page,

					cache:false,

					success:function(php){ afficher(php); },

					error:function(XMLHttpRequest,textStatus, errorThrown){

						alert("Erreur de chargement");

					}

				})

				return false;

		});





		function afficher(data){

			$("#conteneurFiche").empty("#fiche");

			var fiche = $(data).find("#fiche");

			$("#conteneurFiche").append(fiche);

			

			//.....Anim intro

			if (clickOn==1) {

			$("#zoneImg").animate({ width: "0px" }, 0);

			$("#zoneImg").animate({ width: "300px" }, 400);

			$("#zoneVideo").hide();

			$('#fiche').animate({ opacity: "hide" },0);

			$('#fiche').animate({ opacity: "show" },900);

			$("#zoneTx").animate({ width: "0px" }, 0);	

			$("#zoneTx").animate({ width: "430px" }, 600,

						function(){ $("#zoneVideo").show(); }		 

			);

			}

			

			//....Anim transition

			else {

			$('#zoneImg').animate({ opacity: "0" },0);	

			$('#zoneImg').animate({ opacity: "1" },900);

			$("#zoneVideo").hide();

			$("#zoneTx").animate({ width: "0px" }, 0);	

			$("#zoneTx").animate({ width: "430px" }, 600,

						function(){ $("#zoneVideo").show(); }		 

			);	

			}

			

					//....Anim fin

					$("#btFermer").click(function(){

						clickOn = 0;

						$("#fiche").empty("#zoneVideo");

						$("#fiche").animate({ opacity: "hide" }, 900,	

									 function(){

							$("#conteneurFiche").empty("#fiche");

											});

						return false;

					});

										

		}



















		

});















