$(document).ready(function() {

// ===================================================
// === Modification du curseur dans le cas d'un href=#
try
{

$('#menu-navhoriz a').each(function()
{
	if($(this).attr('href')=='#')
	{
	$(this).css('cursor','default');
	}
});
}
catch(e)
{alert(e);}
// =======================================
// === Modification du bouton de recherche
$('#access #searchsubmit').attr('title',$('#access #searchsubmit').attr('value'));
$('#access #searchsubmit').attr('value','');
// ===========================

// === SideBar expand/collapse
try
{
// Init
$('#secondary > ul > li > h3').before('<span class="toggle collapsed">&nbsp;</span>');
$('span.toggle').each(function()
{$(this).attr('psize',$(this).parent('li').height());});
$('#secondary > ul > li span.toggle').each(function()
{$(this).parent('li').css('height',('37' - parseInt($(this).parent('li').innerHeight()) + parseInt($(this).parent('li').height())) + "px");});
// Expand/Collapse

$('#secondary h3.widget-title').click(function()
{
	$(this).siblings('span.toggle').click();
});
$('span.toggle').click(function()
{
	if ($(this).attr('class').indexOf('collapsed') > 0)
	{
		$(this).parent('li').animate
		({
			height:$(this).attr('psize')
		});
		$(this).removeClass("collapsed"); 
		$(this).addClass("expanded"); 
	}
	else
	{
		$(this).parent('li').animate
		({
			height:('37' - parseInt($(this).parent('li').innerHeight()) + parseInt($(this).parent('li').height())) + "px"
		});
		$(this).removeClass("expanded"); 
		$(this).addClass("collapsed"); 
	}
});
// Try
}
catch(e){}
// ===========================
// === Lien header
try
{
	$('#site-links a').mouseover(function()
	{
		$(this).next('span').css('left','400px');
		var posX = parseInt($(this).position().left) + parseInt($(this).outerWidth()) - parseInt($(this).next('span').outerWidth());
		$(this).next('span').animate(
		{
			left:posX
		},300);
	});
	$('#site-links a').mouseleave(function()
	{
		$(this).next('span').animate(
		{
			left:'-230px'
		},300);
	});
}
catch(e){}
// =============
// === Catégorie
try
{
$('.qpz-categories li a').mouseover(function()
{
$(this).next('span').css('right','-300px');

	$(this).next('span').animate(
	{
		right:"24px"
	},400);
});
$('.qpz-categories li a').mouseleave(function()
{
	$(this).next('span').animate(
	{
		right:"340px"
	},300);
});
}
catch(e){}
// =============
});
