// <script type="text/javascript">
<!--  to hide script contents from old browsers

var quote_out = 1;
var rannum = -1;
var undefined;

/***
var br=document.createElement('br');
someelement.appendChild(br);
***/

/**
The undefined property is useful to test if a variable has been initialized.
	if ( var a == undefined ) a = "some value";

If JavaScript doesn’t support the undefined property, the code fails. The 
solution is to declare the undefined property in the code: 
	var undefined;

This variable will be added to the Global object and since it is not given any 
value, its value will be undefined. For newer browsers that support the 
undefined property, this code replaces the predefined version and behaves the same.
**/

function testimonial(name, company, quote1, quote2, quote3)
{
	this.name = name;
	this.company = company;
	this.quote1 = quote1;
	this.quote2 = quote2;
	this.quote3 = quote3;
}

var testimonial_array = new Array();

testimonial_array[0] = new testimonial("Matthew Bachtold, Director", "Upton Town Library",

	'\"Mitchell redesigned our library website. With only a general outline of what we '
	+ 'wanted for our site, he created a functional and attractive design. ',
	
	'\"Mitchell was very responsive to our needs, and his knowledge and skills allowed him to suggest '
	+ 'additional features to make our site more convenient and useful for our patrons.\"');

testimonial_array[1] = new testimonial("Ellen Connor-Stahl", "Hollisgate Graphics",

	'\"I asked Mitch to update my website (that someone else had designed). '
	+ 'He not only did it perfectly, but he fixed glitches and made it much more '
	+ 'efficient and consistent looking than it was. ',

	'\"Mitch doesn\'t cost a million bucks either...but he is worth a million bucks. He is a '
	+ 'perfectionist and a detail person, and he is very easy to work with.',
	
	'\"I would recommend Mitch '
	+ 'to anyone who wants a website that not only looks good, but one that works!\"');

testimonial_array[2] = new testimonial("Tom Ewing", "Ewing Controls",

	'\"Mitchell made the whole process much easier than we had feared. '
	+ 'It was a real pleasure to work with him.',
	
	'\"He really listened to us when we described the impression we were trying to create with our '
	+ 'website and then used his technical and graphic skills to create a great site for us '
	+ 'that is both good looking and very easy and intuitive to navigate.',
					
	'\"We wanted our website to convey professionalism and technical competency and that\'s what we got.\"');

testimonial_array[3] = new testimonial("Carl Swanson", "Woody Lures",
									   
	'\"Mitchell was very insightful in helping us get the content to flow '
	+ 'in a manner that is both intuitive and able to stimulate interest.',
	
	'\"Mitchell\'s broad internet-based business knowledge helped us put together the \'complete\' site. '
	+ 'He is a one-stop shop for artistic-content feedback, business-content feedback, connection to '
	+ 'financial institutions, etc.',
	
	'\"Mitchell is thorough, extremely detail oriented and above all, a real pleasure to work--the '
	+ 'consummate E-commerce professional.\"');

testimonial_array[4] = new testimonial("Therese M. Bacharz", "Westboro Gallery",
									   
	'\"The homepage has wonderful color and design with Mitchell\'s photograph of the interior of the gallery, '
	+ 'and it is easy to navigate to each of the 25 artist\'s pages.',

	'“This has been no easy task--the work is ongoing with new artists coming on board and others '
	+ 'leaving the gallery from time to time. '
	+ 'The artwork on each page changes often, and Mitchell has handled this complex project '
	+ 'with technical expertise.',

	'\"He is very pleasant, with a great sense of humor, and the entire gallery of artists has '
	+ 'enjoyed working with him.\"');

testimonial_array[5] = new testimonial("Kay Vinson", "Coldwell Banker Legacy",
									   
	'\"Mitchell is a pleasure to work with. Highly professional. Very responsive. Smart and patient. '
	+ 'He explains options, offers suggestions, has a great attitude.',

	'\"I\'ve had very positive feedback from clients and customers who say my site is user-friendly and has a crisp, clean look.',

	'\"Couldn\'t ask for more.  Mitchell gets a five-star rating.  I highly recommend his services.\"');

testimonial_array[6] = new testimonial("Deborah Lee", "Gigasoft Development, Inc.",
									   
	'\"It\’s been our pleasure to have worked with Mitchell and his design group, Ruby Creek Design, out of New Mexico, USA!',

	'\"Mitchell is very detail oriented and was able to convey the professionalism necessary on our tech site! We, without a doubt, would highly recommend them to you.',

	'\"Not only do they make your site their number one priority, but they also lend assistance with the organization and contents as well! Do check them out.\"');

