/*** SET JS FUNCTIONS LIBRARY ***/
window.lib = {
	/*** OPTIONS ***/
	opts : {
		speed : 550
	},
	/*** ELEMENTS STORAGE ***/
	$subnav : $('#wrapper-left .rubrik'),
	$wleft : $('#wrapper-left'),
	$wright : $('#wrapper-right'),
	$background : $('#background'),
	$transitions : $('#transitions'),
	$vault : $('#vault'),
	window : {},
	/*** INITIALIZATION ***/
	init : function() {
		// SUB Elements Storage
		lib.$subnavContainers = lib.$subnav.find('ul');
		lib.$subnavElements = lib.$subnav.find('li');
		
		// Set NAV elements
		lib.$subnavContainers.hide();
		/*
		lib.nav.resize();
		*/
		lib.nav.init();
		
		lib.$wleft.find('header').bind('click', lib.nav.reset);
		
		// Set background FX
		lib.background.resize();
		//lib.background.slides();
		
		// Popins
		lib.$wright.delegate('#annonceur div.footer a', 'click', function(event) {
			event.preventDefault();
			lib.popins.toggle();
		});
	},
	/*** BACKGROUND ***/
	background : {
		resize : function() {
			// Background IMG ratio
			ratio = 1.8125;

			// Get window dimensions
			lib.background.winsize();
			win_w = lib.window.w;
			win_h = lib.window.h;
			ratio_w = win_w / win_h;

			// Fix elements dimensions
			if(ratio_w > ratio) {
				w = win_w;
				h = win_w / ratio;
				
			} else if( ratio_w < ratio) {
				w = win_h * ratio;
				h =  win_h;
			} else {
				w = win_w;
				h = win_h;
			}
			
			// Set dimensions
			lib.$background.css({
				width: w,
				height: h
			});
			lib.$transitions.css({
				width: w,
				height: h
			});
			
			// (Des)Active overflow on body
			if(win_w < 960 || win_h < 590) {
				$('body').css('overflow', 'visible');
			} else {
				$('body').css('overflow', 'hidden');
			}
		},
		/*
		slides : function() {
			var slides = new Array();
			$('#vault ul img').each(function() {
				img = {
					src: $(this).attr('src')
				};
				slides.push(img);
			});

			lib.$background.crossSlide({
			  sleep: 2,
			  fade: lib.opts.speed / 1000
			}, slides);
		},
		*/
		winsize : function() {
			lib.window.w = $(window).width();
			lib.window.h = $(window).height();
		}
	},
	/*** MENU ***/
	nav : {
		init : function() {
			// TOPNAV Hover FX
						// TOPNAV Hover FX
			if(0){
			lib.$wleft.find('a').mouseenter(
				function(){
					lib.$vault.find('li.' + $(this).parent().attr('id') + ' > img')
						.clone()
						.addClass('bg')
						.css('left', lib.window.w)
						.prependTo(lib.$transitions)
						.stop(true, true).animate({left: 0}, lib.opts.speed);
				}
			);
			lib.$wleft.find('.rubrik').mouseenter(
				function(){
					lib.$vault.find('li.' + $(this).parent().attr('id') + ' > img')
						.clone()
						.addClass('bg')
						.css('left', lib.window.w)
						.prependTo(lib.$transitions)
						.stop(true, true).animate({left: 0}, lib.opts.speed);
				}
			);
			}
			/*
			lib.$wleft.find('.rubrik').mouseenter(
				function() {
					//$(this).find('ul').stop(true, true).slideDown(lib.opts.speed);
					lib.$vault.find('li.' + $(this).attr('id') + ' > img')
						.clone()
						.addClass('bg')
						.css('left', lib.window.w)
						.prependTo(lib.$transitions)
						.stop(true, true).animate({left: 0}, lib.opts.speed);
					// Don't mask subnav if the submenu is clicked
					//if(!$(this).hasClass('active')) {
					//	$(this).find('ul').stop(true, true).slideUp(lib.opts.speed);
					//}

					// Remove BG
					lib.$transitions.find('img.bg').stop(true, true).animate({left: lib.window.w}, lib.opts.speed, function() {
						$(this).remove();
					});
				}
			);
			*/
			
			lib.$wleft.find('.rubrik').click(
				function(){
						var _item = $(this);
						if(!_item.hasClass('active')){
							if($('.rubrik').hasClass('active')){
								$('.click_action.active').removeClass('active');
								$('.rubrik.active').find('ul').stop(true, true).slideUp(lib.opts.speed,function(){
									$('.rubrik').removeClass('active');
									if(!_item.hasClass('active')){
										_item.addClass('active');
										_item.find('ul').stop(true, true).slideDown(lib.opts.speed);
									}
								});
							}else{
								$('.click_action.active').removeClass('active');
								_item.addClass('active');
								_item.find('ul').stop(true, true).slideDown(lib.opts.speed);
							}
						}
					return false;
				}
			);
			// SUBNAV Hover FX
			/*
			lib.$wleft.find('.rubrik li').mouseenter(
			
				function() {
					// Disable active menu
					lib.$wleft.find('li.active').toggleClass('activeOff active');

					// Remove SubBG that are not clicked
					lib.$transitions.find('img.subbg.not(.active)').fadeOut(lib.opts.speed, function() {
						$(this).remove();
					});

					lib.$vault.find('li.' + $(this).attr('id') + ' > img')
						.clone()
						.addClass('subbg')
						.hide()
						.appendTo(lib.$transitions)
						.fadeIn(lib.opts.speed);
					// Re-active cliked items
					lib.$wleft.find('li.activeOff').toggleClass('activeOff active');

					lib.$transitions.find('img.subbg:not(.active)').fadeOut(lib.opts.speed, function() {
						$(this).remove();
					});
				}
				
			);
			*/
			// SUBNAV Actions
			/*
			lib.$subnavElements.find('a').click(function(event) {
				event.preventDefault();

				// Fix bg image
				lib.$transitions.find('img.subbg').addClass('active');
				
				// Fix menu
				$(this).parents('li').addClass('active');
				lib.$wleft.find('li.activeOff')
					.removeClass('activeOff')
					.not('.active').find('ul').stop(true, true).slideUp(lib.opts.speed);

				// Slide sections and call ajax
				link = this.hash;
				if(lib.$wright.find('section:first').is(':visible')) {
					// if thh first section is visible, we close it
					// and after launch the ajax call
					lib.$wright.find('section:first').slideUp(lib.opts.speed, function() {
						// Send ajax request
						lib.ajax.load(link);
					});
					// and we close all others sections
					lib.$wright.find('section:not(:first)').slideUp(lib.opts.speed);
				} else {
					// Send ajax request
					lib.ajax.load(link);
				}

			});
			*/
			// SPECIAL NAV items Actions
			/*
			$('#group a, #contact a').click(function(event) {
				event.preventDefault();

				// reset all nav
				lib.nav.reset();
				
				// load bg img
				lib.$vault.find('li.neutral > img')
					.clone()
					.addClass('bg')
					.css('left', lib.window.w)
					.prependTo(lib.$transitions)
					.stop(true, true).animate({left: 0}, lib.opts.speed);
				
				// load data
				lib.ajax.load(this.hash);
			});
			*/
		},
		resize : function() {
			tallest = 0;
			lib.$subnavContainers.each(function() {
				elt_h = $(this).height();
				if(elt_h > tallest) {
					tallest = elt_h;
				}
			});
			lib.$subnavContainers.height(tallest);
		},
		reset : function() {
			// Close slides
			lib.$wright.find('.section').slideUp(lib.opts.speed);

			// Fade bg // subbg
			lib.$transitions.find('img').fadeOut(lib.opts.speed, function() {
				$(this).remove();
			});

			// Close menus
			lib.$subnavContainers.slideUp(lib.opts.speed, function() {
				lib.$wleft.find('.active').removeClass('active');
				lib.$wleft.find('.activeOff').removeClass('activeOff');
			});
		}
	},
	popins : {
		toggle : function() {
			if($('#infos').is(':visible')) {
				$('#infos').slideUp(lib.opts.speed);
				$('#annonceur div.footer a')
					.text("+ Infos Pub")
					.css({
						backgroundPosition: 'right top',
						color: '#fff'
					});
			} else {
				$('#infos').slideDown(lib.opts.speed);
				$('#annonceur div.footer a')
					.text("X Infos Pub")
					.css({
						backgroundPosition: 'right -20px',
						color: '#333'
					});
				// Fix stats <span> position
				$('#stats div').each(function() {
					$(this).css('margin-top', ($(this).height()+3) / 2 * -1);
				});
			}
		}
	}
	/*ajax : {
		init : function() {
			// Find ID
			ref = window.location.hash.slice(1).replace('!', '');
			//console.log(ref);
			
			// Load BG && fix menu
			lib.$vault.find('li.' + ref + ' > img')
				.clone()
				.addClass('subbg active')
				.hide()
				.appendTo(lib.$transitions)
				.fadeIn(lib.opts.speed);
			lib.$wleft.find('a[href="#!' + ref + '"]').parents('li').addClass('active');
			lib.$wleft.find('li.rubrik.active ul').slideDown(lib.opts.speed);
			
			// Load data
			lib.ajax.load(window.location.hash);
		},
		load : function(fragment) {
			fragment = fragment.slice(1).replace('!', '');
			$('#wrapper-right-inner').load('http://'+window.location.host+'/'+fragment, function() {
				// Hide sections & Appears first one
				lib.$wright.find('section').hide().filter(':first').slideDown(lib.opts.speed);
				// <table> Zebra
				$('table tbody tr:odd').css('background-color', '#f6f6f6');
				// Placeholders
				$('input[placeholder], textarea[placeholder]').placeholder();
				$('#contact-form').validate();
			});
		}
	}*/
};

