displayNoneHTML();

$(document).ready(function() {

	// logo Click
	$("#header h1 a").click(function() {
		setInstantCookie("jumboWall_FR", 0);
	});

	// cookie logIn or logOut Check
	$.fe_logInOut();

	if ( $("#gnbp3").length ) $("#gnbp3").fe_gnb();

	// layerPopup
	if ( $(".layPopOpener").length ) {
		$.fe_lay({
			triggerClass : ".layPopOpener",
			targetClass : ".layPop",
			type : "overlay",
			overLay_Center : false,
			overLay_animationSpeed : 100
		});
	}

	// bandWidth
	checkBandWidth();

	// feedBack
	$.fe_feedBack();


	/********************************/

	navigation();

	if ( !isMobile && checkBandWidthVar != "Low" ) {

		sectionInit();

		expandTooltip();

		lesNouveau();
		telephone();
		tvAudioVideo();
		photoCamescope();
		informatique();
		electro();

		smallWall();

	} else {
		lowBandWidth();
	}

	if ( isMobile ) {
		$("#jumboWall").addClass("mobileFix");
	}

	learnMore();

	indexTab();

	section0();

	// IE6 NOT SUPPORT
	$.fe_ie6NotSupport();

});

recentlyViewedText = "Récemment consultés";

var flashKV = new Object();
var flashReady = "collapse";

function flContentOnReady( id, success ) {
	flashKV[id] = document.getElementById(success);
	flashKV[id].setCondition( flashReady, 0);
}

function displayNoneHTML() {
	var displayNoneHTML = '<style type="text/css">'
								+ '#gnbp3 .menu { display:none;}'
								+ '.con #gnbp3 ul { margin:0; padding:0;}'
								+ '.con #gnbp3 ul li a {height:41px; padding:37px 22px 2px 22px;}'
								+ '.con #gnbp3 ul li.gnb1,'
								+ '.con #gnbp3 ul li.gnb2,'
								+ '.con #gnbp3 ul li.gnb3,'
								+ '.con #gnbp3 ul li.gnb4 {float:left;}'
								+ '.con #gnbp3 ul li.gnb1 {margin:0 0 0 38px;}'
								+ '#jumboWall { position:relative; width:960px; height:488px; margin-top:-12px; margin-bottom:100px; margin-left:auto; margin-right:auto; background:url(/uk/common/img/index/bg_blue.jpg) no-repeat center top; }'
								+ '#jumboWall .visualArea { display:none}'
								+ '</style>';

	document.write(displayNoneHTML);
}

function learnMore() {
	var $section = $(".visualArea").find(".section").filter(function() {
		if ( !$(this).hasClass(".section0") ) {
			return $(this);
		}
	});

	$section.each(function() {
		$(this).bind({
			mouseenter : function() {
				$(this).find(".btnLearnMore").stop(true, true).delay(150).animate({
					"left" : 0
				}, 300);
			}
		});
	});

	$section.each(function() {
		$(this).bind({
			mouseleave : function() {
				$(this).find(".btnLearnMore").stop(true, true).animate({
					"left" : "-125px"
				}, 300);
			}
		});
	});
}

function lowBandWidth() {
	var $section = $(".visualArea").find(".section0");

	$section.each(function() {

		$(this).find(".textLayer").hide();

		var desc1_Text = $(this).find(".description01").html();
		var Alink = $(this).find(".link").find("a").attr("href");
		var Atarget = $(this).find(".link").find("a").attr("target");
		var descHTML = '<a href="' + Alink + '">' + desc1_Text + '</a>';

		$(this).find(".description01").html(descHTML);
		if ( Atarget ) $(this).find(".description01").find("a").attr("target", Atarget);

		$(this).find(".title02").remove();
		$(this).find(".description02").remove();
		$(this).find(".link").remove();

	});

	// smallWall
	var $wall = $("#jumboWall").find(".section");

	$wall.each(function() {

		var $link = $(this).find("a").filter(function() {
			if ( !$(this).parent().hasClass("btnClose") ) {
				return $(this);
			}
		});

		$link.each(function() {
			if ( $(this).parent().hasClass("btnLearnMore") ) {
				$("<img />", {
					"class" : "endArrow",
					"src" : "/fr/common/img/index/ico_endarrow2.png"
				}).appendTo($(this));
			} else {
				$("<img />", {
					"class" : "endArrow",
					"src" : "/fr/common/img/index/ico_endarrow.png"
				}).appendTo($(this));
			}
		});

		if ( !isMobile ) {

			$(this).bind({
				click : function() {
					if ( !$(this).find("a").length ) return false;
					if ( $(this).find("a").attr("target") == "_blank" ) {
						window.open($(this).find("a").attr("href"));
						return false;
					} else {
						location.href = $(this).find("a").attr("href");
					}

				},
				mouseover : function() {
					if ( !$(this).find("a").length ) return false;
					$(this).css({
						"cursor" : "pointer"
					});
					$(this).find(".textStyle03").find("a").css({
						"color" : "#0c4da2"
					});
					$(this).find(".description").find("a").css({
						"color" : "#0c4da2"
					});
					$link.find(".endArrow").show();
				},
				mouseout : function() {
					if ( !$(this).find("a").length ) return false;
					$(this).find(".textStyle03").find("a").css({
						"color" : "#000"
					});
					$(this).find(".description").find("a").css({
						"color" : "#000"
					});
					$link.find(".endArrow").hide();
				}
			});

		} else {

			$(this).bind({
				click : function() {
					if ( !$(this).find("a").length ) return false;
					if ( $(this).find("a").attr("target") == "_blank" ) {
						window.open($(this).find("a").attr("href"));
						return false;
					} else {
						location.href = $(this).find("a").attr("href");
					}

				}
			});
		}


	});

}

