﻿/*Example message arrays for the two demo scrollers*/
var tabin = '&nbsp;&nbsp;&nbsp;&nbsp;';
var readmore = '<table align=right><tr><td><a href="testimonials.aspx"><strong>READ MORE..></strong></a></td></tr></table>';
var testimonial_content = new Array()
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Do not go past here -->|
testimonial_content[0] = tabin + 'TanTrack has been wonderful for our salon. We searched around for a few months on the best software for our salon, each of us loaded and played with each program and agreed unanimously that TanTrack was the easiest ...' + readmore
testimonial_content[1] = tabin + 'We use the TanTrack program by Nichesoft in our salon and we love it!!! TanTrack is easy to access and very user-friendly. Training my employees is easier than ever. Not to mention how simple the record keeping is ...' + readmore
testimonial_content[2] = tabin + 'From the first time I talked to Nichesoft, the positive, “can do” attitude has never failed. When I had problems getting a connection between computers, you walked me through, over an hour on the phone, the ...' + readmore
testimonial_content[3] = tabin + 'The TanTrack support department is absolutely ‘AWESOME’. Prior to my opening my salon I worked for a software company (we partnered with Microsoft) and I have had the opportunity to deal with many ...' + readmore
testimonial_content[4] = tabin + 'Before I opened my salon I ordered software suggested by the manufacturer of the tanning equipment I purchased. That software was so complicated that I would forget from day to day how to make a simple...' + readmore
testimonial_content[5] = tabin + 'As a brand new salon we wanted to be sure our computer system was the best it could possibly be with solid protection against theft as well as easy to train on and operate. We reviewed several demos from all salon ...' + readmore
testimonial_content[6] = tabin + 'TanTrack has helped our business in ways we never imagined. Our customers do not have to wait while we fumble through cards or try to calculate the last time they tanned. The system maintains all the information ...' + readmore
testimonial_content[7] = tabin + 'We were previously using Helios and have now been using TanTrack for about one year. Believe me, we haven`t looked back. The technical support at Nichesoft runs circles around the Helios support team. These guys ...' + readmore
testimonial_content[8] = tabin + 'I have been in the tanning industry for thirteen years (since I was 19).  I am also a service tech and have been doing work in salons from Maine to Maryland and over to Pennsylvania. I have seen all the programs ...' + readmore

var testimonial_name = new Array()
testimonial_name[0] = 'All Seasons Tan';
testimonial_name[1] = 'Catchin Rays';
testimonial_name[2] = 'Celebrity Tan';
testimonial_name[3] = 'Figures';
testimonial_name[4] = 'Instant Results';
testimonial_name[5] = 'Sun Essentials';
testimonial_name[6] = 'Tan-tra';
testimonial_name[7] = 'Tan City';
testimonial_name[8] = 'Ultima Tan';

var testimonial_image = new Array()
testimonial_image[0] = '<img src="images/testimonials_images/All_Seasons_Tan.gif" border="0">';
testimonial_image[1] = '<img src="images/testimonials_images/catchin_rays.gif" border="0">';
testimonial_image[2] = '<img src="images/testimonials_images/Celebrity_Tan.gif" border="0">';
testimonial_image[3] = '<img src="images/testimonials_images/default.gif" border="0">';
testimonial_image[4] = '<img src="images/testimonials_images/Instant_Results.gif" border="0">';
testimonial_image[5] = '<img src="images/testimonials_images/default.gif" border="0">';
testimonial_image[6] = '<img src="images/testimonials_images/default.gif" border="0">';
testimonial_image[7] = '<img src="images/testimonials_images/default.gif" border="0">';
testimonial_image[8] = '<img src="images/testimonials_images/default.gif" border="0">';


function domticker(content, divId, divClass, delay, fadeornot) {
    this.content = content
    this.tickerid = divId //ID of master ticker div. Message is contained inside first child of ticker div
    this.delay = delay //Delay between msg change, in miliseconds.
    this.mouseoverBol = 0 //Boolean to indicate whether mouse is currently over ticker (and pause it if it is)
    this.pointer = 1
    this.opacitystring = (typeof fadeornot != "undefined") ? "width: 100%; filter:progid:DXImageTransform.Microsoft.alpha(opacity=100); -moz-opacity: 1" : ""
    if (this.opacitystring != "") this.delay += 500 //add 1/2 sec to account for fade effect, if enabled
    this.opacitysetting = 0.2 //Opacity value when reset. Internal use.
    document.write('<div id="' + divId + '" class="' + divClass + '"><div style="' + this.opacitystring + '">' + content[0] + '</div></div>')
    var instanceOfTicker = this
    setTimeout(function() { instanceOfTicker.initialize() }, delay)
}

domticker.prototype.initialize = function() {
    var instanceOfTicker = this
    this.contentdiv = document.getElementById(this.tickerid).firstChild //div of inner content that holds the messages
    document.getElementById(this.tickerid).onmouseover = function() { instanceOfTicker.mouseoverBol = 1 }
    document.getElementById(this.tickerid).onmouseout = function() { instanceOfTicker.mouseoverBol = 0 }
    this.rotatemsg()
}

domticker.prototype.rotatemsg = function() {
    var instanceOfTicker = this
    if (this.mouseoverBol == 1) //if mouse is currently over ticker, do nothing (pause it)
        setTimeout(function() { instanceOfTicker.rotatemsg() }, 100)
    else {
        this.fadetransition("reset") //FADE EFFECT- RESET OPACITY
        this.contentdiv.innerHTML = this.content[this.pointer]
        this.fadetimer1 = setInterval(function() { instanceOfTicker.fadetransition('up', 'fadetimer1') }, 100) //FADE EFFECT- PLAY IT
        this.pointer = (this.pointer < this.content.length - 1) ? this.pointer + 1 : 0
        setTimeout(function() { instanceOfTicker.rotatemsg() }, this.delay) //update container
    }
}

// -------------------------------------------------------------------
// fadetransition()- cross browser fade method for IE5.5+ and Mozilla/Firefox
// -------------------------------------------------------------------

domticker.prototype.fadetransition = function(fadetype, timerid) {
    var contentdiv = this.contentdiv
    if (fadetype == "reset")
        this.opacitysetting = 0.2
    if (contentdiv.filters && contentdiv.filters[0]) {
        if (typeof contentdiv.filters[0].opacity == "number") //IE6+
            contentdiv.filters[0].opacity = this.opacitysetting * 100
        else //IE 5.5
            contentdiv.style.filter = "alpha(opacity=" + this.opacitysetting * 100 + ")"
    }
    else if (typeof contentdiv.style.MozOpacity != "undefined" && this.opacitystring != "") {
        contentdiv.style.MozOpacity = this.opacitysetting
    }
    else
        this.opacitysetting = 1
    if (fadetype == "up")
        this.opacitysetting += 0.2
    if (fadetype == "up" && this.opacitysetting >= 1)
        clearInterval(this[timerid])
}
