	//                 >>>>>>>>>>>>>>>>>>>>> mSlider <<<<<<<<<<<<<<<<<<<<<<<<<<
	//=====================================================================================
	//   -- Mitache Mirel Nicu   -- //
	//   -- http://mndrk.com    --  //
	//   -- Slider Object v 1.3  -- //
	///===================================================================================
	// all_visible_div - container , blocks_class - class of elements to slide, blocks_div_cont - container of divs(is partially hidden), slide_speed - speed to slide(it can be change later), pixelstohide - how much to hive from a block(ex to hide border) , left_arrow, right_arrow, nume, visibleElements
	//=====================How to create it ? ============================================
	  /*
				-> all_visible_div  - Element that contains all visible blocks ( ex. document.getElementById('slide_container'));
				-> blocks_clas      - Class name of the blocks to slide ( ex. 'slide_block');
				-> blocks_div_cont  - Id of the container of all blocks ( ex. 'slide_container_all');
				-> slide_speed      - Pixel number tu jump once
							// you can also change this.jumptime later to change the interval between 2 jumps
				-> pixelstohide		- Pixel to be hidden from one block ( or  - pixels to be show.. ex you want the block to be at a distance of 10px from border you set pixelstohide = -10 )
				-> left_arrow  		- id of left arrow element (ex . 'slide_left_arrow') (same for right arrow)
				-> nume				- Variable name (ex. slidy)
				-> visibleElements  - Nb of elements that are show once;
				////////////// EXAMPLE  \\\\\\\\\\\\\\\\
	<div id='slider'>
		<div id='slide_left_arrow'>Left</div>
		<div id='slide_container'>
			<div id='slide_container_all'>
				<div class='slide_block'> Block1 </div>
				<div class='slide_block'> Block2 </div>
				<div class='slide_block'> Block3 </div>
				<div class='slide_block'> Block4 </div>
				<div class='slide_block'> Block5 </div>
				<div class='slide_block'> Block6 </div>
				<div class='slide_block'> Block7 </div>
			</div>
		</div>
		<div id='slide_right_arrow'>Right</div>
	</div>
	<script> var slidy = new mSlider(document.getElementById('slide_container'), 'slide_block', 'slide_container_all', 6, 0, 'slide_left_arrow', 'slide_right_arrow', 'slidy', 4); </script>
	  */
	//==================================== the END =======================================
	function getElementsNb(classname, blocks_div_cont1){
		var all_elems = blocks_div_cont1.getElementsByTagName('div');
		var elem_nr = 0;
		var i = 0;
		for (i=0; i< all_elems.length; i++){
			if (all_elems[i].className == classname){
				elem_nr++;
			}
		}
		if (elem_nr == 0) {
			var all_elems = blocks_div_cont1.getElementsByTagName('a');
			var elem_nr = 0;
			var i = 0;
			for (i=0; i< all_elems.length; i++){
				if (all_elems[i].className == classname){
					elem_nr++;
				}
			}
		}
		return elem_nr;
	}
	
	function getElementsSpace(classname, blocks_div_cont1){
		var all_elems = blocks_div_cont1.getElementsByTagName('div');
		var widths = new Array();
		var i = 0;
		for (i=0; i< all_elems.length; i++){
			if (all_elems[i].className == classname){
				widths[widths.length] = all_elems[i].offsetLeft - blocks_div_cont1.offsetLeft - all_elems[i].style.marginLeft;  
			}
		}
		if (widths.length <1){
			var all_elems = blocks_div_cont1.getElementsByTagName('a');
			var widths = new Array();
			var i = 0;
			for (i=0; i< all_elems.length; i++){
				if (all_elems[i].className == classname){
				widths[widths.length] = all_elems[i].offsetLeft - blocks_div_cont1.offsetLeft - all_elems[i].style.marginLeft;  
				}
			}
		}
		return widths;
	}
	
function mSlider(visibleDiv, blocks_class, blocks_div_cont, slide_speed, pixelstohide ,left_arrow, right_arrow, numele, visibleElements){
	// all_visible_div - container , blocks_class - class of elements to slide, blocks_div_cont - container of divs(is partially hidden), slide_speed - speed to slide(it can be change later), pixelstohide - how much to hive from a block(ex to hide border)
	this.blockClass = blocks_class;
	this.blocksContainer = blocks_div_cont;
	this.whatToHide = pixelstohide;
	this.nme = numele;
	this.pas = 0;
	this.width = visibleDiv.offsetWidth;
	this.elementsnb = getElementsNb(blocks_class, document.getElementById(blocks_div_cont));
	this.elementsPos = getElementsSpace(blocks_class, document.getElementById(blocks_div_cont));
	this.speed = slide_speed;
	this.jumptime = 20;
	this.lastpos = 0;
	this.newpos = 0;
	this.nbToShow = visibleElements;
	this.moving = false;
    var nume = this.nme;
    document.getElementById(blocks_div_cont).style.marginLeft = (pixelstohide * (-1))+'px';
    document.getElementById(left_arrow).onclick = function(e){
		setTimeout(nume + '.MoveLeft();' , 50);
    }
	    
    document.getElementById(right_arrow).onclick = function(e){
			setTimeout(nume + '.MoveRight();' , 50);
    }
}
	mSlider.prototype.changeSpeed = function(new_speed){
		this.speed = new_speed;
	}
	mSlider.prototype.currentMargin = function(){
		var i = 0;
		var margin= '';
		for (i = 0; i<document.getElementById(this.blocksContainer).style.marginLeft.length-2; i++){
			if (document.getElementById(this.blocksContainer).style.marginLeft.charAt(i) != ' '){
				margin += document.getElementById(this.blocksContainer).style.marginLeft.charAt(i);
			}
		}
		return margin;
	}
	mSlider.prototype.moveOnce = function(whereto){
		if (this.newpos < this.lastpos){
			if (this.currentMargin() >= (this.elementsPos[this.newpos])*(-1)-this.whatToHide){
				this.lastpos = this.newpos;
				this.moving = false;
				document.getElementById(this.blocksContainer).style.marginLeft =  ((this.elementsPos[this.newpos])*(-1)-this.whatToHide) + 'px';
			}
		}
		if (this.newpos > this.lastpos){
			if (this.currentMargin() <= (this.elementsPos[this.newpos])*(-1)-this.whatToHide){
				this.lastpos = this.newpos;
				this.moving = false;
				document.getElementById(this.blocksContainer).style.marginLeft =  ((this.elementsPos[this.newpos])*(-1)-this.whatToHide) + 'px';
			}
		}
		if (this.moving){
			if (this.newpos != this.lastpos){
				if (whereto == 1){
					document.getElementById(this.blocksContainer).style.marginLeft = (this.currentMargin() - (this.speed * (-1))) + 'px';
				} else {
					document.getElementById(this.blocksContainer).style.marginLeft = (this.currentMargin() - this.speed) + 'px';
				}
			}
			setTimeout(this.nme+'.moveOnce('+whereto+');', this.jumptime);
		}
	}
	
	mSlider.prototype.MoveLeft = function(){
		if (!this.moving){
			if (this.lastpos > 0){
				this.moving = true;
				this.newpos--;
				this.moveOnce(1);
			}
		}
	}
	
	mSlider.prototype.MoveRight = function(){
		if (!this.moving){
			if ((this.currentMargin() * (-1)) < this.elementsPos[this.elementsPos.length - this.nbToShow]) {
				this.moving = true;
				this.newpos++;
				this.moveOnce(2);
			}
		}
	}