var bottomw = 1;
var EMPTYIMG = "";

function twidth(empty_img){
 EMPTYIMG = empty_img;
 sw = screen.width;
 if(document.layers)
  sw = innerWidth;
 else{
  if(document.body.clientWidth)
   sw = document.body.clientWidth;
 }
 if(sw<1026)
  document.write("<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">");
 else{
  document.write("<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"1\">");
  bottomw = 864;
 }
}

function _reload(){
 window.location.reload();
}

function bottomwidth(){
 document.write('<div><img src="'+EMPTYIMG+'" width="'+bottomw+'" height="1" alt="" border="0"></div>');
 onresize = _reload;
	if(document.forms.length>0)
	{
		if(document.forms[0].elements.length>2)
		{
			onresize = null;
		}
	}
}

function _empty()
{
	return;
}

function go( u )
{
	location.href = u;
}

function chekEmail( fieldName )
{
	var field = document.getElementById( fieldName );
	var re = /^[a-zA-Z0-9_.\-]+\@[a-zA-Z0-9_.\-]+\.[a-zA-Z0-9_\-]+$/;

	if( field && ( field.value.length == 0 || re.exec( field.value ) == null ) )
	{
		alert( "L'adresse mél n'est pas valide !" );
		field.focus();
		return false;
	}

	return true;
}


function checkAllThema(nbEntries, checked){
	
	for(i=1;i<=nbEntries;i++)
	{
		eval('document.forms[\'recherche\'].universe'+i+'.checked = '+ checked+';');
	}
}

function checkAllDocTypes(nbEntries, checked){
	for(i=1;i<=nbEntries;i++)
		{
			eval('document.forms[\'recherche\'].document_type_id'+i+'.checked = '+ checked+';');
		}
}

function submitSearchByPage(formul, nPageIndex){
	var pos = this.location.href.indexOf('page_index=');
	if (pos == -1){
		var strAction = this.location.href +'&page_index='+nPageIndex;
	}else {
		
		var strAction = this.location.href.substring(0,pos-1)+'&page_index='+nPageIndex;
	}
	formul.method='POST';	
	formul.action = strAction;
	formul.target = "";
	formul.submit();
}

function MM_openBrWindow(theURL,winName,features,l,h) { //v2.0

 features=features + ",width="+l+",height="+h;
 if (screen.height) {
  var top = (screen.height-h)/2; 
  var left=(screen.width-l)/2;
  features=features+",top="+top+",left="+left;
 }
 window.open(theURL,winName,features );
}

function xtTraiter(nompage) { //par emmanuel.souquet@paris.fr le 21/6/2005
/*
Recommendation Xiti pour le paramètre nom de page "p="
# Pas de caractères accentués
# Pas d’espace (nous conseillons le remplacement des espaces par "l’underscore" c'est-à-dire "_")
# Pas de caractères autres que des lettres et des chiffres (évitez surtout les guillemets et les apostrophes)
# Si besoin (comme séparateur par exemple) voici les quelques caractères que nous conseillons : le tiret "-" et le point "."
*/
  nompage = nompage.replace(' - Paris.fr','');
  reg = /[àâä]/g;
  nompage = nompage.replace(reg,'a');
  reg = /[éèêë]/g;
  nompage = nompage.replace(reg,'e');
  reg = /[îï]/g;
  nompage = nompage.replace(reg,'i');
  reg = /[ôö]/g;
  nompage = nompage.replace(reg,'o');
  reg = /[ùûü]/g;
  nompage = nompage.replace(reg,'u');
  reg = /[ç]/g;
  nompage = nompage.replace(reg,'c');
  reg = /[^a-z0-9_:~\.\-]/gi;
  nompage = nompage.replace(reg,'_');
  //alert(nompage);
  return nompage;
}

function xt_clic(typecl,section,page,url,nvlle)
{
Xt_r = document.referrer;
Xt_h = new Date();
xt_img = new Image();
Xt_i = 'http://logi6.xiti.com/hit.xiti?s=122296&s2='+section;
Xt_i += '&p='+page+'&clic='+typecl+'&hl=' + Xt_h.getHours() + 'x' + Xt_h.getMinutes() + 'x' + Xt_h.getSeconds();
if(parseFloat(navigator.appVersion)>=4)
{Xiti_s=screen;Xt_i += '&r=' + Xiti_s.width + 'x' + Xiti_s.height + 'x' + Xiti_s.pixelDepth + 'x' + Xiti_s.colorDepth;}
Xt_i += '&ref=' + Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$');
xt_img.src = Xt_i;
if ((url != null)&&(url!=undefined))
{ if ((nvlle=='')||(nvlle==null)) { document.location = url;} else {xfen = window.open(url,'xfen',''); xfen.focus();}}
else
{return;}
}

var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
var MM_FlashCanPlay;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i];
	    }
	MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}
