/*function quotename() {
	var quote = new Array ();
quote[0] = "\"You\'ve done an awesome job and you should be proud of yourself.  We like the website a lot and we\'re so happy it\'s up and running.\""+ "<div align='right'>-Kathryn H.</div>";

quote[1] = "<br/>\"It is perfect!...Thank you so much.\"" + "<div align='right'>-Erika K.</div>";

quote[2] = "<br/>\"Quality and professionalism that gets results.\"" + "<div align='right'>-Daniel W.</div>";


var i = Math.round(Math.random()*(quote.length-1));

document.getElementById("testimony").innerHTML=(quote[i]);

}*/

function quotename() {
	var quote = new Array ();
	quote[0] = "<div class=\"test\">\"You\'ve done an awesome job and you should be proud of yourself.  We like the website a lot and we\'re so happy it\'s up and running.\""+ "<br/><span>-Kathryn H.</span></div>";
	quote[1] = "<div class=\"test\">\"It is perfect!...Thank you so much.\"" + "<br/><span>-Erika K.</span></div>";
	quote[2] = "<div class=\"test\">\"Quality and professionalism that gets results.\"" + "<br/><span>-Daniel W.</span></div>";
	quote[3] = "<div class=\"test\">\"I wish I would have found M-3 designs a few years ago.  It would have saved me alot of time, money, and headaches... I know that I'm positioned well for the future of my business.\"" + "<br/><span>-D.J.</span></div>";
	quote[4] = "<div class=\"test\">\"Thank you so much.  The site looks great!  I am glad I chose M-cubed to design my web site.\"" + "<br/><span>-Karen P.</span></div>";
	
		var pic = new Array ();
		pic[0] = "<div class=\"pic\"><img class=\"unitPng\" src=\"images/effectivewebdesignsforless_anoble_small.png\" width=\"14.25em\" height=\"6.875em\" />" + "<br/> www.anobleevent.com</div>";
		pic[1] = "<div class=\"pic\"><img class=\"unitPng\" src=\"images/effectivewebdesignsforless_512_small.png\" width=\"14.188em\" height=\"6.875em\"/>" + "<br/> www.512concierge.com</div>";
		pic[2] = "<div class=\"pic\"><img class=\"unitPng\" src=\"images/effectivewebdesignsforless_hydro_small.png\" width=\"14.313em\" height=\"6.875em\"/>" + "<br/> www.hydrogen4vehicles.com</div>";
		pic[3] = "<div class=\"pic\"><img class=\"unitPng\" src=\"images/effectivewebdesignsforless_art_small.png\" width=\"14.25em\" height=\"7em\"/>" + "<br/> www.americanramblertours.com</div>";
		pic[4] = "<div class=\"pic\"><img class=\"unitPng\" src=\"images/effectivewebdesignsforless_aone_small.png\" height=\"7.188em\" width=\"14.375em\"/>" + "<br/> www.aoneelectricaustin.com</div>";
	
	
	
	var prev = parseInt(window.name); 
	do{     
		var i = parseInt( Math.round(Math.random()*(quote.length-1)) );
	}while(i==prev);
	window.name = i;
	
	quote[i] = quote[i] + pic[i]
	
	document.getElementById("testimony").innerHTML=(quote[i]);
	
	InitializeTimer()
	
}


var secs
var timerID = null
var timerRunning = false
var delay = 1000

function InitializeTimer()
{
    // Set the length of the timer, in seconds
    secs = 18
    StopTheClock()
    StartTheTimer()
}

function StopTheClock()
{
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}

function StartTheTimer()
{
    if (secs==0)
    {
        StopTheClock()
        // Here's where you put something useful that's
        // supposed to happen after the allotted time.
        // For example, you could display a message:
        quotename()
		InitializeTimer()
    }
    else
    {
        self.status = secs
        secs = secs - 1
        timerRunning = true
        timerID = self.setTimeout("StartTheTimer()", delay)
    }
}


function checkform()
{
var emailFilter="/^.+@.+\..{2,3,4,6}$/";
var illegalChars= "/[\(\)\<\>\,\;\:\\\/\"\[\]]/";
var stripped = document.contactus.mynumber.value.replace(/[\(\)\.\-\ ]/g, '');
var strng = document.contactus.myemail.value;

	if (document.contactus.myname.value == '') {
		alert('Name is a required feild.');
		return false;
	}
	
	else if (stripped == '') {
		alert('Phone Number is a required feild.');
		return false;
	}
	
	 else if (isNaN(stripped)) { 
      alert('Please enter only numbers.'); 
      return false; 
      } 
	
	else if (!(stripped.length == 10)) {
		alert('Phone number must contain at least 10 digits');
		return false;
	}
	
	else if (document.contactus.myemail.value == '') {
		alert('Email Address is a required feild.');
		return false;
	}
	else if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.contactus.myemail.value))){
	alert('Email Address is not properly formated.');
	return false;
	}

	else if (strng.match(illegalChars)) {
   		alert('Email address entered contains invalid charecters.');
		return false;
	}

	return true;
}