function smallWall() {

	var $wall = $("#jumboWall").find(".section");

	$wall.each(function() {

		var $link = $(this).find("a").filter(function() {
			if ( !$(this).parent().hasClass("btnClose") && !$(this).parent().hasClass("link") ) {
				return $(this);
			}
		});
		var $desc = $(this).find(".description01");

		$(this).find(".link").each(function() {
			$("<img />", {
				"class" : "endArrow",
				"src" : "/fr/common/img/index/ico_endarrow3.png"
			}).appendTo($(this).find("a")).show();
		});

		$link.each(function() {
			if ( $(this).parent().hasClass("btnLearnMore") ) {
				$("<img />", {
					"class" : "endArrow",
					"src" : "/fr/common/img/index/ico_endarrow2.png"
				}).appendTo($(this));
			} else {
				$("<img />", {
					"class" : "endArrow",
					"src" : "/fr/common/img/index/ico_endarrow.png"
				}).appendTo($(this));
			}
		});
		$desc.each(function() {
			$("<img />", {
				"class" : "endArrow",
				"src" : "/fr/common/img/index/ico_endarrow.png"
			}).appendTo($(this));
		});


		$(this).bind({
			click : function() {
				if ( !$(this).find("a").length ) return false;
				if ( !$(this).hasClass("section0") ) {
					if ( $(this).find("a").attr("target") == "_blank" ) {
						window.open($(this).find("a").attr("href"));
					} else {
						location.href = $(this).find("a").attr("href");
					}
					return false;
				}
			},
			mouseover : function() {
				if ( !$(this).find("a").length ) return false;
				$(this).css({
					"cursor" : "pointer"
				});
				$(this).find(".textStyle03").find("a").css({
					"color" : "#0c4da2"
				});
				$link.find(".endArrow").show();
				$desc.find(".endArrow").show();

			},
			mouseout : function() {
				if ( !$(this).find("a").length ) return false;
				$(this).find(".textStyle03").find("a").css({
					"color" : "#000"
				});
				$link.find(".endArrow").hide();
				$desc.find(".endArrow").hide();
			}
		});


	});
}

function section0() {

	var $section = $("#jumboWall").find(".section0");

	$section.each(function(i) {
		$(this).bind({
			mouseover : function() {
				$(this).find(".description01").css({
					"color" : "#0c4da2"
				});

			},
			mouseout : function() {
				$(this).find(".description01").css({
					"color" : "#000"
				});
			}
		});
	});

}

function sectionInit() {

	var $section = $("#jumboWall").find(".section0");
	var $close = $("#jumboWall").find(".btnClose");
	var $animating = $("#jumboWall").find("*:animated");

	$section.removeClass("open").removeClass("expanded");
	$close.hide();
	$animating.stop(true, true);

	flashReady = "collapse";

	// lesNouveau
	$section.eq(0).css({
		"width" : "575px"
	});

	$section.eq(0).find(".title").eq(1).css({
		"bottom" : "-400px"
	});
	$section.eq(0).find(".description").eq(1).css({
		"bottom" : "-400px"
	});
	$section.eq(0).find(".link").css({
		"bottom" : "-400px"
	});

	$section.eq(0).find(".title").eq(0).css({
		"display" : "block",
		"left" : "30px"
	});
	$section.eq(0).find(".description").eq(0).css({
		"display" : "block",
		"left" : "33px"
	});

	// telephone
	$section.eq(1).css({
		"width" : "575px",
		"left" : "193px"
	});
	$section.eq(1).find(".image").css({
		"left" : "-192px"
	});
	$section.eq(1).find(".bg_lowband").css({
		"background-position" : "192px 0px"
	});

	$section.eq(1).find(".title").eq(1).css({
		"top" : "-800px"
	});
	$section.eq(1).find(".description").eq(1).css({
		"top" : "-800px"
	});
	$section.eq(1).find(".link").css({
		"top" : "-800px"
	});

	// tvAudioVideo
	$section.eq(2).css({
		"width" : "575px"
	});
	$section.eq(2).find(".title").eq(1).css({
		"left" : "-800px"
	});
	$section.eq(2).find(".description").eq(1).css({
		"left" : "-800px"
	});
	$section.eq(2).find(".link").css({
		"left" : "-800px"
	});

	$section.eq(2).find(".title").eq(0).css({
		"display" : "block",
		"left" : "30px"
	});
	$section.eq(2).find(".description").eq(0).css({
		"display" : "block",
		"left" : "33px"
	});

	// photoCamescope
	$section.eq(3).css({
		"width" : "383px"
	});
	$section.eq(3).find(".title").eq(1).css({
		"left" : "-800px"
	});
	$section.eq(3).find(".description").eq(1).css({
		"left" : "-800px"
	});
	$section.eq(3).find(".link").css({
		"left" : "-800px"
	});

	$section.eq(3).find(".title").eq(0).css({
		"display" : "block",
		"left" : "30px"
	});
	$section.eq(3).find(".description").eq(0).css({
		"display" : "block",
		"left" : "31px"
	});

	// informatique
	$section.eq(4).css({
		"width" : "383px",
		"left" : "385px"
	});
	$section.eq(4).find(".image").css({
		"left" : "-384px"
	});
	$section.eq(4).find(".bg_lowband").css({
		"background-position" : "384px 0px"
	});

	$section.eq(4).find(".title").eq(1).css({
		"bottom" : "-400px"
	});
	$section.eq(4).find(".description").eq(1).css({
		"bottom" : "-400px"
	});
	$section.eq(4).find(".link").css({
		"bottom" : "-400px"
	});

	$section.eq(4).find(".title").eq(0).css({
		"display" : "block",
		"left" : "20px"
	});
	$section.eq(4).find(".description").eq(0).css({
		"display" : "block",
		"left" : "22px"
	});

	// electro
	$section.eq(5).css({
		"width" : "575px"
	});

	$section.eq(5).find(".title").eq(1).css({
		"left" : "-800px"
	});
	$section.eq(5).find(".description").eq(1).css({
		"left" : "-800px"
	});
	$section.eq(5).find(".link").css({
		"left" : "-800px"
	});

	$section.eq(5).find(".title").eq(0).css({
		"display" : "block",
		"left" : "30px"
	});
	$section.eq(5).find(".description").eq(0).css({
		"display" : "block",
		"left" : "33px"
	});


}

