<!--
//Current HTML of page
var html="";

//View of the page, Normal (Design), HTML, Preview
var currentview=0;

//Hold window objects for the color, table and properties dialogs
var table_dialog, color_dialog, properties_dialog;

//Current color action, ForeColor, or BackColor,
//used for communication between PageCreate window and Color dialog window
var pp;
//Is used to disable use of design tools in HTML or Preview mode
var enabletoolbar=true;
//Variable counter used to index the search in the document
var n=0;

function InitEditor(){
//Init editor in design mode,
maineditor.document.designMode="On";
//Write a blank page
WriteDefaultPage();
//Disable context menu
maineditor.document.oncontextmenu=new Function("return false;");
//Set focus to the editor
maineditor.focus();
}

function initFrame() {
  maineditor.document.designMode = 'On';
  maineditor.focus();
  maineditor.document.onkeydown = function() {
    if (maineditor.event.keyCode == 13) {
      selRange = maineditor.document.selection.createRange();
      selRange.pasteHTML('<br>');
      selRange.select();
      return false;
    }
  }
}


  function insBR() {
 maineditor.document.designMode = 'On';
  maineditor.focus();
    var r = maineditor.document.selection.createRange()
    r.pasteHTML('<BR>')
    r.select()
  }





//Credits: Goes to Kevin Roth
//Taken from Rich Text Editor by Kevin Roth.
//Web: www.kevinroth.com
//function to perform spell check
function checkspell() {
   try {
      var tmpis = new ActiveXObject("ieSpell.ieSpellExtension");
      tmpis.CheckAllLinkedDocuments(document);
   }
   catch(exception) {
      if(exception.number==-2146827859) {
         if (confirm("ieSpell not detected. Click Ok to go to download page. \n (Free for Personal Use.)"))
            window.open("http://www.iespell.com/download.php","DownLoad");
      }
      else
         alert("Error Loading ieSpell: Exception " + exception.number);
   }
}


function EditorView(view){
//Changes editor view to Normal, HTML, and Preview
if(currentview==1){
//If the last view was HTML then get the HTML edited by user in HTML mode
html=maineditor.document.body.innerText;
}
//If the last mode was Normal then get the whole HTML content of the page
else html=maineditor.document.all.tags("HTML")[0].outerHTML;
if(view==0){
//Normal Mode
EnableToolbar(true);
maineditor.location="about:blank";
maineditor.document.designMode="On";
maineditor.document.open("text/html");
maineditor.document.write(html);
maineditor.document.close();
maineditor.document.oncontextmenu=new Function("return false;");
maineditor.focus();
}
if(view==1){
//HTML Mode
EnableToolbar(false);
maineditor.location="about:blank";
maineditor.document.designMode="On";
WriteDefaultPage();
HTMLView();
maineditor.document.oncontextmenu=new Function("return false;");
}
if(view==2){
//Preview Mode
EnableToolbar(false);
maineditor.location="about:blank";
//Disable page editing
maineditor.document.designMode="Inherit";
//Write the HTML of the page
maineditor.document.open("text/html");
maineditor.document.write(html);
maineditor.document.close();
//Enable context menu
maineditor.document.oncontextmenu=new Function("return true;");
}
//Set current view
currentview=view;
}

function EnableToolbar(enable){
//Enable or disable toolbar
enabletoolbar=enable;
}

function WriteDefaultPage(){
//Writes a blank HTML page in the editor
var pagehtml="<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; " +
"charset=windows-1252\">\n<meta name=\"GENERATOR\" content=\"PageCreate\">\n" +
"<title>New Page</title>\n</head>\n<body>\n</body>\n</html>";
maineditor.document.open("text/html");
maineditor.document.write(pagehtml);
maineditor.document.close();
}

function NewPage(){
if(window.confirm("Do you want to save changes in the current document?")){
//Show Save As Dialog
maineditor.document.execCommand("SaveAs");
}
//Write a blank page
maineditor.window.location="about:blank";
WriteDefaultPage();
//Set focus to editor
maineditor.focus();
}

