// Tous droits réservés copyright 2007+
// http://www.RenePaul.net
// Pour son usage exclusif

jQuery.noConflict(); //http://docs.jquery.com/Using_jQuery_with_Other_Libraries
//$(document).ready(function(){
jQuery(document).ready(function($){
	var cible="_blank";
	//var tempo="";

//ONLOAD
	//WindowResize();
	//
	$("form").attr({target:cible}); //voir DON
	//$("a img").not("#nav a img,.zoomify a img").parent().css({background:"transparent"}); //patch d'un lien sur image
	//
	if(location.pathname.match(/divers_musique\.htm/)){$("#img_left").css({background:"url(images/mo.jpg) no-repeat"})}
	else if(location.pathname.match(/jv_collection\.htm/)){$("#img_left").css({background:"url(images/jv.jpg) no-repeat"})}
	else if(location.pathname.match(/sh_collection\.htm/)){$("#img_left").css({background:"url(images/sh.jpg) no-repeat"})}
	else if(location.pathname.match(/al_collection\.htm/)){$("#img_left").css({background:"url(images/al.jpg) no-repeat"})}
	else if(location.pathname.match(/poe_collection\.htm/)){$("#img_left").css({background:"url(images/poe.jpg) no-repeat"})}
	//else if(location.pathname.match(/collection_tintin\.htm/)){$("#img_left").css({background:"url(images/tintin.jpg) no-repeat"})}
	//else if(location.pathname.match(/collection_blakemortimer\.htm/)){$("#img_left").css({background:"url(images/blakemortimer.jpg) no-repeat"})}
	//else if(location.pathname.match(/collection_marple\.htm/)){$("#img_left").css({background:"url(images/marple.jpg) no-repeat"})}
	//else if(location.pathname.match(/collection_poirot\.htm/)){$("#img_left").css({background:"url(images/poirot.jpg) no-repeat"})}
	else if(location.pathname.match(/collection_vinci\.htm/)){$("#img_left").css({background:"url(images/vinci.jpg) no-repeat"})}
	else{$("#img_left").css({background:"url(images/mozart.jpg) no-repeat"})}
	//$("img,#cross_slide,#img_left,#corner_tl,#corner_tr,#corner_bl,#corner_br").bind("contextmenu",function(){return false;});

//CLICK
	$(".tabmenu a").click(function(){
		var tempo1=$(".tabmenu a").index(this);
		if(location.pathname.match(/divers_musique\.htm/)){
			if(tempo1==0){$("#img_left").css({background:"url(images/mo.jpg) no-repeat"})}
			if(tempo1==1){$("#img_left").css({background:"url(images/jmj.jpg) no-repeat"})}
			if(tempo1==2){$("#img_left").css({background:"url(images/pg.jpg) no-repeat"})}
			if(tempo1==3){$("#img_left").css({background:"url(images/schubert.jpg) no-repeat"})}
		}
		if(location.pathname.match(/jv_collection\.htm/)){
			if(tempo1==0){$("#img_left").css({background:"url(images/jv.jpg) no-repeat"})}
			if(tempo1==1){$("#img_left").css({background:"url(images/jv1.jpg) no-repeat"})}
			if(tempo1==2){$("#img_left").css({background:"url(images/jv2.jpg) no-repeat"})}
			if(tempo1==3){$("#img_left").css({background:"url(images/jv3.jpg) no-repeat"})}
		}
		/*
		if(location.pathname.match(/sh_collection\.htm/)){
			if(tempo1==0){$("#img_left").css({background:"url(images/sh.jpg) no-repeat"})}
			//if(tempo1==1){$("#img_left").css({background:"url(images/sh1.jpg) no-repeat"})}
		}
		if(location.pathname.match(/al_collection\.htm/)){
			if(tempo1==0){$("#img_left").css({background:"url(images/al.jpg) no-repeat"})}
			//if(tempo1==1){$("#img_left").css({background:"url(images/al1.jpg) no-repeat"})}
		}
		if(location.pathname.match(/poe_collection\.htm/)){
			if(tempo1==0){$("#img_left").css({background:"url(images/poe.jpg) no-repeat"})}
			//if(tempo1==1){$("#img_left").css({background:"url(images/poe1.jpg) no-repeat"})}
		}
		*/
	});

//HOVER
	$("#menu img.new1").hover(
		function (){
			$(this).attr({src:"images/gen_popup1.gif"});
		}, 
		function (){
			$(this).attr({src:"images/gen_popup.gif"});
		}
	);
	
//TOGGLE
	$(".section").toggle(
		function (){
			$(this).parent().next().hide("slow",function(){WindowResize()});
			//$(this).parent().next().hide("slow");
		},
		function (){
			$(this).parent().next().show("slow",function(){WindowResize()});
			//$(this).parent().next().show("slow");
		}
	);
	//
	$("#menu_close").toggle(
		function (){
			$("#menu").css({left:"-170px"});
			$("#main").css({left:"18px"});
			$("#img_left").css({left:"18px"});
			WindowResize();
		},
		function (){
			$("#menu").css({left:"5px"});
			$("#main").css({left:"192px"});
			$("#img_left").css({left:"192px"});
			WindowResize();
		}
	);
	//
	$("a.more").toggle(
		function (){
			$(this).parent().next().css({height:"auto"});
			WindowResize();
			//return false;
		},
		function (){
			$(this).parent().next().css({height:"110px"}); //voir .playlist
			WindowResize();
			//return false;
		}
	);
	
//RESIZE
/*
	$(window).resize(function(){
		WindowResize();
    });
*/

		
//FUNCTION
	function WindowResize(){
		//if($.browser.msie&&jQuery.browser.version.substr(0,1)<"7"){}
		//barre de défilement
		fleXenv.updateScrollBars();
	};
	//
	/*
	function titledetect(mytitle,mytext,myparenttext){
		var tempo=myparenttext.indexOf(":")+1;
		tempo=myparenttext.substring(0,tempo);
		if(mytext){tempo=tempo+" "+mytext} //priorité à mytext versus mytitle
		else{tempo=tempo+" "+mytitle} //pas mytext donc affaire à une image, prendre mytitle
		return tempo;
	};
	*/

});