function navigation() {

	var $jumboWall = $("#jumboWall, #header");
	var $navi = $("#jumboWall .navigation");
	var $depth1 = $navi.find("ul.depth1");
	var $trigger = $navi.find("li.depth1");
	var $depth2 = $trigger.find("ul.depth2");
	var $arrow = $navi.find(".hoverArrow");
	var $visualArea = $("#jumboWall .visualArea");
	var thisIdx = getCookie("jumboWall_FR");
	var rollTimer;
	var autoRollDelay = 8000;
	var nowIdx = 0;
	var hashWord = [
			"latest-home",
			"mobile-phones-home",
			"tv-audio-video-home",
			"camera-camcorder-home",
			"it-home",
			"home-appliances-home"
	];

	if ( thisIdx == ""   ) {
		thisIdx = 0;
	} else {
		parseInt(thisIdx, 10);
	}

	nowIdx = parseInt(thisIdx, 10);

	window.location.hash = hashWord[thisIdx];

	$visualArea.hide();
	$visualArea.eq(thisIdx).show().addClass("nowPlaying");

	wallBGInit(thisIdx);

	$depth1.removeClass().addClass("depth1 hoverMenu" + thisIdx);
	$depth2.hide();
	$trigger.eq(thisIdx).next().show();
	$arrow.removeClass().addClass("hoverArrow hoverMenu"+thisIdx);
	$trigger.eq(thisIdx).find("ul.depth2").show();

	if ( rollTimer ) clearInterval(rollTimer);
	rollTimer = setInterval(rolling, autoRollDelay);

	$jumboWall.bind({
		mouseover : function() {
			clearInterval(rollTimer);
		},
		mouseout : function() {
			if ( rollTimer ) clearInterval(rollTimer);
			rollTimer = setInterval(rolling, autoRollDelay);
		}
	});

	$trigger.each(function(i) {
		$(this).children("a").bind({
			mouseenter : function() {
				$navi.removeClass().addClass("navigation hoverMenu"+i);
			},
			mouseleave : function() {
				$navi.removeClass().addClass("navigation");
			},
			click : function() {

				nowIdx = i;

				setInstantCookie("jumboWall_FR", i);

				wallBGInit(i);

				var $content = $($(this).attr("href"));

				if ( $content.hasClass("nowPlaying") ) {
					return false;
				} else {
					$visualArea.removeClass("nowPlaying");
					$content.addClass("nowPlaying");
				}

				if ( !isMobile && checkBandWidthVar != "Low" ) sectionInit();

				$depth1.removeClass().addClass("depth1");
				$(this).parent().parent().addClass("hoverMenu"+i);
				$depth2.hide();
				$(this).next().show();
				$arrow.removeClass().addClass("hoverArrow hoverMenu"+i);

				$visualArea.hide();
				$content.show();

				window.location.hash = hashWord[i];

				return false;
			}
		});
	});

	function rolling () {

		nowIdx += 1;

		if ( nowIdx == 6 ) nowIdx = 0;

		setInstantCookie("jumboWall_FR", nowIdx);

		wallBGInit(nowIdx);

		var $content = $($trigger.eq(nowIdx).children("a").attr("href"));

		if ( $content.hasClass("nowPlaying") ) {
			return false;
		} else {
			$visualArea.removeClass("nowPlaying");
			$content.addClass("nowPlaying");
		}

		if ( !isMobile && checkBandWidthVar != "Low" ) sectionInit();

		$depth1.removeClass().addClass("depth1");
		$trigger.eq(nowIdx).children("a").parent().parent().addClass("hoverMenu"+nowIdx);
		$depth2.hide();
		$trigger.eq(nowIdx).children("a").next().show();
		$arrow.removeClass().addClass("hoverArrow hoverMenu"+nowIdx);

		sectionInit();

		$visualArea.hide();
		$content.show();

		window.location.hash = hashWord[nowIdx];

	}
}

