 $(document).ready(function(){
  totalpages=$('div.divtit').not('.divtitoff').length;
  $('#helptext').html('<span style="color:yellow">?</span> &nbsp; les 8 touches de direction du clavier sont disponibles pour naviguer, ainsi que "esc" et "del" pour remonter à l&acute;accueil,'+br+'<br><span style="color:yellow">&raquo;</span> &nbsp; la "barre d´espacement" ou le "retour chariot" traversent tous les chapitres et les pages-onglets,'+br+'<br><span style="color:yellow">&raquo;</span> &nbsp; voir le diaporama '+totalpages+' chapitres x 8 sec. = '+(totalpages*8)+' secondes + les pages-onglets');
  $('div.divtit').not('.divtitoff').hover(
   function(){
    $(this).not('[ac]').removeClass().addClass('divtit divtitover');
    if($(this).attr('ac')==1)$(this).removeClass().addClass('divtit divtitoverseen');
   },
   function(){
    $(this).not('[ac]').removeClass().addClass('divtit divtitout');
    if($(this).attr('ac')==1)$(this).removeClass().addClass('divtit divtitoutseen');
   }
  )
  .click(function(){
   blog_out();
   sh_dee(0);
   if(id_exists('idiasave')){
    save_table(godiapoquit);
	diapooff();
	return;
   }
   $('#divtitleedit').remove();
   if(typeof diapooff=='function'){
    diapooff();
	diaponull();
   }
   $('#diapub_body').show();
   var file=$(this).attr('name');
   var what='tpopy';
   var how=(file.indexOf('_extraits')>0)?how_json_extraits:'';
   $.post('./mrg_dia.php',{ifi:file,iwhat:what,ihow:how},function(response){loaded_dia(response,file,what);},'text/html');
   $('div.divtit[ac=2]').removeClass().addClass('divtit divtitac1').attr({ac:1});
   $(this).removeClass().addClass('divtit divtitac2').attr({ac:2});
   hide_f();
   $('#tvi').hide();
   get_tvi(1);
   if(typeof dia_yoo=='function')dia_yoo( $(this).attr('title') );
  });
  if(typeof parent.get_parentdocsize=='function'){
   parent.ifrwin=window;
   parent.ifrdoc=document;
   parent.get_parentdocsize();
   $(parent.jwin).bind('scroll',pos_menu);
   $(parent.jwin).bind('resize',pos_menu);
   parent.pos_quit();
  }else{
   $(window).bind('scroll',pos_menu);
   $(window).bind('resize',pos_menu);
  }
  $(document).keydown(function(e){checkd_key(e);});
  create_pub();
  load_extracts();
  var deestart=_parseInt($('#divdeezer').attr('start'));
  diapo('ndee',deestart);
  get_tvi(0);
  //parent_pos_ifr();
  load_blog(blogcode,'none');
  // load_blog(blogcode,'');
  $('span[linkunder=1]').hover(
   function(){$(this).css({textDecoration:'underline'});},
   function(){$(this).css({textDecoration:'none'});}
  );
  $('div[linkunder=1]').hover(
   function(){if($(this).attr('title'))$(this).removeClass().addClass('accueil_over');},
   function(){$(this).removeClass().addClass('accueil_out');}
  );
 });