function HTMLView(){
//Switch to HTML view
maineditor.document.body.innerHTML="";
maineditor.document.body.innerText=html;
}

function ToolbarOn(toolon){
//Highlights on or off the current toolbar
//Get the toolbar button on which the mouse is over
var tool=event.srcElement;
//Change background color
if(toolon){
 tool.style.backgroundColor="#B5BED6";
 tool.style.borderColor="#000000";}
else{ tool.style.backgroundColor="#D6D3CE";
tool.style.borderColor = '#D6D3CE';}
}

function FindInPage(showdialog){
//Shows the Find and Replace Dialog
var display="visible";
if(showdialog==false) display="hidden";
find_dialog.style.visibility=display;
if(showdialog!=false) document.find.findwhat.focus();
}

function FindIt(str, replacestr, newstr){
//This functions searchs for a string in the document
//and if specified then replaces it with a new string
if(str==""){
//If no string to search entered
alert("Enter a string to search");
document.find.findwhat.focus();
return;
}
//Creates a range in the document
txt = maineditor.document.body.createTextRange();
//Loop to find the string in the document
for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
txt.moveStart("character", 1);
txt.moveEnd("textedit");
}
if(found) {
//If founded select it and scroll into view
txt.moveStart("character", -1);
txt.findText(str);
//If replace is specified then replace the match with the new string
if(replacestr) txt.text=newstr;
txt.select();
txt.scrollIntoView();
n++;
}
else {
if (n > 0) {
window.alert("There are no more matches");
n=0;
}
// Not found anywhere, give message.
else
window.alert("\"" + str + "\" was not founded in document");
}
 }

function InsertHTML(newhtml){
//Inserts HTML in the selection of the document
maineditor.focus();
var selpoint=maineditor.document.selection.createRange();
selpoint.pasteHTML(newhtml);
}

function GetSelectedText(){
//Get the selection of the document
maineditor.focus();
var selpoint=maineditor.document.selection.createRange();
var seltext=selpoint.text;
return seltext;
}

function InsertNewImage(){
//Activates design tool
if(enabletoolbar==false){
window.alert("You must switch into normal view to do this");
return;
}
maineditor.focus();
//Open Insert Image Dialog
maineditor.document.execCommand("insertimage", true, null);
}

function InsertForm(){
//Activates design tool
if(enabletoolbar==false){
window.alert("You must switch into normal view to do this");
return;
}
//Creates a new form
InsertHTML("<div style=\"background-Color:#C0C0C0\"><form method=\"POST\">\n<p>&nbsp;</p></form></div>");
}

function InsertFormControl(control){
//Activates design tool
if(enabletoolbar==false){
window.alert("You must switch into normal view to do this");
return;
}
maineditor.focus();
//Inserts a form control
maineditor.document.execCommand(control, true, null);
}

function CreateNewLink(){
//Inserts a link in the selected text
//Activates design tool
if(enabletoolbar==false){
window.alert("You must switch into normal view to do this");
return;
}
//Open Insert Link Dialog

maineditor.focus();
maineditor.document.execCommand("createlink", true, null);

}

function Help(){
help_dialog=window.open("help.jsp", "Help", "top=100,left=100,scrollbars=yes");
}

function InsertButton(){
//Activates design tool
if(enabletoolbar==false){
window.alert("You must switch into normal view to do this");
return;
}
button_dialog=window.open("button.jsp", "newbutton", "top=100,left=100,height=170,width=400,scrollbars=no");
}

function CreateButton(name,value,type) {
         if (value != "") {
            value = ' value="' + value + '"'
         } else {
            value = ""
         }

         if (name != "") {
            name = ' name="' + name + '"'
         } else {
            name = ""
         }

         HTMLButton = '<input type="' + type + '"' + name + value + '>'
         InsertHTML(HTMLButton)
         button_dialog.close();
} // End button function

function InsertRadio(){
//Activates design tool
if(enabletoolbar==false){
window.alert("You must switch into normal view to do this");
return;
}
rbutton_dialog=window.open("radio.jsp", "newbutton", "top=100,left=100,height=160,width=400,scrollbars=no");
}

