/*-----------------------------------------------------------
	Project:	Jura UK
	Date : 	january 2009
	Last Update : 30/01/09
	Author:	C2iS - AFO
	JS document		
-----------------------------------------------------------*/

$(document).ready(function(){ 
	/*Functions goes here*/
	colHeightHome();	
	advSearchType();
	/*Inits image cache for IE6*/
	if (jQuery.browser.msie && jQuery.browser.version < 7) {
		try {
			document.execCommand('BackgroundImageCache', false, true);
		} catch(e) {}
	}
}); 

/*gestion hauteur des colonnes sur la home*/
function colHeightHome() {
	if($('#innerMainContent .homePushBlocs').length) {
		$('#innerMainContent .leftPushBlocs > .pushBloc').equalHeights(250);
	}
}

/*gestion du bloc de recherche avancee*/
function advSearchType() {
	if($('#innerMainContent .advSearchBloc').length) {
		$('#innerMainContent .advSearchBloc ul > li:first-child').addClass('active');
		$('#innerMainContent .advSearchBloc .searchFormBloc').hide().eq(0).show();		
		$('#innerMainContent .advSearchBloc ul > li a').click(function() {
			$(this).parent().addClass('active').siblings().removeClass('active');
			$('#innerMainContent .advSearchBloc .searchFormBloc').hide();
			var currentBlocForm = $(this).attr("href").split("#");
			$("#"+currentBlocForm[1]).show();
			return false;
		});
	}
}