testimonial_array[7] = new testimonial("Charlotte Carr", "Upton Town Library, Board of Trustees",

	'\"The Upton Town Library would like to take this opportunity to extend to you our sincere '
	+ 'gratitude for all your work building and improving our library website.',
	
	'\"We have received many compliments on the appearance and organization of the site, and '
	+ 'look forward to your continued involvement with its development.\"');

testimonial_array[8] = new testimonial("Brad Hatfield", "Composer and Musician",
	'\"I couldn\'t be more pleased with the extreme makeover of my old website, the '
	+ 'attention to detail, and the speed of completion that was provided by Ruby Creek Design.',
	
	'\"I had an unusual amount of pages, all with unique problems that Ruby Creek Design '
	+ 'quickly and deftly handled. I could have never done this by myself.',
	
	'\"It\'s the best money I\'ve spent in a long time! Look no further for web design!\"');

testimonial_array[9] = new testimonial("Bob Hardy", "President, RH Systems",
	'\"Mitch did an awesome job redesigning our old tired web site. He knows how to '
	+ 'present diverse information in an intelligent and appealing manner.',

    '\"As a direct result of Mitch\'s web page design, we now receive many more quote '
	+ 'requests and product inquiries than we ever have before.',

    '\"Mitch\'s rates are more than reasonable, and we\'ve already contracted him '
	+ 'for future work designing graphical email newsletters for our advertising '
	+ 'campaigns. We could not be happier!\"');

testimonial_array[10] = new testimonial("Jane O'Hara", "Owner, O'Hara Arts",
	'\"Working with Mitch of Ruby Creek Design has been a positive experience in every '
	+ 'way. His skills range from providing creative design ideas, problem solving, to '
	+ 'superior technical knowledge. His personality is perfect for me--both enthusiastic, '
	+ 'good natured and patient (much needed).',

	'\"Mitch\'s experience with computers is impressive. It enables him to understand the '
	+ 'full ability of a website\'s potential. With his clever, creative approach and technical '
	+ 'expertise, suddenly my websites are extremely accessible from web searches, as well as '
	+ 'appealing, informative and easily navigated once found.',

	'\"I highly recommend working with Mitch and Ruby Creek Design.\"');

testimonial_array[11] = new testimonial("Gail Gallagher", "Singer/Producer",
	'\"You are a master and terrific to deal with as well.',

	'\"Thank you so much for your professionalism, kindness and humor!');

testimonial_array[12] = new testimonial("John Trotter", "Photographer",
	'\"It was a pleasure working with Mitchell to put my website together. '
	+ 'He listened carefully, provided options within the design constraints we agreed on, '
	+ 'responded promptly and efficiently to my questions and concerns, and charged a very fair '
	+ ' price for his work. ',
	
	'\"I have the website I wanted and would recommend Ruby Creek Design '
	+ 'without reservation.');

testimonial_array[13] = new testimonial("Peter Ormondroyd", "Vice President, O.R.M. Incorporated",

	'\"When we were looking to redesign our website, our main criteria for selection was experience, '
	+ 'diversification of product offerings and most important, a seamless and professional management of our project. ',

	'\"Mitch delivered on all aspects and most times went above and beyond in helping our company achieve our goals. ',
	
	'\"We highly recommend Ruby Creek Design!');

testimonial_array[14] = new testimonial("Anne Cole", "Violin Maker",
	'\"If you have ever felt that the new world of Internet commerce is beyond your '
	+ 'comprehension, contact Ruby Creek Design.',
	
	'\"Mitchell will bridge the gap and fulfill '
	+ 'your own vision in such an effortless way that I am sure he must be a mind reader.');

testimonial_array[15] = new testimonial("Mark Werkmeister", "President, New Mexico Off Highway Vehicle Alliance",
	'\"The New Mexico Off Highway Vehicle Alliance engaged Mitchell to update our website\'s "look" and to make '
	+ 'more information available to our members. Mitchell listened to our needs and used his knowledge to identify '
	+ 'the functionality that would meet our requirements. He then delivered the new features in an inviting package.',
	
	'\"The added ability to make "real-time" updates to our website has been a huge win for the organization. '
	+ 'Mitchell was very easy to work with and his subsequent support has been prompt, efficient, and met or '
	+ 'exceeded all our expectations. We look forward to continuing our relationship with him as we grow into the future.');