function wallBGInit(idx) {

	var flashIdx = parseInt(idx, 10) + 1;
	var flashFileName = "";
	var $visualArea = $("#jumboWall .visualArea");

	$visualArea.eq(idx).find(".section").each(function(i) {
		if ( i != 0 ) {
			if ( !$(this).hasClass("bg_Section" + i) ) {
				$(this).addClass("bg_Section"+i);
			}
		}
	});

	switch ( flashIdx ) {
		case 1 :
			flashFileName = "les_nouveau";
			break;
		case 2 :
			flashFileName = "telephone";
			break;
		case 3 :
			flashFileName = "tv_av";
			break;
		case 4 :
			flashFileName = "photo_camescope";
			break;
		case 5 :
			flashFileName = "informatique";
			break;
		case 6 :
			flashFileName = "electro";
	}

	var flashHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="961" height="489" name="kv_loader_ie' + flashIdx +'" id="kv_loader_ie' + flashIdx + '" align="middle">'
						+	'<param name="movie" value="/fr/common/img/index/contents/kv_loader.swf" />'
						+	'<param name="quality" value="high" />'
						+	'<param name="bgcolor" value="#ffffff" />'
						+	'<param name="play" value="true" />'
						+	'<param name="loop" value="true" />'
						+	'<param name="wmode" value="opaque" />'
						+	'<param name="scale" value="showall" />'
						+	'<param name="menu" value="true" />'
						+	'<param name="devicefont" value="false" />'
						+	'<param name="salign" value="" />'
						+	'<param name="flashvars" value="id=kv' + flashIdx + '&swf=/fr/common/img/index/contents/kv_' + flashFileName + '.swf" />'
						+	'<param name="allowScriptAccess" value="always" />'
						+	'<!--[if !IE]>-->'
						+	'<object type="application/x-shockwave-flash" data="/fr/common/img/index/contents/kv_loader.swf" width="961" height="489" name="kv_loader' + flashIdx + '" id="kv_loader' + flashIdx + '">'
						+		'<param name="movie" value="/fr/common/img/index/contents/kv_loader.swf" />'
						+		'<param name="quality" value="high" />'
						+		'<param name="bgcolor" value="#ffffff" />'
						+		'<param name="play" value="true" />'
						+		'<param name="loop" value="true" />'
						+		'<param name="wmode" value="opaque" />'
						+		'<param name="scale" value="showall" />'
						+		'<param name="menu" value="true" />'
						+		'<param name="devicefont" value="false" />'
						+		'<param name="salign" value="" />'
						+		'<param name="flashvars" value="id=kv' + flashIdx +'&swf=/fr/common/img/index/contents/kv_' + flashFileName + '.swf" />'
						+		'<param name="allowScriptAccess" value="always" />'
						+	'<!--<![endif]-->'
						+		'<a href="http://www.adobe.com/go/getflash">'
						+			'<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />'
						+		'</a>'
						+	'<!--[if !IE]>-->'
						+	'</object>'
						+	'<!--<![endif]-->'
						+'</object>';


		if ( isMobile || checkBandWidthVar == "Low" ) {
			if ( !$visualArea.eq(idx).find(".image").hasClass("bg_lowband") ) {
				$visualArea.eq(idx).find(".image").html("");
				$visualArea.eq(idx).find(".image").addClass("bg_lowband");
			}
		} else {
			$visualArea.eq(idx).find(".image").html(flashHTML);
		}

}
function expandTooltip() {

	var $expand = $("<div />", { "id" : "expandTooltip"});
	$expand.prependTo($("body"));
	$expand.html('<p>CLIQUEZ POUR AGRANDIR</p>').hide();

	$("#jumboWall .section0").each(function() {
		$(this).bind({
			mousemove : function(e) {
				var xPos = e.pageX + 10;
				var yPos = e.pageY + 20;
				$expand.animate({
					"left" : xPos + "px",
					"top" : yPos + "px"
				}, 0);
			}
		});
	});

	$("#jumboWall .section").not(".section0").each(function() {
		$(this).bind({
			mouseover : function() {
				$expand.hide();
			}
		});
	});

}


function lesNouveau() {

	var $section = $("#lesNouveau").find(".section");
	var $btnClose = $section.eq(0).find(".btnClose");
	var $h4 = $section.eq(0).find("h4");
	var $desc = $section.eq(0).find(".description");
	var $link = $section.eq(0).find(".link");
	var $learnMore = $("#lesNouveau").find("p.btnLearnMore");
	var expandable = true;
	var clickable = true;
	var $expand = $("#expandTooltip");

	$section.eq(0).mouseover(function() {
		$(this).css("cursor","pointer");
	});

	$btnClose.find("a").click(function(e) {
		e.stopPropagation();
		$btnClose.fadeOut(50);
		textHide();
		$expand.show();
		$section.eq(0)
			.animate({
				"width" : "575px"
			}, {
				duration: 1100,
				easing: "easeOutExpo"
			})
			.removeClass("open");
		flashReady = "collapse";
		flashKV.kv1.setCondition("collapse");
		return false;
	});

	$section.eq(0).bind({
		mouseenter : function() {
			if ( !$(this).hasClass("open") ) {
				$expand.show();
			}
			if ( !$(this).hasClass("expanded") ) {
				if ( !$(this).hasClass("open") ) {
					$(this).stop(true, true).animate({
						"width" : "600px"
					}, 200, function() {
					});
					$(this).addClass("expanded");
					flashReady = "over";
					flashKV.kv1.setCondition("over");
				}
			}
		},
		mouseleave : function() {
			if ( $(this).hasClass("expanded") ) {
				if ( !$(this).hasClass("open") ) {
					$(this).animate({
						"width" : "575px"
					}, 200, function() {

					});
					$(this).removeClass("expanded");
					flashReady = "collapse";
					flashKV.kv1.setCondition("collapse");
				}
			}
			$expand.hide();
		},
		click : function(e) {
			if ( clickable ) {
				clickable = false;
				if ( !$(this).hasClass("open") ) {
					textShow();
					$expand.hide();
					$section.eq(0).animate({
						"width" : "961px"
					}, {
						duration: 1100,
						easing: "easeOutExpo",
						complete : function() {
							$btnClose.fadeIn(50);
							expandable = false;
						}
					})
					.addClass("open");
					flashReady = "expand";
					flashKV.kv1.setCondition("expand");
				} else {
					$btnClose.fadeOut(50);
					textHide();
					$expand.show();
					$section.eq(0)
						.animate({
							"width" : "575px"
						}, {
							duration: 1100,
							easing: "easeOutExpo"
						})
						.removeClass("open");
					flashReady = "collapse";
					flashKV.kv1.setCondition("collapse");
				}
			}
		}
	});

	function textShow() {

		$desc.eq(0).stop(true, true).fadeOut(150);

		$h4.eq(0).stop(true, true).fadeOut(150, function() {
			$h4.eq(1).stop(true, true).delay(150).animate({
				"bottom" : "400px"
			}, {
				duration: 800,
				easing: "easeOutExpo"
			});

			$desc.eq(1).stop(true, true).animate({
				"bottom" : "280px"
			}, {
				duration: 1200,
				easing: "easeOutExpo",
				complete : function() {

				}
			});

			$link.stop(true, true).animate({
				"bottom" : "230px"
			}, {
				duration: 1500,
				easing: "easeOutExpo",
				complete : function() {
					clickable = true;
				}
			});

		});

	}

	function textHide() {

		$desc.eq(1).stop(true, true).animate({
			"bottom" : "-400px"
		},{
			duration: 700,
			easing: "easeOutExpo"
		});

		$link.stop(true, true).animate({
			"bottom" : "-400px"
		},{
			duration: 700,
			easing: "easeOutExpo"
		});

		$h4.eq(1).stop(true, true).animate({
			"bottom" : "-400px"
		}, {
			duration: 700,
			easing: "easeOutExpo",
			complete : function() {
				$desc.eq(0).fadeIn(350);
				$h4.eq(0).fadeIn(350, function() {
					expandable = true;
					clickable = true;
				});
			}
		});

	}

}

