// Tous droits réservés copyright 2009
// http://www.RenePaul.net
// Pour son usage exclusif

$(document).ready(function(){
	var cible="new"; //"_blank"
	var tempo1=[];

//ONLOAD
	//$('.deezermini').css({overflow:'hidden'});
	//$('.deezermaxi').css({width:'450px',height:'50px',overflow:'hidden'});
	//$(".post-body img").css({border:'solid 1px #fff'});
	$(".deezermini").css({border:'solid 1px #555'});
	//$("#Label1").css({height:"100px",overflow:"hidden"});
	/*
	$(document).bind('keydown', {combi:'F12',disableinInput: false},function(){
		if($("#sidebar-wrapper").is(":visible")){
			$("#sidebar-wrapper").hide();
			$("#main-wrapper").css({width:"100%"});
		}
		else{
			$("#sidebar-wrapper").show();
			$("#main-wrapper").css({width:"78%"});		
		}
	});
	*/
	//
	/*
	if(location.href.match("show=no")){
		$("#header-wrapper").hide();
		//$("#crosscol-wrapper").hide();
		$("#main-wrapper").css({width:"100%"});
		$("#sidebar-wrapper").hide();
		$("#footer-wrapper").hide();
	}
	*/
	//
	//les lignes suivantes ne fonctionnent que sous FF et Chrome pas IE à cause de onclick
	//$("div.highslide-gallery a").addClass("highslide").attr("onclick","return hs.expand(this)");
	//$("div.highslide-gallery a").attr("class","highslide").attr("onclick","return hs.expand(this)");
	//pour IE et les autres,il faut alors procéder ainsi:
	$(".highslide-gallery a, a.highslide-gallery").each(function(){
		tempo1[0]=$(this).attr("href");
		tempo1[2]=$(this).attr("title");
		tempo1[3]=$(this).attr("class"); //si class=nondispo
		tempo1[3]="highslide "+tempo1[3];
		tempo1[1]=$(this).children().attr("src");
		//tempo1[2]=$(this).children().attr("title");
		//$(this).replaceWith('<a class="'+tempo1[3]+'" href='+tempo1[0]+' onclick="return hs.expand(this)"><img src='+tempo1[1]+' title="'+tempo1[2]+'"></a>');
		$(this).replaceWith('<a class="'+tempo1[3]+'" href='+tempo1[0]+' onclick="return hs.expand(this)" title="'+tempo1[2]+'"><img src='+tempo1[1]+'></a>');
	});
	//
	//$("a img").parent().css({background:"transparent"}); //patch d'un lien sur image
	$("img").bind("contextmenu",function(){return false;});

//MOUSEDOWN	pour bloquer le drag-drop sous FF et Chrome
	$("img").mousedown(function(){
		return false;
	});
	
//CLICK
	//
	/*
	$("#header .description a,.post h3 a,.post-body a,#MesLiens a").not(".PopUpVideo a,a.PopUpVideo,.PopUpDoc a,a.PopUpDoc,.PopUpZoomify a,a.PopUpZoomify").click(function(){
		$(this).attr({target:cible});
	});
	*/
	$("a").not(".PopUpVideo a,a.PopUpVideo,.PopUpDoc a,a.PopUpDoc,.PopUpZoomify a,a.PopUpZoomify").click(function(){
		var tempo=$(this).attr("href");

		//if(tempo.match(/\.blogspot\.com/)){}
		if(tempo.match(location.host)){}
		else if(tempo.substring(0,1)=="#"){}
		else if(!tempo.match("http")){}
		else{$(this).attr({target:cible})}
	});
	//
	$(".PopUpVideo a,a.PopUpVideo").click(function(){
		PopUpVideo($(this).attr("href"));
		return false;
	});
	//
	$(".PopUpDoc a,a.PopUpDoc").click(function(){
		if(typeof($(this).attr("data")) == "undefined"){
			PopUpDoc($(this).attr("href"));
			return false;		
		}
		else if($(this).attr("data").match("PopUpDoc")){
			eval($(this).attr("data"));
			return false;
		}
		else{
			PopUpDoc($(this).attr("data"));
			return false;
		}
	});	
	//
	$(".PopUpZoomify a").click(function(){
		PopUpZoomify($(this).attr("data"),$(this).parent().attr("data"));
		return false;
	});
	//
	$("a.PopUpZoomify").click(function(){
		PopUpZoomify($(this).attr("data"),$(this).attr("data1"));
		return false;
	});
	
//DBLCLICK
/*
    $("*").dblclick(function(){
		PopUpFront();
    });
*/

//TOGGLE
	$("#myMenu1").toggle(
		function (){
			$(this).html("&#9650;");
			//$("#myMenu").css({top:"40px"});
			$("#Navbar1").css({display:"block",visibility:"visible"});
		},
		function (){
			$(this).html("&#9660;");
			//$("#myMenu").css({top:"10px"});
			$("#Navbar1").css({display:"none",visibility:"hidden"});
		}
	);
	//
	$("#myMenu2").toggle(
		function (){
			$(this).html("&#9668;");
			$("#sidebar-wrapper").hide();
			$("#main-wrapper").css({width:"100%"});
		},
		function (){
			$(this).html("&#9658;");
			$("#sidebar-wrapper").show();
			$("#main-wrapper").css({width:"78%"});
		}
	);
	//
	$("#myMenu3").toggle(
		function (){
			$(".date-header").css({display:"block"});
			$(".post-footer").css({display:"block"});
			$("#comments").css({display:"block"});
			$(".feed-links").css({display:"block"});
			$(".status-msg-wrap").css({display:"block"});
		},
		function (){
			$(".date-header").css({display:"none"});
			$(".post-footer").css({display:"none"});
			$("#comments").css({display:"none"});
			$(".feed-links").css({display:"none"});
			$(".status-msg-wrap").css({display:"none"});
		}
	);
	
//HOVER
/*
	$('.post-body,.comment-body').hover(
		function(){
			$(this).css({background:'#000'});
			$(this).css({border:'solid 1px #777'});
		},
		function(){ 		
			$(this).css({background:'#000 url(http://www.renepaul.net/blog/fond1.gif)'});
			$(this).css({border:'solid 1px #555'});
		}
	);
*/
/*
	$(".post-body a img").hover(
		function(){
			$(this).css({border:'solid 1px #c00'});
			//$(this).css({outline:"solid 1px #f00"});
		},
		function(){ 		
			$(this).css({border:'solid 1px #fff'});
			//$(this).css({outline:"none"});
		}
	);
*/
	$('.deezermini').hover(
		function(){
			$(this).css({height:'220px'});
			$(this).css({border:'solid 1px #fff'});
		},
		function(){ 		
			$(this).css({height:'45px'});
			$(this).css({border:'solid 1px #555'});
		}
	);
	//
	$('.deezermaxi').hover(
		function(){
			$(this).css({height:'375px'});
			$(this).css({border:'solid 1px #fff'});
		},
		function(){ 		
			$(this).css({height:'45px'});
			$(this).css({border:'solid 1px #555'});
		}
	);
	//
	/*
	$("#Label1").hover(
		function(){
			$(this).css({height:'100%'});
		},
		function(){ 		
			$(this).css({height:'100px'});
		}
	);
	*/

});