testimonial_array[16] = new testimonial("Virginia Garbers", "Administrator, Friends of Fenway Studios",
	'\"Mitchell is a pleasure to work with: he\'s very responsive, collaborative, and provides quick turnarounds. '
	+ 'He\'s also thoroughly grounded in computer mechanics--knowing how to do all the things his clients need for building a great website.');

testimonial_array[17] = new testimonial("Scott M. Wood", "President, Mednet Medical Billing and Collections, Inc.",
	'\"Our website was old and outdated. We needed a fresh look that reflected who we were today. '
	+ 'Also we wanted a website that had a aesthetic appeal and showed creativity.',
	
	'\"We were not disappointed. Mitchell did a great job of guiding us through the reconstruction of our site and '
	+ 'offered suggestions in critical areas. He always kept in close communication and showed us the progress of his work. ',
	
	'\"We will not hesitate to call upon him in the future and would highly recommend his services.');

/***************************************************************************************************
This function selects a random number, removes all the child nodes of the left sidebar testimonial, 
and replaces them with a new testimonial quote.
***************************************************************************************************/

function get_random_quote()
{	var text, author, company;

    // Math.random() returns a decimal number between 0 and 1.  You multiply the result by the range
    // of numbers you want. 
    // Math.random() * 100 would generate 0 - 100.
    // This would generate 145-200: rannum = Math.random()*55 + 145;

	if (rannum == -1)
	{
		// This will generate 0 => testimonial_array.length - 1.
	
		rannum = Math.random() * testimonial_array.length;
	
		// rannum is now a decimal value, to turn it into an integer use Math.round to round it to the nearest
		// integer.  Math.floor(rannum) to always round down and Math.ceil(rannum) to round up.
	
		rannum = Math.floor(rannum);
	}
	else if (++rannum >= testimonial_array.length)
	{	
		rannum = 0;
	}
	
	display_quote(rannum);

	id = document.getElementById("quote");
	fadeIn(id, 0);

	setTimeout("fadeOut(id, 100)", 7 * 1000);	
}

/***************************************************************************************************
This function displays a testimonial quote. The parameters are:
index: Index into testimonial_array[]
***************************************************************************************************/
function display_quote(index)
{	
	var newElem; var newText;

	id_text = document.getElementById("quoteText");
	id_text.innerHTML = "<p>" + testimonial_array[index].quote1 + "</p>"; 
	
	if (testimonial_array[index].quote2 != undefined)
		id_text.innerHTML += "<p>" + testimonial_array[index].quote2 + "</p>"; 
	if (testimonial_array[index].quote3 != undefined)
		id_text.innerHTML += "<p>" + testimonial_array[index].quote3 + "</p>"; 
	
	id_author = document.getElementById("quoteAuthor");
	id_author.innerHTML = "<p>" + testimonial_array[index].name + "</p>";

	id_company = document.getElementById("quoteCompany");
	id_company.innerHTML = "<p>" + testimonial_array[index].company + "</p>";
}

/***************************************************************************************************
The fadeIn function uses a Timeout to call itself every 50ms with an object Id and an 
opacity. The opacity is specified as a percentage and increased 5% at a time. The loop 
stops once the opacity reaches 100%:
***************************************************************************************************/

function fadeIn(id, opacity)
{
	if (opacity <= 100)
	{
		setOpacity(id, opacity);
		opacity += 5;
		window.setTimeout(function() { fadeIn(id, opacity) }, 50);
	}
}


function fadeOut(id, opacity)
{
	if (opacity > 0) 
	{
		setOpacity(id, opacity);
		opacity -= 5;
		window.setTimeout(function() { fadeOut(id, opacity) }, 50);
	}
	else
	{
		setTimeout("get_random_quote()", 100);	
	}
}

/***************************************************************************************************
The setOpacity function is passed an object and an opacity value. It then sets the opacity of 
the supplied object using four proprietary ways. It also prevents a flicker in Firefox 
caused when opacity is set to 100%, by setting the value to 99.999% instead.
***************************************************************************************************/

function setOpacity(obj, opacity)
{
	opacity = (opacity == 100)?99.999:opacity;

	// IE/Win
	obj.style.filter = "alpha(opacity:"+opacity+")";
	 
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = opacity/100;
	 
	// Older Mozilla and Firefox
	obj.style.MozOpacity = opacity/100;
	 
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = opacity/100;
}


// end hiding contents from old browsers  -->
// </script>