function telephone() {

	var $section = $("#telephone").find(".section");
	var $btnClose = $section.eq(0).find(".btnClose");
	var $h4 = $section.eq(0).find("h4");
	var $desc = $section.eq(0).find(".description");
	var $link = $section.eq(0).find(".link");
	var $learnMore = $("#telephone").find("p.btnLearnMore");
	var expandable = true;
	var clickable = true;
	var $expand = $("#expandTooltip");

	$section.eq(0).mouseover(function() {
		$(this).css("cursor","pointer");
	});

	$btnClose.find("a").click(function(e) {
		e.stopPropagation();
		$btnClose.fadeOut(50);
		textHide();
		$expand.show();
		$section.eq(0)
			.animate({
				"width" : "575px",
				"left" : "193px"
			}, {
				duration: 1100,
				easing: "easeOutExpo"
			})
			.removeClass("open");
		$section.eq(0).find(".image").animate({
			"left" : "-192px"
		}, {
			duration: 1100,
			easing: "easeOutExpo"
		});
		flashReady = "collapse";
		flashKV.kv2.setCondition("collapse");
		return false;
	});

	$section.eq(0).bind({
		mouseenter : function() {
			if ( !$(this).hasClass("open") ) {
				$expand.show();
			}
			if ( !$(this).hasClass("expanded") ) {
				if ( !$(this).hasClass("open") ) {
					$(this).stop(true, true).animate({
						"width" : "620px",
						"left" : "173px"
					}, 200, function() {
					});
					$(this).addClass("expanded");
					//flashKV.kv2.setCondition("over");
				}
			}
		},
		mouseleave : function() {
			if ( $(this).hasClass("expanded") ) {
				if ( !$(this).hasClass("open") ) {
					$(this).animate({
						"width" : "575px",
						"left" : "193px"
					}, 200);
					$(this).removeClass("expanded");
					//flashKV.kv2.setCondition("collapse");
				}
			}
			$expand.hide();
		},
		click : function() {
			if ( clickable ) {
				clickable = false;
				if ( !$(this).hasClass("open") ) {
					textShow();
					$expand.hide();
					$section.eq(0).animate({
						"left" : "0px",
						"width" : "961px"
					}, {
						duration: 1100,
						easing: "easeOutExpo",
						complete : function() {
							$btnClose.fadeIn(50);
							expandable = false;
						}
					})
					.addClass("open");
					$section.eq(0).find(".image").animate({
						"left" : 0
					},{
						duration: 1100,
						easing: "easeOutExpo"
					});
					flashReady = "expand";
					flashKV.kv2.setCondition("expand");
				} else {
					$btnClose.fadeOut(50);
					textHide();
					$expand.show();
					$section.eq(0)
						.animate({
							"width" : "575px",
							"left" : "193px"
						}, {
							duration: 700
							//easing: "easeOutExpo"
						})
						.removeClass("open");
					$section.eq(0).find(".image").animate({
						"left" : "-192px"
					}, {
						duration: 700
						//easing: "easeOutExpo"
					});
					flashReady = "collapse";
					flashKV.kv2.setCondition("collapse");

				}
			}
		}
	});

	function textShow() {

		$h4.eq(0).stop(true, true).fadeOut(150);
		$desc.eq(0).stop(true, true).fadeOut(150, function() {
			$h4.eq(1).stop(true, true).animate({
				"top" : "130px"
			}, {
				duration: 800,
				easing: "easeOutExpo"
			});

			$desc.eq(1).stop(true, true).animate({
				"top" : "225px"
			}, {
				duration: 1000,
				easing: "easeOutExpo"
			});

			$link.eq(0).stop(true, true).animate({
				"top" : "255px"
			}, {
				duration: 1200,
				easing: "easeOutExpo",
				complete : function() {
					clickable = true;
				}
			});

		});



	}

	function textHide() {

		$h4.eq(1).animate({
			"top" : "-800px"
		}, {
			duration: 700,
			easing: "easeOutExpo"
		});

		$desc.eq(1).animate({
			"top" : "-800px"
		}, {
			duration: 700,
			easing: "easeOutExpo"
		});

		$link.eq(0).animate({
			"top" : "-800px"
		}, {
			duration: 900,
			easing: "easeOutExpo",
			complete : function() {
				$h4.eq(0).fadeIn(150);
				$desc.eq(0).fadeIn(150);
				expandable = true;
				clickable = true;
			}
		});

	}

}