/* GLOBAL */
var _bool_slide_auto = true;
var timer = '';
/*
function slide_auto(){
	if(_bool_slide_auto){
		clearTimeout(timer);
		switch_bg()
		timer = setTimeout(function(){
			if(_bool_slide_auto)slide_auto();
		},5000);
	}
}

function switch_bg(){
	if($('div.nav .click_action.active').attr('id') == 'group'){
		_bool_slide_auto = true;
		slide_auto();
	}else{
		var num_rand = Math.floor(Math.random()*10);
		if(num_rand==1 || num_rand==0) num_rand = 2;
		var class_bg = "bg-"+num_rand;
		var html_bg = '<img src="'+$('img.'+class_bg).attr('src')+'">';
		var html_transi = '<img src="img/transition_neutral.jpg">';
		if(html_bg != $('#background').html() || $('#background').html()==''){
			if($('div.nav .click_action.active').html()==null){
				$('#transitions').html(html_transi);
				if($('#transitions').css('display') == 'none'){
					$('#transitions').fadeIn('slow',function(){
						$('#background').html(html_bg);
						$('#transitions').fadeOut('slow');
					});
				}else{
					$('#background').html(html_bg);
					$('#transitions').fadeOut('slow');
				}
			}else{
				var _id_le_bg = $('div.nav .click_action.active').attr('id');
				var _id_le_transi = $('div.nav .rubrik.active').attr('id');
				$('#transitions').html(html_transi);
				if($('#transitions').css('display') == 'none'){
					$('#transitions').fadeIn('slow',function(){
						$('#background').html(html_bg);
						$('#transitions').fadeOut('slow');
					});
				}else{
					$('#background').html(html_bg);
					$('#transitions').fadeOut('slow');
				}
			}
		}
	}
}

function switch_bg_cible(_id){
	if(_id == 'group'){
		_bool_slide_auto = true;
		//slide_auto();
	}else{
		_bool_slide_auto = false;
		var _id_le_bg = _id;
		var _id_le_transi = $('#'+_id).parent().parent().attr('id');
		var html_bg = '<img src="'+$('img#bg_'+_id_le_bg).attr('src')+'">';
		var html_transi = '<img src="'+$('img#transi_'+_id_le_transi).attr('src')+'">';
		if(html_bg != $('#background').html() || $('#background').html() == ''){
			$('#transitions').html(html_transi);
			if($('#transitions').css('display') == 'none'){
				$('#transitions').fadeIn('slow',function(){
					$('#background').html(html_bg);
					$('#transitions').fadeOut('slow');
				});
			}else{
				$('#background').html(html_bg);
				$('#transitions').fadeOut('slow');
			}
		}
	}
}
*/
function submit_form(){
	$.ajax({
		type: "POST",
		url: "ajax/validation_form.php",
		data: $('#contact-form').serialize(),
		success: function(msg){
			if(msg==1){
				$('#contact-form').append('<p style="padding-left:10px"><strong>Votre message a été envoyé : nous prendrons contact avec vous dans les plus brefs délais.</strong></p>');
								
			}else{
				var tab_err = msg.split('|');
				for(var i_err = 0; i_err < tab_err.length; i_err++){
					$('#'+tab_err[i_err]).addClass('error');
				}
			}
		}
	});
	$('#contact-form input').focus(function(){$(this).removeClass('error')});
	$('#contact-form textarea').focus(function(){$(this).removeClass('error')});
}