function CreateRadio(name,value,checked) {
      if (value != "") {
         value = ' value="' + value + '"'
      } else {
         value = ""
      }

      if (name != "") {
         name = ' name="' + name + '"'
      } else {
         name = ""
      }

      if (checked == "Unchecked"){
         checked = ""
      }

          HTMLRadioB = '<input type=radio ' + checked + name + value + '>'
         InsertHTML(HTMLRadioB)
         rbutton_dialog.close();
} // End button function

function InsertCBox(){
//Activates design tool
if(enabletoolbar==false){
window.alert("You must switch into normal view to do this");
return;
}
CBox_dialog=window.open("checkbox.jsp", "newbutton", "top=100,left=100,height=163,width=400,scrollbars=no");
}

function CreateCBox(name,value,checked) {
      if (value != "") {
         value = ' value="' + value + '"'
      } else {
         value = ""
      }

      if (name != "") {
         name = ' name="' + name + '"'
      } else {
         name = ""
      }

      if (checked == "Unchecked"){
         checked = ""
      }

          HTMLCBox = '<input type=checkbox ' + checked + name + value + '>'
         InsertHTML(HTMLCBox)
         CBox_dialog.close();
} // End button function

//Insert Text Field

function InsertTField(){
//Activates design tool
if(enabletoolbar==false){
window.alert("You must switch into normal view to do this");
return;
}
CBox_dialog=window.open("textfield.jsp", "newbutton", "top=100,left=100,height=185,width=400,scrollbars=no");
}

function CreateTField(type,maxlength,size,name,value,checked) {
      //if (type != "") {
      //	type = ' type=password'
      //} else {
      //	type = ""
      //}

      if (maxlength != "") {
         maxlength = ' maxlength="' + maxlength + '"'
      } else {
         maxlength = ""
      }

      if (size != "") {
         size = ' size="' + size + '"'
      } else {
         size = ""
      }

      if (value != "") {
         value = ' value="' + value + '"'
      } else {
         value = ""
      }

      if (name != "") {
         name = ' name="' + name + '"'
      } else {
         name = ""
      }

          HTMLCBox = '<input  type="' + type + '"' + maxlength +  size +  value  + name + '/>'
         InsertHTML(HTMLCBox)
         CBox_dialog.close();
} // End textfield function


//@@@@@@@@@@@@@@@@@@@@@@@@@@@2

//Insert Text area

function InsertTArea(){
//Activates design tool
if(enabletoolbar==false){
window.alert("You must switch into normal view to do this");
return;
}
CBox_dialog=window.open("textarea.jsp", "newbutton", "top=100,left=100,height=165,width=400,scrollbars=no");
}

function CreateTArea(name,value,rows,cols) {
      //if (type != "") {
      //	type = ' type=password'
      //} else {
      //	type = ""
      //}
       if (name != "") {
         name = ' name="' + name + '"'
      } else {
         name = ""
      }

/*		if (value != "") {
         value = ' value="' + value + '"'
      } else {
         value = ""
      }*/

      if (rows != "") {
         rows = ' rows="' + rows + '"'
      } else {
         rows = ""
      }

      if (cols != "") {
         cols = ' cols="' + cols + '"'
      } else {
         cols = ""
      }

          HTMLCBox = '<textarea ' + name + rows +  cols +'>'+  value+   '</textarea>'
         InsertHTML(HTMLCBox)
         CBox_dialog.close();
} // End textarea function


//@@@@@@@@@@@@@@@@@@@@@@@@@@@2
function InsertTable(){
//Activates design tool
if(enabletoolbar==false){
window.alert("You must switch into normal view to do this");
return;
}

table_dialog=window.open("table.jsp", "newtable", "top=100,left=100,height=300,width=450,scrollbars=no");

}