function tvAudioVideo() {

	var $section = $("#tvAudioVideo").find(".section");
	var $btnClose = $section.eq(0).find(".btnClose");
	var $h4 = $section.eq(0).find("h4");
	var $desc = $section.eq(0).find(".description");
	var $link = $section.eq(0).find(".link");
	var $learnMore = $("#tvAudioVideo").find("p.btnLearnMore");
	var expandable = true;
	var clickable = true;
	var $expand = $("#expandTooltip");

	$section.eq(0).mouseover(function() {
		$(this).css("cursor","pointer");
	});

	$btnClose.find("a").click(function(e) {
		e.stopPropagation();
		$btnClose.fadeOut(50);
		textHide();
		$expand.show();
		$section.eq(0)
			.animate({
				"width" : "575px"
			}, {
				duration: 1100,
				easing: "easeOutExpo"
			})
			.removeClass("open");
		flashReady = "collapse";
		flashKV.kv3.setCondition("collapse");
		return false;
	});

	$section.eq(0).bind({
		mouseenter : function() {
			if ( !$(this).hasClass("open") ) {
				$expand.show();
			}
			if ( !$(this).hasClass("expanded") ) {
				if ( !$(this).hasClass("open") ) {
					$(this).stop(true, true).animate({
						"width" : "600px"
					}, 200, function() {
					});
					$(this).addClass("expanded");
					flashReady = "over";
					flashKV.kv3.setCondition("over");
				}
			}
		},
		mouseleave : function() {
			if ( $(this).hasClass("expanded") ) {
				if ( !$(this).hasClass("open") ) {
					$(this).animate({
						"width" : "575px"
					}, 200, function() {
					});
					$(this).removeClass("expanded");
					flashKV.kv3.setCondition("collapse");
				}
			}
			$expand.hide();
		},
		click : function(e) {
			if ( clickable ) {
				clickable = false;
				if ( !$(this).hasClass("open") ) {
					textShow();
					$expand.hide();
					$(this).animate({
						"width" : "961px"
					}, {
						duration: 1100,
						easing: "easeOutExpo",
						complete : function() {
							$btnClose.fadeIn(50);
							expandable = false;
						}
					})
					.addClass("open");
					flashReady = "expand";
					flashKV.kv3.setCondition("expand");
				} else {
					$btnClose.fadeOut(50);
					textHide();
					$expand.show();
					$section.eq(0)
						.animate({
							"width" : "575px"
						}, {
							duration: 1100,
							easing: "easeOutExpo"
						})
						.removeClass("open");
					flashReady = "collapse";
					flashKV.kv3.setCondition("collapse");
				}
			}
		}
	});

	function textShow() {

		$desc.eq(0).stop(true, true).fadeOut(150);

		$h4.eq(0).stop(true, true).fadeOut(150, function() {
			$h4.eq(1).stop(true, true).delay(150).animate({
				"left" : "30px"
			}, {
				duration: 1100,
				easing: "easeOutExpo"
			});

			$desc.eq(1).stop(true, true).animate({
				"left" : "33px"
			}, {
				duration: 1100,
				easing: "easeOutExpo",
				complete : function() {

				}
			});

			$link.stop(true, true).animate({
				"left" : "33px"
			}, {
				duration: 1100,
				easing: "easeOutExpo",
				complete : function() {
					clickable = true;
				}
			});

		});

	}

	function textHide() {

		$desc.eq(1).stop(true, true).animate({
			"left" : "-800px"
		},{
			duration: 700,
			easing: "easeOutExpo"
		});

		$link.stop(true, true).animate({
			"left" : "-800px"
		},{
			duration: 700,
			easing: "easeOutExpo"
		});

		$h4.eq(1).stop(true, true).animate({
			"left" : "-800px"
		}, {
			duration: 700,
			easing: "easeOutExpo",
			complete : function() {
				$desc.eq(0).fadeIn(350);
				$h4.eq(0).fadeIn(350, function() {
					expandable = true;
					clickable = true;
				});
			}
		});

	}

}


function photoCamescope() {

	var $section = $("#photoCamescope").find(".section");
	var $btnClose = $section.eq(0).find(".btnClose");
	var $h4 = $section.eq(0).find("h4");
	var $desc = $section.eq(0).find(".description");
	var $link = $section.eq(0).find(".link");
	var $learnMore = $("#photoCamescope").find("p.btnLearnMore");
	var expandable = true;
	var clickable = true;
	var $expand = $("#expandTooltip");

	$section.eq(0).mouseover(function() {
		$(this).css("cursor","pointer");
	});

	$btnClose.find("a").click(function(e) {
		e.stopPropagation();
		$btnClose.fadeOut(50);
		textHide();
		$expand.show();
		$section.eq(0)
			.animate({
				"width" : "383px"
			}, {
				duration: 1100,
				easing: "easeOutExpo"
			})
			.removeClass("open");
		flashReady = "collapse";
		flashKV.kv4.setCondition("collapse");
		return false;
	});

	$section.eq(0).bind({
		mouseenter : function() {
			if ( !$(this).hasClass("open") ) {
				$expand.show();
			}
			if ( !$(this).hasClass("expanded") ) {
				if ( !$(this).hasClass("open") ) {
					$(this).stop(true, true).animate({
						"width" : "420px"
					}, 200, function() {
					});
					$(this).addClass("expanded");
					flashReady = "over";
					flashKV.kv4.setCondition("over");
				}
			}
		},
		mouseleave : function() {
			if ( $(this).hasClass("expanded") ) {
				if ( !$(this).hasClass("open") ) {
					$(this).animate({
						"width" : "383px"
					}, 200, function() {
					});
					$(this).removeClass("expanded");
					flashKV.kv4.setCondition("collapse");
				}
			}
			$expand.hide();
		},
		click : function(e) {
			if ( clickable ) {
				clickable = false;
				if ( !$(this).hasClass("open") ) {
					textShow();
					$expand.hide();
					$(this).animate({
						"width" : "961px"
					}, {
						duration: 1100,
						easing: "easeOutExpo",
						complete : function() {
							$btnClose.fadeIn(50);
							expandable = false;
						}
					})
					.addClass("open");
					flashReady = "expand";
					flashKV.kv4.setCondition("expand");
				} else {
					$btnClose.fadeOut(50);
					textHide();
					$expand.show();
					$section.eq(0)
						.animate({
							"width" : "383px"
						}, {
							duration: 1100,
							easing: "easeOutExpo"
						})
						.removeClass("open");
					flashReady = "collapse";
					flashKV.kv4.setCondition("collapse");
				}
			}
		}
	});

	function textShow() {

		$desc.eq(0).stop(true, true).animate({
			"left" : "-600px"
		}, 700);

		$h4.eq(0).stop(true, true).animate({
			"left" : "-600px"
		},500, function() {
			$h4.eq(1).stop(true, true).delay(150).animate({
				"left" : "30px"
			}, {
				duration: 1100,
				easing: "easeOutExpo"
			});

			$desc.eq(1).stop(true, true).animate({
				"left" : "33px"
			}, {
				duration: 1100,
				easing: "easeOutExpo",
				complete : function() {

				}
			});

			$link.stop(true, true).animate({
				"left" : "33px"
			}, {
				duration: 1100,
				easing: "easeOutExpo",
				complete : function() {
					clickable = true;
				}
			});

		});

	}

	function textHide() {

		$desc.eq(1).stop(true, true).animate({
			"left" : "-800px"
		},{
			duration: 1000,
			easing: "easeOutExpo"
		});

		$link.stop(true, true).animate({
			"left" : "-800px"
		},{
			duration: 1000,
			easing: "easeOutExpo"
		});

		$h4.eq(1).stop(true, true).animate({
			"left" : "-800px"
		}, {
			duration: 700,
			easing: "easeOutExpo",
			complete : function() {
				$desc.eq(0).stop(true, true).animate({
					"left" : "33px"
				}, 700);

				$h4.eq(0).stop(true, true).animate({
					"left" : "30px"
				},500, function() {
					expandable = true;
					clickable = true;
				});
			}

		});

	}
}

