var nNews = new Array();
var nBetweendelay = 5000;
nNews[0]=new Array();
nNews[0]["text"]="<b>Immunizations</b><br/><br/>Need your immunizations updated? Please drop in!";
nNews[0]["link"]="Javascript: domenu('bulletin')";
nNews[0]["target"]="_self";
nNews[1]=new Array();
nNews[1]["text"]="<b>Work and School related medicals</b><br/><br/>We provide Work and School related medicals exams - Book Online";
nNews[1]["link"]="Javascript: domenu('bulletin')";
nNews[1]["target"]="_self";
nNews[2]=new Array();
nNews[2]["text"]="<b>Change in hours</b><br/><br/>the walk-in clinic is now open 9 AM to 6 PM Mondays to Fridays";
nNews[2]["link"]="Javascript: domenu('bulletin')";
nNews[2]["target"]="_self";
nNews[3]=new Array();
nNews[3]["text"]="<b>Flu Shot Clinics</b><br/><br/>Flu Shot Clinics Starting Soon - Please Check Back For More Information";
nNews[3]["link"]="Javascript: domenu('bulletin')";
nNews[3]["target"]="_self";
nNews[4]=new Array();
nNews[4]["text"]="<b>Friendly reminder</b><br/><br/>Please remember to bring your medications' list to your visits,  and notify the physician of any allergies.";
nNews[4]["link"]="Javascript: domenu('bulletin')";
nNews[4]["target"]="_self";
nNews[5]=new Array();
nNews[5]["text"]="<b>Artwork at the clinic</b><br/><br/>The beautiful artwork on display in our waiting room is by: »";
nNews[5]["link"]="Javascript: domenu('bulletin')";
nNews[5]["target"]="_self";
nNews[6]=new Array();
nNews[6]["text"]="<b>PAP screening</b><br/><br/>Starting June 10, we will offer routine PAP screening for women without a physician or nurse practitioner.  Please book an appointment online or drop »";
nNews[6]["link"]="Javascript: domenu('bulletin')";
nNews[6]["target"]="_self";
nNews[7]=new Array();
nNews[7]["text"]="<b>Physician Recruitment</b><br/><br/>We realize that there is a great need for family doctors and medical practitioners in Sault Ste. Marie. At this time our only family doctor already ha»";
nNews[7]["link"]="Javascript: domenu('bulletin')";
nNews[7]["target"]="_self";
nNews[8]=new Array();
nNews[8]["text"]="<b>Physician Opportunities</b><br/><br/>SaultCare is actively recruiting physicians for the Walk-in clinic.   Office space for private practice (Primary Care/Specialist/Allied Health) is als»";
nNews[8]["link"]="Javascript: domenu('bulletin')";
nNews[8]["target"]="_self";
nNews[9]=new Array();
nNews[9]["text"]="<b>Patient Pagers</b><br/><br/>We understand your time is important! --- We aim to get people into the walk-in clinic and seen in an efficient time and manner, as a result of our ex»";
nNews[9]["link"]="Javascript: domenu('bulletin')";
nNews[9]["target"]="_self";
var familypracticemessages = new Array();
newsitem='familypracticenewsitem';
familypracticemessages[0]="<a class="news" href='javascript:expandfamilynews(0);'>&nbsp;Physician Recruitment&nbsp;&raquo;<a/><div id='familypracticenewsitem0' class='hide'>We realize that there is a great need for family doctors and medical practitioners in Sault Ste. Marie. At this time our only family doctor already has a full practice and is not accepting new patients.<br/><br/>However, we are actively recruiting to try to help meet this need, and hope soon to announce the addition of more family practitioners. In the meantime, we hope you find the services we do provide, such as our prescription renewal appointments and walk-in clinic, helpful.</div><br/>";
familypracticemessages[1]="<a class=news href='javascript:expandfamilynews(1);'>&nbsp;Electronic Medical Records&nbsp;&raquo;<a/><div id=familypracticenewsitem1 class=hide>Our clinic is fully automated with an Electronic Medical Record (EMR) and online appointment scheduling.  <br /><br />You will notice when you visit our clinic, that every examination room has a computer.  The doctors and nurses will be using a computer during your visit to access your chart, enter your visit notes, prescribe medications, and update your files.  <br /><br />Our EMR system meets and exceeds the Ministry of Health’s standards for Electronic Medical Records, most importantly in terms of patient confidentiality and security.</div><br/>";
var walkinclinicmessages = new Array();
newsitem='walkinclinicnewsitem';
walkinclinicmessages[0]="<a class=news href='javascript:expandwalkinnews(0);'>&nbsp;Clinic Now Open&nbsp;&raquo;<a/><div id=walkinclinicnewsitem0 class=hide>SaultCare Walkin-Clinic and Appointment Based clinics are now open.  Please check out our website for information on the services we provide.  Welcome aboard!</div><br/>";
walkinclinicmessages[1]="<a class=news href='javascript:expandwalkinnews(1);'>&nbsp;Physician Opportunities&nbsp;&raquo;<a/><div id=walkinclinicnewsitem1 class=hide>SaultCare is actively recruiting physicians for the Walk-in clinic.   Office space for private practice (Primary Care/Specialist/Allied Health) is also available.  At SaultCare we provide everything you need for your practice, including staffing, supplies, and a state of the art electronic medical record that includes billing and scheduling.  We have spacious fully equipped exam rooms, including a minor procedure room. <br /><br />For more information, please contact our office manager at susan.mclean@saultcare.ca.</div><br/>";
walkinclinicmessages[2]="<a class=news href='javascript:expandwalkinnews(2);'>&nbsp;Electronic Medical Records&nbsp;&raquo;<a/><div id=walkinclinicnewsitem2 class=hide>Our clinic is fully automated with an Electronic Medical Record (EMR) and online appointment scheduling.  <br /><br />You will notice when you visit our clinic, that every examination room has a computer.  The doctors and nurses will be using a computer during your visit to access your chart, enter your visit notes, prescribe medications, and update your files.  <br /><br />Our EMR system meets and exceeds the Ministry of Health’s standards for Electronic Medical Records, most importantly in terms of patient confidentiality and security.</div><br/>";
walkinclinicmessages[3]="<a class=news href='javascript:expandwalkinnews(3);'>&nbsp;What is a “Patient Pager”?&nbsp;&raquo;<a/><div id=walkinclinicnewsitem3 class=hide>A “patient pager” is a small device that you will be given if our wait times for the clinic are longer than expected.  When it comes close to the time for your visit with the physician, you will be “paged” back to the clinic. This will allow you to walk around the mall and shop while waiting for your appointment. We know your time is important and hope this tool will allow you to make best of your time and visit to our clinic!</div><br/>";

