
function modifie_instructeur(noinstr, lng) {
//$("outerBox").hide();
var url="/admin/instructors/editinstr.php";
var niveau=0;
 if ($("bxInstr").checked) niveau|=1;
 if ($("bxExpert").checked) niveau|=2;
 if ($("bxStaff").checked) niveau|=4;

 params= {
  id: noinstr,
  lang: lng
 };

 var transport=new Ajax.Updater('innerBox',url,
 {
  method: 'post',
  parameters: params,

  onFailure: function() {
    alert(transport.responseText);
    return;
   },

  onSuccess: function() {
   $("textBox").innerHTML='Modifier';
   $("innerBox").style.backgroundColor="#FFFFFF";
   $("outerBox").style.width="550px";
   $("outerBox").style.height="550px";
   if (!$("outerBox").visible()) $("outerBox").show();
  }
 }
 );
 
return false;
}

/*************************************************************/
function searchInstructors(lng) {
//$("outerBox").hide();
var url="/fibd/trombino/trombino.php";
var niveau=0;
 if ($("bxInstr").checked) niveau|=1;
 if ($("bxExpert").checked) niveau|=2;
 if ($("bxStaff").checked) niveau|=4;

 params= {
  searchstr: $F("searchstr"),
  level: niveau,
  sortby: $F("sortby"),
  lang: lng
 };

 var transport=new Ajax.Request(url,
 {
  method: 'post',

  parameters: params,
  onSuccess: function(Sender) {
   $("mainDiv").innerHTML=(Sender.responseText);
   $("tellError").innerHTML=Sender.responseText.evalScripts();
   $("tellError").className="";
   return;
  },

  onFailure: function(Sender) {
  $("mainDiv").innerHTML="";
  $("tellError").innerHTML=Sender.responseText;
  $("tellError").className="erreur";
  return;
 }
 }
 );
return false;
}

/*************************************************************/
function showBio(ndx,lng) {
switch(lng) {
 case "de": 
  txtbio="Biographie";
 break;
case "es": 
  txtbio="Biograf&iacute;a";
 break;
case "gb": 
  txtbio="Biography";
 break;
case "it": 
  txtbio="Biografia";
 break;
case "po": 
  txtbio="Biograf&iacute;a";
 break;
default:
  txtbio="Biographie";
 break;
}


var url="/fibd/trombino/showinstr.php";
 params= {
  id: ndx,
  lang: lng
 };

 var transport=new Ajax.Updater('innerBox',url,
 {
  method: 'post',
  parameters: params,

  onFailure: function() {
    alert(transport.responseText);
    return;
   },

  onSuccess: function() {
   $("textBox").innerHTML=txtbio;
   $("innerBox").style.backgroundColor="#FFFFFF";
   $("outerBox").style.width="314px";
   $("outerBox").style.height="190px";
   if (!$("outerBox").visible()) $("outerBox").show();
//   resizeElement($("outerBox"),358,220);

  }
 }
 );
return false;
}
/*************************************************************/
function positionLayer(e) {
evt=e?e:window.event;
var newX=evt.clientX;
var newY=evt.clientY;

var actualWidth=parseInt($("outerBox").style.width);
var actualHeight=parseInt($("outerBox").style.height);
var refW=window.innerWidth || document.body.clientWidth;
var refH=window.innerHeight || document.body.clientHeight;
if (newX+actualWidth>refW) newX=newX-actualWidth;
if (newY+actualHeight>refH) newY=newY-actualHeight;
if (newX<0) newX=0;
if (newY<0) newY=0;
//moveLayer("outerBox",(newX+document.body.scrollLeft),(newY+document.body.scrollTop));
moveElement("outerBox",(newX+document.body.scrollLeft),(newY+document.body.scrollTop));
}
