function pixelwerk_slide(idElement,waitTimeParam,allowPlay,playSens){
	this.IE = document.all?true:false
	this.pxEl=document.getElementById(idElement);
	this.waitTime=waitTimeParam;
	var thisObj=this;
	this.playModeSens=playSens?playSens:false;
	
	this.AllowPlay=allowPlay;
	
	this.curI=0;
	if(!this.pxEl)
		alert('No element with id '+idElement);
		
		
	this.elementeContainer= new Array();
	//chemam o functie interna  de initializare;
	thisObj.init(thisObj);
	thisObj.startSlide();
	// o functie de reset elemente inutila;
	this.resetElements=function(){
			arrayElem= new Array();
			element=this.pxEl.firstChild;
			while( element && element.nodeType==3){
				element=element.nextSibling;
			}
			i=0;
		while(element){
			arrayElem[i++]=element;
			element=element.nextSibling;
			while( element && element.nodeType==3){
				element=element.nextSibling;
			}
			
		}
		this.elementeContainer=arrayElem;
		return(arrayElem);
	}

}
pixelwerk_slide.prototype.returnElements=function(){
			arrayElem= new Array();
			element=this.pxEl.firstChild;
			while( element && element.nodeType==3){
				element=element.nextSibling;
			}
			i=0;
		while(element){
			if(i==0){
				element.style.display="";
			} else {
				element.style.display="none";
			}
			arrayElem[i++]=element;
	
			element=element.nextSibling;
			while( element && element.nodeType==3){
				element=element.nextSibling;
			}
			
		}
		return(arrayElem);
	}
//functia de init ;
pixelwerk_slide.prototype.init=function(t){
	this.elementeContainer=this.returnElements();
}

pixelwerk_slide.prototype.startSlide=function(){
	//document.onload=this.Miscare();
		var thisObj=this;
		mielu=setTimeout(function(gg){thisObj.Miscare()},this.waitTime);
	//this.Miscare();
}
pixelwerk_slide.prototype.Miscare=function(){
		var thisObj=this;
		if(this.AllowPlay){
		if(this.playModeSens){
			this.next();
		} else {
			this.previews();
		}
		mielu=setTimeout(function(gg){thisObj.Miscare()},this.waitTime);
	}
}
pixelwerk_slide.prototype.mutaLaAcestElement=function(valoare){
	if(this.elementeContainer[valoare]){
	this.elementeContainer[this.curI].style.display='none';
	
	this.curI=valoare
	this.elementeContainer[this.curI].style.display="";
	}

}
pixelwerk_slide.prototype.next=function(){
	this.elementeContainer[this.curI].style.display='none';
	if(this.elementeContainer[this.curI+1]){
		this.elementeContainer[++this.curI].style.display="";
	} else {
		this.elementeContainer[0].style.display="";
		this.curI=0;
	}

}
pixelwerk_slide.prototype.previews=function(){
	this.elementeContainer[this.curI].style.display='none';
	if(this.elementeContainer[this.curI-1]){
		this.elementeContainer[--this.curI].style.display="";
	} else {
		this.elementeContainer[this.elementeContainer.length-1].style.display="";
		this.curI=this.elementeContainer.length-1;
	}

}
pixelwerk_slide.prototype.stopPlay=function(){
	this.AllowPlay=false;
}
pixelwerk_slide.prototype.Play=function(){
	var thisObj=this;
	this.AllowPlay=true;
		mielu=setTimeout(function(gg){thisObj.Miscare()},this.waitTime);

}
pixelwerk_slide.prototype.controlPlay=function(){
		if(this.AllowPlay){
			this.stopPlay();
		} else {
			this.Play();
		}
}
pixelwerk_slide.prototype.controlSens=function(sens){
		if(sens){
			this.playModeSens=true;
		} else {
			this.playModeSens=false;;
		}
}
pixelwerk_slide.prototype.controlSensAdv=function(){
		if(this.playModeSens==true){
			this.playModeSens=false;
		} else {
			this.playModeSens=true;;
		}
}