/***********************************************
* Textarea Maxlength script-   Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/


function expandstaff(i) 
{ 
  var j = 1;
  var d=document.getElementById('staffrow'+j);
  while (d != null)
  {    
    if (j!=i) d.style.display='none'; 
    d=document.getElementById('staffthumb'+j);
    d.style.borderColor='LightGrey';
    j++;
    d=document.getElementById('staffrow'+j);
  }

  var r=document.getElementById('staffrow'+i);
  if (r.style.display=='block') 
  {
    r.style.display='none';
    r=document.getElementById('staffthumb'+i);
    r.style.borderColor='LightGrey';
  }
  else 
  {
    r.style.display='block'; 
    r=document.getElementById('staffthumb'+i);
    r.style.borderColor='Black';
  }   
}
function expandfaq(i) 
{ 

  var d=document.getElementById('faqitem'+i);

  if (d.style.display=='block') d.style.display='none' 
  else d.style.display='block'; 
}

function expandfamilynews(i) 
{ 

  var d=document.getElementById('familypracticenewsitem'+i);

  if (d.style.display=='block') d.style.display='none' 
  else d.style.display='block'; 
}

function expandwalkinnews(i) 
{ 

  var d=document.getElementById('walkinclinicnewsitem'+i);

  if (d.style.display=='block') d.style.display='none' 
  else d.style.display='block'; 
}

function expandfamilypractice(i) 
{ 

  var d=document.getElementById('familypractice'+i);

  if (d.style.display=='block') d.style.display='none' 
  else d.style.display='block'; 
}

var curmsg
var whichnews
var messages
function slidemessage()
{

if (whichnews=='familypracticenews') messages=familypracticemessages;    
if (whichnews=='walkinclinicnews') messages=walkinclinicmessages;    

if (curmsg<messages.length-1) 
{
  curmsg++;
}
else 
{
  return;
}

if (document.getElementById(whichnews)!=null) document.getElementById(whichnews).innerHTML += '<br/>' + messages[curmsg];

setTimeout("slidemessage()",300);
}

function lib_bwcheck(){ //Browsercheck (needed)
  this.ver=navigator.appVersion
  this.agent=navigator.userAgent
  this.dom=document.getElementById?1:0
  this.opera5=this.agent.indexOf("Opera 5")>-1 
  this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
  this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
  this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera5)?1:0;
  //this.ie8=(this.ver.indexOf("MSIE 8")>-1 && this.dom && !this.opera5)?1:0;
  this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
  //this.ie=this.ie4||this.ie5||this.ie6||this.ie7||this.ie8
  this.ie=(this.ver.indexOf("MSIE ")>-1 && this.dom && !this.opera5)?1:0;
  this.mac=this.agent.indexOf("Mac")>-1
  this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
  this.ns4=(document.layers && !this.dom)?1:0;
  this.bw=(this.ie || this.ns4 || this.ns6 || this.opera5)
  return this
}

var bw=new lib_bwcheck()

/****
Variables to set
****/

//How do you want the script to work?
//0 = Fade in - Fade out
//1 = Slide in - Fade out
//2 = Random
nWorks = 0

