var urlMedia ="http://media-cms.bnpparibas.com/design/careers/";

function resizeFenetre(){
	$('#Recadrage').css({"margin":"0px"});
	if(( $(window).width()<1280) && $(window).width()>=1000){
		
		var margin =-((1280-$(window).width())/2);
		var largeur =1280+(margin*2);
		$('#Page').css({"width":largeur+"px"});
		$('#Recadrage').css({"margin-left": margin+"px"})
	}
	if($(window).width()<=1000){
		$('#Page').css({"width":"1000px"});
		$('#Recadrage').css({"margin-left": "-140px","margin-right": "-140px"})
	}
	if($(window).width()>=1280){
		$('#Page').css({"width":"1280px"});
		$('#Recadrage').css({"margin-left": "0","margin-right": "0"})
	}
}


$(window).resize(function(){
  resizeFenetre();
});

function menuGauche(){
	$("div#LeftRose,div#LeftBleu,div#LeftVert").hide();
	$(".menuGauche").each(function(){$(this).css({'background-image':'url('+urlMedia+'images/'+$(this).attr('id')+'-Off.png)'});});

$('.menuGauche>a').click(	function () {
	if($(this).next().css('display') == 'block'){

		$(this).next().slideUp("slow",function(){$(this).parent().css({'background-image':'url('+urlMedia+'images/'+$(this).parent().attr('id')+'-Off.png)'});
		$('img[@src$=.png], div#joinUsIn,div#worlewideActivities,div#jobOffers').ifixpng(); });
	}
else{
		/*remettre tout les background a off*/
		$(".menuGauche").each(function(){$(this).find('div:first').slideUp("slow",function(){$(this).parent().css({'background-image':'url('+urlMedia+'images/'+$(this).parent().attr('id')+'-Off.png)'});
		$('img[@src$=.png], div#joinUsIn,div#worlewideActivities,div#jobOffers').ifixpng(); });});
		/*on met le background a on a l'element en cour*/
		$(this).parent().css({'background-image':'url('+urlMedia+'images/'+$(this).parent().attr('id')+'-On.png)'});
		$('img[@src$=.png], div#joinUsIn,div#worlewideActivities,div#jobOffers').ifixpng(); 
		/*on fait l'effet*/
		$(this).next().slideDown("slow");
}
	return false;});
}


$(document).ready(function(){
resizeFenetre();
if($(".menuAccueil").length==0)
menuGauche();
//pour les images sˇparateurs du menu du haut
$('#PageMenu  a').hover(
function(){
var imgPrev = $(this).prev();
var imgNext = $(this).next();
 if(imgPrev.hasClass("navsep"))imgPrev.css({'visibility':'hidden'});
 if(imgNext.hasClass("navsep"))imgNext.css({'visibility':'hidden'});
		// return false;
},
function(){
var imgPrev = $(this).prev();
var imgNext = $(this).next();
 if(imgPrev.hasClass("navsep"))imgPrev.css({'visibility':'visible'});
 if(imgNext.hasClass("navsep"))imgNext.css({'visibility':'visible'}); 
}
);//fin hover

$('#recherche').focus(function () {
	$("#recherche[value='Search']").attr("value","");	
});


});



function Chargement(){
	$('img[@src$=.png], div#joinUsIn,div#worlewideActivities,div#jobOffers').ifixpng(); 
	$("#PageLeft,#PCenter,#PageRight").equalizeCols();
}
window.onload=Chargement;


function Imprime() {
    window.print();
}

function mailpage() {
	location.href = "mailto:?subject=Visit this page&body=I have found this page into BNP Paribas recruitment website and think it would interest you : "+location.href;
}
