var blinkTimer;
var _total_twists = 3;
var _current_twists = 0;
var _speed = 100;

function twistBeard() {
	rotatePlus();
}

function rotatePlus() {
	document.getElementById('beardImg').style.visibility = "hidden";
	document.getElementById('beardImgTilt').style.visibility = "visible";

	blinkTimer = setTimeout("rotateMinus()", _speed);
}

function rotateMinus() {
	document.getElementById('beardImg').style.visibility = "visible";
	document.getElementById('beardImgTilt').style.visibility = "hidden";

	_current_twists++;
	
	if (_current_twists < _total_twists) {
		blinkTimer = setTimeout("rotatePlus()", _speed);
	} else {
		_current_twists = 0;
		blinkTimer = setTimeout("rotatePlus()", 5000);	
	}
}
