// Création : Dustin Diaz
//Site : http://www.dustindiaz.com/getelementsbyclass
function getElementsByClass(searchClass, node, tag) { 
var classElements = new Array(); 
if ( node == null ) 
node = document; 
if ( tag == null ) 
tag = '*'; 
var els = node.getElementsByTagName(tag); 
var elsLen = els.length; 
var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)"); 
for (i = 0, j = 0; i < elsLen; i++) { 
if ( pattern.test(els[i].className) ) { 
classElements[j] = els[i]; 
j++; 
} 
} 
return classElements; 
} 

        // Xavier Borderie
function tailleFonte(classe, taille) { 
cibles = getElementsByClass(classe); 
for (i = 0; i < cibles.length; i++) {
        cibles[i].style.fontSize = taille; 
        } 
}
		
function style( id,taille){
	if(document.getElementById(id).style.fontSize != ''){
		var c = parseInt(document.getElementById(id).style.fontSize.substring(0,document.getElementById(id).style.fontSize.indexOf('%',0)));
		var a = (c + taille);
		alert(a);
		document.getElementById(id).style.fontSize = a+'%';
	}
	else
		document.getElementById(id).style.fontSize = '100%';
}

function styleClasse(classe, taille) { 
cibles = getElementsByClass(classe); 
	for (i = 0; i < cibles.length; i++) {
        //cibles[i].style.fontSize = taille;
				if(cibles[i].style.fontSize != ''){
					var c = parseInt(cibles[i].style.fontSize.substring(0,cibles[i].style.fontSize.indexOf('%',0)));
					var a = (c + taille);
					cibles[i].style.fontSize = a+'%';
				}
				else{
					a = 100 + taille;
					cibles[i].style.fontSize = a+'%';
				}
	} 
}

// Afficher/Masquer ------------------------------------------------------------

function Afficher(element){
  var Obj;
  Obj = document.getElementById(element);
  if( Obj){
    with( Obj.style){
      display="block";
    }
  }
}
function Masquer(element){
  var Obj;
  Obj = document.getElementById(element);
  if( Obj){
    with( Obj.style){
      display="none";
    }
  }
}

function pub_size(id,w,h,top){
	document.getElementById(id+'_obj').width = w;
	document.getElementById(id+'_obj').height = h;
	document.getElementById(id+'_emb').width = w;
	document.getElementById(id+'_emb').height = h;
	//document.getElementById('pub_'+id).style.top = top;
}

// CSS Browser Selector --------------------------------------------------------

var css_browser_selector = function() {
  var ua=navigator.userAgent.toLowerCase(),is=function(t){
    return ua.indexOf(t) != -1;
  },
  h=document.getElementsByTagName('html')[0],b=(!(/opera|webtv/i.test(ua))&&/msie (\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?'gecko ff2':is('firefox/3')?'gecko ff3':is('gecko/')?'gecko':is('opera/9')?'opera opera9':/opera (\d)/.test(ua)?'opera opera'+RegExp.$1:is('konqueror')?'konqueror':is('applewebkit/')?'webkit safari':is('mozilla/')?'gecko':'',os=(is('x11')||is('linux'))?' linux':is('mac')?' mac':is('win')?' win':'';var c=b+os+' js'; h.className += h.className?' '+c:c;
}();
