$(document).ready(function(){
	if (self.pageYOffset){
		yScroll = self.pageYOffset;}
	else if (document.documentElement && document.documentElement.scrollTop){// Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;} 
	else if (document.body){//autres Explorers
		yScroll = document.body.scrollTop;}
  //boutons
	$('#boutons-icones a, #mini-icones a, #contactTwitter a, .SendButton a, a.sendButton, #podcastImgContainer a, #mixThisWeekImgContainer a, #utiliIcons a, #sendThis a, a.return').each(function(){
		var classe = $(this).attr("class");
		$(this).hover(
			function (){
				$($(this)+'.'+classe+' span.hover').fadeIn(100);
			},
			function () {
				$($(this)+'.'+classe+' span.hover').fadeOut(120);
			}
		);
	});

	$('#webradioImgContainer a, #albums a, .thumb a, #album a').each(function(){
		var id = $(this).attr("id");
		$(this).hover(
			function (){
				$($(this)+'#'+id+' span.hover').fadeIn(100);
			},
			function (){
				$($(this)+'#'+id+' span.hover').fadeOut(120);
			}
		);
	});
	
	$('#contactTwitter a.tweet1').hover(
		function (){
			$('#contactTwitter a.tweet2 span.hover').fadeIn(100);
		},
		function () {
			$('#contactTwitter a.tweet2 span.hover').fadeOut(120);
		}
	);
	$('a.returnTop').each(function(){
		$(this).click(function(){
			var scroll = $("#header").offset().top;
		   $("html:not(:animated),body:not(:animated)").animate({ scrollTop: scroll}, 500 );
		});
	});
			
// guest
	$(".guest-btn-slide").click(function(){
	  $("#guest-panel").slideToggle(350);
	  $(this).toggleClass("active");
	});
	$('#guestbookButton a').hover(
		function (){
			$('#guestbookButton a span.hover').fadeIn(75);
		},
		function () {
			$('#guestbookButton a span.hover').fadeOut(150);
		}
	);

//tooltips
	$('a#media').attr({qttarget : "leftMiddle", qttooltip : "rightTop"});
	$('a#audio').attr({qttarget : "bottomLeft", qttooltip : "topRight"});
	$('a#news, a#home, a#links').each(function(){$(this).attr({qttarget : "bottomMiddle", qttooltip : "topMiddle"});});
	$('a#bio').attr({qttarget : "bottomRight", qttooltip : "topLeft"});
	$('a#contact').attr({qttarget : "rightMiddle", qttooltip : "leftTop"});
	//
	$('a.tweet').attr({qttarget : "topMiddle", qttooltip : "bottomMiddle"});
	$('#utiliIcons a.tweet').attr({qttarget : "topLeft", qttooltip : "rightBottom"});
	$('a.rss').attr({qttarget : "topLeft", qttooltip : "bottomRight"});
	$('#utiliIcons a.rss').attr({qttarget : "topMiddle", qttooltip : "bottomRight"});
	$('a.facebook').attr({qttarget : "bottomLeft", qttooltip : "topRight"});
	$('a.digg').attr({qttarget : "bottomLeft", qttooltip : "topRight"});
	$('#utiliIcons a.digg').attr({qttarget : "bottomMiddle", qttooltip : ""});
	$('a.myspace').attr({qttarget : "bottomRight", qttooltip : "topLeft"});
	$('#utiliIcons a.contact').attr({qttarget : "bottomLeft", qttooltip : "topRight"});
	//
	$('a.flag').attr({qttarget : "bottomLeft", qttooltip : "topRight"});
	$('a.guest-btn-slide').attr({qttarget : "leftMiddle", qttooltip : "rightBottom"});
	$('a.webradio').each(function(){$(this).attr({qttarget : "topMiddle", qttooltip : "bottomLeft"});});
	$('a.totem').attr({qttarget : "leftTop", qttooltip : "rightBottom"});
	$('a.albumLink').attr({qttarget : "topMiddle", qttooltip : "bottomLeft"});
	$('mixImg a').each(function(){$(this).attr({qttarget : "", qttooltip : "topMiddle"});});// A CORRIGER
	$('a.sendthis').attr({qttarget : "bottomMiddle", qttooltip : "topRight"});
	$('.albumD a, .albumG a, #videoWrap .thumb a, .videoD .thumb a, .videoG .thumb a').each(function(){$(this).attr({qttarget : "rightTop", qttooltip : "bottomLeft"});});
	$('#photoWrap .thumb a').each(function(){$(this).attr({qttarget : "leftTop", qttooltip : "bottomRight"});});
	
	$('#boutons-menu a, #boutons-icones a, #mini-icones a, a.guest-btn-slide, .mix span.mixImg a, a.webradio, a.totem, #utiliIcons a, #sendThis a, #flags a, #albumLink, .albumD .thumb a, .albumG .thumb a, #photoWrap .thumb a, #videoWrap .thumb a, .videoD .thumb a, .videoG .thumb a').each(function(){
		if ($(this).attr('class')!='facebookShare'){
			var qttarget = $(this).attr('qttarget');
			var qttooltip = $(this).attr('qttooltip');
			$(this).qtip({ 
				content: {
					text: false // Use each elements title attribute
				},
				position: {
					corner: {
						target: qttarget,
						tooltip: qttooltip
					}
				},
				style: {
					background: '#474441',
					color: '#D6C9B9',
					textAlign: 'center',
					border: {
					 width: 4,
					 radius: 5,
					 color: '#817D7C'
					},
					name: 'dark',
					tip: true
				}
			})
		}
	});
//end
});

function AutoScroll(){
	var scroll = $("#menu").offset().top;
   $("html:not(:animated),body:not(:animated)").animate({ scrollTop: scroll}, 800);
}

function fbs_click(){ 
	u=location.href; 
	window.open(
	'http://www.facebook.com/sharer.php?u='+encodeURIComponent(u), ' sharer', 'toolbar=0, status=0, width=626, height=436'
	); 
	return false; 
} 

 