function create_pub(){
 $('<a href="'+diapubhref_body+'" target=_new></a>').append($('<img src="'+diapubsrc_body+'"'+diapubsrc_body_wh+' border=0 />')).css({cursor:'pointer',position: 'absolute', top: 140, left: 800,textDecoration:'none'}).attr({id:'diapub_body',title:diapubtitle_body}).appendTo('body');
 $('#divdeezer').attr({start:0,top0:400,left0:900}).css({position:'absolute',top: 400, left: 900,display:'none'}).appendTo('body');
}
function checkd_key(e){
 if(id_exists('divtitleedit') || id_exists('idiasave'))return;
 var ee=e.keyCode;
 if(ee==32 || ee==13){
  var tottab=$('table[name=captiontable]').find('td[sections=1][idx]').length;
  if(tottab){
   var next=0;
   $('table[name=idiapotable]').find('tbody[idx]').each(function(i,n){
    if($(n).css('display')!='none'){
	 next=_parseInt($(n).attr('idx'))+1;
	 return false;
	}
   });
   if(next>tottab)ee=34; else{
    if(next<1)next=1;
	if($('#ccdia').is(':visible'))diapooff();
    $('table[name=captiontable]').find('td[sections=1][idx='+next+']').eq(0).trigger('click');
	return false;
   }
  }else ee=34;
 }
 if(ee==27 || ee==46){
  if($('#ccdia').is(':visible'))diapooff(); else go_accueil();
  return false;
 }
 if(ee<33 || ee>40)return;
 if(ee>=33 && ee<=36){
  if(ee==36)go_divtit(0); else
  if(ee==35)go_divtit('last'); else
  if(ee==34)go_divtit(1); else
  if(ee==33)go_divtit(-1);
  return false;
 }
 var idia=$('table[name=idiapotable]').length;
 var cdia=id_exists('ccdia');
 if(idia && cdia){
  if(ee==37)godia(-1); else
  if(ee==39)godia(1); else
  if(ee==38)godia(0); else
  if(ee==40)godia('last');
 }else
 if(idia && !cdia){
  diapo($('table[name=idiapotable]').find('img[name=idiapo]').eq(0).get());
 }else
 if(!idia){
  var current=$('div.divtit').not('.divtitoff').index($('div.divtit[ac=2]'));
  if(current==-1){
   if(ee==37)go_divtit('last'); else
   if(ee==39)go_divtit(0); else
   if(ee==38)go_divtit(0); else
   if(ee==40)go_divtit('last');
  }else{
   if(ee==37)go_divtit('current'); else
   if(ee==39)go_divtit('current'); else
   if(ee==38)go_divtit(-1); else
   if(ee==40)go_divtit(1);
  }
 }
 return false;
}
 var tabinterval=null;
 var start_autotab=0;