/* [NEW] FERMETURE DE CONTENU */
function close_contenu(){
	$('#wrapper-right').attr('class','');
	switch($('#wrapper-right').children().attr('id')){
		case 'wrapper-left-inner':
			$('#wrapper-right').slideUp('slow',function(){$('#wrapper-right').html('');$('#wrapper-right').css('display','none');});
		break;
		case 'wrapper-right-inner':
			$('#wrapper-right').css('overflow','hidden');
			$('#wrapper-right #wrapper-right-inner').animate({bottom: '-100%'}, 'slow', function(){
				$('#wrapper-right').css('display','none');
				$('#wrapper-right').html('');
				$('#wrapper-right').css('overflow','auto');
			});
		break;
		default:
			if($('#wrapper-right').css('display')!='none'){
				$('#wrapper-right').css('display','none');
				$('#wrapper-right').html('');
			}
		break;
	}
}

/* [NEW] SWITCH DE BG */
var timer_bg = ''
function bg_reload(bg){//alert(bg);
//$('div#background img').load(function() {
	//alert($('#loader').css('display'));
	
		//});
	if(_timer_slide_bg) clearTimeout(_timer_slide_bg);
	if($('#wrapper-right').attr('class') != bg){
		if(timer_bg){
			clearTimeout(timer_bg);
			$('div#transitions').stop(true, true);
			//$('div#transitions').css('display','block');
		}
		timer_bg = setTimeout(function(){
			if($('div#transitions img').attr('src') != $('div#background img').attr('src') || $('div#background img').attr('src') != 'img/bg/'+bg+'.jpg'){
				$('div#background img').attr('src','img/bg/'+bg+'.jpg');
				setTimeout(function(){
					$('div#transitions').fadeOut('slow',function(){
					$('div#transitions img').attr('src','img/bg/'+bg+'.jpg');
					setTimeout(function(){$('div#transitions').css('display','block');},100);
				});},250);
				/*
				$('div#transitions img').attr('src',$('div#background img').attr('src'));
				$('div#transitions').fadeIn('slow',function(){
					$('div#background img').attr('src','img/bg/'+bg+'.jpg');
					$('div#transitions').fadeOut('slow');
				});
				*/
			}
		},200);
	}
}
function bg_reload_auto(bg){
	
	if($('#wrapper-right').attr('class') != bg){
		if(timer_bg){
			clearTimeout(timer_bg);
			$('div#transitions').stop(true, true);
			//$('div#transitions').css('display','block');
		}
		timer_bg = setTimeout(function(){
			if($('div#transitions img').attr('src') != $('div#background img').attr('src') || $('div#background img').attr('src') != 'img/bg/'+bg+'.jpg'){
				$('div#background img').attr('src','img/bg/'+bg+'.jpg');
				
				setTimeout(function(){
					$('div#transitions').fadeOut('slow',function(){
					$('div#transitions img').attr('src','img/bg/'+bg+'.jpg');
					$('div#transitions img').css('top','0');
					$('div#transitions img').css('left','0');
					$('div#transitions img').css('width','100%');
					$('div#transitions img').css('height','100%');
					
					$('div#transitions').css('padding-top','0');
					setTimeout(function(){$('div#transitions').css('display','block');},100);
				});},100);
				/*
				$('div#transitions img').attr('src',$('div#background img').attr('src'));
				$('div#transitions').fadeIn('slow',function(){
					$('div#background img').attr('src','img/bg/'+bg+'.jpg');
					$('div#transitions').fadeOut('slow');
				});
				*/
			}
		},200);
	}
}
var _bg_tableau = Array();
var _bg_tableau_taille = 0;
var _bg_tableau_pos = 0;
var _timer_slide_bg = '';
function init_bg(){
	var i_bg = 0;
	var i_bg_group = 0
	$('#vault li').each(function(){
		i_bg = i_bg + 1;
		_bg_tableau[i_bg] = "neutre";
		i_bg_group = i_bg_group + 1;
		$(this).children('img').each(function(){
			i_bg = i_bg + 1;
			_bg_tableau[i_bg] = $(this).attr('src').replace('.jpg','').replace('img/bg/','').replace('img/transi/','');
		});
		_bg_tableau_taille = _bg_tableau.length;
	});
}
function start_bg_slide(){
	bg_slide_during = 3000;
	if(_timer_slide_bg) clearTimeout(_timer_slide_bg);
	if(_bg_tableau_pos >= _bg_tableau_taille-1){
		_bg_tableau_pos = 0;
	}
	_bg_tableau_pos = _bg_tableau_pos + 1;
	if(_bg_tableau[_bg_tableau_pos]=='')_bg_tableau_pos=1;
	if(_bg_tableau[_bg_tableau_pos]=="neutre")bg_slide_during = 1000;
	bg_reload_auto(_bg_tableau[_bg_tableau_pos]);
	_timer_slide_bg = setTimeout(function(){start_bg_slide()},bg_slide_during);
}
$(window).load(function() {
	
	$('#wrapper-right').css('display','none');
		lib.init();


	init_bg();
	if(!get_href()){
		setTimeout(function(){start_bg_slide();},500);
	}
	/* [NEW] ANTHONY */
	/* CLICK SUR RUB CONTENU CLASSIQUE */
	$('div.nav a[rel=classique]').click(function(){
		//$('.click_action.active').removeClass('active');
		//$('li.active a').css('background-image','url("../img/bg_marker.png") no-repeat scroll 0 0 transparent');
		//$('li.active a').css('color','#FFFFFF');
		bg_reload('neutre');
		if(get_href()){
			var href_url = get_href();
		}else{
			var href_url = '';
		}
		//var href = $(this).attr('href').replace('#!', '');
		var href = $(this).attr('href').replace('/', '').replace('.html', '');
		//if(href != href_url) close_contenu();
		bg_reload(href);
		
		//bg_reload(href)
		$('li.rubrik.active').removeClass('active');
		$(this).parent('li').addClass('active');
		$('#wrapper-right').fadeOut('slow',function(){
			$.ajax({
				url: "data/"+href+".php",
				success: function(msg){
					$('#wrapper-right').addClass(href);
					setTimeout(function(){
						$('#wrapper-right').html('<div id="wrapper-left-inner">'+msg+'</div>');
						$('#wrapper-right').slideDown('slow');
					},200);
				}
			});
		});
	});
	/* CLICK SUR RUB CONTENU MAG */
	$('div.nav a[rel=mag]').click(function(){
		//$('.click_action.active').removeClass('active');
		//$('li.active a').css('background-image','url("../img/bg_marker.png") no-repeat scroll 0 0 transparent');
		//$('li.active a').css('color','#FFFFFF');
		if(get_href()){
			//var href_url = window.location.hash.replace('#!', '');
			var href_url = get_href();
		}else{
			var href_url = '';
		}
		$('#wrapper-right').css('overflow','hidden');
		$('#container').css('overflow','hidden');
		var href = $(this).attr('href').replace('http://www.editions-lva.fr/','').replace('.html','').replace('.php','');
		//if(href != href_url) close_contenu();
		
		bg_reload(href);
		//bg_reload(href)
		$('li.rubrik.active').removeClass('active');
		$(this).parent('li').addClass('active');
		$('#wrapper-right').fadeOut('slow',function(){
			$.ajax({
				url: "data/"+href+".php",
				success: function(msg){
					$('#wrapper-right').addClass(href);
					$('#wrapper-right').css('overflow','hidden');
					setTimeout(function(){
						$('#wrapper-right').html('<div id="wrapper-right-inner">'+msg+'</div>');
						$('#wrapper-right').css('display','block');
						$('#wrapper-right #wrapper-right-inner').animate({bottom: '1em'}, 'slow', function(){$('#wrapper-right').css('overflow','auto');$('#container').css('overflow','auto');});
					},200);
				}
			});
		});
	});
	/* CLICK SUR RUB CONTENU RUB */
	$('div.nav a[rel=rub]').click(function(){
		//$('.click_action.active').removeClass('active');
		//$('li.active a').css('background-image','url("../img/bg_marker.png") no-repeat scroll 0 0 transparent');
		//$('li.active a').css('color','#FFFFFF');
		if(get_href()){
			//var href_url = window.location.hash.replace('#!', '');
			var href_url = get_href();
		}else{
			var href_url = '';
		}
		$('#wrapper-right').css('overflow','hidden');
		$('#container').css('overflow','hidden');
		var href = $(this).attr('href').replace('http://www.editions-lva.fr/','').replace('.html','').replace('.php','');
		//if(href != href_url) close_contenu();
		
		bg_reload(href);
		$('#wrapper-right').fadeOut('slow',function(){
			$.ajax({
				url: "data/"+href+".php",
				success: function(msg){
					$('#wrapper-right').addClass(href);
					setTimeout(function(){
						$('#wrapper-right').html('<div id="wrapper-left-inner">'+msg+'</div>');
						$('#wrapper-right').slideDown('slow');
					},200);
				}
			});
		});
		
	});
	/* CLICK SUR ALL RUB */
	/*
	$('div.nav a').mouseenter(function(){
		$('li.click_action.active').removeClass('active');
		if(get_href()){
			//var href_url = window.location.hash.replace('#!', '');
			var href_url = get_href();
		}else{
			var href_url = '';
		}
		//var href = $(this).attr('href').replace('#!', '');
		//if(href != href_url) close_contenu();
		//bg_reload(href);
	});
	*/
	/*
	$('div.nav').mouseleave(function(){
		//start_bg_slide();
		
		if(window.location.hash){
			var href_url = window.location.hash.replace('#!', '');
			$('li#'+href_url).addClass('active');
			setTimeout(function(){
				if($('#wrapper-right').html()==''){
					//$('li#'+href_url+' a').hover();
					$('li#'+href_url+' a').click();
					$('li#'+href_url).addClass('active');
					bg_reload(href_url);
				}
			},200);
		}
		
	});
	*/
	/* ANTHONY */
	/*
	$('.rubrik ul li').mouseenter(function(){
		$('#wrapper-right').slideUp('slow');
		_bool_slide_auto = true;
		var _id = $(this).attr('id');
		if(_id == 'group' || _id == 'contact'){
			slide_auto();
		}else{
			setTimeout(function(){switch_bg_cible(_id)},100);
		}
	});
	$('.rubrik').mouseenter(function(){
		_bool_slide_auto = true;
		var _id = $(this).attr('id');
		var _id_fils = $(this).children().children().attr('id');
		if(_id == 'group' || _id == 'contact'){
			slide_auto();
		}else{
			setTimeout(function(){switch_bg_cible(_id_fils);_bool_slide_auto = true;slide_auto();},100);
		}
	});
	$('.click_action a').click(function(){
		_bool_slide_auto = false;
		var href = $(this).attr('href').replace('#!', '');
		var cible = $(this).attr('rel');
		var tab_content = Array();
		$('.click_action.active').removeClass('active');
		$('.rubrik.active').removeClass('active');
		$(this).parent('li').addClass('active');
		tab_content["classique"] = "wrapper-left-inner";
		tab_content["mag"] = "wrapper-right-inner";
		$.ajax({
			url: "data/"+href+".php",
			success: function(msg){
				$('#wrapper-right').slideUp('slow',function(){
					$('#wrapper-right').html('<div id="'+tab_content[cible]+'">'+msg+'</div>');
					$('#wrapper-right').slideDown('slow');
				});
			},
			error: function(){
				$('#wrapper-right').slideUp('slow',function(){
					$('#wrapper-right').html('');
				});
			}
		});
		switch_bg_cible($(this).parent('li').attr('id'));
	});
	*/
	if(get_href()){
		//var href = window.location.hash.replace('#!', '');
		var href = get_href();
		//lib.ajax.init();
		$('div.nav a').each(function(){
			if($(this).attr('href').replace('.html','').replace('.php','')==get_href()){
				$(this).click();
				$(this).parent('li').addClass('active');
				bg_reload(href);
			}
		});
		//$('#'+href+' a').click($(this).parent('li').attr('id'));
	}else{
		$('#wrapper-right').attr('class','');
		$('#wrapper-right').css('display','none');
		$('#wrapper-right').html('');
	}
	/*
	switch_bg();
	slide_auto();
	_bool_slide_auto = true;
	*/
})	
	.resize(function() {
		lib.background.resize();
	});
function get_href(){
	var href_location = window.location;
	href_location = href_location.toString(); 
	href_location = href_location.replace('http://www.editions-lva.fr/','').replace('.html','').replace('.php',''); 
	if(href_location == ''){
		return '';
	}else{
		return href_location;
	}
}

