	var Tools = {				 
		 select : function( node ) {
			 if( node.getAttribute( 'id' ) != 'contentBottomHeaderSelectedTab' && node.className != "salersName") {
				 var oldNode = document.getElementById( 'contentBottomHeaderSelectedTab' );
				 var oldTab = document.getElementById( oldNode.getAttribute( 'tab' ) );
				 var newTab = document.getElementById( node.getAttribute( 'tab' ) );
				 oldTab.style.display = 'none';
				 newTab.style.display = 'block';
				 oldNode.setAttribute( 'id', 'contentBottomHeaderUnselectedTab' );
				 node.setAttribute( 'id', 'contentBottomHeaderSelectedTab' );
				 Tools.opacity(node,1);
				 Tools.opacity(oldNode,0.5);
				 
			}
			else if (node.className == "salersName"){
				var oldNode = document.getElementById( 'selectedSaler' );
				var oldTab = document.getElementById( oldNode.getAttribute( 'tab' ) );
				var newTab = document.getElementById( node.getAttribute( 'tab' ) );
				oldNode.setAttribute( 'id', 'unselectedSaler' );
				node.setAttribute( 'id', 'selectedSaler' );
				oldTab.style.display = 'none';
				newTab.style.display = 'block';
			}
		},
		opacity : function( node, value ) {
			
				node.style.filter='alpha(opacity='+(value*100)+')';
				node.style.MozOpacity= value;
				node.style.KhtmlOpacity = value;
				node.style.opacity = value;

				if( value == 1 ) {
				node.style.filter = null;
				node.style.MozOpacity = null;
				node.style.KhtmlOpacity = null;
				
				}
		}
	}
	
	function Displayer( o, min, max, speed, max_start ) {
		this.isMoving = false;
		this.node = o;
		this.isShowing = false;
		this.value = max_start ? max : min;
		this.min = min;
		this.max = max;
		this.speed = speed ? speed : 30;

		if( !document.displayers ) {
		document.displayers = new Array();
		}
		
		
	
		this.i = document.displayers.length;
		document.displayers[this.i] = this;
		if (this.node.id == "contentBottomHeaderSelectedTab")
			Tools.opacity( o, 100/100);
		else
			Tools.opacity( o, this.value/100 );

		this.show = function() {
			this.isShowing = true;
			this.start();
		}
		this.hide = function() {
			this.isShowing = false;
			this.start();
		}

		this.start = function() {

		if( !this.isMoving ) {
		this.isMoving = true;
		this.update();
		}
		}

		this.update = function() {
		if (this.node.id == "contentBottomHeaderSelectedTab"){
			this.value=100;
		}
		if( this.isShowing ) {
		this.value+=5;
		if( this.value > this.max ) {
		return this.end();
		}
		}
		else {
		this.value-=5;

		if( this.value < this.min ) {
			return this.end();
		}
		}

		Tools.opacity( o, this.value/100 );

		setTimeout( 'document.displayers[' + this.i + '].update()', this.speed );
		}

		this.end = function() {
		this.isMoving = false;
		}
	}
	
	function toogleRow(node){
	if(node.parentElement){
	var cell = node.parentElement;
	var row = cell.parentElement;
	var section = row.parentElement;
	var table = section.parentElement;
	}
	else{
	var cell = node.parentNode;
	var row = cell.parentNode;
	var section = row.parentNode;
	var table = section.parentNode;
	}
		if (document.getElementById(table.id)){
		var toogled = document.getElementById(table.id).getElementsByTagName("tr");
			for (i=0; i<toogled.length;i++){
				if(toogled[i].getAttribute("toogle") == node.id && toogled[i].getAttribute("toogled") == "no" && toogled[i].getAttribute("class") != "emptyRow" && toogled[i].getAttribute("class") != "hideEmptyRow" ){
					toogled[i].setAttribute("class","hideRow");
					toogled[i].setAttribute("className","hideRow");
					toogled[i].setAttribute("toogled","yes");
					node.style.backgroundImage = "url(/pfizerSites/pfizer_veterinaires_fr/images/img_remises/plusCategorie.gif)";
				}
				else if(toogled[i].getAttribute("toogle") == node.id && toogled[i].getAttribute("toogled") == "yes" && toogled[i].getAttribute("class") != "hideEmptyRow" && toogled[i].getAttribute("class") != "emptyRow"){
					toogled[i].setAttribute("class","paiementRow");
					toogled[i].setAttribute("className","paiementRow");
					toogled[i].setAttribute("toogled","no");
					node.style.backgroundImage = "url(/pfizerSites/pfizer_veterinaires_fr/images/img_remises/puceCategorie.gif)";
				}
				if(toogled[i].getAttribute("toogle") == node.id && toogled[i].getAttribute("class") == "emptyRow" && toogled[i].getAttribute("toogled") == "no"){
					toogled[i].setAttribute("class","hideEmptyRow");
					toogled[i].setAttribute("className","hideEmptyRow");
					toogled[i].setAttribute("toogled","yes");
				}
				else if(toogled[i].getAttribute("toogle") == node.id  && toogled[i].getAttribute("class") == "hideEmptyRow" && toogled[i].getAttribute("toogled") == "yes"){
					toogled[i].setAttribute("class","emptyRow");
					toogled[i].setAttribute("className","emptyRow");
					toogled[i].setAttribute("toogled","no");
				}
			}
		}
	}
	

