/*************************************************************************
  This code is from Dynamic Web Coding at dyn-web.com
  Copyright 2001-5 by Sharon Paine 
  See Terms of Use at www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

// preload images
imageHandler.path = "img/";
imageHandler.preload("/img/chakra-hands.gif", "testimonial-2.png", "nancy.jpg");

function initBanner() {
    if ( !document.getElementById ) return;
    // arguments: id, delay (amount of time in milliseconds you linger on each item)
    var ban1 = new dw_Banner('txtBanner', 13000);
    // add as many items as you like
    ban1.addItem('&#8220;Every Reiki treatment I give gets better and better and better! My Reiki began to flow by itself.  I always feel awesome.  I look in the mirror after I&#8217;ve given a treatment, and I look ten years younger!  People say I look so bright eyed because it is so refreshing to me to give a treatment.&#8221;<br /><span style="float:right;">Liberty Mason</span>');
    ban1.addItem('&#8220;Initially I took Reiki for myself so I could assist myself in healing. I had daily migraines which caused me to have to take narcotics and all the side effects that go with that.  The month and half prior to going off the narcotics, I did Reiki on myself every day.  It got the energy moving through my body, and I feel like it really prepared me to go off them. I feel wonderful!&#8221;<br /><span style="float:right;">- Krysty Duvall</span>');
    ban1.addItem('&#8220;The value of taking Reiki was that it broadened my horizons of my abilities to connect with my higher power, and has allowed me to use the healing force that is within me.  Having a Reiki treatment was amazing, but it was the realization that I could do this for myself that was so very powerful.  I knew that I had power in my hands - just didn&#8217;t know what it was before.  This knowledge is very empowering.&#8221;<br /><span style="float:right;">- Marc Mason</span>');
    ban1.addItem('&#8220;I now integrate Reiki into my personal life and practice.  I have a much better connection with my spirit guides and guardian angels.  This heightened connection helped me to realize that a loved one was in crisis.  Upon this awareness I immediately responded to these promptings and was able to prevent this loved one&#8217;s death by suicide.  Had I waited just twenty more minutes the affects of this suicide attempt would have been irreversible.&#8221;<br /><span style="float:right;">- Jay Jackson</span>');
    var ban2 = new dw_Banner('imgBanner', 6500);
    // put your items here
    ban2.addItem('<a href="/testimonials/"><img src="/img/chakra-hands.gif" width="100" height="100" border="0" alt="testimonials" /></a>');
    ban2.addItem('<a href="/testimonials/"><img src="/img/chakra-hands.gif" width="100" height="100" border="0" alt="testimonials" /></a>');
    ban2.addItem('<a href="/testimonials/"><img src="/img/chakra-hands.gif" width="100" height="100" border="0" alt="testimonials" /></a>');
        
    dw_Banner.setPartners(ban1, ban2);
    ban1.rotate();  
    ban2.rotate(); 
}

dw_Banner.setPartners = function(p1, p2) {
    p1.el = document.getElementById(p1.id);
    p2.el = document.getElementById(p2.id);
    if (p1.el && p2.el) {
        p1.el.onmouseover = dw_Banner.tandemHalt;
        p2.el.onmouseover = dw_Banner.tandemHalt;
        p1.el.onmouseout = dw_Banner.tandemResume;
        p2.el.onmouseout = dw_Banner.tandemResume;
        p1.partner = p2; p2.partner = p1;
    }
}

dw_Banner.tandemHalt = function() {
    var curObj = dw_Banners[this.id];
    if ( curObj && curObj.partner ) {
        clearTimeout(curObj.timer); curObj.timer = null;
        clearTimeout(curObj.partner.timer); curObj.partner.timer = null; 
    }
}

dw_Banner.tandemResume = function(e) {
    e = e? e: window.event;
    var toEl = e.relatedTarget? e.relatedTarget: e.toElement;
    if ( this != toEl && !dw_contained(toEl, this) ) { 
        var curObj = dw_Banners[this.id];
        if ( curObj && curObj.partner ) {
            curObj.timer = setTimeout(curObj.animString + ".rotate()", dw_Banner.restartDelay);
            curObj.partner.timer = setTimeout(curObj.partner.animString + ".rotate()", dw_Banner.restartDelay);        
        }
    }     
}
