$(document).ready(function(){

	$('#nomtel a').empty().append($('.carroussel_top.default').attr('title')).attr('href',$('.carroussel_top.default').attr('href'));
	$('a.toggle').toggle(function(){
		$($(this).attr('href')).css('display','block');
		$(this).hasClass('link_sc')
		{
			$(this).children('img').attr('src','../mobile/edito/img/home_bol/bt_sc_up.png')
		}
	},function(){
		$($(this).attr('href')).css('display','none');
		$(this).hasClass('link_sc')
		{
			$(this).children('img').attr('src','../mobile/edito/img/home_bol/bt_sc_down.png')
		}	
	});
	$('a.carroussel_top').bind('mouseenter',function(){
		var url = new String(document.location);
		$('#nomtel a').empty().append($(this).attr('title')).attr('href',$(this).attr('href'));
		if(url.substring(0,30)=='http://www.sfr.fr/mobile-adsl/' || url.substring(0,30)=='http://cms.sfr.fr/mobile-adsl/')
			$('#curseur').css('background-position',($(this).position().left-$(this).width())+'px 0px');
		else
			$('#curseur').css('background-position',($(this).position().left-14)+'px 0px');
		//console.info($(this).position().left);
		//console.info($(this).width());
	});
	$('a.popup').bind('click',function(){
		popup($(this).attr('href'), ($(this).attr('rel')!='')? $(this).attr('rel') : $(this).attr('class').substring(($(this).attr('class').indexOf('popup d')+7),$(this).attr('class').length),$(this).attr('title'));
		return false;
	});
});