function CreateTable(tr, tc, ta, tb, tp, ts, tw, tt,bg){
//Creates a new table
var tablewidth="";
if(tw!=""){
tablewidth=" width=\"" + tw + tt + "\"";
}
var thtml="<table border=\"" + tb + "\" bgcolor=\"" + bg + "\" cellpadding=\"" + tp + "\" cellspacing=\"" + ts + "\"" + tablewidth +">";
tr=parseInt(tr);
tc=parseInt(tc);
for(r=0;r<tr;r++){
thtml+="<tr>";
for(c=0;c<tc;c++){
thtml+="<td></td>";
}
thtml+="</tr>";
}
thtml+="</table>";
InsertHTML(thtml);
table_dialog.close();
}

function EditPage(){
properties_dialog=window.open("properties.jsp", "editpage", "top=100,left=100,height=250,width=387,scrollbars=no");
}

function EditPageProperties(pt, pbgc, pbgi, usewatermark, pbgs){
maineditor.document.title=pt;
maineditor.document.body.bgColor=pbgc;
maineditor.document.body.background=pbgi;
if(usewatermark) maineditor.document.body.bgProperties="fixed";
else maineditor.document.body.bgProperties="";
if(pbgs!=""){
var pagehtml=maineditor.document.all.tags("HTML")[0].outerHTML;
var bodytag= pagehtml.toLowerCase().indexOf("<body");
if(bodytag==-1) return;
var beforebodytag=  pagehtml.substring(0, bodytag);
var afterbodytag=  pagehtml.substring(bodytag,  pagehtml.length);
var pagehtml=beforebodytag + "<bgsound src=\"" + pbgs + "\">" + afterbodytag;
maineditor.document.open("text/html");
maineditor.document.write(pagehtml);
maineditor.document.close();
}
properties_dialog.close();
maineditor.focus();
}

function ChangeForeColor(){
//Activates design tool
if(enabletoolbar==false){
window.alert("You must switch into normal view to do this");
return;
}
//Show the Color dialog to edit Fore Color of text selected
if(GetSelectedText()!=""){
pp="EditForeColor";
color_dialog=window.open("color.jsp", "colorpicker", "top=100,left=100,height=270,width=500,scrollbars=no");
}
 }

function EditForeColor(thecolor){
//Activates design tool
if(enabletoolbar==false){
window.alert("You must switch into normal view to do this");
return;
}
maineditor.focus();
//Change fore color of text selected
maineditor.document.execCommand("forecolor", false, thecolor);
//Close Color Dialog
color_dialog.close();
}

function ChangeBackColor(){
//Activates design tool
if(enabletoolbar==false){
window.alert("You must switch into normal view to do this");
return;
}
//Show the Color dialog to edit Back Color of text selected
if(GetSelectedText()!=""){
pp="EditBackColor";
color_dialog=window.open("color.jsp?p=EditBackColor", "colorpicker", "top=100,left=100,height=270,width=500,scrollbars=no");
}
 }

function EditBackColor(thecolor){
//Activates design tool
if(enabletoolbar==false){
window.alert("You must switch into normal view to do this");
return;
}
maineditor.focus();
//Change back color of text selected
maineditor.document.execCommand("backcolor", false, thecolor);
//Close Color Dialog
color_dialog.close();
}

function ChangeFont(font){
//Changes the font of the selected text
maineditor.focus();
maineditor.document.execCommand("fontname", false, font);
}

function ChangeFontSize(size){
//Changes the font size of the selected text
maineditor.focus();
maineditor.document.execCommand("fontsize", false, size);
}

function DesignTools(tool){
//Activates design tool
if(enabletoolbar==false){
window.alert("You must switch into normal view to do this");
return;
}
maineditor.focus();
maineditor.document.execCommand(tool, true, null);
}



// eco Web Scripts
function imprimerPage(str) {
   window.open(str + "?toPrint=print","Impression","scrollbars=yes");

}
function imprimerPage2(str) {
   window.open(str + "&toPrint=print","Impression","scrollbars=yes");
}
function exportPage(str) {
   window.open(str,"Export","scrollbars=yes");

}
function printpr()
{
var OLECMDID = 7;
/* OLECMDID values:
* 6 - print
* 7 - print preview
* 1 - open window
* 4 - Save As
*/
var PROMPT = 1; // 2 DONTPROMPTUSER
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(OLECMDID, PROMPT);
WebBrowser1.outerHTML = "";
}
//
// messages de confirmations pour les actions
//
function afficherConfirmation(url,text,isModal) {
  var ok=true ;


  if(text!=null && text!='')
    ok=confirm(text) ;

  if (ok)
      if (isModal)
        openModal(url);
      else
        go(url);

}


