var volet_class = function (cache, content) {
	this.volet = document.getElementById(cache);
	this.content = document.getElementById(content);
	this.lnk_class = document.getElementById(volet_class.arguments[2]);
	this.width;
	this.height;
	
	this.pos = 0;	
	this.vitesse=15;
	this.flag=0;
	
	var obj = this;
	
		
	this.initClass = function () {
		this.style_volet();
		}	
	
	this.style_volet = function () {
		this.volet.style.overflow = 'hidden';
		}
		
	this.actionVolet = function () {	
		this.width = parseInt(this.content.offsetWidth);
		this.height = parseInt(this.content.offsetHeight);
		switch (this.flag) {
			case 0:
				this.openVolet();
				break;
			case 1:
				this.closeVolet();
				break;
		}
	}
	
	this.changeClass = function() {
		switch (this.flag) {
			case 0:
				this.lnk_class.className='';
				break;
			case 1:
				this.lnk_class.className='volet_on';
				break;
		}		
	}
		
	var timerCloseVolet;
	this.closeVolet = function() {
		clearTimeout(timerOpenVolet);
		if ((this.pos>0) && (this.flag!=0)) {
			if (this.pos-this.vitesse<=0) {
				this.pos = 0;
				}
				else {
					this.pos = this.pos-this.vitesse;
					}
			
			this.volet.style.height = this.pos+'px';
			timerCloseVolet = setTimeout(function () {obj.closeVolet();},80);
			}
			else {
				clearTimeout(timerCloseVolet);
				this.flag=0;
				this.changeClass();
				}
		}
	var timerOpenVolet;
	this.openVolet = function() {
		clearTimeout(timerCloseVolet);
		if ((this.pos<this.height) && (this.flag!=1)) {
			if (this.pos+this.vitesse>=this.height) {
				this.pos = this.height;
				}
				else {
					this.pos = this.pos+this.vitesse;
					}
			
			this.volet.style.height = this.pos+'px';
			timerOpenVolet = setTimeout(function () {obj.openVolet();},80);
			}
			else {
				clearTimeout(timerOpenVolet);
				this.flag=1;
				this.changeClass();
				}
		}
		
	return this.initClass();
	}