function autotab(){
 if(tabinterval!=null)return false;
 some_msg('début du diaporama<br>'+totalpages+' chapitres * 8 sec.= '+totalpages*8+' secondes,<br> + les pages-onglets');
 start_autotab=0;
 tabinterval=0;
 go_divall();
 tabinterval=window.setInterval(go_divall,8000);
 window.setTimeout(function(){
  $(document).bind('keypress',end_autotab);
  $(document).bind('click',end_autotab);
 },333);
 // $('#dia_all_auto').attr({checked:'true'});
}
function some_msg(msg,delay){
 if(!delay || delay==null)delay=6000; else delay=_parseInt(delay);
 $('#divmsg').remove();
 if(typeof get_docsize=='function')get_docsize(); else{
  jdoct=0;
  jdocl=0;
 }
 //get_docsize();
 var totop=150+jdoct;
 var toleft=150+jdocl;
 $('<div id=divmsg style="position: absolute; font: bold 10pt arial; color: white; background-Color: chocolate; padding: 5px; width: 250px; border: 1px tan solid; display: none; cursor: pointer;" title="cliquer pour fermer ce message">&nbsp;</div>').appendTo('body').css({top:totop,left:toleft,zIndex:30000000}).html(msg).fadeIn('slow').click(rem_msg);
 window.setTimeout(rem_msg,delay);
}
function rem_msg(){
 $('#divmsg').fadeOut('slow');
}
function checkend_autotab(){
 if(tabinterval!=null || $('#dia_all_auto').attr('checked'))end_autotab();
}
function end_autotab(){
 some_msg('fin du diaporama');
 window.clearInterval(tabinterval);
 tabinterval=null;
 start_autotab=0;
 $(document).unbind('keypress',end_autotab);
 $(document).unbind('click',end_autotab);
 $('#dia_all_auto').removeAttr('checked');
}
function go_divall(){
  if(tabinterval==null)return false;
  var tottab=$('table[name=captiontable]').find('td[sections=1][idx]').length;
  if(tottab){
   var next=0;
   $('table[name=idiapotable]').find('tbody[idx]').each(function(i,n){
    if($(n).css('display')!='none'){
	 next=_parseInt($(n).attr('idx'))+1;
	 return false;
	}
   });
   if(next>tottab)go_divtit(1); else{
    if(next<1)next=1;
	if($('#ccdia').is(':visible'))diapooff();
    $('table[name=captiontable]').find('td[sections=1][idx='+next+']').eq(0).trigger('click');
	return false;
   }
  }else go_divtit(1);
}
function go_divtit(what){
 if(id_exists('divtitleedit') || id_exists('idiasave'))return;
 if(what==1 && tabinterval!=null){
  start_autotab++;
  if(start_autotab>totalpages){
   end_autotab();
   return false;
  }else some_msg('diaporama, chapitre '+start_autotab+' / '+totalpages,2000);
 }
 var tofound=0;
 var tot=$('div.divtit').not('.divtitoff').length;
 var current=$('div.divtit').not('.divtitoff').index($('div.divtit[ac=2]'));
 if(what=='current')tofound=current; else
 if(what==0)tofound=0; else
 if(what==1)tofound=current+1; else
 if(what==-1)tofound=current-1; else
 if(what=='last')tofound=tot-1;
  if(tofound>tot-1)tofound=0; else
  if(tofound<0)tofound=tot-1;
 $('div.divtit').not('.divtitoff').eq(tofound).click();
 return false;
}
function load_extracts(force){
 if(typeof diapooff=='function'){
  diapooff();
  diaponull();
 }
 blog_out();
   if(id_exists('iextracts') && !force){
    $('#divalldiapo').empty();
    $('#iextracts').fadeIn('slow').find('table[name=wasidiapotable]').attr({name:'idiapotable'});
	$('#wasxsrc[name=iextracts]').attr({id:'xsrc'});
	//parent_pos_ifr();
	return;
   }
   var file=cpr+"_extracts";
   var what='extracts';
   $.post('./mrg_dia.php',{ifi:file,iwhat:what,ihow:how_json_extracts},function(response){loaded_dia(response,file,what);},'text/html');
}
function go_accueil(){
 if(!$('#accueil').attr('title'))return;//already in accueil
 if(typeof diapooff=='function'){
  diapooff();
  diaponull();
 }
 blog_out();
 $('#divalldiapo').empty();
 sh_menu_separator(true);
 var left0=$('#divallmenu').attr('left0');
 var top0=$('#divallmenu').attr('top0');
 $('#divallmenu').css({top:top0,left:left0});
 if(prjtit!=prjtit2)$('#accueil').html(prjtit);
 $('div.divtit').css({width:''});
 $('#diapub_body').fadeIn(2000);
 $('#accueil').removeAttr('title').css({cursor:'default'});
 $('#span_accueil').css({visibility:'hidden'});
 load_extracts();
 get_tvi(0);
 if(typeof dia_yoo=='function')dia_yoo('accueil');
 if(typeof sh_dee=='function')sh_dee(1);
 if(typeof parent.pos_quit=='function')parent.pos_quit();
}
function get_tvi(what){
 if(!what)what=0;//go_accueil
 $.get('./tvi2.php?'+cpr3,function(response){getted_tvi(response,what);},'text/html');
 if(!what){
  $('#tvi0').html('&nbsp;');
 }else{
  // $("#somehelp").remove();
  $('#tvi').hide();
 }
}
 var firstenter=0;