function informatique() {

	var $section = $("#informatique").find(".section");
	var $btnClose = $section.eq(0).find(".btnClose");
	var $h4 = $section.eq(0).find("h4");
	var $desc = $section.eq(0).find(".description");
	var $link = $section.eq(0).find(".link");
	var $learnMore = $("#informatique").find("p.btnLearnMore");
	var expandable = true;
	var clickable = true;
	var $expand = $("#expandTooltip");

	$section.eq(0).mouseover(function() {
		$(this).css("cursor","pointer");
	});

	$btnClose.find("a").click(function(e) {
		e.stopPropagation();
		$btnClose.fadeOut(50);
		textHide();
		$expand.show();
		$section.eq(0)
			.animate({
				"width" : "383px",
				"left" : "385px"
			}, {
				duration: 1100,
				easing: "easeOutExpo"
			})
			.removeClass("open");
		$section.eq(0).find(".image").animate({
			"left" : "-384px"
		}, {
			duration: 1100,
			easing: "easeOutExpo"
		});
		flashReady = "collapse";
		flashKV.kv5.setCondition("collapse");
		return false;
	});

	$section.eq(0).bind({
		mouseenter : function() {
			if ( !$(this).hasClass("open") ) {
				$expand.show();
			}
			if ( !$(this).hasClass("expanded") ) {
				if ( !$(this).hasClass("open") ) {
					$(this).stop(true, true).animate({
						"width" : "423px",
						"left" : "365px"
					}, 200, function() {
					});
					$(this).addClass("expanded");
					//flashKV.kv5.setCondition("over");
				}
			}
		},
		mouseleave : function() {
			if ( $(this).hasClass("expanded") ) {
				if ( !$(this).hasClass("open") ) {
					$(this).animate({
						"width" : "383px",
						"left" : "385px"
					}, 200, function() {
					});
					$(this).removeClass("expanded");
					//flashKV.kv5.setCondition("collapse");
				}
			}
			$expand.hide();
		},
		click : function() {
			if ( clickable ) {
				clickable = false;
				if ( !$(this).hasClass("open") ) {
					textShow();
					$expand.hide();
					$section.eq(0).animate({
						"left" : "0px",
						"width" : "961px"
					}, {
						duration: 1100,
						easing: "easeOutExpo",
						complete : function() {
							$btnClose.fadeIn(50);
							expandable = false;
						}
					})
					.addClass("open");
					$section.eq(0).find(".image").animate({
						"left" : 0
					}, {
						duration: 1100,
						easing: "easeOutExpo"
					});
					flashReady = "expand";
					flashKV.kv5.setCondition("expand");
				} else {
					$btnClose.fadeOut(50);
					textHide();
					$expand.show();
					$section.eq(0)
						.animate({
							"width" : "383px",
							"left" : "385px"
						}, {
							duration: 1100,
							easing: "easeOutExpo"
						})
						.removeClass("open");
					$section.eq(0).find(".image").animate({
						"left" : "-384px"
					}, {
						duration: 1100,
						easing: "easeOutExpo"
					});
					flashReady = "collapse";
					flashKV.kv5.setCondition("collapse");

				}
			}
		}
	});

	function textShow() {

		$h4.eq(0).stop(true, true).fadeOut(150);
		$desc.eq(0).stop(true, true).fadeOut(150, function() {
			$h4.eq(1).stop(true, true).animate({
				"bottom" : "121px"
			}, {
				duration: 800,
				easing: "easeOutExpo"
			});

			$desc.eq(1).stop(true, true).animate({
				"bottom" : "87px"
			}, {
				duration: 1000,
				easing: "easeOutExpo"
			});

			$link.eq(0).stop(true, true).animate({
				"bottom" : "58px"
			}, {
				duration: 1200,
				easing: "easeOutExpo",
				complete : function() {
					clickable = true;
				}
			});

		});



	}

	function textHide() {

		$h4.eq(1).stop(true, true).animate({
			"bottom" : "-400px"
		}, {
			duration: 300,
			easing: "easeOutExpo"
		});

		$desc.eq(1).stop(true, true).animate({
			"bottom" : "-400px"
		}, {
			duration: 300,
			easing: "easeOutExpo"
		});

		$link.eq(0).stop(true, true).animate({
			"bottom" : "-400px"
		}, {
			duration: 300,
			easing: "easeOutExpo",
			complete : function() {
				$h4.eq(0).stop(true, true).fadeIn(150);
				$desc.eq(0).stop(true, true).fadeIn(150, function() {
					expandable = true;
					clickable = true;
				});
			}
		});

	}


}

