function cookie_lang(lang)
{
	set_cookie ('user_lang',lang);
}

function openMenu(toOpen) {
	myMenu = document.getElementById(toOpen);
	if(myMenu.style.display == "none") {
		document.getElementById(toOpen).style.display = "block";
	} else {
		document.getElementById(toOpen).style.display = "none";
	}
}
// we sould add the hidden input id and name has parameter
function selectMenu(id,idToChange,toOpen){
	document.getElementById(idToChange).innerHTML = document.getElementById(id).innerHTML;
	$('customBox').value = id;
}

function popupvedette() {
	if ($('vedette_popup').style.display == "none")
	{
		$('clearsite').style.display = "block";
		$('clearsite').style.width = document.documentElement.scrollWidth + "px";
		$('clearsite').style.height = document.documentElement.scrollHeight + "px";
		$('vedette_popup').style.display = "block";
		$('banner_clear').style.display = "block";
		$('banner').style.display = "none";
	}
	else
	{
		$('clearsite').style.display = "none";
		$('vedette_popup').style.display = "none";
		$('clearsite').style.width = "0px";
		$('clearsite').style.height = "0px";
		$('banner_clear').style.display = "none";
		$('banner').style.display = "block";
	}
}

function popupvideo(){

	if($('video_popup').style.display == "none")
	{
		$('clearsite').style.display = "block";
		$('clearsite').style.width = document.documentElement.scrollWidth + "px";
		$('clearsite').style.height = document.documentElement.scrollHeight + "px";
		//$('video_content').innerHTML = '<object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="328" height="200"><param name="movie" value="swf/player.swf" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="flashvars" value="file=video.flv&image=swf/preview.jpg" /><object type="application/x-shockwave-flash" data="swf/player.swf" width="328" height="200"><param name="movie" value="swf/player.swf" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="flashvars" value="file=video.flv&image=swf/preview.jpg" /><p><a href="http://get.adobe.com/flashplayer">Get Flash</a> to see this player.</p></object></object>';
		$('video_popup').style.display = "block";
		$('banner_clear').style.display = "block";
		$('banner').style.display = "none";
		$('video_popup').style.left = "50%";
		var marginLeft = $('video_content').style.width;
		marginLeft = marginLeft.split("px");
		marginLeft = marginLeft[0] /2;
				
		$('video_popup').style.marginLeft = -(marginLeft) + "px";
	}else
	{
		$('clearsite').style.display = "none";
		$('video_popup').style.display = "none";
		$('clearsite').style.width = "0px";
		$('clearsite').style.height = "0px";
		$('banner_clear').style.display = "none";
		$('banner').style.display = "block";
	}
}

function popupvideoproduct(video, lang, width, height){
	
	if($('video_popup').style.display == "none")
	{
		$('clearsite').style.display = "block";
		$('clearsite').style.width = document.documentElement.scrollWidth + "px";
		$('clearsite').style.height = document.documentElement.scrollHeight + "px";
		$('video_content').style.width = (width + 100) + 'px';
		$('video_popup').style.width = (width + 100) + 'px';
		$('video_content').innerHTML = '<object type="application/x-shockwave-flash" data="swf/player.swf" width="' + width + '" height="' + height + '"><param name="movie" value="swf/player.swf" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="flashvars" value="file=/upload/products/video/' + video + '" /><p><a href="http://get.adobe.com/flashplayer">Get Flash</a> to see this player.</p></object>';
		$('video_popup').style.display = "block";
		$('video_popup').style.left = "50%";
		var marginLeft = $('video_content').style.width;
		marginLeft = marginLeft.split("px");
		marginLeft = marginLeft[0] /2;
				
		$('video_popup').style.marginLeft = -(marginLeft) + "px";
		
		//$('banner_clear').style.display = "block";
		//$('banner').style.display = "none";
	}else
	{
		$('clearsite').style.display = "none";
		$('video_popup').style.display = "none";
		$('clearsite').style.width = "0px";
		$('clearsite').style.height = "0px";
		$('video_content').innerHTML="";
		//$('banner_clear').style.display = "none";
		//$('banner').style.display = "block";
	}
	document.location.hash = "video";
}