function giveFocus() {
   var elements = document.all ;
   for (j = 0; j < elements.length; j++) {
       if(elements[j].tabIndex==1){
        elements[j].focus();
       }
   }
}


 function showDesign(ctxpath,field,property,GCFORM){

        sUrl = ctxpath+"/ecoRessources/editor/EcoUcDesign.jsp?fb="+GCFORM+"&val="+property+"&field="+ field;

        window.open(sUrl,"","resizable=yes,width=760,height=550");
}

 function showUpload(ctxpath,field,property,GCFORM,fileName){
//   alert(ctxpath);
        sUrl = ctxpath+"/ecoRessources/upload/EcoUcUploadFichiers.jsp?fb="+GCFORM+"&val="+property+"&field="+ field+"&fileName="+ fileName;
//alert(sUrl);
        window.open(sUrl,"","resizable=yes,width=760,height=350");
}
 function showUploadModal(ctxpath,field,property,GCFORM,fileName,typeDocument){
//   alert(ctxpath);
        sUrl = ctxpath+"/uc/documents/EcoUcUploadFichiers.jsp?fb="+GCFORM+"&val="+property+"&field="+ field+"&fileName="+ fileName+"&typeCours="+ typeDocument+"&idCours="+ field;

//alert(sUrl);
        window.open(sUrl,"","resizable=yes,width=760,height=350");
}
 function openWindow(url){
            var targeturl=url;
            newwin=window.open("","","scrollbars=no");
            if (document.all){
               newwin.moveTo(0,0);
               newwin.resizeTo(screen.width,screen.height);
            }
            newwin.location=targeturl;
 }
//***********************************************************************************
// Sous Onglets
//**********************************************************************************
addEvent(window, 'load', et_init);

var et_ssOngletsElements = [];

/* Initialisation */
function et_init() {
     var i, link, id, target, first;
     first = true;

     for (i = 0; (link = document.links[i]); i++) {
         if (/\bssOnglet\b/.exec(link.className))
            {
             id = link.href.split('#')[1];
             target = document.getElementById(id);
             et_ssOngletsElements[et_ssOngletsElements.length] = target;
                   if (first) {
                 //     link.style.backgroundColor='#dee7ec'
                        link.className='selected'

                       first = false;
                   } else {
                      target.style.display = 'none';
               //       link.style.backgroundColor='#FFFFFF'
                      link.className='plain'

                   }

            link.onclick = et_ssOnglets;
         }
     }
}

function et_ssOnglets(e) {


     if (typeof e == 'undefined') {
         var e = window.event;
     }

     var source;
     if (typeof e.target != 'undefined') {
         source = e.target;
     } else if (typeof e.srcElement != 'undefined') {
         source = e.srcElement;
     } else {
         return true;
     }

     if (source.nodeType == 3) {
         source = source.parentNode;
     }
     var id = source.href.split('#')[1];

     var elem;
     for (var i = 0; (elem = et_ssOngletsElements[i]); i++) {

         if (elem.id != id) {

             elem.style.display = 'none';

         } else {
             changeColor(elem.id);
             elem.style.display = 'block';

         }
     }
     return false;
}


function addEvent(obj, evType, fn){
     if (obj.addEventListener) {
         obj.addEventListener(evType, fn, true);
         return true;
     } else if (obj.attachEvent) {
         var r = obj.attachEvent("on"+evType, fn);
         return r;
     } else {
      return false;
     }
}