function getted_tvi(response,what){
 if(!what)what=0;//go_accueil
 firstenter++;
 if(response.search(/^<xall>.*<\/xall>$/gi)==-1)return;
 response=response.replace(/<\/?xall>/gi,'');
 // $("#somehelp").remove();
 var totaldiaporama=8*totalpages;
 if(!what){// && !$('table[name=idiapotable]').length){
  // var txthelp='<div id=somehelp style="text-align: right; position: absolute; bottom: 20; right: 10; white-Space: nowrap; color: rgb(99,90,90); cursor: help;" onmouseover="if(!this.title)this.title=$(this).text();">'+$('#helptext').html()+'</div>';
  $('#tvi').html(response).show();
  $('#tvi0').hide();
  // $(txthelp).appendTo('body');
  if(firstenter==1){
   if( $('#dia_all_auto').get(0).checked )autotab();
  }
 }else{
  $('#tvi').hide();
  var txt=_parseInt(response);
  $('#tvi0').html(txt).attr({title:response}).show();
 }
}
function go_blog(where){
 // return;
 //alert('go_blog: '+where+br+$('#ifr_blog').css('width')+':'+$('#ifr_blog').css('height')+', left:'+$('#ifr_blog').css('left'));
 // alert('enter go_blog');
 
 if(!where)return;
 hide_f();
 var blog_visible=(_parseInt($('#ifr_blog').css('left'))>=0)?true:false;
 // alert('before go_accueil, blog_visible: '+blog_visible+br+_parseInt($('#ifr_blog').css('left')) );
 go_accueil();
 if(typeof sh_dee=='function')sh_dee(0);
 window.scrollTo(0,0);
 var isok=$('#ifr_blog').attr('open');
 // alert('isok:'+isok+', visible:'+blog_visible+'!');
 if(isok){
  if(blog_visible){
   //$('#ifr_blog').fadeOut('slow');
   blog_out();
   return;
  }
  //$('#ifr_blog').show();//fadeIn('slow');
  // alert($('#ifr_blog').css('width')+':'+$('#ifr_blog').css('height'));
  // alert('go_blog, start show_blog');
  show_blog();
  // pos_blog();
  return;
 }
 load_blog(where,'');
}
function show_blog(){
 // return;
 var top0=$('#ifr_blog').attr('top0');
 var left0=$('#ifr_blog').attr('left0');
 var w1=$('#ifr_blog').attr('w1');
 var h1=$('#ifr_blog').attr('h1');
 $('#ifr_blog').css({top:top0,left:left0,width:w1,height:h1}).hide().fadeIn('slow');
  // alert(w1+':'+h1+br+$('#ifr_blog').css('width')+':'+$('#ifr_blog').css('height'));
 // alert('blog is visible now');
}
function blog_out(){
 // return;
 // alert('enter blog_out');
 // $('#ifr_blog').fadeOut('slow',function(){$(this).css({left:-1000,width:200,height:200}).show();});
 $('#ifr_blog').css({left:-1000,width:200,height:200}).show();
 // $('#ifr_blog').css({left:-1000});
}
function load_blog(where,what){
 // return;
 // alert('enter load_blog');
 if(!where)return;
 // $('#ifr_blog').attr({'open':1,'src':'./go_blog.php?gs='+where}).css({display:what,top:10,left:500});//.bind('load',pos_blog);
 if(what=='none')blog_out(); else show_blog();
 $('#ifr_blog').attr({'open':1,'src':'./go_blog.php?gs='+where});//.css({top:10,left:500});//.bind('load',pos_blog);
}
function pos_blog(){
  // pos_ifr(id_exists('ifr_blog'));// it is doit that by itself
  return;
  // var myifr=jQuery('#ifr_blog');
  // var myifrc=myifr.contents();
  // var myifrcb=myifrc.find('body');
  // var myheight=_parseInt(myifrcb.height());
  // if(!myheight)myheight=800;
  // myheight+=10;
  // myifr.css({height:myheight});
}
function givemyparentiframe(){
  try{
   if(!parent || !parent.document || parent.document==document)return '';
  }catch(e){return '';}
  var collect=parent.document.getElementsByTagName('IFRAME');
  var myparentiframeid='';
  var myparentiframe='';
  for(var i=0;i<collect.length;i++){
   var myiframe=collect.item(i);
   var mydoc=(myiframe.contentWindow)?myiframe.contentWindow.document:myiframe.contentDocument;
   var isitmyne=(document==mydoc)?true:false;
   if(isitmyne){
    myparentiframe=myiframe;
    myparentiframeid=myiframe.getAttribute('id',0);
	break;
   }
  }
  return(myparentiframe);
}
function xxparent_pos_ifr(){
 var myifrobj=givemyparentiframe();
 // alert('parent_pos_ifr, myifrobj :'+myifrobj+'!'+br+$('#ifr_blog').css('width')+':'+$('#ifr_blog').css('height'));
 try{
  if(!myifrobj || typeof parent.pos_ifr!='function')return false;
 }catch(e){return false;}
 
 if(typeof parent.get_parentdocsize=='function'){
  parent.get_parentdocsize();
  var iw0=parent.jdocw-30;
  var ih0=parent.jdoch-30;
 }else{
  var iw0=1200;
  var ih0=400;
 }
 var iw=$(document).width();
 if(_parseInt(iw)<iw0)iw=iw0;
 var ih=$(document).height();
 if(_parseInt(iw)<ih0)iw=ih0;

 var iwhat='diapo';
 var obj={w:iw,h:ih,ifrobj:myifrobj,what:iwhat,w0:iw0,h0:ih0,w1:0,h1:0};
 // alert('before again pos_ifr:'+iw+':'+ih+':')
 parent.pos_ifr(obj);
 return true;
}
function pos_ifr(what_){
 // return;
 if(!what_)what_={w:0,h:0,ifrobj:'',what:'',w0:0,h0:0};
 // alert(what_+':'+what_['w']+':'+what_['h']+':'+what_['ifrobj'].tagName+':'); 
 if(what_['w']<100 || what_['h']<100 && !what_['ifrobj'])return;
 var isvisible=(_parseInt($(what_['ifrobj']).css('left'))<0)?false:true;
 if(isvisible)$(what_['ifrobj']).css({width:what_['w'],height:what_['h'],scroll:'hidden'}).attr({w1:what_['w'],h1:what_['h']});
         else $(what_['ifrobj']).css({width:200,height:200,scroll:'hidden'}).attr({w1:what_['w'],h1:what_['h']}).hide();
 // $(what_['ifrobj']).css({width:what_['w'],height:what_['h']});
 if(what_['what']!='blog')$(what_['ifrobj']).show();
 // $(what_['ifrobj']).show();
 // alert('pos_ifr, was visible:'+isvisible+br+$('#ifr_blog').css('width')+':'+$('#ifr_blog').css('height'));
 // return;
 if(1==1 || what_['what']=='blog')pos2_ifr(what_);
}
function pos2_ifr(what_){
 if(!what_)what_={w:0,h:0,ifrobj:'',what:'',w0:0,h0:0};
 if(what_['w']<100 || what_['h']<100 && !what_['ifrobj'])return;
 $(what_['ifrobj']).show();
 var myifrdoc=$(what_['ifrobj']).contents().find('body').find('*:visible');
 var maxh=0;
 var maxw=0;
 myifrdoc.each(function(i,n){
   var offset=$(n).offset({border: true, padding: true});
   var myh=offset.top+$(n).outerHeight({margin:true});
   if(myh && myh>maxh)maxh=myh;
   var myw=offset.left+$(n).outerWidth({margin:true});
   if(myw && myw>maxw)maxw=myw;
 });
 // alert('pos2_ifr: '+maxw+':'+maxh);
 if(what_['h0'])maxh=Math.max(what_['h0'],maxh);
 if(what_['h1'])maxh=Math.min(what_['h1'],maxh);
 if(what_['w0'])maxw=Math.max(what_['w0'],maxw);
 if(what_['w1'])maxw=Math.min(what_['w1'],maxw);
 if(maxh && maxw){
  var isvisible=(_parseInt($(what_['ifrobj']).css('left'))<0)?false:true;
  if(isvisible)$(what_['ifrobj']).css({width:maxw,height:maxh,scroll:'hidden'}).attr({w1:maxw,h1:maxh});
         else $(what_['ifrobj']).css({width:200,height:200,scroll:'hidden'}).attr({w1:maxw,h1:maxh}).hide();
 }
}
function xpos_ifr(domifr){
  var a=domifr.getAttribute('id');
  if(typeof domifr=='undefined'){
   alert('a0 with pos_ifr : domifr ? ');
   return;
  }else if(a=='ifr_blog')alert('a1 with pos_ifr : '+domifr.tagName+':'+domifr.getAttribute('id'));
  var myifr=jQuery(domifr);
  myifr.css({height:200,width:200});
  var myifrc=myifr.contents();
   if(a=='ifr_blog'){
    alert('a2 '+br+myifrc.find('body').outerHTML().substr(0,1000));
    alert('height : '+myifrc.height());
    alert('width : '+myifrc.width());
   }
  var myheight=_parseInt(myifrc.height());
  var mywidth=_parseInt(myifrc.width());
  if(document.all){
   myheight+=25;
   mywidth+=25;
  }
  if(!myheight || myheight<300)myheight=300;
  if(!mywidth || mywidth<300)mywidth=300;
  myheight+=10;
  myifr.css({height:myheight,width:mywidth,scroll:'hidden'});
  $('body').css({overflow:'hidden'});

}
function pos_menu(){
 // return;
 // alert('enter pos_menu');
 if(!$('table[name=idiapotable]').length || $('#iextracts').is(':visible')){  
  var left0=$('#divallmenu').attr('left0');
  var top0=$('#divallmenu').attr('top0');
  $('#divallmenu').css({top:top0,left:left0});
  if(prjtit!=prjtit2)$('#accueil').html(prjtit);
  $('#accueil').removeAttr('title').css({cursor:'default'});
  $('#span_accueil').css({visibility:'hidden'});
  if(typeof sh_dee!='function')return;
  if($('#divdeezer').attr('onoff')=='on' && $('#ifr_blog').is(':hidden'))sh_dee(1); else sh_dee(0);
  if(typeof parent.pos_quit=='function')parent.pos_quit();
  return;
 }
 if(prjtit!=prjtit2)$('#accueil').html(prjtit2);
 var mytit=$('#accueil').attr('title0');
 $('#accueil').attr({title:mytit}).css({cursor:'pointer'});
 $('#span_accueil').css({visibility:'visible'});
 if(typeof get_docsize!='function')return;
 if(typeof parent.get_parentdocsize=='function'){
  parent.get_parentdocsize();
  var totop=40+parent.jdoct;
  var toleft=5+parent.jdocl;
  parent.pos_quit();
 }else{
  get_docsize();
  var totop=40+jdoct;
  var toleft=5+jdocl;
  if(1==2)$('#divallmenu').css({top:totop,left:toleft});//not good to scroll : infinite scroll
 }
}
function sh_menu_separator(what){
  if(!mmsd || (!what && mmsd))$('span[name=menu_separator]').hide(); else $('span[name=menu_separator]').show();
}
function loaded_dia(response,file,what){
 if(what!='extracts'){
  $('#old').remove();//was the previous iextracts now hidden
  $('#iextracts').hide().find('table[name=idiapotable]').attr({name:'wasidiapotable'});
  $('#xsrc[name=iextracts]').attr({id:'wasxsrc'});
  $('#divalldiapo').html(response);
  sh_menu_separator(false);
  $('#divallmenu').css({left:5});
  $('div.divtit').css({width:180});
  // alert('loaded_dia, file: '+file+', what: '+what);
  if(file.indexOf('_extraits')==-1)prep_mod();
  $('div[name=captiontitle]').css({color:'white'});
  // alert($('div[name=captiontitle]').outerHTML());
 }else{
  sh_menu_separator(true);
  $('#divalldiapo').empty();
  $('#old').remove();
  $('#xsrc[name=iextracts]').attr({id:'wasxsrc'});
  $('#iextracts').attr({id:'old'}).fadeOut(5000).find('img[name=idiapo]').attr({name:'wasidiapo'});
  $(response).appendTo('body').css({position: 'absolute',top: json_extracts['top'], left: json_extracts['left']}).fadeIn('slow');
 }
 // return;
 window.scrollTo(0,0);
 pos_menu();
 $('#diapub_body').fadeOut(5000);
 $('img[name=idiapo]').add('img[name=ideco]').attr({unselectable:'on'}).addClass('img_noselect');
 //parent_pos_ifr();
}
function prep_mod(){
  if($('table[name=idiapotable]').length){
   var thew=$('table[name=idiapotable]').width();
   $('table[name=idiapotable]').wrap($('<div id=idiadivdiv style="width: '+thew+';"></div>'))
    .after('<div id=idiadiv style="text-align: right; font: normal 8pt tahoma; color: silver; padding: 0 10; cursor: pointer;position: relative; top: -3; white-space: nowrap;"><span id=idiapriv title="accés réservé pour la gestion des images, identifiant et mot de passe requis" onclick="diapo(\'help\',\'mod\')">privé</span></div>');
  }
}
function diapo(myitem,opt){
  blog_out();
 if(typeof hide_f=='function')hide_f();
 if(!myitem)myitem='';
 if(!opt)opt='';
 if(!myitem && typeof go_diapo!='function'){
  $.getScript(jsfiles+'mrg_diapo.js');
  return;
 }
 if(typeof go_diapo=='function')go_diapo(myitem,opt); else{
  $.getScript(jsfiles+'mrg_diapo.js',function(){
   go_diapo(myitem,opt);
  });
 }
}
function hide_f(){
 var myifr=id_exists('ifr_f');
 if(!myifr || myifr.style.display=='none')return;
 myifr.style.display='none';
 myifr.src='about:blank';
}
function show_f(subj,mess,ema,opt){
 blog_out();
 var myifr=id_exists('ifr_f');
 if(!opt)opt='';
 if(myifr && myifr.style.display==''){
  var myopt = myifr.getAttribute('opt');
  hide_f();
  if(myopt=='' || myopt==opt)return;
 }
 var dff=document.form_f;
 dff.subj.value= subj;
 dff.mess.value= mess;
 dff.ema.value=ema;
 dff.opt.value=opt;
 dff.action='pop_'+'for'+'mulaire.'+'p'+'h'+'p';
 dff.submit();
 var isok=ifr_position(myifr);
 myifr.setAttribute('opt',opt);
 myifr.style.display='';
 if(!isok)myifr.scrollIntoView(true);
 var subj2=(opt)?opt:subj;
 dia_yoo('contact '+subj2);
}
function ifr_position(myifr){
  var form_left=200;
  var form_top=100;
 var mybody=document.getElementsByTagName('body').item(0);
 var sx=mybody.scrollLeft;
 var sy=mybody.scrollTop;
 sx=_parseInt(sx);
 sy=_parseInt(sy);
 myifr.style.left=form_left+sx+'px';
 myifr.style.top=form_top+sy+'px';
 return(true);
}
// function diapo_mod(myitem){
 // if(myitem==null && typeof go_diapo_mod!='function'){
  // $.getScript('./mrg_diapo_mod.js');
  // return;
 // }
 // if(typeof go_diapo_mod=='function')go_diapo_mod(myitem); else{
  // $.getScript('./mrg_diapo_mod.js',function(){
   // go_diapo_mod(myitem);
  // });
 // }
// }