if(navigator.appName =="Microsoft Internet Explorer") {
	if(navigator.userAgent.indexOf("Mac") == -1 && navigator.appVersion.indexOf("MSIE 5.0")<0) window.onresize = function(){window.document.location.reload();}
	else if(navigator.appVersion.indexOf("MSIE 5.0")>0) window.onresize = preload;
}

function preload() {
	window.document.location.reload();
}

if ((navigator.appName=="Netscape")) reloadPage(true);
function reloadPage(init) {
  if (init==true) {
    pageW=innerWidth;
	pageH=innerHeight;
	onresize=reloadPage;
  }
  else if (innerWidth!=pageW || innerHeight!=pageH) location.reload();
}

var popLargeur=800;
var popHauteur=600;
var popDicoLargeur=600;
var popDicoHauteur=350;
var popBioLargeur=800;
var popBioHauteur=600;
var popSearchPersonLargeur=780;
var popSearchPersonHauteur=500;
var popForumConditionLargeur=800;
var popForumConditionHauteur=600;
var popAideNoticeLargeur=800;
var popAideNoticeHauteur=580;
var popSearchNoticeLargeur=780;
var popSearchNoticeHauteur=640;
var popSearchResistanceLargeur=780;
var popSearchResistanceHauteur=540;
var popNewsletterLargeur=650;
var popNewsletterHauteur=450;
var popDatesClesLargeur=566;
var popDatesClesHauteur=630;
var UniqueID = 314 // Make each link open in a new window
var newWinOffset = 0 // Position of first pop-up

function popForumCondition() {
	var left=(screen.width-popForumConditionLargeur)/2;
	var top=(screen.height-popForumConditionHauteur)/2;
	window.open("/g_forum/common/popForumConditionAction.do","popAdvice","top="+top+",left="+left+",width="+popForumConditionLargeur+",height="+popForumConditionHauteur+",scrollbars=1,menubar=0,resizable=0");
}

function popAideNotice() {
	var left=(screen.width-popAideNoticeLargeur)/2;
	var top=(screen.height-popAideNoticeHauteur)/2;
	window.open("/n_media/popHelpNoticeAction.do","popHelpNotice","top="+top+",left="+left+",width="+popAideNoticeLargeur+",height="+popAideNoticeHauteur+",scrollbars=1,menubar=0,resizable=0");
}

function forwardPageAideNotice() {
	if(window.opener.opener)
	window.opener.opener.location="/b_content/getContentFromNumLinkAction.do?type=1&itemId=317";
}

function popAdvice() {
	var left=(screen.width-popLargeur)/2;
	var top=(screen.height-popHauteur)/2;
	window.open("/n_media/popAdviceAction.do","popAdvice","top="+top+",left="+left+",width="+popLargeur+",height="+popHauteur+",scrollbars=0,menubar=0,resizable=0");
}

function popCalendar() {
	var left=(screen.width-popLargeur)/2;
	var top=(screen.height-popHauteur)/2;
	window.open("/c_events/popCalendarAction.do","popCalendar","top="+top+",left="+left+",width="+popLargeur+",height="+popHauteur+",scrollbars=0,menubar=0,resizable=0");
}

function popDictionnaire() {
	var left=(screen.width-popDicoLargeur)/2;
	var top=(screen.height-popDicoHauteur)/2;
	window.open("/f_dictionnaire/getDictionaryAction.do","popDictionnaire","top="+top+",left="+left+",width="+popDicoLargeur+",height="+popDicoHauteur+",scrollbars=yes");
}

function popBiography() {
	var left=(screen.width-popBioLargeur)/2;
	var top=(screen.height-popBioHauteur)/2;
	window.open("/r_biography/getBiographyAction.do","popBiographie","top="+top+",left="+left+",width="+popBioLargeur+",height="+popBioHauteur+",scrollbars=yes");
}

function popSearchResistance() {
	var left=(screen.width-popSearchResistanceLargeur)/2;
	var top=(screen.height-popSearchResistanceHauteur)/2;
	window.open("/o_resistance/getSearchEngineAction.do","popSearchPerson","top="+top+",left="+left+",width="+popSearchResistanceLargeur+",height="+popSearchResistanceHauteur+",scrollbars=yes");
}

function popSearchNotice() {
	var left=(screen.width-popSearchNoticeLargeur)/2;
	var top=(screen.height-popSearchNoticeHauteur)/2;
	window.open("/n_media/getSearchEngineAction.do","popSearchPerson","top="+top+",left="+left+",width="+popSearchNoticeLargeur+",height="+popSearchNoticeHauteur+",scrollbars=yes");
}

function popSearchPerson() {
	var left=(screen.width-popSearchPersonLargeur)/2;
	var top=(screen.height-popSearchPersonHauteur)/2;
	window.open("/m_persons/getSearchEngineAction.do","popSearchPerson","top="+top+",left="+left+",width="+popSearchPersonLargeur+",height="+popSearchPersonHauteur+",scrollbars=yes");
}