//If you use the slide set these variables:
nSlidespeed = 1 //in px
nNewsheight = 20 //This is how long down it should start the slide.

//nBetweendelay = 1000 //The delay before fading out.
//nFont = 'verdana, tahoma, arial' //The font for the news.
nFont = 'sans-serif' //The font for the news.
nFontsize = 18 //Font size in pixel.
nFadespeed = 100 //The speed to fade in, in milliseconds.

//Set the colors, first color is same as background, last color is the color it stops at:
//You can have as many colors you want
nColor=new Array('#FFFFFF', '#EEEEEE','#CCCCCC','#999999','#666666','#333333','#000000')

/********************************************************************************
Object code...Object constructors and functions...
********************************************************************************/
function makeNewsObj(obj,nest,font,size,color,news,fadespeed,betweendelay,slidespeed,works,newsheight){
    nest=(!nest) ? "":'document.'+nest+'.'
    this.css=bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+"document.layers." +obj):0;
    this.writeref=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+"document.layers." +obj+".document"):0;
  if(font){this.color=new Array(); this.color=eval(color); this.news=new Array(); this.news=eval(news)
    this.font=font; this.size=size; this.speed=fadespeed; this.delay=betweendelay; this.newsheight=newsheight;
    this.fadeIn=b_fadeIn;this.fadeOut=b_fadeOut; this.newsWrite=b_newsWrite; this.y=1
    this.slideIn=b_slideIn; this.moveIt=b_moveIt; this.slideSpeed=slidespeed; this.works=works
    if(bw.dom || bw.ie4){this.css.fontFamily=this.font; this.css.fontSize=this.size; this.css.color=this.color[0]}
  }
  this.obj = obj + "Object";  eval(this.obj + "=this"); return this
}

function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x+px; this.css.top=this.y+px;}

function b_newsWrite(num,i){
  if (bw.ns4){
      this.writeref.write("<a href=\""+this.news[num]['link']+"\" style=\"text-decoration:underline; font-size:"+this.size+"px\">"
        +"<font face=\""+this.font+"\" color=\""+this.color[i]+"\">"+this.news[num]['text']+"</font></a>")
      this.writeref.close()
    }else this.writeref.innerHTML = '<a id="'+this.obj+'link' +'" style="text-decoration:none; font-size:'+this.size+'px; color:'+this.color[i]+'" href="'+this.news[num]['link']+'">'+this.news[num]['text']+'</a>'
}
//Slide in
function b_slideIn(num,i){
  if (this.y>0){
    if (i==0){this.moveIt(0,this.newsheight); this.newsWrite(num,this.color.length-1)}
    this.moveIt(this.x,this.y-this.slideSpeed)
    i ++
    setTimeout(this.obj+".slideIn("+num+","+i+");",50)
  }else setTimeout(this.obj+".fadeOut("+num+","+(this.color.length-1)+")",this.delay)
}
//The fade functions
function b_fadeIn(num,i){
  if (i<this.color.length){
    if (i==0 || bw.ns4) this.newsWrite(num,i)
    else{
      obj = bw.ie4?eval(this.obj+"link"):document.getElementById(this.obj+"link")
      obj.style.color = this.color[i]
    }
    i ++
    setTimeout(this.obj+".fadeIn("+num+","+i+")",this.speed)
  }else setTimeout(this.obj+".fadeOut("+num+","+(this.color.length-1)+")",this.delay)
}

function b_fadeOut(num,i){
  if (i>=0){
    if (i==0 || bw.ns4) this.newsWrite(num,i)
    else{
      obj = bw.ie4?eval(this.obj+"link"):document.getElementById(this.obj+"link")
      obj.style.color = this.color[i]
    }
    i --
    setTimeout(this.obj+".fadeOut("+num+","+i+")",this.speed)
  }else{
    num ++
    if(num==this.news.length) num=0
    works = !this.works?0:this.works==1?1:Math.round(Math.random())
    if(works==0) setTimeout(this.obj+".fadeIn("+num+",0)",500)
    else if (works==1){this.y=1; setTimeout(this.obj+".slideIn("+num+",0)",500)
    }
  }
}
/********************************************************************************************
The init function. Calls the object constructor and set some properties and starts the fade
*********************************************************************************************/
function fadeInit(){
  oNews = new makeNewsObj('divNews','divNewsCont',nFont,nFontsize,"nColor","nNews",nFadespeed,nBetweendelay,nSlidespeed,nWorks,nNewsheight)
  oNewsCont = new makeNewsObj('divNewsCont')
  works = !oNews.works?0:oNews.works==1?1:Math.round(Math.random())
  if (works==0) oNews.fadeIn(0,0)
  else if (works==1) oNews.slideIn(0,0)
  oNewsCont.css.visibility = "visible"
}

//Calls the init function on pageload.
if(bw.bw) onload = fadeInit