function changeColor(id)
{
 var i, link;

for (i = 0; (link = document.links[i]); i++)
 {
         if (/\bssOnglet\b/.exec(link.className) || /\bplain\b/.exec(link.className) || /\bselected\b/.exec(link.className))
            {
                         if(id==link.href.split('#')[1])
                           {
                            // link.style.backgroundColor='#dee7ec';
                              link.className='selected'
                          }else
                          {
                              //link.style.backgroundColor='#FFFFFF';
                             link.className='plain'
                          }
         }
}
}
/*********************************************
* FIN SOUS ONGLETS
* ************************************************************/
function toDayExt() {
  today = new Date;
  jour = today.getDay();
  numero = today.getDate();
  if (numero<10) {
    numero = "0"+numero;
  }
  mois = today.getMonth();
  annee = today.getFullYear();
  TabJour = new Array("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi");
  TabMois = new Array("janvier","f&eacute;vrier","mars","avril","mai","juin","juillet","ao&ugrave;t","septembre","octobre","novembre","d&eacute;cembre");//
  return (TabJour[jour] + " " + numero + " " + TabMois[mois] + " " + annee);
}

// Invoked by onFocus event handler of EVERY frame,
// return focus to dialog window if it's open.
function checkModal() {
   if (dialogWin.win && !dialogWin.win.closed) {
      dialogWin.win.focus()
   }
}

function setName()
{
   this.window.name = (new Date()).getSeconds().toString();
}

function closingModal()
{
   var iX = window.document.body.offsetWidth - window.event.clientX ;
   var iY = window.event.clientY ;

   if (iX <=30 && iY < 0 )
   {
      mainForm().target = opener.name;
      closeWindow();
//      enableForms();
      unblockEvents();
      opener.focus();
   }
}

/**************************
  END MODAL DIALOG CODE
**************************/

function showWaitMessage() {
  var popWaitMsg=document.getElementById('wait-span');
  var w=240;
  var h=111;
  var t=(document.body.clientHeight-h)/2;
  var l=(document.body.clientWidth-w)/2;
  popWaitMsg.childNodes[1].style.top=t;
  popWaitMsg.childNodes[1].style.left=l;
  popWaitMsg.childNodes[1].style.width=w;
  popWaitMsg.childNodes[1].style.height=h;
  popWaitMsg.childNodes[0].style.top=popWaitMsg.childNodes[1].offsetTop;
  popWaitMsg.childNodes[0].style.left=popWaitMsg.childNodes[1].offsetLeft;
  popWaitMsg.childNodes[0].style.width=popWaitMsg.childNodes[1].offsetWidth;
  popWaitMsg.childNodes[0].style.height=popWaitMsg.childNodes[1].offsetHeight;
  popWaitMsg.style.visibility = "visible";
}
//
// IE only: attach eventhandlers.
// They trigger when a user  prints a web page;
//     From File->Print, File->Print Preview or
//     by executing a window.print() command
//
window.onbeforeprint=beforePrint
window.onafterprint=afterPrint

function beforePrint() {
    appendlinks(content);
}

function afterPrint() {
    removelinks(appendedlinks);
}


//
// Generic print function, called from the web page
//
function printContent() {
    if (window.print) {
           window.print();
    } else {
        alert("your browser doesn't support this function")
    }
}


//
// When appending links to the document, do not
// append links pointing to the following domains / sites
//

var excludedomains=["soderlind.no", "soderlind.org","localhost"]
var excludedomains=excludedomains.join("|")
rexcludedomains=new RegExp(excludedomains, "i")

//
// appendlinks(id)
// id = id of the part of the web page you want to extract links from
//      ex: document.body
//

function appendlinks(id){

    var strD = "<p/>";
    var num = 0;
    if (document.getElementById){
        var links=id.getElementsByTagName("A")
        var total=links.length
        strD += "<dl id=\"appendedlinks\" border=0>"
        strD += "<dt><h2>Links extracted from the document:</h2></dt>"
        for (i=0;i<total;i++){
            if (links[i].hostname.search(rexcludedomains)==-1
                && links[i].href.indexOf("http:")!=-1) {
                strD += '<dt>'+links[i].innerText+'</dt>'
                strD += '<dd>'+links[i]+'</dd>'
                num++;
            }
        }
        strD += "</dl>"

        if (id.insertAdjacentHTML && num>0)
            id.insertAdjacentHTML("beforeEnd",strD);
    }
}