function popNewsletter(id) {
	var left=(screen.width-popNewsletterLargeur)/2;
	var top=(screen.height-popNewsletterHauteur)/2;
	window.open("/l_lettreinfo/getNewsletterAction.do?newsletterId="+id,"popNewsletter","top="+top+",left="+left+",width="+popNewsletterLargeur+",height="+popNewsletterHauteur+",scrollbars=yes");
}

function popDatesCles(id) {
	var left=(screen.width-popDatesClesLargeur)/2;
	var top=(screen.height-popDatesClesHauteur)/2;
	window.open("/k_dates_cles/getDatesClesAction.do","popDatesCles","top="+top+",left="+left+",width="+popDatesClesLargeur+",height="+popDatesClesHauteur+",scrollbars=no");
}

function confirmFormulaire() {
	if(window.confirm("Confirmez-vous votre demande ?")) {
		if(document.formulaireForm)
			document.formulaireForm.action=document.formulaireForm.action+"#formulaire";
		return true;
	}
	return false;
}

function blurCalendar() {
	self.focus();
}

function show(id) {
	if(window.opener)
		window.opener.location.href="/b_content/getContentFromNumLinkAction.do?type=0&itemId="+id;
}

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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;

  new getObj("ArchiveOn").style.visibility ="hidden";
  new getObj("PedagogieOn").style.visibility ="hidden";
  new getObj("ProgrammeOn").style.visibility ="hidden";
  new getObj("EnfantOn").style.visibility ="hidden";
  new getObj("DecouvrirOn").style.visibility ="hidden";

  for (i=0; i<(args.length-2); i+=3)
  	if ((obj=MM_findObj(args[i]))!=null) {
		v=args[i+2];
    		if (obj.style) {
			obj=obj.style;
			v=(v=='show')?'visible':(v=='hide')?'hidden':v;
		}
    		obj.visibility=v;
		FF_showHideSelectElements(v);
	}
}

function FF_showHideSelectElements(_visibility) {
	if(!document.forms)
		return;

	_visibility = (_visibility=='visible')?'hidden':(_visibility=='hidden')?'visible':(_visibility=='show')?'hide':(_visibility=='hide')?'show':_visibility;

	for(_f = 0; _f < document.forms.length ; _f++) {
		_currentForm = document.forms[_f];
		if(!_currentForm.elements)
			continue;

		for(_e = 0; _e < _currentForm.elements.length; _e++) {
			_currentElement = _currentForm.elements[_e];
			if(_currentElement.type && _currentElement.type.indexOf("select")!=-1) {
				_currentElement.style.visibility=_visibility;
			}
		}
	}
}

function playWMPClip(playerId) {
	document.all[playerId].play();
}

function playRealClip(playerId) {
	document.all[playerId].doPLay();
}

function playQtClip(playerId) {
	document.all[playerId].play();
}

function submitCode(str) {
	document.userForm.requestedCode.value=str;
	document.userForm.submit();
}

function playerOpen(soundfiledesc,soundfilepath) {
	PlayWin = window.open('',UniqueID,'width=320,height=190,top=' + newWinOffset +',left=0,resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
	PlayWin.focus();

	var winContent = "<HTML><HEAD><META http-equiv=Content-Type content='text/html; charset=iso-8859-1'><TITLE>" + soundfiledesc + "</TITLE>";
	winContent += "<style type=text/css>*{font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 12px;color:#1F5D9C;} .titre{font-weight:600;font-size:16px;}</style>";
	winContent += "</HEAD><BODY bgcolor=#E4F1FC text=#000000 leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>";
	winContent += "<center><div class=titre><img src=/m_persons/images/fleche_bleu.gif width=16 height=9 hspace=10>" + soundfiledesc + "</div><br><br>";

	winContent += "<div><OBJECT width='300' height='42'>";
	winContent += "<param name='SRC' value='" + soundfilepath + "'>";
	winContent += "<param name='AUTOPLAY' VALUE='true'>";
	winContent += "<param name='CONTROLLER' VALUE='true'>";
	winContent += "<param name='BGCOLOR' VALUE='#E4F1FC'>";
	winContent += "<EMBED SRC='" + soundfilepath + "' AUTOSTART='TRUE' LOOP='FALSE' WIDTH='300' HEIGHT='42' CONTROLLER='TRUE' BGCOLOR='#E4F1FC'></EMBED>";
	winContent += "</OBJECT></div><br><br>";

	winContent += "<div><a href='" + soundfilepath + "'><u>T�l�charger ce fichier</u></a></div><br>";
	winContent += "<div><a href='javascript:window.close()'><u>Fermer la fen�tre</u></a></div></center>";
	winContent += "</BODY></HTML>";

	PlayWin.document.write(winContent);
	PlayWin.document.close(); // "Finalizes" new window
	UniqueID = UniqueID + 1 // newWinOffset = newWinOffset + 20 // subsequent pop-ups will be this many pixels lower
}

