
/*Example message arrays for the two demo scrollers*/

var healthtips=new Array()
healthtips[0]='Men and Women over the age of 50 should avoid excessive levels of iron in their supplement. Look for a multi-vitamin & mineral supplement with less than 5 mg of iron.'
healthtips[1]='When buying  a vitamin E supplement, check the label carefully and look for the natural source d-form avoid the synthetic dl-form.'
healthtips[2]='Vitamin  C helps in the absorption of non-animal forms of iron such as the iron found in fruits, vegetables and nuts.'
healthtips[3]='High levels of vitamin C can protect levels  of vitamin E in the body and may contribute to the immune enhancement of vitamin E.'
healthtips[4]='To increase absorption of vitamins and minerals, avoid coffee and other high coffeine drinks for 1-1.5 hours of taking a supplement.'
healthtips[5]='When vegetables are boiled, the minerals leech out of the  vegetables into the waterlight steaming will preserve mineral content.'
healthtips[6]='Wound healing and immune function  are highly dependent on adequate levels of trace minerals.'
healthtips[7]='Almonds  contain more calcium than any other nut (190 mg per 1/2 cup /125 ml).'
healthtips[8]='Vitamin E  strengthens the antioxidant effect of selenium- they are more powerful when taken together.'
healthtips[9]='Regular use of ginseng has been shown to boost the level of white blood cells-a sign of increased immune system functioning.'
healthtips[10]='Garlic can help reduce blood pressure and cholesterol -use it daily.'
healthtips[11]='All fruits and vegetables are most nutritious when served raw. The best cooking method is steaming with very little water.'
healthtips[12]='The nutrients in fruits and vegetables are often concentrated just below the skin-avoid peeling whenever possible.'
healthtips[13]='Lycopene is better absorbed by the body after it has been heated during processing -good examples are tomato sauce and ketchup.'
healthtips[14]='Phytonutrients are more powerful when consumed with the antioxidants vitamin C, Vitamin E and the mineral selenium.'





var diduknow=new Array()
diduknow[0]='Only 5% of pesticides reach target weeds and the rest runs off into water and goes into the air we breathe.'
diduknow[1]='Indoor air pollution can be worse than outdoors. To reduce indoor air pollution levels in your home, open windows regularly.'
diduknow[2]='Roughly four hundred million tons of chemicals are used or produced worldwide each year.'
diduknow[3]='Using only organic based cleaners in your home can reduce your exposure to chemicals considerably.'
diduknow[4]='Thoroughly washing fruits and vegetables with a non toxic detergent will remove many of the chemicals. If available, try special fruit and vegetable washes.'
diduknow[5]='The herb dandelion can help detoxify and cleanse your liver one of the main organs'
diduknow[6]='Drinking only bottled, purified or distilled water will dramatically reduce your intake of chemicals and heavy metals.'
diduknow[7]='During the refining process of whole wheat, the grain is bleached, sometimes using a bleaching agent similar to laundry bleach.'
diduknow[8]='Olive and canola oil are the best choices for cooking oils because they contain the highest levels of polyunsaturated fats-the healthiest fats.'
diduknow[9]='Certain essential fats are involved in the signaling of hormones and also play a role in regulating the immune system.'
diduknow[10]='Salt and smoke have been used as preservatives since early history. The Egyptians used colours and flavourings to preserve their food while the Romans used saltpeter, and spices.'
diduknow[11]='Eating a small amount of protein at each meal will help stablize blood sugar levels and prevent sugar cravings.'
diduknow[12]='In 1970, Americans spent approximately 6 billion dollars on fast food and in 2000 they spent more than 110 billion dollars.'
diduknow[13]='An easy way to avoid unhealthy fats: the more solid fats are at room temperature, the more they should be avoided.'


var fastfacts=new Array()
fastfacts[0]='Adding a high fibre supplement to your diet is a convenient and effective way to increase your daily fibre intake.'
fastfacts[1]='Following the 5A  Day  recommendation of fruits and vegetables not only increases you phytonutrients but your fibre as well.'
fastfacts[2]='Oat beta glucan is thought  to be the active ingredient responsible for the heart healthy properties of oat fibre.'
fastfacts[3]='High-fibre snacks  between meals will help you feel full until your next meal so you avoid snacking on junk foods.'
fastfacts[4]='Boost the fibre of your salads by adding raisins, nuts, shredded carrots, apple slices or sunflower seeds.'
fastfacts[5]='When increasing your fibre intake, increase you consumption of water as well. Extra water will help the fibre to remove more toxins from the body.'
fastfacts[6]='White meats generally contain less fat than dark meats. Turkey is one of the lowest fat meats and makes a great low-fat sandwich.'
fastfacts[7]='Fat cells can keep cancer causing chemicals trapped in the body, which can lead to the development of the disease.'
fastfacts[8]='To maximize your body fat burning systems, eat smaller meals every three to four hours.'
fastfacts[9]='You need  to eat  3,500 calories in order to gain one pound or burn that same amount in order to lose one pound.'
fastfacts[10]='When on a weight management program, never skip meals or allotted snacks -this often leads to overeating later in the evening.'


var takeactiontoday=new Array()
takeactiontoday[0]='A fifty- year old woman risk of dying from a hip  fracture is equal  to her risk of dying from breast cancer.'
takeactiontoday[1]='Taking vitamin E  with a small amount of fat increases its antioxidant protection dramatically.'
takeactiontoday[2]='People in their late nineties or older  are often healthier and more robust than those 20 years younger.'
takeactiontoday[3]='As the body ages, the liver and kidney ability to cleanse toxins and metabolize most drugs decreases.'
takeactiontoday[4]='As we age, our ability to absorb nutrient decreases significantly supplements that assist with absorption can help.'
takeactiontoday[5]='Regular  exercise and optimal  calcium intake are the two best ways to maximize bone strength and avoid asteoporosis.'
takeactiontoday[6]='Work stress can be as harmful to health as smoking or not exercising.'
takeactiontoday[7]='Exercise  can turn your body into a fat-burning machine because it continues to burn calories at an elevated rate for a minimum of 30 minutes after you exercise.'
takeactiontoday[8]='Nearly half of all young people ages 12-21 arent vigorously active on a regular basis.'
takeactiontoday[9]='According to the World Health Organization approximately 2 million deaths per year are attributed to physical  inactivity.'
takeactiontoday[10]='According to the World Health Organization, a  sedentary lifestyle is one of the ten leading  causes of death and disability in the world.'


function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=8000 //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 10)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}



function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}
