/* Javacript News Rotation, based on article by Tom Duffy - http://www.devx.com/getHelpOn/10MinuteSolution/17245/0/page/1 - Thanks Tom! */
function makeNews(c){	this.copy = c;	this.write = writeNews; }
function writeNews(){	var str = '';	str += this.copy;	return str;}
var newsArray = new Array();
newsArray[0] = new makeNews("On the first Sunday of each month Integral Yoga Dorset hold a Satsang at The Zen Zone. Come and join us for an inspiring evening of chanting, yoga philosophy and talks. Open to everyone. 18.30 to 20.30. No charge, but donations welcome.<br>").write();
newsArray[1] = new makeNews("We are now delighted to be able to offer a full range of beauty treatments for men and women: facials, waxing, eyelash/brow tint and perm, manicures, pedicures. Michelle uses Dermalogica products in all facials and Creative products in hands and feet treatments. To view our price list, please click <a href=\"/beauty/prices.php\">here</a>.").write();
newsArray[2] = new makeNews("We are pleased to promote a new range of organic yoga tops by Tribe Worldwear, in eco-fabrics such as luxuriously soft bamboo and Earth Positive cotton, which is not only organic and fairtrade, but also made in factories solely powered by wind and solar power. <br><br>For full details, please see <a href=\"http://www.tribeworldwear.com/\">http://www.tribeworldwear.com/</a>").write();
newsArray[3] = new makeNews("Pelvic Floor Exercise Class<br><br>Be fit, be sexy, be in control<br><br>This new exercise class is specifically designed for women of all ages and is led by Louise James, Chartered Physiotherapist and Maya Abdominal Massage Practitioner.<br><br>  “Stress urinary incontinence”, the leaks that can happen when you laugh, cough, sneeze and lift, is more common than you think, and affects more than half of pregnant women. Yet, as helpless as you may feel, there is something you can do to help.  Pelvic floor muscles exercises are a powerful and effective way to treat the problem. The exercises are not difficult, but as with everything else, correct form and consistency makes all the difference. Take the plunge and book yourself on the course today to reclaim your sexual, emotional and physical well-being.<br><br>please contact Louise on 07836 643 017 to find out when the next course starts.").write();
newsArray[4] = new makeNews("New Sunday Satsang<br><br>Every 3rd Sunday of the month (21st March; 18th April; 16th May) Satsang with Tara. 6.30 p.m. – 8.30 p.m. (min. Donation £5 please). <br><br>An informal meeting exposing the Myths and Reality of Enlightenment. Moving away from the traditional language and tradition of Eastern ‘Satsang’, Tara speaks in the language of the West, saying it as it is. There is only ‘this’. We are all in pursuit of this something that is already here. <br><br>Please contact Tara on 01202 604 340 for further information.").write();
newsArray[5] = new makeNews("Cardiac® Yoga – with Lalitha, - a certified Cardiac® Yoga and Stress Management Teacher - starting Friday 9th April – 10.00 a.m. to 11.00 a.m.  <br><br>A Yoga class for people with heart and respiratory conditions. For further information, please call Lalitha on 01202 780 189 or e-mail <a href=\"mailto:Lalitayoga@tiscali.co.uk\">Lalitayoga@tiscali.co.uk</a>. For more details, click <a href=\"/special/cardiac.php\">here</a>.").write();

var nIndex = -1;
var timerOn = 1;
var timerID = null;
var len = newsArray.length;var pp_symbol = "||";
var pp_start = "<a href=\"javascript:prevNews();\" style=\"color: #FFFFFF; text-decoration: none\">&lt;</a> <a href=\"javascript:togglePlay();\" style=\"color: #FFFFFF; text-decoration: none\">"; 
var pp_end = "</a> <a href=\"javascript:nextNews();\" style=\"color: #FFFFFF; text-decoration: none\">&gt;</a>";

function rotateNews(){	
nIndex++;	
if(nIndex >= len)		
nIndex = 0;
document.getElementById('stories').innerHTML = newsArray[nIndex];
document.getElementById('pauseplay').innerHTML = pp_start + pp_symbol + pp_end;
document.getElementById('pagecount').innerHTML = "(" + (nIndex+1) + "/" + (len) + ")";
if(timerOn == 1) 
timerID = setTimeout('rotateNews()',9000);
}
function pauseNews() {	
if (timerID != null) {	
timerOn = 0; 
clearTimeout(timerID);	
timerID = null;	pp_symbol = "Play";
document.getElementById('pauseplay').innerHTML = pp_start + pp_symbol + pp_end;	
} 
}

function playNews() {	
if (timerID == null) 
{
timerOn = 1; 
timerID = 
setTimeout('rotateNews()', 1000);	
}

pp_symbol = "||";	document.getElementById('pauseplay').innerHTML = pp_start + pp_symbol + pp_end; 
}

function nextNews(){	nIndex++;	if(nIndex >= len)		nIndex = 0;
	document.getElementById('stories').innerHTML = newsArray[nIndex];
	document.getElementById('pauseplay').innerHTML = pp_start + pp_symbol + pp_end;
	document.getElementById('pagecount').innerHTML = "(" + (nIndex + 1) + "/" + (len) + ")";
	pauseNews();
}

function prevNews(){
	nIndex--;
	if(nIndex < 0)
		nIndex = len-1;
	document.getElementById('stories').innerHTML = newsArray[nIndex];
	document.getElementById('pauseplay').innerHTML = pp_start + pp_symbol + pp_end;
	document.getElementById('pagecount').innerHTML = "(" + (nIndex + 1) + "/" + (len) + ")";
	pauseNews();
}


function togglePlay(){
	if(timerOn == 1) 
	{
		pauseNews();
	} 
	else 
	{
		playNews();
	}
}