//
// removelinks(id)
// After the print job is done, remove the appended links from the document
// id = appendedlinks
//
function removelinks(id) {
    if (document.getElementById){
        id.removeNode(true);
    }
}
function unLoad(ctxpath)
{

var bRes = self.closed;

//alert(bRes);
//alert(window.event.clientX);
if ((window.event.clientX<0) && (window.event.clientY<0))
{
 // alert(ctxpath+'/logout.do');
    go(ctxpath+'/logout.do');
}

}

function new_window(page,w,h)
 {
var heightspeed = 9; // vertical scrolling speed (higher = slower)
var widthspeed = 20; // horizontal scrolling speed (higher = slower)
var leftdist = (window.screen.availWidth - w)/2 ; // distance to left edge of window
var topdist = (window.screen.availHeight - h)/2; // distance to top edge of window
page=escape(page);
page=page.replace(/%3A/,":");
page=page.replace(/%3F/,"?");
page=page.replace(/%26/g,"&");
page=page.replace(/%3D/g,"=");
if (document.all) {

//var winwidth = window.screen.availWidth - leftdist;
//var winheight = window.screen.availHeight - topdist;
var winwidth = w;
var winheight = h;
var sizer = window.open("","","left=" + leftdist + ",top=" + topdist + ",width=1,height=1,scrollbars=yes");
 for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed)
 {
sizer.resizeTo("1", sizeheight);
 }
for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed) {
sizer.resizeTo(sizewidth, sizeheight); } //escape(page); sizer.location = page;
} else
window.open(page,'new_window','left='+leftdist+',top='+topdist+'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizeable=1,width='+w+',height='+h);
}
function openUrlModal(action)
{
window.open(action,"ouverture","toolbar=no, status=no,scrollbars = yes,resizable=yes, width=660,height=500");
}
// fONCTION POUR OUVRIR DES FILES pdf,.... AVEC ENTETE
function ARTpopup(file_name) {

//create window object
ARTpopup_win = open('popwin', 'win' , 'toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=1,width=664,height=450,scrollbars=no');


//write frameset in created window object

ARTpopup_win.document.write('<html>');
ARTpopup_win.document.write('<head>');
ARTpopup_win.document.write('<title>Hedge Fund Association</title>');
ARTpopup_win.document.write('<LINK REL=STYLESHEET TYPE="text/css" HREF="style_med_font.css">');
ARTpopup_win.document.write('</HEAD>');
ARTpopup_win.document.write('<frameset rows="78,*" border=0 framespacing=0 frameborder="no" name="frmst" MARGINHEIGHT="0" MARGIWIDTH="0">');
ARTpopup_win.document.write('<frame name="top" border="0" scrolling="NO" noresize src="pressrealease_top.htm" frameborder=no frameborder=0 MARGINHEIGHT="0" MARGIWIDTH="0" framespacing="0">');
ARTpopup_win.document.write('<frame name="body" border="0" scrolling="yes" noresize src="'+file_name+'" frameborder=no frameborder=0 MARGINHEIGHT="0" MARGIWIDTH="0" framespacing="0">');
ARTpopup_win.document.write('</frameset>');
ARTpopup_win.document.write('<noframes>');
ARTpopup_win.document.write('<BODY bgcolor="#FFFFFF" MARGINHEIGHT="0" MARGIWIDTH="0">');
ARTpopup_win.document.write('</body></noframes>');
ARTpopup_win.document.write('</html>');

//sent focus on new window
ARTpopup_win.focus();

}

function popupVisibility(id,vis)
{
var dddd;
 if(document.all)
  {dddd=document.all[id].style;
if (dddd)
dddd.visibility = vis ? "visible":"hidden";
  }
 if(document.layers)
  {dddd=document.layers[id];
   if (dddd)
   dddd.visibility = vis ? "show":"hide";
  }
return false;
}


function openDocument(doc,width,height)
{
window.open(doc,"","toolbar=no, status=no,scrollbars = yes,resizable=yes, width="+width+",height="+height+"");
}



//-->