// JavaScript Document


function demo(){
   alert("Ceci est une version de démonstration.\n Les formalaires qui envoient des mails on été automatiquement désactivés.");
   return false; 
}


//ajout aux favoris

function favoris() {
  window.external.AddFavorite("http://www.observatoire-tic.com","L'Observatoire des TIC");
    alert(navigator.appName);
    if ( navigator.appName != 'Microsoft Internet Explorer' )
  { window.sidebar.addPanel("L'Observatoire des TIC","http://www.observatoire-tic.com",""); }
  else { window.external.AddFavorite("http://www.observatoire-tic.com","L'Observatoire des TIC"); } 
}

function favoris(title,url){
if (window.sidebar){window.sidebar.addPanel(title, url, "");} // firefox
else if(window.opera && window.print)
{ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(window.external)// ie autre que IE7
{
window.external.AddFavorite(url, title);
}
}


function hidden(ajax){
  dim = $(ajax).getDimensions();
  height = dim.height;
  width = dim.width;
  if(height>0){
    $(ajax).innerHTML = "<div class='loading2' style='height:"+height+"px;width:"+width+"px'>loading...<div>";
  }
  else{
    $(ajax).innerHTML = "<div class='loading2' style='height:22px;width:126px;margin:auto'>loading...<div>";
  }
    
  
}

function visible(ajax){
  $(ajax).style.visibility="visible";
  $(ajax).style.display="block";
}






function maj_div(div, url){

  var ajax = $(div);

  hidden(ajax);
  url = url+"&ajax=1";
  
  var myAjax = new Ajax.Updater(ajax,  url, {  method: 'get',evalScripts : true,onComplete: function (xhr){
                    visible(ajax)
                  }} );
}

function error () { return true; }
window.onerror = error;


/*------------------------------------------------------------
    pour la taille des polcie
------------------------------------------------------------*/
/*------------------------------------------------------------
    Document Text Sizer- Copyright 2003 - Taewook Kang.  All rights reserved.
    Coded by: Taewook Kang (txkang.REMOVETHIS@hotmail.com)
    Web Site: http://txkang.com
    Script featured on Dynamic Drive (http://www.dynamicdrive.com)
    
    Please retain this copyright notice in the script.
    License is granted to user to reuse this code on 
    their own website if, and only if, 
    this entire copyright notice is included.
--------------------------------------------------------------*/

//Specify affected tags. Add or remove from list:
var tgs = new Array( 'div','td','tr','p','a','li','strong','u','i','h1','h3','h4','h5','h6','span');

//Specify spectrum of different font sizes:
var szs = new Array( 'xx-small','x-small','small','medium','large','x-large','xx-large' );
var startSz = 2;

function ts( trgt,inc ) {
    if (!document.getElementById) return
    var d = document,cEl = null,sz = startSz,i,j,cTags;
    
    sz += inc;
    if ( sz < 0 ) sz = 0;
    if ( sz > 6 ) sz = 6;
    startSz = sz;
        
    if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

    cEl.style.fontSize = szs[ sz ];

    for ( i = 0 ; i < tgs.length ; i++ ) {
        cTags = cEl.getElementsByTagName( tgs[ i ] );
        for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
    }
}   




function bookmark() 

{

alert("Appuyer sur Crtl + D");

}

