// Chain window onload events
function addLoadEvent(func) { 
 var oldonload = window.onload; 
  if (typeof window.onload != 'function') { 
   window.onload = func; 
  } else { 
   window.onload = function() { 
   oldonload(); 
   func(); 
  } 
 } 
}

/****************************************
SWF
****************************************/
//added to move all js at the end of pages
//we will have to fully replace old swf Function by this one gradually
/*
function swfInject(idElmnt) {
	$("#" + element)
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + w + '" height="' + h + '">\n');
	document.write(' <param name="movie" value="' + varurl + '">\n');
	document.write('<param name="wmode" value="transparent">\n');
	document.write(' <param name="quality" value="high">\n');
	document.write(' <embed src="' + varurl + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + w + '" height="' + h + '" wmode="transparent"></embed></object>\n');
	document.write('</object>\n');
}
*/


function getLang() {
	var temp = document.URL.split(".aspx")[0];
	return temp.substr(temp.length - 2, temp.length);
}

function swf(varurl, w, h) {
	var swfString = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + w + '" height="' + h + '">\n';
	swfString += ' <param name="movie" value="' + varurl + '">\n';
	swfString += '<param name="wmode" value="transparent">\n';
	swfString += ' <param name="quality" value="high">\n';
	swfString += ' <embed src="' + varurl + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + w + '" height="' + h + '" wmode="transparent"></embed></object>\n';
	swfString += '</object>\n';

	return swfString;
}


// GP Boutiques

$j(document).ready(function () {
	$j('.Navboutiques li.continent').click(function () {
		$j(this).children('.ville').slideToggle('slow');
	});
});				

// GP SAV 

$j(document).ready(function () {
// Nav
	$j('.NavSav li.lvl1').click(function () {
		$j(this).children('.lvl2').slideToggle('slow');
	});

// Page utilisation - mode emploi	
		$j('#txt-two , #txt-three').hide(); // cacher blocs
		
		// cacher les blocs de texte
		$j('.NavSav li.lvl1 a').click(function () {
		$j('.txt-bloc').hide(0);
	});

// afficher blocs voulus
	$j('a#one').click(function () {
		$j('#txt-one').fadeIn('slow');
	});
	$j('a#two').click(function () {
		$j('#txt-two').fadeIn('slow');
	});
	$j('a#three').click(function () {
		$j('#txt-three').fadeIn('slow');
	});

});	