function electro() {

	var $section = $("#electro").find(".section");
	var $btnClose = $section.eq(0).find(".btnClose");
	var $h4 = $section.eq(0).find("h4");
	var $desc = $section.eq(0).find(".description");
	var $link = $section.eq(0).find(".link");
	var $learnMore = $("#electro").find("p.btnLearnMore");
	var expandable = true;
	var clickable = true;
	var $expand = $("#expandTooltip");

	$section.eq(0).mouseover(function() {
		$(this).css("cursor","pointer");
	});

	$btnClose.find("a").click(function(e) {
		e.stopPropagation();
		$btnClose.fadeOut(50);
		textHide();
		$expand.show();
		$section.eq(0)
			.animate({
				"width" : "575px"
			}, {
				duration: 1100,
				easing: "easeOutExpo"
			})
			.removeClass("open");
		flashReady = "collapse";
		flashKV.kv6.setCondition("collapse");
		return false;
	});

	$section.eq(0).bind({
		mouseenter : function() {
			if ( !$(this).hasClass("open") ) {
				$expand.show();
			}
			if ( !$(this).hasClass("expanded") ) {
				if ( !$(this).hasClass("open") ) {
					$(this).stop(true, true).animate({
						"width" : "600px"
					}, 200, function() {
					});
					$(this).addClass("expanded");
					flashReady = "over";
					flashKV.kv6.setCondition("over");
				}
			}
		},
		mouseleave : function() {
			if ( $(this).hasClass("expanded") ) {
				if ( !$(this).hasClass("open") ) {
					$(this).animate({
						"width" : "575px"
					}, 200, function() {

					});
					$(this).removeClass("expanded");
					flashReady = "collapse";
					flashKV.kv6.setCondition("collapse");
				}
			}
			$expand.hide();
		},
		click : function(e) {
			if ( clickable ) {
				clickable = false;
				if ( !$(this).hasClass("open") ) {
					textShow();
					$expand.hide();
					$section.eq(0).animate({
						"width" : "961px"
					}, {
						duration: 1100,
						easing: "easeOutExpo",
						complete : function() {
							$btnClose.fadeIn(50);
							expandable = false;
						}
					})
					.addClass("open");
					flashReady = "expand";
					flashKV.kv6.setCondition("expand");
				} else {
					$btnClose.fadeOut(50);
					textHide();
					$expand.show();
					$section.eq(0)
						.animate({
							"width" : "575px"
						}, {
							duration: 1100,
							easing: "easeOutExpo"
						})
						.removeClass("open");
					flashReady = "collapse";
					flashKV.kv6.setCondition("collapse");
				}
			}
		}
	});

	function textShow() {

		$desc.eq(0).stop(true, true).fadeOut(150);

		$h4.eq(0).stop(true, true).fadeOut(150, function() {
			$h4.eq(1).stop(true, true).delay(150).animate({
				"left" : "30px"
			}, {
				duration: 1100,
				easing: "easeOutExpo"
			});

			$desc.eq(1).stop(true, true).animate({
				"left" : "33px"
			}, {
				duration: 1100,
				easing: "easeOutExpo",
				complete : function() {

				}
			});

			$link.stop(true, true).animate({
				"left" : "33px"
			}, {
				duration: 1100,
				easing: "easeOutExpo",
				complete : function() {
					clickable = true;
				}
			});

		});

	}

	function textHide() {

		$desc.eq(1).stop(true, true).animate({
			"left" : "-800px"
		},{
			duration: 700,
			easing: "easeOutExpo"
		});

		$link.stop(true, true).animate({
			"left" : "-800px"
		},{
			duration: 700,
			easing: "easeOutExpo"
		});

		$h4.eq(1).stop(true, true).animate({
			"left" : "-800px"
		}, {
			duration: 700,
			easing: "easeOutExpo",
			complete : function() {
				$desc.eq(0).fadeIn(350);
				$h4.eq(0).fadeIn(350, function() {
					expandable = true;
					clickable = true;
				});
			}
		});

	}

}

function indexTab() {

	var $tab = $("#indexTab");
	var $trigger = $tab.find("li");
	var $cont = $(".homeContent").children("div");

	var p = parameters();

	$cont.hide();

	if(p.brightcove) {
		$trigger.find("a.videos").addClass("activator").parent().addClass("activator");
		$($trigger.find("a.videos").attr("href")).show();
	}
	else {
		$trigger.eq(0).addClass("activator").find("a").addClass("activator");
		$cont.eq(0).show();
	}

	$trigger.each(function(i) {
		$(this).find("a").bind({
			click : function() {
				var $thisCont = $($(this).attr("href"));
				$trigger.each(function() {
					$(this).removeClass("activator");
					$(this).find("a").removeClass("activator");
				});
				$(this).addClass("activator");
				$(this).parent().addClass("activator");
				$cont.hide();
				$thisCont.fadeIn(250);

				switch($thisCont.attr('id')) {
					case 'videos' :
						try{indexBC();} catch(e){};
						break;
					default:
						break;
				}
				if($thisCont.attr('id') != 'videos') $('#videos .bc').html('');

				return false;
			}
		});
	});

}
