/* 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("<u>Beauty Treatments at The Zen Zone</u><br><br>We are 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[1] = new makeNews("<u>The Healing Codes Workshop</u><br><br><P>We are pleased to announce that we will be hosting two workshops with Anne and Jack Stewart.</P>  <P>First, \"The Healing Code: workshop with Anne and Jack Stewart\" on Saturday 10th March, between 10 a.m. and 5 p.m. </P>  <P>The Healing Codes are the greatest healing discovery in history; the greatest discovery since medicine... For more detail, check <A href=\"http://www.thehealingcodes.co.uk/\">www.thehealingcodes.co.uk</A> or phone Anne on 01925 479 257. </P>  <P>This workshop will cost £67 (a £17 deposit is required).</P>  <P>Following the Healing Code workshop, Anne and Jack will host \"The Healing Code applied to Succes\" on Sunday 11th March, also at The Zen Zone, between 10 a.m. and 5 p.m. </P>  <P>Create the life of your dreams by invoking your \"Success Mechanism\".</P>  <P>This workshop will also cost £67 (a £17 deposit is required).</P>  <P>Please contact Anne on 01925 479 257 for more details about these workshops.<BR></P>").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();
	}
}

