/** Ouverture d'une nouvelle fenetre */
function popupWindow( link )
{
	window.open( link, '', '' );
}

/** Ouverture d'une nouvelle fenetre des CGV */
function popupAddMediaWindow( link, name )
{
	window.open( link, name, 'width=600, height=300, channelmode=no, resizable=no, location=no, menubar=no, status=no, scrollbars=yes, toolbar=no' );
}

/** Ouverture d'une nouvelle fenetre de s?lection de m?dia pour un post */
function popupSelectValidMediaWindow( link, name )
{
	window.open( link, name, 'width=600, height=500, channelmode=no, resizable=no, location=no, menubar=no, status=no, scrollbars=yes, toolbar=no' );
}

/** Ouverture d'une nouvelle fenetre des CGV */
function popupCGUWindow( link )
{
	window.open( link, '', 'width=600, height=600, channelmode=no, resizable=no, location=no, menubar=no, status=no, scrollbars=yes, toolbar=no' );
}

/** Ouverture d'une nouvelle fenetre des cr?dits */
function popupCdtWindow( link )
{
	window.open( link, '', 'width=600, height=650, channelmode=no, resizable=no, location=no, menubar=no, status=no, scrollbars=yes, toolbar=no' );
}

/** Ouverture d'une nouvelle fenetre en 1024 * 768 */
function popupBigWindow( link )
{
	window.open( link, '', 'width=1024, height=768, channelmode=yes, resizable=yes, location=yes, menubar=yes, status=yes, scrollbars=yes, toolbar=yes' );
}

/** Ouverture d'une nouvelle fenetre conseiller ce message à un ami */
function popupSendAdviceFriendWindow( link )
{
	window.open( link, '', 'width=650, height=430, channelmode=no, resizable=no, location=no, menubar=no, status=no, scrollbars=yes, toolbar=no' );
}

function popupGetPlayerCode( mediaId )
{
	var link = '../front.do?method=getPlayerCodePage&mediaId=' + mediaId;
	popupGetPlayerCodeWindow( link, 'playerCode' )
}

function popupGetPlayerCodeWindow( link, name )
{
	window.open( link, name, 'width=800, height=500, channelmode=no, resizable=no, location=no, menubar=no, status=no, scrollbars=no, toolbar=no' );
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/** Active le lien sur la fen?tre m?re et ferme la fen?tre courante */
function openParentWindowAndClose( link )
{
	window.opener.location.href = link;
	if (window.opener.progressWindow)
	{
		window.opener.progressWindow.close();
	}
	window.close();
}

/** ------------------------------------------------- */
/** 	Appel du post du formulaire de paiement		  */
/** ------------------------------------------------- */
function submitPaymentForm()
{
	document.PaymentRequest.submit();
}

/** ------------------------------------------------- */
/** 	Appel du post du formulaire d'autentification */
/** ------------------------------------------------- */
function submitAuthenticateMenuForm()
{
	document.getElementById('authenticateMenuForm').submit();
}

/** ------------------------------------------------- */
/** 	Appel du post du formulaire de recherche de blog */
/** ------------------------------------------------- */
function submitSearchMenuForm()
{
	document.getElementById('searchMenuForm').submit();
}

/** ------------------------------------------------- */
/** 	Appel du post du formulaire de recherche tri?e de blog */
/** ------------------------------------------------- */
function submitSearchSortedForm()
{
	document.getElementById('searchSortedForm').submit();
}

/** ------------------------------------------------- */
/** 	Appel du post du formulaire de recherche tri?e de blog */
/** ------------------------------------------------- */
function submitAdvancedSearchSortedForm()
{
	document.getElementById('advancedSearchSortedForm').submit();
}

/** ------------------------------------------------- */
/** 	Appel du post du formulaire de recherche tri?e de blog de communaut? */
/** ------------------------------------------------- */
function submitSearchSortedCommunityForm()
{
	document.getElementById('searchSortedCommunityForm').submit();
}

/** ---------------------------------------------------------------------------- */
/** 				M?thodes de d?tection de l'OS courant						 */
/** ---------------------------------------------------------------------------- */

function isWindowsOS()
{
	return navigator.appVersion.indexOf("Win") != -1;
}

function isLinuxOS()
{
	return navigator.appVersion.indexOf("Linux") != -1;
}

function isUnixOS()
{
	return navigator.appVersion.indexOf("X11") != -1;
}

function isMacOS()
{
	return navigator.appVersion.indexOf("Mac") != -1;
}

function isLinuxOrUnixOS()
{
	return isLinuxOS() || isUnixOS();
}

function goFullscreen(time,whatToPlay,playerId,movieDuration,movieWidth,movieHeight)
{
 
    player = document.getElementById(playerId);
    
	if (!window.fullscreen) 
	{
			var reg=new RegExp("startTime=0", "g");
			document.getElementById('fullscreenPlayer').innerHTML = player.innerHTML.replace(reg,"startTime=" + time + "&movieDuration=" + movieDuration + "&movieWidth=" + movieWidth + "&movieHeight=" + movieHeight);
			document.getElementById('inner_body').style.display = 'none';
			document.getElementById('fullscreenPlayer').style.display = '';	
		    fullscreen = true;
    }
    else 
    { 
			document.getElementById('fullscreenPlayer').innerHTML = '';
			document.getElementById('inner_body').style.display = '';
			document.getElementById('fullscreenPlayer').style.display = 'none';	
			fullscreen = false;			
    }
}

/** Gestion des thématiques sur le menu */
function showChildThematics(id) {
	var selectedDt = $(id);
	var dd;
	for (var i = 1; i <= 10; i ++) 
	{
		dd = $('smenu' + i);
		if (dd && dd.visible()) 
		{
			Effect.SlideUp(dd, {duration : 0.5, queue : 'end'});
		}
	}
	if (selectedDt) 
	{
		if (selectedDt.descendants().length > 0)
		{
			Effect.SlideDown(selectedDt, {duration : 0.5, queue : 'end'});
		}
	}
	return false;
}
//-->
