/* USE WORDWRAP AND MAXIMIZE THE WINDOW TO SEE THIS FILE
========================================
 NewsBar v1.4
 License : Freeware (Enjoy it!)
 (c)2004 VASIL DINKOV- PLOVDIV, BULGARIA
========================================
 For IE4+, NS4+, Opera7+ & Konqueror2+
========================================
 Get the NewsBar script at:
 http://www.smartmenus.org/other.php
 and don't wait to get the Great SmartMenus script at:
 http://www.smartmenus.org
 LEAVE THESE NOTES PLEASE - delete the comments if you want */

// BUG in Opera:
// If you want to be able to control the body margins
// put the script right after the BODY tag, not in the HEAD!!!

// === 1 === FONT, COLORS, EXTRAS...

n_top=0;//	|
n_left=0;//	| defining
n_width=550;//	| the box
n_height=14;//	|
n_position='relative';// absolute/relative
n_timeOut=3;//seconds
n_pauseOnMouseOver=true;
n_speed=60;//1000 = 1 second
n_leadingSign='_';
//n_leadtext='Latest News: ';//moved to setup.inc
n_alternativeHTML='<span class=\"prefix\">'+n_leadtext+'</span>';
// for not supported browsers like Opera<7 - usually
// you may want to put a link to your news page 

// === 2 === THE CONTENT - ['href','text','target']
/*if(!self.n_content) n_content=[
['','Welcome to the Naturopathic Centre Website, use the menus below to find out more',''],
['page/fertility_open_day','Fertility Open Day Monday 5th June 2006 - A no commitment open day to discuss any issues around fertility and pre-conceptual health',''],
['page/hypnobirthing flyer','Hypnobirthing - for safer, easier & more comfortable birthing.',''],
['page/pregnancy yoga','Pregnancy yoga course is now on - click here for details',''],
['','Wellness children - A half term health check for your children',''],
['','Uniqueness of me workshop - to help tap into your unique purpose in life',''],
['','Autism  - All you need to know on autism - next presentation September 06. Call 01962 775111 for details.','']
];*/

// THE SERIOUS SCRIPT - PLEASE DO NOT TOUCH
n_nS4=document.layers?1:0;
n_iE=document.all&&!window.innerWidth&&navigator.userAgent.indexOf("MSIE")!=-1?1:0;
n_nSkN=document.getElementById&&(navigator.userAgent.indexOf("Opera")==-1||document.body.innerHTML)&&!n_iE?1:0;
n_t=0;
n_cur=0;
n_l=n_content[0][1].length;
n_timeOut*=1000;
thePrefix="<span class=\"prefix\">"+n_leadtext+"</span>";
//n_fontSize2=n_nS4&&navigator.platform.toLowerCase().indexOf("win")!=-1?n_fontSizeNS4:n_fontSize;

n_p=n_pauseOnMouseOver?" onmouseover=clearTimeout(n_TIM) onmouseout=n_TIM=setTimeout('n_new()',"+n_timeOut+")>":">";

function n_new(n_content){
	if(!(n_iE||n_nSkN||n_nS4))return;
	var O,mes;
	O=n_iE?document.all['nnewsb']:n_nS4?document.layers['n_container'].document.layers['nnewsb']:document.getElementById('nnewsb');
	var elm=document.getElementById('ticker_anchor');
	if(n_cur==0)
	{		
		//remove and recreate the link - this is because we cannot delete the href property in IE
		var z=elm.parentNode;
		z.removeChild(elm);
		z.innerHTML="<a id='ticker_anchor'></a>";
		elm=document.getElementById('ticker_anchor');
	}
	if(n_content[n_t][0]!='') elm.href=n_content[n_t][0];
	elm.target=n_content[n_t][2];
	
	elm.innerHTML=thePrefix+n_content[n_t][1].substring(0,n_cur)+leadingSign(n_cur,n_content[n_t][1].length);
	//mes=n_content[n_t][0]!=""&&n_cur==n_l?("<a href='"+n_content[n_t][0]+"' target='"+n_content[n_t][2]+"' class=nnewsbar"+n_p+thePrefix+n_content[n_t][1].substring(0,n_cur)+n_leadingSign+"</a>"):("<span class=nnewsbar>"+thePrefix+n_content[n_t][1].substring(0,n_cur)+n_leadingSign+"</span>");
	/*if(n_nS4)with(O.document){open();
	write(mes);
	close()
	}
	else O.innerHTML=mes;*/
	if(n_cur++==n_l){
		n_cur=0;
		n_TIM=setTimeout("n_new(n_content)",n_timeOut);
		n_t++;
		if(n_t==n_content.length) n_t=0;
		n_l=n_content[n_t][1].length
	}
	else{setTimeout("n_new(n_content)",n_speed)}
};

function leadingSign(current,total)
{
	if(current == total)
	{
		return '';
	}

	if((current % 2) == 1)
	{
		return '_';
	}
	else
	{
		return '-';
	}
}

var elm=document.getElementById('ticker_anchor');
//elm.innerHTML='<div '+(n_nS4?"name":"id")+'=n_container style=width:'+n_width+'px;height:'+n_height+'px;clip:rect(0,'+n_width+','+n_height+',0)"><div '+(n_nS4?"name":"id")+'=nnewsb style="width:'+n_width+';height:'+n_height+'px;clip:rect(0,'+n_width+','+n_height+',0);" class=nnewsbar>'+n_alternativeHTML+'</div></div></div>';
elm.innerHTML=n_alternativeHTML;
if(!n_nS4)setTimeout("n_new(n_content)",1000);
else window.onload=n_new(n_content);
if(n_nS4)onresize=function(){location.reload()}
